auden 0.1.0-alpha.2
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 -0
- package/README.md +59 -0
- package/dist/auden-paths.d.ts +8 -0
- package/dist/auden-paths.d.ts.map +1 -0
- package/dist/auden-paths.js +10 -0
- package/dist/auden-paths.js.map +1 -0
- package/dist/bin.d.ts +11 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +13 -0
- package/dist/bin.js.map +1 -0
- package/dist/chunk.d.ts +3 -0
- package/dist/chunk.d.ts.map +1 -0
- package/dist/chunk.js +13 -0
- package/dist/chunk.js.map +1 -0
- package/dist/commands/doctor.d.ts +13 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +125 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/eval/index.d.ts +2 -0
- package/dist/commands/eval/index.d.ts.map +1 -0
- package/dist/commands/eval/index.js +2 -0
- package/dist/commands/eval/index.js.map +1 -0
- package/dist/commands/eval/run.d.ts +38 -0
- package/dist/commands/eval/run.d.ts.map +1 -0
- package/dist/commands/eval/run.js +179 -0
- package/dist/commands/eval/run.js.map +1 -0
- package/dist/commands/guides/active.d.ts +2 -0
- package/dist/commands/guides/active.d.ts.map +1 -0
- package/dist/commands/guides/active.js +38 -0
- package/dist/commands/guides/active.js.map +1 -0
- package/dist/commands/guides/index.d.ts +2 -0
- package/dist/commands/guides/index.d.ts.map +1 -0
- package/dist/commands/guides/index.js +13 -0
- package/dist/commands/guides/index.js.map +1 -0
- package/dist/commands/guides/project.d.ts +13 -0
- package/dist/commands/guides/project.d.ts.map +1 -0
- package/dist/commands/guides/project.js +71 -0
- package/dist/commands/guides/project.js.map +1 -0
- package/dist/commands/guides/search.d.ts +8 -0
- package/dist/commands/guides/search.d.ts.map +1 -0
- package/dist/commands/guides/search.js +46 -0
- package/dist/commands/guides/search.js.map +1 -0
- package/dist/commands/init.d.ts +43 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +436 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/mcp.d.ts +23 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +55 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/pull.d.ts +38 -0
- package/dist/commands/pull.d.ts.map +1 -0
- package/dist/commands/pull.js +127 -0
- package/dist/commands/pull.js.map +1 -0
- package/dist/commands/rules/export.d.ts +140 -0
- package/dist/commands/rules/export.d.ts.map +1 -0
- package/dist/commands/rules/export.js +635 -0
- package/dist/commands/rules/export.js.map +1 -0
- package/dist/commands/rules/import.d.ts +33 -0
- package/dist/commands/rules/import.d.ts.map +1 -0
- package/dist/commands/rules/import.js +122 -0
- package/dist/commands/rules/import.js.map +1 -0
- package/dist/commands/rules/index.d.ts +2 -0
- package/dist/commands/rules/index.d.ts.map +1 -0
- package/dist/commands/rules/index.js +13 -0
- package/dist/commands/rules/index.js.map +1 -0
- package/dist/commands/rules/watch.d.ts +43 -0
- package/dist/commands/rules/watch.d.ts.map +1 -0
- package/dist/commands/rules/watch.js +125 -0
- package/dist/commands/rules/watch.js.map +1 -0
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +61 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/suggest.d.ts +8 -0
- package/dist/commands/suggest.d.ts.map +1 -0
- package/dist/commands/suggest.js +43 -0
- package/dist/commands/suggest.js.map +1 -0
- package/dist/commands/sync.d.ts +23 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +193 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/commands/verdict/index.d.ts +2 -0
- package/dist/commands/verdict/index.d.ts.map +1 -0
- package/dist/commands/verdict/index.js +11 -0
- package/dist/commands/verdict/index.js.map +1 -0
- package/dist/commands/verdict/record.d.ts +18 -0
- package/dist/commands/verdict/record.d.ts.map +1 -0
- package/dist/commands/verdict/record.js +60 -0
- package/dist/commands/verdict/record.js.map +1 -0
- package/dist/config.d.ts +96 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +246 -0
- package/dist/config.js.map +1 -0
- package/dist/context/pull.d.ts +40 -0
- package/dist/context/pull.d.ts.map +1 -0
- package/dist/context/pull.js +46 -0
- package/dist/context/pull.js.map +1 -0
- package/dist/dashboard-health.d.ts +20 -0
- package/dist/dashboard-health.d.ts.map +1 -0
- package/dist/dashboard-health.js +24 -0
- package/dist/dashboard-health.js.map +1 -0
- package/dist/eval-provider.d.ts +30 -0
- package/dist/eval-provider.d.ts.map +1 -0
- package/dist/eval-provider.js +359 -0
- package/dist/eval-provider.js.map +1 -0
- package/dist/eval-summary.d.ts +24 -0
- package/dist/eval-summary.d.ts.map +1 -0
- package/dist/eval-summary.js +30 -0
- package/dist/eval-summary.js.map +1 -0
- package/dist/feedback/extract.d.ts +6 -0
- package/dist/feedback/extract.d.ts.map +1 -0
- package/dist/feedback/extract.js +580 -0
- package/dist/feedback/extract.js.map +1 -0
- package/dist/http-retry.d.ts +23 -0
- package/dist/http-retry.d.ts.map +1 -0
- package/dist/http-retry.js +54 -0
- package/dist/http-retry.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/client.d.ts +70 -0
- package/dist/mcp/client.d.ts.map +1 -0
- package/dist/mcp/client.js +121 -0
- package/dist/mcp/client.js.map +1 -0
- package/dist/mcp/scope.d.ts +30 -0
- package/dist/mcp/scope.d.ts.map +1 -0
- package/dist/mcp/scope.js +64 -0
- package/dist/mcp/scope.js.map +1 -0
- package/dist/mcp/server.d.ts +57 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +427 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/write-items.d.ts +34 -0
- package/dist/mcp/write-items.d.ts.map +1 -0
- package/dist/mcp/write-items.js +59 -0
- package/dist/mcp/write-items.js.map +1 -0
- package/dist/rules/deletions-client.d.ts +16 -0
- package/dist/rules/deletions-client.d.ts.map +1 -0
- package/dist/rules/deletions-client.js +40 -0
- package/dist/rules/deletions-client.js.map +1 -0
- package/dist/rules/diff.d.ts +19 -0
- package/dist/rules/diff.d.ts.map +1 -0
- package/dist/rules/diff.js +36 -0
- package/dist/rules/diff.js.map +1 -0
- package/dist/rules/discover.d.ts +81 -0
- package/dist/rules/discover.d.ts.map +1 -0
- package/dist/rules/discover.js +307 -0
- package/dist/rules/discover.js.map +1 -0
- package/dist/rules/file-origin.d.ts +16 -0
- package/dist/rules/file-origin.d.ts.map +1 -0
- package/dist/rules/file-origin.js +31 -0
- package/dist/rules/file-origin.js.map +1 -0
- package/dist/rules/global-flag.d.ts +12 -0
- package/dist/rules/global-flag.d.ts.map +1 -0
- package/dist/rules/global-flag.js +15 -0
- package/dist/rules/global-flag.js.map +1 -0
- package/dist/rules/import-client.d.ts +37 -0
- package/dist/rules/import-client.d.ts.map +1 -0
- package/dist/rules/import-client.js +98 -0
- package/dist/rules/import-client.js.map +1 -0
- package/dist/rules/init-pull.d.ts +34 -0
- package/dist/rules/init-pull.d.ts.map +1 -0
- package/dist/rules/init-pull.js +43 -0
- package/dist/rules/init-pull.js.map +1 -0
- package/dist/rules/member-files-client.d.ts +17 -0
- package/dist/rules/member-files-client.d.ts.map +1 -0
- package/dist/rules/member-files-client.js +29 -0
- package/dist/rules/member-files-client.js.map +1 -0
- package/dist/rules/path-contains.d.ts +9 -0
- package/dist/rules/path-contains.d.ts.map +1 -0
- package/dist/rules/path-contains.js +17 -0
- package/dist/rules/path-contains.js.map +1 -0
- package/dist/rules/payload.d.ts +13 -0
- package/dist/rules/payload.d.ts.map +1 -0
- package/dist/rules/payload.js +35 -0
- package/dist/rules/payload.js.map +1 -0
- package/dist/rules/pull-bundle.d.ts +13 -0
- package/dist/rules/pull-bundle.d.ts.map +1 -0
- package/dist/rules/pull-bundle.js +32 -0
- package/dist/rules/pull-bundle.js.map +1 -0
- package/dist/rules/watch.d.ts +121 -0
- package/dist/rules/watch.d.ts.map +1 -0
- package/dist/rules/watch.js +457 -0
- package/dist/rules/watch.js.map +1 -0
- package/dist/skill-template.d.ts +19 -0
- package/dist/skill-template.d.ts.map +1 -0
- package/dist/skill-template.js +174 -0
- package/dist/skill-template.js.map +1 -0
- package/dist/sync-batches.d.ts +37 -0
- package/dist/sync-batches.d.ts.map +1 -0
- package/dist/sync-batches.js +67 -0
- package/dist/sync-batches.js.map +1 -0
- package/dist/sync-client.d.ts +22 -0
- package/dist/sync-client.d.ts.map +1 -0
- package/dist/sync-client.js +38 -0
- package/dist/sync-client.js.map +1 -0
- package/dist/sync-response.d.ts +23 -0
- package/dist/sync-response.d.ts.map +1 -0
- package/dist/sync-response.js +22 -0
- package/dist/sync-response.js.map +1 -0
- package/dist/token-verify.d.ts +14 -0
- package/dist/token-verify.d.ts.map +1 -0
- package/dist/token-verify.js +30 -0
- package/dist/token-verify.js.map +1 -0
- package/dist/usage/extract.d.ts +31 -0
- package/dist/usage/extract.d.ts.map +1 -0
- package/dist/usage/extract.js +200 -0
- package/dist/usage/extract.js.map +1 -0
- package/dist/usage/providers.d.ts +8 -0
- package/dist/usage/providers.d.ts.map +1 -0
- package/dist/usage/providers.js +23 -0
- package/dist/usage/providers.js.map +1 -0
- package/dist/verdict-queue.d.ts +50 -0
- package/dist/verdict-queue.d.ts.map +1 -0
- package/dist/verdict-queue.js +131 -0
- package/dist/verdict-queue.js.map +1 -0
- package/package.json +72 -0
|
@@ -0,0 +1,635 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { mkdir, readFile, realpath, stat, writeFile } from 'node:fs/promises';
|
|
3
|
+
import { basename, dirname, isAbsolute, join, relative, resolve } from 'node:path';
|
|
4
|
+
import { createInterface } from 'node:readline/promises';
|
|
5
|
+
import { detectFormat } from '@auden.to/projections';
|
|
6
|
+
import { SkillMemberPathSchema, parseGuideBundleResponse } from '@auden.to/protocol';
|
|
7
|
+
import { defineCommand } from 'citty';
|
|
8
|
+
import * as v from 'valibot';
|
|
9
|
+
import { AUDEN_GUIDES_FILE } from '../../auden-paths.js';
|
|
10
|
+
import { readConfigToken, resolveDashboardUrl } from '../../config.js';
|
|
11
|
+
import { formatUnifiedDiff } from '../../rules/diff.js';
|
|
12
|
+
import { parseFileOrigin } from '../../rules/file-origin.js';
|
|
13
|
+
import { fetchGuideMemberFiles } from '../../rules/member-files-client.js';
|
|
14
|
+
import { pullGuideBundle } from '../../rules/pull-bundle.js';
|
|
15
|
+
function sha256(content) {
|
|
16
|
+
return createHash('sha256').update(content, 'utf8').digest('hex');
|
|
17
|
+
}
|
|
18
|
+
async function readCachedBundle(path) {
|
|
19
|
+
let raw;
|
|
20
|
+
try {
|
|
21
|
+
raw = await readFile(path, 'utf8');
|
|
22
|
+
}
|
|
23
|
+
catch (err) {
|
|
24
|
+
const code = err?.code;
|
|
25
|
+
if (code === 'ENOENT') {
|
|
26
|
+
throw new Error(`No cached guide bundle at ${path} — run "auden sync" first to pull guides.`);
|
|
27
|
+
}
|
|
28
|
+
throw err;
|
|
29
|
+
}
|
|
30
|
+
let parsed;
|
|
31
|
+
try {
|
|
32
|
+
parsed = JSON.parse(raw);
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
throw new Error(`Cached guide bundle at ${path} is not valid JSON.`);
|
|
36
|
+
}
|
|
37
|
+
return parseGuideBundleResponse(parsed);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Re-assert containment after resolving symlinks. `resolve()`/`relative()`
|
|
41
|
+
* are purely lexical, so a symlinked ancestor (e.g. `.agents` pointing at
|
|
42
|
+
* `/etc`) would pass the lexical check but write outside `root` once the
|
|
43
|
+
* filesystem follows the link. Walks up from `absolutePath` to the longest
|
|
44
|
+
* existing ancestor, resolves *that* with `realpath`, and re-checks
|
|
45
|
+
* containment against `realpath(root)`.
|
|
46
|
+
*/
|
|
47
|
+
async function isRealpathContained(root, absolutePath) {
|
|
48
|
+
const realRoot = await realpath(root).catch(() => root);
|
|
49
|
+
let current = absolutePath;
|
|
50
|
+
const tail = [];
|
|
51
|
+
for (;;) {
|
|
52
|
+
try {
|
|
53
|
+
const real = await realpath(current);
|
|
54
|
+
const candidate = tail.length > 0 ? join(real, ...tail) : real;
|
|
55
|
+
const rel = relative(realRoot, candidate);
|
|
56
|
+
return rel === '' || (!rel.startsWith('..') && !isAbsolute(rel));
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
if (err?.code !== 'ENOENT')
|
|
60
|
+
throw err;
|
|
61
|
+
const parent = dirname(current);
|
|
62
|
+
if (parent === current)
|
|
63
|
+
return false;
|
|
64
|
+
tail.unshift(basename(current));
|
|
65
|
+
current = parent;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
async function readDiskFile(absolutePath) {
|
|
70
|
+
try {
|
|
71
|
+
return await readFile(absolutePath, 'utf8');
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
const code = err?.code;
|
|
75
|
+
if (code === 'ENOENT')
|
|
76
|
+
return null;
|
|
77
|
+
throw err;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
async function planWrite(guide, cwd, formats) {
|
|
81
|
+
const parsed = parseFileOrigin(guide.origin);
|
|
82
|
+
if (!parsed)
|
|
83
|
+
return null;
|
|
84
|
+
if (!formats.has(parsed.format))
|
|
85
|
+
return null;
|
|
86
|
+
// Treat anything outside cwd as out-of-scope. Absolute paths are
|
|
87
|
+
// intentionally rejected — round-trip writes only touch the project tree.
|
|
88
|
+
if (isAbsolute(parsed.path) || parsed.path.startsWith('..'))
|
|
89
|
+
return null;
|
|
90
|
+
const resolvedCwd = resolve(cwd);
|
|
91
|
+
const absolutePath = resolve(resolvedCwd, parsed.path);
|
|
92
|
+
// path.relative is the safe containment check: a startsWith on the
|
|
93
|
+
// resolved string would let `/tmp/project-evil` pass under `/tmp/project`.
|
|
94
|
+
const rel = relative(resolvedCwd, absolutePath);
|
|
95
|
+
if (rel === '' || rel.startsWith('..') || isAbsolute(rel))
|
|
96
|
+
return null;
|
|
97
|
+
// Lexical containment isn't enough: a symlinked ancestor (e.g. `.agents`
|
|
98
|
+
// pointing outside the project) would pass the check above but write
|
|
99
|
+
// outside `cwd` once the filesystem follows the link.
|
|
100
|
+
if (!(await isRealpathContained(resolvedCwd, absolutePath)))
|
|
101
|
+
return null;
|
|
102
|
+
const expectedHash = sha256(guide.content);
|
|
103
|
+
// Trust an explicit content_hash from the server when present; recompute
|
|
104
|
+
// anyway because the cache file may have been edited by hand.
|
|
105
|
+
if (guide.contentHash && guide.contentHash.toLowerCase() !== expectedHash) {
|
|
106
|
+
// Mismatch means the cached bundle is internally inconsistent. Skip
|
|
107
|
+
// rather than silently overwrite with content the server did not endorse.
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
const onDisk = await readDiskFile(absolutePath);
|
|
111
|
+
let status;
|
|
112
|
+
if (onDisk === null) {
|
|
113
|
+
status = 'new';
|
|
114
|
+
}
|
|
115
|
+
else if (sha256(onDisk) === expectedHash) {
|
|
116
|
+
status = 'unchanged';
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
status = 'changed';
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
guideId: guide.id,
|
|
123
|
+
format: parsed.format,
|
|
124
|
+
payloadPath: parsed.path,
|
|
125
|
+
absolutePath,
|
|
126
|
+
content: guide.content,
|
|
127
|
+
diskContent: status === 'changed' ? onDisk : null,
|
|
128
|
+
status,
|
|
129
|
+
expectedHash,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Plan one member-file write under an already-planned skill guide. The path
|
|
134
|
+
* comes from the server, so it is re-validated against the same safe-relative
|
|
135
|
+
* schema import enforces (defense-in-depth), then containment-checked against
|
|
136
|
+
* the project root exactly like guide paths — lexically and after resolving
|
|
137
|
+
* symlinked ancestors.
|
|
138
|
+
*/
|
|
139
|
+
async function planMemberWrite(parent, member, cwd) {
|
|
140
|
+
if (!v.safeParse(SkillMemberPathSchema, member.path).success)
|
|
141
|
+
return null;
|
|
142
|
+
const resolvedCwd = resolve(cwd);
|
|
143
|
+
const absolutePath = resolve(dirname(parent.absolutePath), member.path);
|
|
144
|
+
const rel = relative(resolvedCwd, absolutePath);
|
|
145
|
+
if (rel === '' || rel.startsWith('..') || isAbsolute(rel))
|
|
146
|
+
return null;
|
|
147
|
+
if (!(await isRealpathContained(resolvedCwd, absolutePath)))
|
|
148
|
+
return null;
|
|
149
|
+
const expectedHash = sha256(member.content);
|
|
150
|
+
if (member.contentHash.toLowerCase() !== expectedHash) {
|
|
151
|
+
// Server said the content hashes to something else — inconsistent
|
|
152
|
+
// response, skip rather than write content the server did not endorse.
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
const onDisk = await readDiskFile(absolutePath);
|
|
156
|
+
let status;
|
|
157
|
+
if (onDisk === null) {
|
|
158
|
+
status = 'new';
|
|
159
|
+
}
|
|
160
|
+
else if (sha256(onDisk) === expectedHash) {
|
|
161
|
+
status = 'unchanged';
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
status = 'changed';
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
guideId: parent.guideId,
|
|
168
|
+
format: parent.format,
|
|
169
|
+
payloadPath: relative(resolvedCwd, absolutePath).replaceAll('\\', '/'),
|
|
170
|
+
absolutePath,
|
|
171
|
+
content: member.content,
|
|
172
|
+
diskContent: status === 'changed' ? onDisk : null,
|
|
173
|
+
status,
|
|
174
|
+
expectedHash,
|
|
175
|
+
isMember: true,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
function formatPlan(plans) {
|
|
179
|
+
return plans
|
|
180
|
+
.map((plan, index) => {
|
|
181
|
+
const marker = plan.status === 'new'
|
|
182
|
+
? 'NEW'
|
|
183
|
+
: plan.status === 'changed'
|
|
184
|
+
? 'OVERWRITE'
|
|
185
|
+
: 'unchanged';
|
|
186
|
+
return ` ${index + 1}. [${plan.format}] ${plan.payloadPath} (${marker})`;
|
|
187
|
+
})
|
|
188
|
+
.join('\n');
|
|
189
|
+
}
|
|
190
|
+
async function stdinConfirm(prompt) {
|
|
191
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
192
|
+
try {
|
|
193
|
+
const answer = (await rl.question(prompt)).trim().toLowerCase();
|
|
194
|
+
return answer === 'y' || answer === 'yes';
|
|
195
|
+
}
|
|
196
|
+
finally {
|
|
197
|
+
rl.close();
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
export function makeStdinPrompts() {
|
|
201
|
+
return {
|
|
202
|
+
confirmNewFiles: ({ count, cwd }) => stdinConfirm(`Write ${count} new file(s) under ${cwd}? [y/N] `),
|
|
203
|
+
confirmOverwrite: async ({ path, diff, index, total }) => {
|
|
204
|
+
console.log('');
|
|
205
|
+
console.log(` Overwrite ${path}? (${index}/${total})`);
|
|
206
|
+
console.log('');
|
|
207
|
+
console.log(diff);
|
|
208
|
+
console.log('');
|
|
209
|
+
return await stdinConfirm(` Apply overwrite to ${path}? [y/N] `);
|
|
210
|
+
},
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
export async function runRulesExport(args) {
|
|
214
|
+
const bundle = await readCachedBundle(args.bundlePath);
|
|
215
|
+
const formats = new Set(args.format);
|
|
216
|
+
const plans = [];
|
|
217
|
+
let skipped = 0;
|
|
218
|
+
let memberSkillsSkipped = 0;
|
|
219
|
+
let memberFetchErrors = 0;
|
|
220
|
+
let memberFilesRejected = 0;
|
|
221
|
+
for (const guide of bundle.guides) {
|
|
222
|
+
const plan = await planWrite(guide, args.cwd, formats);
|
|
223
|
+
if (!plan) {
|
|
224
|
+
// Only count guides that look like they could have been candidates so
|
|
225
|
+
// the skipped total is meaningful — pure non-imported guides are not
|
|
226
|
+
// "skipped", they are out of scope for this command.
|
|
227
|
+
const parsed = parseFileOrigin(guide.origin);
|
|
228
|
+
if (parsed && formats.has(parsed.format))
|
|
229
|
+
skipped += 1;
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
if (args.excludePathPrefixes?.some((prefix) => plan.payloadPath === prefix || plan.payloadPath.startsWith(prefix))) {
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
235
|
+
plans.push(plan);
|
|
236
|
+
if (plan.format !== 'skill-md')
|
|
237
|
+
continue;
|
|
238
|
+
// Member expansion only for origins that are genuinely skill-shaped —
|
|
239
|
+
// detectFormat only assigns skill-md under a skills/ directory, so a
|
|
240
|
+
// tampered origin like `file:skill-md:SKILL.md` (whose "skill directory"
|
|
241
|
+
// would be the project root, putting .git/hooks and CI workflows in
|
|
242
|
+
// member-path range) never gets members planned.
|
|
243
|
+
if (detectFormat(plan.payloadPath) !== 'skill-md') {
|
|
244
|
+
memberFilesRejected += 1;
|
|
245
|
+
continue;
|
|
246
|
+
}
|
|
247
|
+
if (!args.fetchMemberFiles) {
|
|
248
|
+
memberSkillsSkipped += 1;
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
let memberFiles;
|
|
252
|
+
try {
|
|
253
|
+
memberFiles = await args.fetchMemberFiles(plan.guideId);
|
|
254
|
+
}
|
|
255
|
+
catch {
|
|
256
|
+
// A failed member fetch must not abort the export — the SKILL.md plan
|
|
257
|
+
// stands, and the miss is surfaced in the result for the CLI notice.
|
|
258
|
+
memberFetchErrors += 1;
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
261
|
+
for (const member of memberFiles) {
|
|
262
|
+
const memberPlan = await planMemberWrite(plan, member, args.cwd);
|
|
263
|
+
if (memberPlan)
|
|
264
|
+
plans.push(memberPlan);
|
|
265
|
+
else
|
|
266
|
+
memberFilesRejected += 1;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
const allNewPlans = plans.filter((plan) => plan.status === 'new');
|
|
270
|
+
const overwritePlans = plans.filter((plan) => plan.status === 'changed');
|
|
271
|
+
const unchanged = plans.length - allNewPlans.length - overwritePlans.length;
|
|
272
|
+
// A NEW member file whose parent SKILL.md overwrite is still undecided
|
|
273
|
+
// rides that decision instead of the bulk NEW prompt — the bulk writes
|
|
274
|
+
// happen first, so it would otherwise land server content in the skill
|
|
275
|
+
// directory before the user ever sees the parent diff they may decline.
|
|
276
|
+
const pendingParentIds = new Set(overwritePlans.filter((plan) => !plan.isMember).map((plan) => plan.guideId));
|
|
277
|
+
const deferredMemberPlans = allNewPlans.filter((plan) => plan.isMember && pendingParentIds.has(plan.guideId));
|
|
278
|
+
const newPlans = allNewPlans.filter((plan) => !deferredMemberPlans.includes(plan));
|
|
279
|
+
if (plans.length === 0) {
|
|
280
|
+
return {
|
|
281
|
+
written: 0,
|
|
282
|
+
unchanged: 0,
|
|
283
|
+
skipped,
|
|
284
|
+
declined: 0,
|
|
285
|
+
memberSkillsSkipped,
|
|
286
|
+
memberFetchErrors,
|
|
287
|
+
memberFilesRejected,
|
|
288
|
+
plans: [],
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
if (!args.write) {
|
|
292
|
+
return {
|
|
293
|
+
written: 0,
|
|
294
|
+
unchanged,
|
|
295
|
+
skipped,
|
|
296
|
+
declined: 0,
|
|
297
|
+
memberSkillsSkipped,
|
|
298
|
+
memberFetchErrors,
|
|
299
|
+
memberFilesRejected,
|
|
300
|
+
plans,
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
const writableCount = newPlans.length + overwritePlans.length + deferredMemberPlans.length;
|
|
304
|
+
if (writableCount === 0) {
|
|
305
|
+
return {
|
|
306
|
+
written: 0,
|
|
307
|
+
unchanged,
|
|
308
|
+
skipped,
|
|
309
|
+
declined: 0,
|
|
310
|
+
memberSkillsSkipped,
|
|
311
|
+
memberFetchErrors,
|
|
312
|
+
memberFilesRejected,
|
|
313
|
+
plans,
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
const prompts = args.prompts ?? makeStdinPrompts();
|
|
317
|
+
let written = 0;
|
|
318
|
+
let declined = 0;
|
|
319
|
+
// NEW files have no clobber risk — one bulk confirm matches the historical
|
|
320
|
+
// behavior and avoids a chain of trivial prompts on a fresh-machine restore.
|
|
321
|
+
if (newPlans.length > 0) {
|
|
322
|
+
const ok = args.yes ||
|
|
323
|
+
(await prompts.confirmNewFiles({ count: newPlans.length, cwd: args.cwd }));
|
|
324
|
+
if (ok) {
|
|
325
|
+
for (const plan of newPlans) {
|
|
326
|
+
await writePlan(plan);
|
|
327
|
+
written += 1;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
else {
|
|
331
|
+
declined += newPlans.length;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
// OVERWRITE files are the foot-gun: walk them one by one with a diff so the
|
|
335
|
+
// user can see exactly what would be discarded before consenting.
|
|
336
|
+
for (let i = 0; i < overwritePlans.length; i += 1) {
|
|
337
|
+
const plan = overwritePlans[i];
|
|
338
|
+
let ok;
|
|
339
|
+
if (args.yes) {
|
|
340
|
+
ok = true;
|
|
341
|
+
}
|
|
342
|
+
else {
|
|
343
|
+
const diff = formatUnifiedDiff(plan.diskContent ?? '', plan.content, plan.payloadPath, {
|
|
344
|
+
color: args.color ?? false,
|
|
345
|
+
});
|
|
346
|
+
ok = await prompts.confirmOverwrite({
|
|
347
|
+
path: plan.payloadPath,
|
|
348
|
+
diff,
|
|
349
|
+
index: i + 1,
|
|
350
|
+
total: overwritePlans.length,
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
const deferredForParent = plan.isMember
|
|
354
|
+
? []
|
|
355
|
+
: deferredMemberPlans.filter((member) => member.guideId === plan.guideId);
|
|
356
|
+
if (ok) {
|
|
357
|
+
await writePlan(plan);
|
|
358
|
+
written += 1;
|
|
359
|
+
// Parent accepted — its deferred NEW members are covered by the same
|
|
360
|
+
// consent (they carry no clobber risk; they were NEW).
|
|
361
|
+
for (const member of deferredForParent) {
|
|
362
|
+
await writePlan(member);
|
|
363
|
+
written += 1;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
else {
|
|
367
|
+
declined += 1 + deferredForParent.length;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return {
|
|
371
|
+
written,
|
|
372
|
+
unchanged,
|
|
373
|
+
skipped,
|
|
374
|
+
declined,
|
|
375
|
+
memberSkillsSkipped,
|
|
376
|
+
memberFetchErrors,
|
|
377
|
+
memberFilesRejected,
|
|
378
|
+
plans,
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
async function writePlan(plan) {
|
|
382
|
+
await mkdir(dirname(plan.absolutePath), { recursive: true });
|
|
383
|
+
await writeFile(plan.absolutePath, plan.content);
|
|
384
|
+
}
|
|
385
|
+
async function cacheExists(path) {
|
|
386
|
+
try {
|
|
387
|
+
const st = await stat(path);
|
|
388
|
+
// A non-file at the cache path (directory, etc.) would let on-missing
|
|
389
|
+
// skip the pull and then crash later with EISDIR. Treat as missing so
|
|
390
|
+
// the pull path takes over; pullGuideBundle's writeFile will surface a
|
|
391
|
+
// clearer error if the path really is a directory.
|
|
392
|
+
return st.isFile();
|
|
393
|
+
}
|
|
394
|
+
catch (err) {
|
|
395
|
+
if (err?.code === 'ENOENT')
|
|
396
|
+
return false;
|
|
397
|
+
throw err;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
export async function runRulesExportWithPull(args) {
|
|
401
|
+
let pulled = false;
|
|
402
|
+
let pulledCount = 0;
|
|
403
|
+
if (args.pull && args.pull.mode !== 'never') {
|
|
404
|
+
const exists = await cacheExists(args.bundlePath);
|
|
405
|
+
const shouldPull = args.pull.mode === 'always' || !exists;
|
|
406
|
+
if (shouldPull) {
|
|
407
|
+
const pullOptions = args.pull.fetchFn
|
|
408
|
+
? {
|
|
409
|
+
dashboardUrl: args.pull.dashboardUrl,
|
|
410
|
+
token: args.pull.token,
|
|
411
|
+
bundlePath: args.bundlePath,
|
|
412
|
+
fetchFn: args.pull.fetchFn,
|
|
413
|
+
}
|
|
414
|
+
: {
|
|
415
|
+
dashboardUrl: args.pull.dashboardUrl,
|
|
416
|
+
token: args.pull.token,
|
|
417
|
+
bundlePath: args.bundlePath,
|
|
418
|
+
};
|
|
419
|
+
const result = await pullGuideBundle({
|
|
420
|
+
...pullOptions,
|
|
421
|
+
});
|
|
422
|
+
pulled = true;
|
|
423
|
+
pulledCount = result.bundle.guides.length;
|
|
424
|
+
args.onPull?.(pulledCount, args.bundlePath);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
// Member files are fetched lazily per skill guide (they are not in the
|
|
428
|
+
// cached bundle), and only when the bundle was actually pulled THIS run:
|
|
429
|
+
// pairing a stale cached SKILL.md with live member files could write a
|
|
430
|
+
// skill directory state that never existed on the server. `mode: 'never'`
|
|
431
|
+
// stays fully offline; on-missing with a warm cache exports SKILL.md only
|
|
432
|
+
// (the CLI notice points at --pull).
|
|
433
|
+
const exportArgs = { ...args };
|
|
434
|
+
if (!exportArgs.fetchMemberFiles && args.pull && pulled) {
|
|
435
|
+
const { dashboardUrl, token, fetchFn } = args.pull;
|
|
436
|
+
exportArgs.fetchMemberFiles = (guideId) => fetchGuideMemberFiles({
|
|
437
|
+
dashboardUrl,
|
|
438
|
+
token,
|
|
439
|
+
guideId,
|
|
440
|
+
...(fetchFn ? { fetchImpl: fetchFn } : {}),
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
const result = await runRulesExport(exportArgs);
|
|
444
|
+
return { ...result, pulled, pulledCount };
|
|
445
|
+
}
|
|
446
|
+
const DEFAULT_FORMATS = ['agents-dir'];
|
|
447
|
+
export const ALL_FORMATS = [
|
|
448
|
+
'agents-md',
|
|
449
|
+
'agents-dir',
|
|
450
|
+
'claude-md',
|
|
451
|
+
'claude-rules',
|
|
452
|
+
'cursorrules',
|
|
453
|
+
'cursor-rules',
|
|
454
|
+
'skill-md',
|
|
455
|
+
];
|
|
456
|
+
function resolveFormats(raw) {
|
|
457
|
+
const trimmed = raw.trim();
|
|
458
|
+
if (trimmed.length === 0)
|
|
459
|
+
return DEFAULT_FORMATS;
|
|
460
|
+
if (trimmed === 'all')
|
|
461
|
+
return ALL_FORMATS;
|
|
462
|
+
const tokens = trimmed
|
|
463
|
+
.split(',')
|
|
464
|
+
.map((t) => t.trim())
|
|
465
|
+
.filter((t) => t.length > 0);
|
|
466
|
+
const formats = [];
|
|
467
|
+
for (const token of tokens) {
|
|
468
|
+
if (!ALL_FORMATS.includes(token)) {
|
|
469
|
+
throw new Error(`Unknown format "${token}"`);
|
|
470
|
+
}
|
|
471
|
+
formats.push(token);
|
|
472
|
+
}
|
|
473
|
+
return formats;
|
|
474
|
+
}
|
|
475
|
+
export const rulesExportCommand = defineCommand({
|
|
476
|
+
meta: {
|
|
477
|
+
name: 'export',
|
|
478
|
+
description: 'Write imported guides back to disk byte-for-byte (default: .agents/ only)',
|
|
479
|
+
},
|
|
480
|
+
args: {
|
|
481
|
+
cwd: {
|
|
482
|
+
type: 'string',
|
|
483
|
+
description: 'Project root to write into (defaults to current working directory)',
|
|
484
|
+
default: '',
|
|
485
|
+
},
|
|
486
|
+
format: {
|
|
487
|
+
type: 'string',
|
|
488
|
+
description: 'Comma-separated formats to include (defaults to "agents-dir"; use "all" for every supported format)',
|
|
489
|
+
default: '',
|
|
490
|
+
},
|
|
491
|
+
yes: {
|
|
492
|
+
type: 'boolean',
|
|
493
|
+
description: 'Skip the confirmation prompt and write every planned file',
|
|
494
|
+
default: false,
|
|
495
|
+
},
|
|
496
|
+
write: {
|
|
497
|
+
type: 'boolean',
|
|
498
|
+
description: 'Actually write to disk (default: dry-run)',
|
|
499
|
+
default: false,
|
|
500
|
+
},
|
|
501
|
+
bundle: {
|
|
502
|
+
type: 'string',
|
|
503
|
+
description: 'Override the cached guide-bundle path (defaults to ~/.auden/guides.json)',
|
|
504
|
+
default: '',
|
|
505
|
+
},
|
|
506
|
+
pull: {
|
|
507
|
+
type: 'boolean',
|
|
508
|
+
description: 'Refresh the cached bundle from the dashboard before exporting (forces a pull even when the cache exists)',
|
|
509
|
+
default: false,
|
|
510
|
+
},
|
|
511
|
+
'no-pull': {
|
|
512
|
+
type: 'boolean',
|
|
513
|
+
description: 'Never auto-pull, even if the cache is missing (strict offline mode; skill member files, which are always fetched live, are skipped too)',
|
|
514
|
+
default: false,
|
|
515
|
+
},
|
|
516
|
+
token: {
|
|
517
|
+
type: 'string',
|
|
518
|
+
description: 'Auden API token (overrides the token stored by "auden init"; required for --pull or auto-pull only when no token is configured)',
|
|
519
|
+
default: '',
|
|
520
|
+
},
|
|
521
|
+
'dashboard-url': {
|
|
522
|
+
type: 'string',
|
|
523
|
+
description: 'Override the dashboard base URL for this call (default: ~/.auden/config.json then the baked-in default)',
|
|
524
|
+
default: '',
|
|
525
|
+
},
|
|
526
|
+
},
|
|
527
|
+
async run({ args }) {
|
|
528
|
+
let formats;
|
|
529
|
+
try {
|
|
530
|
+
formats = resolveFormats(args.format);
|
|
531
|
+
}
|
|
532
|
+
catch (err) {
|
|
533
|
+
console.log(` ${err.message}`);
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
const cwd = args.cwd ? resolve(args.cwd) : process.cwd();
|
|
537
|
+
const bundlePath = args.bundle ? resolve(args.bundle) : AUDEN_GUIDES_FILE;
|
|
538
|
+
let pull;
|
|
539
|
+
if (args.pull && args['no-pull']) {
|
|
540
|
+
console.log(' --pull and --no-pull are mutually exclusive.');
|
|
541
|
+
return;
|
|
542
|
+
}
|
|
543
|
+
const token = args.token || (await readConfigToken());
|
|
544
|
+
const dashboardUrl = await resolveDashboardUrl(args['dashboard-url']);
|
|
545
|
+
if (args.pull) {
|
|
546
|
+
if (!token) {
|
|
547
|
+
console.log(' --pull requires a dashboard token — pass --token or run "auden init".');
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
pull = {
|
|
551
|
+
mode: 'always',
|
|
552
|
+
dashboardUrl,
|
|
553
|
+
token,
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
else if (args['no-pull']) {
|
|
557
|
+
pull = undefined;
|
|
558
|
+
}
|
|
559
|
+
else if (token) {
|
|
560
|
+
pull = {
|
|
561
|
+
mode: 'on-missing',
|
|
562
|
+
dashboardUrl,
|
|
563
|
+
token,
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
let result;
|
|
567
|
+
try {
|
|
568
|
+
const exportArgs = {
|
|
569
|
+
cwd,
|
|
570
|
+
format: formats,
|
|
571
|
+
bundlePath,
|
|
572
|
+
yes: args.yes,
|
|
573
|
+
write: args.write,
|
|
574
|
+
// Only color when stdout is a real TTY; piping to a file or another
|
|
575
|
+
// process should produce clean text the receiving tool can parse.
|
|
576
|
+
color: process.stdout.isTTY === true,
|
|
577
|
+
onPull: (count, target) => {
|
|
578
|
+
console.log(` Pulled ${count} active guide(s) → ${target}`);
|
|
579
|
+
},
|
|
580
|
+
};
|
|
581
|
+
if (pull) {
|
|
582
|
+
exportArgs.pull = pull;
|
|
583
|
+
}
|
|
584
|
+
result = await runRulesExportWithPull(exportArgs);
|
|
585
|
+
}
|
|
586
|
+
catch (err) {
|
|
587
|
+
console.log(` ${err.message}`);
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
if (result.plans.length === 0) {
|
|
591
|
+
console.log(` No exportable guides found for formats: ${formats.join(', ')}.`);
|
|
592
|
+
if (result.skipped > 0) {
|
|
593
|
+
console.log(` Skipped ${result.skipped} guide(s) outside the project root.`);
|
|
594
|
+
}
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
console.log(`Planned ${result.plans.length} file(s) under ${cwd} (formats: ${formats.join(', ')}):\n`);
|
|
598
|
+
console.log(formatPlan(result.plans));
|
|
599
|
+
console.log('');
|
|
600
|
+
if (!args.write) {
|
|
601
|
+
console.log(' Dry run — pass --write to apply.');
|
|
602
|
+
if (result.skipped > 0) {
|
|
603
|
+
console.log(` Skipped ${result.skipped} guide(s) outside the project root.`);
|
|
604
|
+
}
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
if (result.written === 0) {
|
|
608
|
+
if (result.unchanged === result.plans.length) {
|
|
609
|
+
console.log(' All target files already match — nothing to write.');
|
|
610
|
+
}
|
|
611
|
+
else {
|
|
612
|
+
console.log(` No files written (${result.declined} file(s) declined).`);
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
else {
|
|
616
|
+
const parts = [`Wrote ${result.written} file(s)`, `${result.unchanged} unchanged`];
|
|
617
|
+
if (result.declined > 0)
|
|
618
|
+
parts.push(`${result.declined} declined`);
|
|
619
|
+
console.log(` ${parts.join('; ')}.`);
|
|
620
|
+
}
|
|
621
|
+
if (result.skipped > 0) {
|
|
622
|
+
console.log(` Skipped ${result.skipped} guide(s) outside the project root.`);
|
|
623
|
+
}
|
|
624
|
+
if (result.memberSkillsSkipped > 0) {
|
|
625
|
+
console.log(` ${result.memberSkillsSkipped} skill guide(s) exported without member files — they are fetched live with a fresh bundle, so pass --pull (with a token from "auden init") to include them.`);
|
|
626
|
+
}
|
|
627
|
+
if (result.memberFetchErrors > 0) {
|
|
628
|
+
console.log(` Failed to fetch member files for ${result.memberFetchErrors} skill guide(s) — their SKILL.md was still exported; retry to pick up the rest.`);
|
|
629
|
+
}
|
|
630
|
+
if (result.memberFilesRejected > 0) {
|
|
631
|
+
console.log(` Refused ${result.memberFilesRejected} skill member file(s) from the server (unsafe path or content-hash mismatch) — nothing was written for them.`);
|
|
632
|
+
}
|
|
633
|
+
},
|
|
634
|
+
});
|
|
635
|
+
//# sourceMappingURL=export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../../src/commands/rules/export.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC7E,OAAO,EAAE,QAAQ,EAAE,OA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