@nodesify/astria 1.0.0 → 1.0.1
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/LICENSE +21 -21
- package/README.md +65 -65
- package/dist/commands/add.d.ts +7 -7
- package/dist/commands/add.js +33 -33
- package/dist/commands/affected.d.ts +5 -5
- package/dist/commands/affected.js +29 -29
- package/dist/commands/cluster.d.ts +1 -1
- package/dist/commands/cluster.js +50 -50
- package/dist/commands/diagnose.d.ts +4 -4
- package/dist/commands/diagnose.js +19 -19
- package/dist/commands/diff.d.ts +1 -1
- package/dist/commands/diff.js +35 -35
- package/dist/commands/explain.d.ts +3 -3
- package/dist/commands/explain.js +37 -37
- package/dist/commands/export.d.ts +6 -6
- package/dist/commands/export.js +32 -32
- package/dist/commands/feedback.d.ts +11 -11
- package/dist/commands/feedback.js +40 -40
- package/dist/commands/global.d.ts +6 -6
- package/dist/commands/global.js +60 -60
- package/dist/commands/history.d.ts +4 -4
- package/dist/commands/history.js +27 -27
- package/dist/commands/hook-guard.d.ts +1 -1
- package/dist/commands/hook-guard.js +144 -144
- package/dist/commands/hook.d.ts +2 -2
- package/dist/commands/hook.js +52 -52
- package/dist/commands/install.d.ts +2 -2
- package/dist/commands/install.js +39 -39
- package/dist/commands/map.d.ts +5 -5
- package/dist/commands/map.js +15 -15
- package/dist/commands/mcp.d.ts +3 -3
- package/dist/commands/mcp.js +14 -14
- package/dist/commands/merge.d.ts +1 -1
- package/dist/commands/merge.js +50 -50
- package/dist/commands/migrate.d.ts +3 -3
- package/dist/commands/migrate.js +74 -74
- package/dist/commands/path.d.ts +5 -5
- package/dist/commands/path.js +18 -18
- package/dist/commands/prs.d.ts +4 -4
- package/dist/commands/prs.js +132 -132
- package/dist/commands/query.d.ts +9 -9
- package/dist/commands/query.js +21 -21
- package/dist/commands/run.d.ts +9 -9
- package/dist/commands/run.js +68 -68
- package/dist/commands/stats.d.ts +3 -3
- package/dist/commands/stats.js +17 -17
- package/dist/commands/status.d.ts +3 -3
- package/dist/commands/status.js +56 -56
- package/dist/commands/tree.d.ts +5 -5
- package/dist/commands/tree.js +52 -52
- package/dist/commands/update.d.ts +6 -6
- package/dist/commands/update.js +65 -65
- package/dist/commands/watch.d.ts +3 -3
- package/dist/commands/watch.js +113 -113
- package/dist/commands/wiki.d.ts +6 -6
- package/dist/commands/wiki.js +59 -59
- package/dist/index.d.ts +4 -4
- package/dist/index.js +249 -249
- package/dist/install/hooks.d.ts +11 -11
- package/dist/install/hooks.js +306 -306
- package/dist/install/index.d.ts +2 -2
- package/dist/install/index.js +361 -361
- package/dist/install/markdown-inject.d.ts +6 -6
- package/dist/install/markdown-inject.js +177 -177
- package/dist/install/platforms.d.ts +12 -12
- package/dist/install/platforms.js +129 -129
- package/dist/install/settings-inject.d.ts +17 -17
- package/dist/install/settings-inject.js +424 -424
- package/dist/native.d.ts +31 -31
- package/dist/native.js +106 -106
- package/package.json +72 -72
- package/skills/skill-aider.md +40 -40
- package/skills/skill-codex.md +46 -46
- package/skills/skill-copilot.md +46 -46
- package/skills/skill-cursor.md +39 -39
- package/skills/skill-gemini.md +46 -46
- package/skills/skill-kiro.md +39 -39
- package/skills/skill-opencode.md +44 -44
- package/skills/skill-trae.md +46 -46
- package/skills/skill.md +266 -266
- package/dist/graphify.node +0 -4
|
@@ -1,145 +1,145 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// hook-guard: editor PreToolUse guards (port of upstream hook-guard). Reads
|
|
3
|
-
// the tool-call JSON from stdin, nudges agents toward graph queries, and —
|
|
4
|
-
// in strict mode — denies ONE un-indexed read per session until the agent
|
|
5
|
-
// orients via query/explain/path. Fails open on any error: a wedged guard
|
|
6
|
-
// must never break a tool call.
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.hookGuard = hookGuard;
|
|
9
|
-
const fs_1 = require("fs");
|
|
10
|
-
const path_1 = require("path");
|
|
11
|
-
const SOURCE_EXTS = new Set([
|
|
12
|
-
'.py', '.ts', '.tsx', '.js', '.jsx', '.rs', '.go', '.java', '.c', '.cpp',
|
|
13
|
-
'.h', '.hpp', '.rb', '.php', '.swift', '.kt', '.scala', '.cs', '.lua',
|
|
14
|
-
'.ex', '.exs', '.hs', '.sh', '.dart', '.zig', '.md', '.toml', '.yaml', '.yml',
|
|
15
|
-
]);
|
|
16
|
-
const SEARCH_COMMANDS = new Set(['grep', 'rg', 'ag', 'git']);
|
|
17
|
-
function readStdinJson() {
|
|
18
|
-
try {
|
|
19
|
-
const raw = (0, fs_1.readFileSync)(0, 'utf-8');
|
|
20
|
-
return JSON.parse(raw);
|
|
21
|
-
}
|
|
22
|
-
catch {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
function graphDir() {
|
|
27
|
-
const cwd = process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
28
|
-
const g = (0, path_1.join)(cwd, '.astria');
|
|
29
|
-
return (0, fs_1.existsSync)((0, path_1.join)(g, 'graph.json')) ? g : null;
|
|
30
|
-
}
|
|
31
|
-
/// Reads `ASTRIA_<name>`, falling back to the deprecated `GRAPHIFY_<name>`.
|
|
32
|
-
function envVar(name) {
|
|
33
|
-
return (process.env[`ASTRIA_${name}`] ||
|
|
34
|
-
process.env[`GRAPHIFY_${name}`] ||
|
|
35
|
-
undefined);
|
|
36
|
-
}
|
|
37
|
-
function orientedRecently(gdir) {
|
|
38
|
-
try {
|
|
39
|
-
const stamp = (0, fs_1.readFileSync)((0, path_1.join)(gdir, 'cache', 'last_query_stamp'), 'utf-8');
|
|
40
|
-
const ts = Number(stamp.split('\t')[0]);
|
|
41
|
-
const age = Date.now() / 1000 - ts;
|
|
42
|
-
const ttl = Number(envVar('HOOK_STRICT_TTL') || 1800);
|
|
43
|
-
return Number.isFinite(ts) && age < ttl;
|
|
44
|
-
}
|
|
45
|
-
catch {
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
function emitNudge(text) {
|
|
50
|
-
console.log(JSON.stringify({
|
|
51
|
-
hookSpecificOutput: {
|
|
52
|
-
hookEventName: 'PreToolUse',
|
|
53
|
-
additionalContext: text,
|
|
54
|
-
},
|
|
55
|
-
}));
|
|
56
|
-
}
|
|
57
|
-
function emitDeny(reason) {
|
|
58
|
-
console.log(JSON.stringify({
|
|
59
|
-
hookSpecificOutput: {
|
|
60
|
-
hookEventName: 'PreToolUse',
|
|
61
|
-
permissionDecision: 'deny',
|
|
62
|
-
permissionDecisionReason: reason,
|
|
63
|
-
},
|
|
64
|
-
}));
|
|
65
|
-
}
|
|
66
|
-
function hookGuard(mode, _args) {
|
|
67
|
-
try {
|
|
68
|
-
if (!mode || mode === 'gemini') {
|
|
69
|
-
// Gemini's BeforeTool only understands allow decisions.
|
|
70
|
-
console.log(JSON.stringify({ decision: 'allow' }));
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
const input = readStdinJson();
|
|
74
|
-
if (!input)
|
|
75
|
-
return;
|
|
76
|
-
const gdir = graphDir();
|
|
77
|
-
if (!gdir)
|
|
78
|
-
return;
|
|
79
|
-
const strict = envVar('HOOK_STRICT') === '1' ||
|
|
80
|
-
(envVar('HOOK_STRICT') !== '0' && _args.includes('--strict'));
|
|
81
|
-
if (mode === 'search') {
|
|
82
|
-
const ti = input.tool_input || {};
|
|
83
|
-
const isGrepTool = Boolean(ti.pattern);
|
|
84
|
-
const cmd = (ti.command || '').trim();
|
|
85
|
-
const first = cmd.split(/\s+/)[0];
|
|
86
|
-
const isSearchBash = first === 'git'
|
|
87
|
-
? cmd.split(/\s+/)[1] === 'grep'
|
|
88
|
-
: SEARCH_COMMANDS.has(first);
|
|
89
|
-
if (isGrepTool || isSearchBash) {
|
|
90
|
-
emitNudge('MANDATORY: Before searching with grep, check the knowledge graph first: ' +
|
|
91
|
-
'`astria query "<question>"` returns structured answers with ' +
|
|
92
|
-
'file:line provenance in one call. The graph is already built for this repo.');
|
|
93
|
-
}
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
if (mode === 'read') {
|
|
97
|
-
const filePath = input.tool_input?.file_path;
|
|
98
|
-
if (!filePath)
|
|
99
|
-
return;
|
|
100
|
-
const resolved = (0, path_1.resolve)(filePath);
|
|
101
|
-
if (resolved.includes('.astria'))
|
|
102
|
-
return;
|
|
103
|
-
const ext = (0, path_1.extname)(resolved).toLowerCase();
|
|
104
|
-
if (ext && !SOURCE_EXTS.has(ext))
|
|
105
|
-
return;
|
|
106
|
-
// Staleness: file newer than the graph?
|
|
107
|
-
try {
|
|
108
|
-
const fileMtime = require('fs').statSync(resolved).mtimeMs;
|
|
109
|
-
const graphMtime = require('fs').statSync((0, path_1.join)(gdir, 'db.sqlite')).mtimeMs;
|
|
110
|
-
if (fileMtime > graphMtime) {
|
|
111
|
-
emitNudge(`STALE GRAPH: ${filePath} changed after the last graph build. ` +
|
|
112
|
-
'Run `astria update .` before trusting graph answers.');
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
catch {
|
|
117
|
-
// stat failures are not guard failures
|
|
118
|
-
}
|
|
119
|
-
// Strict: deny one un-indexed read per session until oriented.
|
|
120
|
-
if (strict && input.tool_name === 'Read' && !orientedRecently(gdir)) {
|
|
121
|
-
// Session ids become filenames; strip anything that could carry a
|
|
122
|
-
// path separator or traversal before using one.
|
|
123
|
-
const session = (process.env.CLAUDE_SESSION_ID || 'default')
|
|
124
|
-
.replace(/[^A-Za-z0-9_-]/g, '')
|
|
125
|
-
.slice(0, 64) || 'default';
|
|
126
|
-
const marker = (0, path_1.join)(gdir, 'cache', 'hook_sessions', `${session}.denied`);
|
|
127
|
-
try {
|
|
128
|
-
(0, fs_1.mkdirSync)((0, path_1.join)(gdir, 'cache', 'hook_sessions'), { recursive: true });
|
|
129
|
-
(0, fs_1.writeFileSync)(marker, String(Date.now()), { flag: 'wx' });
|
|
130
|
-
emitDeny('ORIENT FIRST: this read is not yet covered by a graph query. ' +
|
|
131
|
-
'Run `astria query "<question>"` (or explain/path) once — ' +
|
|
132
|
-
'further reads then proceed without interruption for 30 minutes.');
|
|
133
|
-
}
|
|
134
|
-
catch {
|
|
135
|
-
// Marker exists: already denied once this session — allow.
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
catch {
|
|
142
|
-
// Fail open: never break a tool call.
|
|
143
|
-
}
|
|
144
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
// hook-guard: editor PreToolUse guards (port of upstream hook-guard). Reads
|
|
3
|
+
// the tool-call JSON from stdin, nudges agents toward graph queries, and —
|
|
4
|
+
// in strict mode — denies ONE un-indexed read per session until the agent
|
|
5
|
+
// orients via query/explain/path. Fails open on any error: a wedged guard
|
|
6
|
+
// must never break a tool call.
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.hookGuard = hookGuard;
|
|
9
|
+
const fs_1 = require("fs");
|
|
10
|
+
const path_1 = require("path");
|
|
11
|
+
const SOURCE_EXTS = new Set([
|
|
12
|
+
'.py', '.ts', '.tsx', '.js', '.jsx', '.rs', '.go', '.java', '.c', '.cpp',
|
|
13
|
+
'.h', '.hpp', '.rb', '.php', '.swift', '.kt', '.scala', '.cs', '.lua',
|
|
14
|
+
'.ex', '.exs', '.hs', '.sh', '.dart', '.zig', '.md', '.toml', '.yaml', '.yml',
|
|
15
|
+
]);
|
|
16
|
+
const SEARCH_COMMANDS = new Set(['grep', 'rg', 'ag', 'git']);
|
|
17
|
+
function readStdinJson() {
|
|
18
|
+
try {
|
|
19
|
+
const raw = (0, fs_1.readFileSync)(0, 'utf-8');
|
|
20
|
+
return JSON.parse(raw);
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function graphDir() {
|
|
27
|
+
const cwd = process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
28
|
+
const g = (0, path_1.join)(cwd, '.astria');
|
|
29
|
+
return (0, fs_1.existsSync)((0, path_1.join)(g, 'graph.json')) ? g : null;
|
|
30
|
+
}
|
|
31
|
+
/// Reads `ASTRIA_<name>`, falling back to the deprecated `GRAPHIFY_<name>`.
|
|
32
|
+
function envVar(name) {
|
|
33
|
+
return (process.env[`ASTRIA_${name}`] ||
|
|
34
|
+
process.env[`GRAPHIFY_${name}`] ||
|
|
35
|
+
undefined);
|
|
36
|
+
}
|
|
37
|
+
function orientedRecently(gdir) {
|
|
38
|
+
try {
|
|
39
|
+
const stamp = (0, fs_1.readFileSync)((0, path_1.join)(gdir, 'cache', 'last_query_stamp'), 'utf-8');
|
|
40
|
+
const ts = Number(stamp.split('\t')[0]);
|
|
41
|
+
const age = Date.now() / 1000 - ts;
|
|
42
|
+
const ttl = Number(envVar('HOOK_STRICT_TTL') || 1800);
|
|
43
|
+
return Number.isFinite(ts) && age < ttl;
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function emitNudge(text) {
|
|
50
|
+
console.log(JSON.stringify({
|
|
51
|
+
hookSpecificOutput: {
|
|
52
|
+
hookEventName: 'PreToolUse',
|
|
53
|
+
additionalContext: text,
|
|
54
|
+
},
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
function emitDeny(reason) {
|
|
58
|
+
console.log(JSON.stringify({
|
|
59
|
+
hookSpecificOutput: {
|
|
60
|
+
hookEventName: 'PreToolUse',
|
|
61
|
+
permissionDecision: 'deny',
|
|
62
|
+
permissionDecisionReason: reason,
|
|
63
|
+
},
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
66
|
+
function hookGuard(mode, _args) {
|
|
67
|
+
try {
|
|
68
|
+
if (!mode || mode === 'gemini') {
|
|
69
|
+
// Gemini's BeforeTool only understands allow decisions.
|
|
70
|
+
console.log(JSON.stringify({ decision: 'allow' }));
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const input = readStdinJson();
|
|
74
|
+
if (!input)
|
|
75
|
+
return;
|
|
76
|
+
const gdir = graphDir();
|
|
77
|
+
if (!gdir)
|
|
78
|
+
return;
|
|
79
|
+
const strict = envVar('HOOK_STRICT') === '1' ||
|
|
80
|
+
(envVar('HOOK_STRICT') !== '0' && _args.includes('--strict'));
|
|
81
|
+
if (mode === 'search') {
|
|
82
|
+
const ti = input.tool_input || {};
|
|
83
|
+
const isGrepTool = Boolean(ti.pattern);
|
|
84
|
+
const cmd = (ti.command || '').trim();
|
|
85
|
+
const first = cmd.split(/\s+/)[0];
|
|
86
|
+
const isSearchBash = first === 'git'
|
|
87
|
+
? cmd.split(/\s+/)[1] === 'grep'
|
|
88
|
+
: SEARCH_COMMANDS.has(first);
|
|
89
|
+
if (isGrepTool || isSearchBash) {
|
|
90
|
+
emitNudge('MANDATORY: Before searching with grep, check the knowledge graph first: ' +
|
|
91
|
+
'`astria query "<question>"` returns structured answers with ' +
|
|
92
|
+
'file:line provenance in one call. The graph is already built for this repo.');
|
|
93
|
+
}
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (mode === 'read') {
|
|
97
|
+
const filePath = input.tool_input?.file_path;
|
|
98
|
+
if (!filePath)
|
|
99
|
+
return;
|
|
100
|
+
const resolved = (0, path_1.resolve)(filePath);
|
|
101
|
+
if (resolved.includes('.astria'))
|
|
102
|
+
return;
|
|
103
|
+
const ext = (0, path_1.extname)(resolved).toLowerCase();
|
|
104
|
+
if (ext && !SOURCE_EXTS.has(ext))
|
|
105
|
+
return;
|
|
106
|
+
// Staleness: file newer than the graph?
|
|
107
|
+
try {
|
|
108
|
+
const fileMtime = require('fs').statSync(resolved).mtimeMs;
|
|
109
|
+
const graphMtime = require('fs').statSync((0, path_1.join)(gdir, 'db.sqlite')).mtimeMs;
|
|
110
|
+
if (fileMtime > graphMtime) {
|
|
111
|
+
emitNudge(`STALE GRAPH: ${filePath} changed after the last graph build. ` +
|
|
112
|
+
'Run `astria update .` before trusting graph answers.');
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
// stat failures are not guard failures
|
|
118
|
+
}
|
|
119
|
+
// Strict: deny one un-indexed read per session until oriented.
|
|
120
|
+
if (strict && input.tool_name === 'Read' && !orientedRecently(gdir)) {
|
|
121
|
+
// Session ids become filenames; strip anything that could carry a
|
|
122
|
+
// path separator or traversal before using one.
|
|
123
|
+
const session = (process.env.CLAUDE_SESSION_ID || 'default')
|
|
124
|
+
.replace(/[^A-Za-z0-9_-]/g, '')
|
|
125
|
+
.slice(0, 64) || 'default';
|
|
126
|
+
const marker = (0, path_1.join)(gdir, 'cache', 'hook_sessions', `${session}.denied`);
|
|
127
|
+
try {
|
|
128
|
+
(0, fs_1.mkdirSync)((0, path_1.join)(gdir, 'cache', 'hook_sessions'), { recursive: true });
|
|
129
|
+
(0, fs_1.writeFileSync)(marker, String(Date.now()), { flag: 'wx' });
|
|
130
|
+
emitDeny('ORIENT FIRST: this read is not yet covered by a graph query. ' +
|
|
131
|
+
'Run `astria query "<question>"` (or explain/path) once — ' +
|
|
132
|
+
'further reads then proceed without interruption for 30 minutes.');
|
|
133
|
+
}
|
|
134
|
+
catch {
|
|
135
|
+
// Marker exists: already denied once this session — allow.
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
catch {
|
|
142
|
+
// Fail open: never break a tool call.
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
145
|
//# sourceMappingURL=hook-guard.js.map
|
package/dist/commands/hook.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
export declare function registerHookCommand(program: Command): void;
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
export declare function registerHookCommand(program: Command): void;
|
|
3
3
|
//# sourceMappingURL=hook.d.ts.map
|
package/dist/commands/hook.js
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerHookCommand = registerHookCommand;
|
|
4
|
-
const hooks_1 = require("../install/hooks");
|
|
5
|
-
function registerHookCommand(program) {
|
|
6
|
-
const hook = program.command('hook').description('Manage git hooks for auto-rebuild');
|
|
7
|
-
hook
|
|
8
|
-
.command('install')
|
|
9
|
-
.description('Install post-commit and post-checkout hooks')
|
|
10
|
-
.action(() => {
|
|
11
|
-
try {
|
|
12
|
-
const results = (0, hooks_1.installGitHooks)('.');
|
|
13
|
-
for (const msg of results) {
|
|
14
|
-
console.log(msg);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
catch (err) {
|
|
18
|
-
console.error(err.message || err);
|
|
19
|
-
process.exitCode = 1;
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
hook
|
|
23
|
-
.command('uninstall')
|
|
24
|
-
.description('Remove astria git hooks')
|
|
25
|
-
.action(() => {
|
|
26
|
-
try {
|
|
27
|
-
const results = (0, hooks_1.uninstallGitHooks)('.');
|
|
28
|
-
for (const msg of results) {
|
|
29
|
-
console.log(msg);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
catch (err) {
|
|
33
|
-
console.error(err.message || err);
|
|
34
|
-
process.exitCode = 1;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
hook
|
|
38
|
-
.command('status')
|
|
39
|
-
.description('Show git hook status')
|
|
40
|
-
.action(() => {
|
|
41
|
-
try {
|
|
42
|
-
const results = (0, hooks_1.statusGitHooks)('.');
|
|
43
|
-
for (const msg of results) {
|
|
44
|
-
console.log(msg);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
catch (err) {
|
|
48
|
-
console.error(err.message || err);
|
|
49
|
-
process.exitCode = 1;
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerHookCommand = registerHookCommand;
|
|
4
|
+
const hooks_1 = require("../install/hooks");
|
|
5
|
+
function registerHookCommand(program) {
|
|
6
|
+
const hook = program.command('hook').description('Manage git hooks for auto-rebuild');
|
|
7
|
+
hook
|
|
8
|
+
.command('install')
|
|
9
|
+
.description('Install post-commit and post-checkout hooks')
|
|
10
|
+
.action(() => {
|
|
11
|
+
try {
|
|
12
|
+
const results = (0, hooks_1.installGitHooks)('.');
|
|
13
|
+
for (const msg of results) {
|
|
14
|
+
console.log(msg);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
catch (err) {
|
|
18
|
+
console.error(err.message || err);
|
|
19
|
+
process.exitCode = 1;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
hook
|
|
23
|
+
.command('uninstall')
|
|
24
|
+
.description('Remove astria git hooks')
|
|
25
|
+
.action(() => {
|
|
26
|
+
try {
|
|
27
|
+
const results = (0, hooks_1.uninstallGitHooks)('.');
|
|
28
|
+
for (const msg of results) {
|
|
29
|
+
console.log(msg);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
catch (err) {
|
|
33
|
+
console.error(err.message || err);
|
|
34
|
+
process.exitCode = 1;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
hook
|
|
38
|
+
.command('status')
|
|
39
|
+
.description('Show git hook status')
|
|
40
|
+
.action(() => {
|
|
41
|
+
try {
|
|
42
|
+
const results = (0, hooks_1.statusGitHooks)('.');
|
|
43
|
+
for (const msg of results) {
|
|
44
|
+
console.log(msg);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
console.error(err.message || err);
|
|
49
|
+
process.exitCode = 1;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
53
|
//# sourceMappingURL=hook.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
export declare function registerInstallCommand(program: Command): void;
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
export declare function registerInstallCommand(program: Command): void;
|
|
3
3
|
//# sourceMappingURL=install.d.ts.map
|
package/dist/commands/install.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerInstallCommand = registerInstallCommand;
|
|
4
|
-
const index_1 = require("../install/index");
|
|
5
|
-
const platforms_1 = require("../install/platforms");
|
|
6
|
-
function registerInstallCommand(program) {
|
|
7
|
-
program
|
|
8
|
-
.command('install')
|
|
9
|
-
.description('Install astria skill for an AI platform')
|
|
10
|
-
.option('--platform <name>', `Platform: ${platforms_1.PLATFORM_NAMES.join(', ')}`, 'claude')
|
|
11
|
-
.action(async (opts) => {
|
|
12
|
-
try {
|
|
13
|
-
const results = (0, index_1.installPlatform)(opts.platform, process.cwd());
|
|
14
|
-
for (const msg of results) {
|
|
15
|
-
console.log(msg);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
catch (err) {
|
|
19
|
-
console.error(err.message || err);
|
|
20
|
-
process.exitCode = 1;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
program
|
|
24
|
-
.command('uninstall')
|
|
25
|
-
.description('Uninstall astria skill for an AI platform')
|
|
26
|
-
.option('--platform <name>', `Platform: ${platforms_1.PLATFORM_NAMES.join(', ')}`, 'claude')
|
|
27
|
-
.action(async (opts) => {
|
|
28
|
-
try {
|
|
29
|
-
const results = (0, index_1.uninstallPlatform)(opts.platform, process.cwd());
|
|
30
|
-
for (const msg of results) {
|
|
31
|
-
console.log(msg);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
catch (err) {
|
|
35
|
-
console.error(err.message || err);
|
|
36
|
-
process.exitCode = 1;
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerInstallCommand = registerInstallCommand;
|
|
4
|
+
const index_1 = require("../install/index");
|
|
5
|
+
const platforms_1 = require("../install/platforms");
|
|
6
|
+
function registerInstallCommand(program) {
|
|
7
|
+
program
|
|
8
|
+
.command('install')
|
|
9
|
+
.description('Install astria skill for an AI platform')
|
|
10
|
+
.option('--platform <name>', `Platform: ${platforms_1.PLATFORM_NAMES.join(', ')}`, 'claude')
|
|
11
|
+
.action(async (opts) => {
|
|
12
|
+
try {
|
|
13
|
+
const results = (0, index_1.installPlatform)(opts.platform, process.cwd());
|
|
14
|
+
for (const msg of results) {
|
|
15
|
+
console.log(msg);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
catch (err) {
|
|
19
|
+
console.error(err.message || err);
|
|
20
|
+
process.exitCode = 1;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
program
|
|
24
|
+
.command('uninstall')
|
|
25
|
+
.description('Uninstall astria skill for an AI platform')
|
|
26
|
+
.option('--platform <name>', `Platform: ${platforms_1.PLATFORM_NAMES.join(', ')}`, 'claude')
|
|
27
|
+
.action(async (opts) => {
|
|
28
|
+
try {
|
|
29
|
+
const results = (0, index_1.uninstallPlatform)(opts.platform, process.cwd());
|
|
30
|
+
for (const msg of results) {
|
|
31
|
+
console.log(msg);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
console.error(err.message || err);
|
|
36
|
+
process.exitCode = 1;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
40
|
//# sourceMappingURL=install.js.map
|
package/dist/commands/map.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare function mapCommand(opts: {
|
|
2
|
-
graph: string;
|
|
3
|
-
budget: string;
|
|
4
|
-
detail?: string;
|
|
5
|
-
}): Promise<void>;
|
|
1
|
+
export declare function mapCommand(opts: {
|
|
2
|
+
graph: string;
|
|
3
|
+
budget: string;
|
|
4
|
+
detail?: string;
|
|
5
|
+
}): Promise<void>;
|
|
6
6
|
//# sourceMappingURL=map.d.ts.map
|
package/dist/commands/map.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapCommand = mapCommand;
|
|
4
|
-
const native_1 = require("../native");
|
|
5
|
-
async function mapCommand(opts) {
|
|
6
|
-
try {
|
|
7
|
-
const budget = parseInt(opts.budget || '2000', 10);
|
|
8
|
-
const result = (0, native_1.repoMap)(opts.graph, budget, opts.detail);
|
|
9
|
-
console.log(result.text);
|
|
10
|
-
}
|
|
11
|
-
catch (e) {
|
|
12
|
-
console.error(`Error: ${e.message || e}`);
|
|
13
|
-
process.exitCode = 1;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mapCommand = mapCommand;
|
|
4
|
+
const native_1 = require("../native");
|
|
5
|
+
async function mapCommand(opts) {
|
|
6
|
+
try {
|
|
7
|
+
const budget = parseInt(opts.budget || '2000', 10);
|
|
8
|
+
const result = (0, native_1.repoMap)(opts.graph, budget, opts.detail);
|
|
9
|
+
console.log(result.text);
|
|
10
|
+
}
|
|
11
|
+
catch (e) {
|
|
12
|
+
console.error(`Error: ${e.message || e}`);
|
|
13
|
+
process.exitCode = 1;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
16
|
//# sourceMappingURL=map.js.map
|
package/dist/commands/mcp.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function mcpCommand(opts: {
|
|
2
|
-
graph: string;
|
|
3
|
-
}): Promise<void>;
|
|
1
|
+
export declare function mcpCommand(opts: {
|
|
2
|
+
graph: string;
|
|
3
|
+
}): Promise<void>;
|
|
4
4
|
//# sourceMappingURL=mcp.d.ts.map
|
package/dist/commands/mcp.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mcpCommand = mcpCommand;
|
|
4
|
-
const native_1 = require("../native");
|
|
5
|
-
async function mcpCommand(opts) {
|
|
6
|
-
try {
|
|
7
|
-
// Blocks serving newline-delimited JSON-RPC on stdio until stdin closes
|
|
8
|
-
(0, native_1.runMcpServer)(opts.graph);
|
|
9
|
-
}
|
|
10
|
-
catch (e) {
|
|
11
|
-
console.error(`Error: ${e.message || e}`);
|
|
12
|
-
process.exitCode = 1;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mcpCommand = mcpCommand;
|
|
4
|
+
const native_1 = require("../native");
|
|
5
|
+
async function mcpCommand(opts) {
|
|
6
|
+
try {
|
|
7
|
+
// Blocks serving newline-delimited JSON-RPC on stdio until stdin closes
|
|
8
|
+
(0, native_1.runMcpServer)(opts.graph);
|
|
9
|
+
}
|
|
10
|
+
catch (e) {
|
|
11
|
+
console.error(`Error: ${e.message || e}`);
|
|
12
|
+
process.exitCode = 1;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
15
|
//# sourceMappingURL=mcp.js.map
|
package/dist/commands/merge.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function mergeCommand(pathA: string, pathB: string, outPath: string): Promise<void>;
|
|
1
|
+
export declare function mergeCommand(pathA: string, pathB: string, outPath: string): Promise<void>;
|
|
2
2
|
//# sourceMappingURL=merge.d.ts.map
|