auden 0.1.0-alpha.4 → 0.1.0-alpha.5
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/dist/commands/pull.d.ts +7 -1
- package/dist/commands/pull.d.ts.map +1 -1
- package/dist/commands/pull.js +126 -32
- package/dist/commands/pull.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +35 -1
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/sync.d.ts +10 -0
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +41 -0
- package/dist/commands/sync.js.map +1 -1
- package/dist/docs/repo-config.d.ts +76 -0
- package/dist/docs/repo-config.d.ts.map +1 -0
- package/dist/docs/repo-config.js +143 -0
- package/dist/docs/repo-config.js.map +1 -0
- package/dist/docs/status.d.ts +35 -0
- package/dist/docs/status.d.ts.map +1 -0
- package/dist/docs/status.js +48 -0
- package/dist/docs/status.js.map +1 -0
- package/dist/docs/subscribe.d.ts +47 -0
- package/dist/docs/subscribe.d.ts.map +1 -0
- package/dist/docs/subscribe.js +83 -0
- package/dist/docs/subscribe.js.map +1 -0
- package/dist/docs/sync-docs.d.ts +55 -0
- package/dist/docs/sync-docs.d.ts.map +1 -0
- package/dist/docs/sync-docs.js +72 -0
- package/dist/docs/sync-docs.js.map +1 -0
- package/package.json +4 -4
package/dist/commands/pull.d.ts
CHANGED
|
@@ -2,13 +2,19 @@ export declare const pullCommand: import("citty").CommandDef<{
|
|
|
2
2
|
bundle: {
|
|
3
3
|
type: "positional";
|
|
4
4
|
description: string;
|
|
5
|
-
required:
|
|
5
|
+
required: false;
|
|
6
|
+
default: string;
|
|
6
7
|
};
|
|
7
8
|
out: {
|
|
8
9
|
type: "string";
|
|
9
10
|
description: string;
|
|
10
11
|
default: string;
|
|
11
12
|
};
|
|
13
|
+
once: {
|
|
14
|
+
type: "boolean";
|
|
15
|
+
description: string;
|
|
16
|
+
default: false;
|
|
17
|
+
};
|
|
12
18
|
types: {
|
|
13
19
|
type: "string";
|
|
14
20
|
description: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pull.d.ts","sourceRoot":"","sources":["../../src/commands/pull.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pull.d.ts","sourceRoot":"","sources":["../../src/commands/pull.ts"],"names":[],"mappings":"AAkCA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4MtB,CAAA"}
|
package/dist/commands/pull.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { createInterface } from 'node:readline/promises';
|
|
1
2
|
import { defineCommand } from 'citty';
|
|
2
3
|
import { resolveDashboardUrl, resolveToken } from '../config.js';
|
|
3
4
|
import { defaultPullDir, pullBundleToDir } from '../context/pull.js';
|
|
5
|
+
import { parseSelectionInput, subscribeBundles, } from '../docs/subscribe.js';
|
|
4
6
|
import { createContextClient } from '../mcp/client.js';
|
|
5
7
|
// Mirror the REST endpoint's (and MCP server's) MAX_LIMIT so an over-large
|
|
6
8
|
// `--limit` fails client-side with a clear message instead of being rejected or
|
|
@@ -22,19 +24,25 @@ function parseTypesFlag(raw) {
|
|
|
22
24
|
export const pullCommand = defineCommand({
|
|
23
25
|
meta: {
|
|
24
26
|
name: 'pull',
|
|
25
|
-
description: 'Pull a context bundle
|
|
27
|
+
description: 'Pull a context bundle into this repo and subscribe so `auden sync` keeps it fresh',
|
|
26
28
|
},
|
|
27
29
|
args: {
|
|
28
30
|
bundle: {
|
|
29
31
|
type: 'positional',
|
|
30
|
-
description: 'Bundle slug to pull
|
|
31
|
-
required:
|
|
32
|
+
description: 'Bundle slug to pull (omit for an interactive picker of your bundles)',
|
|
33
|
+
required: false,
|
|
34
|
+
default: '',
|
|
32
35
|
},
|
|
33
36
|
out: {
|
|
34
37
|
type: 'string',
|
|
35
|
-
description: 'Directory to write items into (default: .auden/context/<bundle>/)',
|
|
38
|
+
description: 'Directory to write items into (default: .auden/context/<bundle>/). Implies --once.',
|
|
36
39
|
default: '',
|
|
37
40
|
},
|
|
41
|
+
once: {
|
|
42
|
+
type: 'boolean',
|
|
43
|
+
description: 'Pull without subscribing — a one-off, not kept fresh by `auden sync`',
|
|
44
|
+
default: false,
|
|
45
|
+
},
|
|
38
46
|
types: {
|
|
39
47
|
type: 'string',
|
|
40
48
|
description: 'Comma-separated item types to include (guide,document,reference,asset)',
|
|
@@ -62,12 +70,9 @@ export const pullCommand = defineCommand({
|
|
|
62
70
|
},
|
|
63
71
|
},
|
|
64
72
|
async run({ args }) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
process.exitCode = 1;
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
73
|
+
// resolveToken honours the --token flag, then $AUDEN_TOKEN, then the stored
|
|
74
|
+
// config token (env-var credentials, PR #351). No positional-bundle guard
|
|
75
|
+
// here — a bare `auden pull` opens the interactive picker below.
|
|
71
76
|
const token = await resolveToken(args.token);
|
|
72
77
|
if (!token) {
|
|
73
78
|
console.error('No Auden token configured. Get one from the dashboard (Settings → Developer → CLI Token), then run `auden init --token <token>` or pass `auden pull <bundle> --token <token>`.');
|
|
@@ -93,35 +98,124 @@ export const pullCommand = defineCommand({
|
|
|
93
98
|
process.exitCode = 1;
|
|
94
99
|
return;
|
|
95
100
|
}
|
|
96
|
-
const dir = args.out.trim() || defaultPullDir(bundle, process.cwd());
|
|
97
|
-
const types = parseTypesFlag(args.types);
|
|
98
|
-
const query = args.query.trim();
|
|
99
101
|
const client = createContextClient({ dashboardUrl, token });
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
102
|
+
const cwd = process.cwd();
|
|
103
|
+
// Resolve which bundles to pull: an explicit positional, or an interactive
|
|
104
|
+
// picker when none is given (restores the discoverability the old
|
|
105
|
+
// `docs enable` picker provided).
|
|
106
|
+
const explicit = args.bundle.trim();
|
|
107
|
+
// --out targets a single directory, so it only makes sense with an explicit
|
|
108
|
+
// single bundle — reject it with the multi-select picker rather than
|
|
109
|
+
// silently ignoring it and writing to the default dirs.
|
|
110
|
+
if (args.out.trim() && !explicit) {
|
|
111
|
+
console.error('--out requires an explicit bundle: `auden pull <bundle> --out <dir>` (it cannot be combined with the interactive picker).');
|
|
112
|
+
process.exitCode = 1;
|
|
113
|
+
return;
|
|
108
114
|
}
|
|
109
|
-
|
|
110
|
-
|
|
115
|
+
let bundles;
|
|
116
|
+
if (explicit) {
|
|
117
|
+
bundles = [explicit];
|
|
118
|
+
}
|
|
119
|
+
else if (process.stdin.isTTY) {
|
|
120
|
+
try {
|
|
121
|
+
bundles = await pickBundles(client);
|
|
122
|
+
}
|
|
123
|
+
catch (err) {
|
|
124
|
+
console.error(err instanceof Error ? err.message : String(err));
|
|
125
|
+
process.exitCode = 1;
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
if (bundles.length === 0) {
|
|
129
|
+
console.log('No bundles selected.');
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
console.error('A bundle slug is required: `auden pull <bundle>` (or run in an interactive terminal to pick).');
|
|
111
135
|
process.exitCode = 1;
|
|
112
136
|
return;
|
|
113
137
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
138
|
+
// A custom --out is inherently a one-off to a chosen location; subscribing
|
|
139
|
+
// there would be inconsistent (sync refreshes the default dir), so --out
|
|
140
|
+
// implies --once. A picker selection can target several bundles, so --out
|
|
141
|
+
// (single directory) doesn't apply to it.
|
|
142
|
+
const customOut = args.out.trim();
|
|
143
|
+
const subscribe = !args.once && !customOut;
|
|
144
|
+
const types = parseTypesFlag(args.types);
|
|
145
|
+
const query = args.query.trim();
|
|
146
|
+
let anyFailed = false;
|
|
147
|
+
const pulled = [];
|
|
148
|
+
for (const bundle of bundles) {
|
|
149
|
+
const dir = explicit && customOut ? customOut : defaultPullDir(bundle, cwd);
|
|
150
|
+
try {
|
|
151
|
+
const result = await pullBundleToDir(client, {
|
|
152
|
+
bundle,
|
|
153
|
+
query: query || undefined,
|
|
154
|
+
types: types.length > 0 ? types : undefined,
|
|
155
|
+
limit,
|
|
156
|
+
}, dir);
|
|
157
|
+
const skipped = result.items.length - result.written.length;
|
|
158
|
+
console.log(`Pulled ${result.written.length} item(s) from "${bundle}" into ${dir}` +
|
|
159
|
+
(skipped > 0
|
|
160
|
+
? ` (${skipped} item(s) without text content skipped, e.g. assets)`
|
|
161
|
+
: ''));
|
|
162
|
+
for (const path of result.written) {
|
|
163
|
+
console.log(` ${path}`);
|
|
164
|
+
}
|
|
165
|
+
if (result.items.length === 0) {
|
|
166
|
+
console.log(' (bundle is empty or no items matched the filters)');
|
|
167
|
+
}
|
|
168
|
+
pulled.push(bundle);
|
|
169
|
+
}
|
|
170
|
+
catch (err) {
|
|
171
|
+
anyFailed = true;
|
|
172
|
+
console.error(`Failed to pull "${bundle}": ${err instanceof Error ? err.message : String(err)}`);
|
|
173
|
+
}
|
|
121
174
|
}
|
|
122
|
-
|
|
123
|
-
|
|
175
|
+
// Subscribe the bundles that actually pulled, so `auden sync` keeps them
|
|
176
|
+
// fresh. Never blocks or fails the pull — the content is already on disk.
|
|
177
|
+
if (subscribe && pulled.length > 0) {
|
|
178
|
+
const result = await subscribeBundles(cwd, pulled);
|
|
179
|
+
if (!result.ok) {
|
|
180
|
+
const detail = result.reason === 'malformed-config'
|
|
181
|
+
? '.auden/config.json is malformed — fix or remove it'
|
|
182
|
+
: result.reason === 'home-collision'
|
|
183
|
+
? 'run from inside a repository, not your home directory (where it would collide with ~/.auden/config.json)'
|
|
184
|
+
: `could not write .auden/config.json${result.message ? ` (${result.message})` : ''}`;
|
|
185
|
+
console.warn(` warning: pulled, but did not subscribe — ${detail}. Pass --once to silence.`);
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
if (result.removedToken) {
|
|
189
|
+
console.warn(' warning: removed a `token` field from .auden/config.json — this file is committed, so rotate that token from the dashboard if it may have been pushed.');
|
|
190
|
+
}
|
|
191
|
+
if (result.added.length > 0) {
|
|
192
|
+
console.log(`Subscribed to ${result.added.join(', ')} — \`auden sync\` will keep ${result.added.length > 1 ? 'them' : 'it'} fresh. Pass --once next time to pull without subscribing.`);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
124
195
|
}
|
|
196
|
+
if (anyFailed)
|
|
197
|
+
process.exitCode = 1;
|
|
125
198
|
},
|
|
126
199
|
});
|
|
200
|
+
/** List the caller's bundles and read one selection line from stdin. */
|
|
201
|
+
async function pickBundles(client) {
|
|
202
|
+
const { bundles } = await client.listBundles();
|
|
203
|
+
const choices = bundles.map((b) => ({ slug: b.slug, name: b.name }));
|
|
204
|
+
if (choices.length === 0) {
|
|
205
|
+
console.log('You have no bundles yet. Create one in the dashboard (or capture context to the inbox), then re-run `auden pull`.');
|
|
206
|
+
return [];
|
|
207
|
+
}
|
|
208
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
209
|
+
try {
|
|
210
|
+
console.log('Your bundles:');
|
|
211
|
+
choices.forEach((choice, i) => {
|
|
212
|
+
console.log(` ${i + 1}. ${choice.slug}${choice.name ? ` (${choice.name})` : ''}`);
|
|
213
|
+
});
|
|
214
|
+
const answer = await rl.question('Pull which? (numbers or slugs, comma-separated; blank to cancel): ');
|
|
215
|
+
return parseSelectionInput(answer, choices);
|
|
216
|
+
}
|
|
217
|
+
finally {
|
|
218
|
+
rl.close();
|
|
219
|
+
}
|
|
220
|
+
}
|
|
127
221
|
//# sourceMappingURL=pull.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pull.js","sourceRoot":"","sources":["../../src/commands/pull.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,OAAO,EAA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AAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;IACpF,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,CAAC,GAAG,CACT,mHAAmH,CACpH,CAAA;QACD,OAAO,EAAE,CAAA;IACX,CAAC;IACD,MAAM,EAAE,GAAG,eAAe,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;IAC5E,IAAI,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;QAC5B,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;QACpF,CAAC,CAAC,CAAA;QACF,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,QAAQ,CAC9B,oEAAoE,CACrE,CAAA;QACD,OAAO,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7C,CAAC;YAAS,CAAC;QACT,EAAE,CAAC,KAAK,EAAE,CAAA;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,aAAa,gCAyFxB,CAAA"}
|
package/dist/commands/status.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { readFile } from 'node:fs/promises';
|
|
1
|
+
import { readdir, readFile } from 'node:fs/promises';
|
|
2
2
|
import { defineCommand } from 'citty';
|
|
3
3
|
import { AUDEN_CONFIG, AUDEN_GUIDES_FILE, AUDEN_QUEUE_DIR } from '../auden-paths.js';
|
|
4
|
+
import { readRepoDocsConfig } from '../docs/repo-config.js';
|
|
5
|
+
import { computeDocsStatus } from '../docs/status.js';
|
|
4
6
|
import { notifyUpdateIfDue } from '../update/notice.js';
|
|
5
7
|
import { readVerdictQueue } from '../verdict-queue.js';
|
|
6
8
|
export const statusCommand = defineCommand({
|
|
@@ -48,6 +50,26 @@ export const statusCommand = defineCommand({
|
|
|
48
50
|
const queue = await readVerdictQueue(AUDEN_QUEUE_DIR);
|
|
49
51
|
const pendingCount = queue.actions.length;
|
|
50
52
|
const invalidCount = queue.invalidFilePaths.length;
|
|
53
|
+
// Doc-bundle subscriptions for the current repo (cross-repo-docs). Read from
|
|
54
|
+
// the repo-level .auden/config.json (cwd), distinct from the home config
|
|
55
|
+
// above; `auden sync` keeps these bundles' content fresh under
|
|
56
|
+
// .auden/context/<bundle>/.
|
|
57
|
+
const cwd = process.cwd();
|
|
58
|
+
const repoDocs = await readRepoDocsConfig(cwd);
|
|
59
|
+
const docRows = repoDocs.malformed
|
|
60
|
+
? []
|
|
61
|
+
: await computeDocsStatus(cwd, repoDocs.bundles, {
|
|
62
|
+
listDir: async (dir) => {
|
|
63
|
+
try {
|
|
64
|
+
return await readdir(dir);
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
if (err.code === 'ENOENT')
|
|
68
|
+
return null;
|
|
69
|
+
throw err;
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
});
|
|
51
73
|
console.log('Auden status:');
|
|
52
74
|
if (projectName)
|
|
53
75
|
console.log(` project: ${projectName}`);
|
|
@@ -57,6 +79,18 @@ export const statusCommand = defineCommand({
|
|
|
57
79
|
if (invalidCount > 0) {
|
|
58
80
|
console.log(` invalid: ${invalidCount} unreadable queue file(s) (cleaned on next sync)`);
|
|
59
81
|
}
|
|
82
|
+
if (repoDocs.malformed) {
|
|
83
|
+
console.log(' docs: .auden/config.json is malformed — fix or remove it');
|
|
84
|
+
}
|
|
85
|
+
else if (docRows.length > 0) {
|
|
86
|
+
console.log(` docs: ${docRows.length} subscribed bundle(s)`);
|
|
87
|
+
for (const row of docRows) {
|
|
88
|
+
const state = row.exists
|
|
89
|
+
? `${row.materialized} file(s)`
|
|
90
|
+
: 'not yet pulled — run auden sync';
|
|
91
|
+
console.log(` ${row.bundle} — ${state}`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
60
94
|
// After the status output, never before it — the notice must not push the
|
|
61
95
|
// thing the user asked for out of view. Self-suppressing off a TTY.
|
|
62
96
|
await notifyUpdateIfDue();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAEpD,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAEtD,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAC;IACzC,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,0DAA0D;KACxE;IACD,IAAI,EAAE,EAAE;IACR,KAAK,CAAC,GAAG;QACP,cAAc;QAC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AAS,EAAE,CAAC;YACvB,OAAO,CAAC,GAAG,CAAC,gEAAgE,CAAC,CAAA;QAC/E,CAAC;aAAM,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC9B,OAAO,CAAC,GAAG,CAAC,eAAe,OAAO,CAAC,MAAM,uBAAuB,CAAC,CAAA;YACjE,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;gBAC1B,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM;oBACtB,CAAC,CAAC,GAAG,GAAG,CAAC,YAAY,UAAU;oBAC/B,CAAC,CAAC,iCAAiC,CAAA;gBACrC,OAAO,CAAC,GAAG,CAAC,iBAAiB,GAAG,CAAC,MAAM,MAAM,KAAK,EAAE,CAAC,CAAA;YACvD,CAAC;QACH,CAAC;QAED,0EAA0E;QAC1E,oEAAoE;QACpE,MAAM,iBAAiB,EAAE,CAAA;IAC3B,CAAC;CACF,CAAC,CAAA"}
|
package/dist/commands/sync.d.ts
CHANGED
|
@@ -19,5 +19,15 @@ export declare const syncCommand: import("citty").CommandDef<{
|
|
|
19
19
|
description: string;
|
|
20
20
|
default: false;
|
|
21
21
|
};
|
|
22
|
+
docs: {
|
|
23
|
+
type: "boolean";
|
|
24
|
+
description: string;
|
|
25
|
+
default: false;
|
|
26
|
+
};
|
|
27
|
+
'no-docs': {
|
|
28
|
+
type: "boolean";
|
|
29
|
+
description: string;
|
|
30
|
+
default: false;
|
|
31
|
+
};
|
|
22
32
|
}>;
|
|
23
33
|
//# sourceMappingURL=sync.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/commands/sync.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/commands/sync.ts"],"names":[],"mappings":"AA2BA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6QtB,CAAA"}
|
package/dist/commands/sync.js
CHANGED
|
@@ -3,7 +3,10 @@ import { unlink } from 'node:fs/promises';
|
|
|
3
3
|
import { defineCommand } from 'citty';
|
|
4
4
|
import { AUDEN_GUIDES_FILE, AUDEN_QUEUE_DIR } from '../auden-paths.js';
|
|
5
5
|
import { readConfigToken, resolveDashboardUrl, resolveToken, writeConfigToken, } from '../config.js';
|
|
6
|
+
import { readRepoDocsConfig } from '../docs/repo-config.js';
|
|
7
|
+
import { formatDocsSyncLine, syncSubscribedDocs } from '../docs/sync-docs.js';
|
|
6
8
|
import { extractConversationalFeedback } from '../feedback/extract.js';
|
|
9
|
+
import { createContextClient } from '../mcp/client.js';
|
|
7
10
|
import { pullGuideBundle } from '../rules/pull-bundle.js';
|
|
8
11
|
import { buildSyncBatches } from '../sync-batches.js';
|
|
9
12
|
import { postSyncBatch } from '../sync-client.js';
|
|
@@ -39,6 +42,16 @@ export const syncCommand = defineCommand({
|
|
|
39
42
|
description: 'Extract conversational feedback without sending it to the dashboard',
|
|
40
43
|
default: false,
|
|
41
44
|
},
|
|
45
|
+
docs: {
|
|
46
|
+
type: 'boolean',
|
|
47
|
+
description: 'Force the docs phase (pull subscribed bundles) even if this run would otherwise skip it',
|
|
48
|
+
default: false,
|
|
49
|
+
},
|
|
50
|
+
'no-docs': {
|
|
51
|
+
type: 'boolean',
|
|
52
|
+
description: 'Skip the docs phase (pulling subscribed bundles) for this run',
|
|
53
|
+
default: false,
|
|
54
|
+
},
|
|
42
55
|
},
|
|
43
56
|
async run({ args }) {
|
|
44
57
|
const queue = await readVerdictQueue(AUDEN_QUEUE_DIR);
|
|
@@ -182,6 +195,34 @@ export const syncCommand = defineCommand({
|
|
|
182
195
|
const message = err instanceof Error ? err.message : String(err);
|
|
183
196
|
console.warn(` warning: ${message} — skipping.`);
|
|
184
197
|
}
|
|
198
|
+
// Docs phase (cross-repo-docs Slice 1a): when this repo subscribes to doc
|
|
199
|
+
// bundles, pull each into .auden/context/<bundle>/ so subscribed repos stay
|
|
200
|
+
// fresh on the same heartbeat. Pull-only; --no-docs skips, --docs forces the
|
|
201
|
+
// hint even when nothing is subscribed. Never aborts the sync — a bundle's
|
|
202
|
+
// failure is reported and the others still run.
|
|
203
|
+
if (!args['no-docs']) {
|
|
204
|
+
const { bundles, malformed } = await readRepoDocsConfig(process.cwd());
|
|
205
|
+
if (malformed) {
|
|
206
|
+
console.warn(' warning: .auden/config.json is malformed — skipping docs. Fix or remove the file.');
|
|
207
|
+
}
|
|
208
|
+
else if (bundles.length === 0) {
|
|
209
|
+
if (args.docs) {
|
|
210
|
+
console.log(' No doc bundles subscribed in this repo — run `auden pull <bundle>` to subscribe.');
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
const docsClient = createContextClient({ dashboardUrl, token });
|
|
215
|
+
const { results } = await syncSubscribedDocs(docsClient, bundles, process.cwd());
|
|
216
|
+
// A docs pull reaching the server also proves the token — mark
|
|
217
|
+
// acceptance so a --token flag is still stored even if the guide-bundle
|
|
218
|
+
// pull above failed transiently.
|
|
219
|
+
if (results.some((r) => r.error === undefined))
|
|
220
|
+
serverAccepted = true;
|
|
221
|
+
for (const result of results) {
|
|
222
|
+
console.log(formatDocsSyncLine(result));
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
185
226
|
if (serverAccepted && args.token.trim() && args.token.trim() !== storedToken) {
|
|
186
227
|
try {
|
|
187
228
|
await writeConfigToken(args.token);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../../src/commands/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACtE,OAAO,EACL,eAAe,EACf,m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;QAED,2EAA2E;QAC3E,8DAA8D;QAC9D,MAAM,iBAAiB,EAAE,CAAA;IAC3B,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repo-level docs subscription config: `<repo>/.auden/config.json`.
|
|
3
|
+
*
|
|
4
|
+
* This is a DIFFERENT file from the machine-level `~/.auden/config.json` that
|
|
5
|
+
* `src/config.ts` owns. That one lives in the home directory, is chmod `0600`,
|
|
6
|
+
* and holds the bearer **token**. This one is repo-relative, meant to be
|
|
7
|
+
* committed to git, and holds only a repo's doc-bundle subscription
|
|
8
|
+
* (`docs.bundles`). They share a basename by design-doc convention
|
|
9
|
+
* (cross-repo-docs-plan.md) but never the same path — this reader is built so a
|
|
10
|
+
* token can never be read from, or written into, the committed repo file:
|
|
11
|
+
* it only ever touches the `docs` key, and is never routed through
|
|
12
|
+
* `writeConfigToken`/the home-config writers.
|
|
13
|
+
*
|
|
14
|
+
* Kept free of citty/console so it unit-tests directly against a temp dir.
|
|
15
|
+
*/
|
|
16
|
+
/** Repo-relative path of the docs subscription config. */
|
|
17
|
+
export declare const REPO_CONFIG_RELATIVE_PATH = ".auden/config.json";
|
|
18
|
+
/** Absolute path of a repo's `.auden/config.json`, rooted at `cwd`. */
|
|
19
|
+
export declare function repoConfigPath(cwd: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* True when `cwd`'s repo config path resolves to the *same file* as the
|
|
22
|
+
* machine-level `~/.auden/config.json` token store — i.e. `cwd` is the home
|
|
23
|
+
* directory. Reading/writing there would treat the token file as a repo config
|
|
24
|
+
* and (on write) strip the bearer token, breaking future authenticated
|
|
25
|
+
* commands. Callers must refuse the repo-config path in that case.
|
|
26
|
+
*/
|
|
27
|
+
export declare function collidesWithHomeConfig(cwd: string): boolean;
|
|
28
|
+
export type RepoDocsConfigResult = {
|
|
29
|
+
/** Subscribed bundle slugs (trimmed, de-duplicated, empties dropped). */
|
|
30
|
+
bundles: string[];
|
|
31
|
+
/** True when the file did not exist on disk. */
|
|
32
|
+
missing: boolean;
|
|
33
|
+
/** True when the file existed but was not a JSON object. */
|
|
34
|
+
malformed: boolean;
|
|
35
|
+
/** True when a stray top-level `token` key is present (must be stripped on write). */
|
|
36
|
+
hasToken: boolean;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Normalize an arbitrary value into a clean list of bundle slugs: keep strings
|
|
40
|
+
* only, trim each, drop empties, de-duplicate while preserving first-seen
|
|
41
|
+
* order. Shared by the reader and the merge/write path so a hand-edited config
|
|
42
|
+
* and a `--bundle` flag are cleaned identically.
|
|
43
|
+
*/
|
|
44
|
+
export declare function normalizeBundleSlugs(value: unknown): string[];
|
|
45
|
+
/**
|
|
46
|
+
* Read a repo's docs-bundle subscription. Returns an empty list on a missing or
|
|
47
|
+
* malformed config so callers can treat "not subscribed" uniformly; `missing`
|
|
48
|
+
* / `malformed` distinguish the two for messaging.
|
|
49
|
+
*/
|
|
50
|
+
export declare function readRepoDocsConfig(cwd: string): Promise<RepoDocsConfigResult>;
|
|
51
|
+
export type WriteRepoDocsResult = {
|
|
52
|
+
/**
|
|
53
|
+
* True when a `token` key was found in the existing file and stripped before
|
|
54
|
+
* writing. The committed repo config must never carry a bearer token; if one
|
|
55
|
+
* was there (e.g. the file was copied from `~/.auden/config.json` — the exact
|
|
56
|
+
* basename-collision this slice guards against), we remove it rather than
|
|
57
|
+
* re-serialize it back into a file the user commits. The caller should warn
|
|
58
|
+
* so the user can rotate a token that may already be in git history.
|
|
59
|
+
*/
|
|
60
|
+
removedToken: boolean;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Persist a repo's docs-bundle subscription, preserving every other key already
|
|
64
|
+
* in the file (a future `project` identity field, hand-added keys) — but never a
|
|
65
|
+
* `token`, which is stripped defensively so this committed file can't leak a
|
|
66
|
+
* credential. Refuses to overwrite a file that exists but is malformed, rather
|
|
67
|
+
* than silently discarding it.
|
|
68
|
+
*/
|
|
69
|
+
export declare function writeRepoDocsBundles(cwd: string, bundles: string[]): Promise<WriteRepoDocsResult>;
|
|
70
|
+
/**
|
|
71
|
+
* Union an existing subscription with newly-selected slugs, cleaned and
|
|
72
|
+
* de-duplicated. `docs enable` is additive: re-running it to add one bundle
|
|
73
|
+
* must never drop the others already subscribed.
|
|
74
|
+
*/
|
|
75
|
+
export declare function mergeBundleSubscriptions(existing: string[], added: string[]): string[];
|
|
76
|
+
//# sourceMappingURL=repo-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repo-config.d.ts","sourceRoot":"","sources":["../../src/docs/repo-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAOH,0DAA0D;AAC1D,eAAO,MAAM,yBAAyB,uBAAuB,CAAA;AAE7D,uEAAuE;AACvE,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,yEAAyE;IACzE,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAA;IAChB,4DAA4D;IAC5D,SAAS,EAAE,OAAO,CAAA;IAClB,sFAAsF;IACtF,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAY7D;AA+BD;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAanF;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;;;;;OAOG;IACH,YAAY,EAAE,OAAO,CAAA;CACtB,CAAA;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,mBAAmB,CAAC,CA+B9B;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAEtF"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repo-level docs subscription config: `<repo>/.auden/config.json`.
|
|
3
|
+
*
|
|
4
|
+
* This is a DIFFERENT file from the machine-level `~/.auden/config.json` that
|
|
5
|
+
* `src/config.ts` owns. That one lives in the home directory, is chmod `0600`,
|
|
6
|
+
* and holds the bearer **token**. This one is repo-relative, meant to be
|
|
7
|
+
* committed to git, and holds only a repo's doc-bundle subscription
|
|
8
|
+
* (`docs.bundles`). They share a basename by design-doc convention
|
|
9
|
+
* (cross-repo-docs-plan.md) but never the same path — this reader is built so a
|
|
10
|
+
* token can never be read from, or written into, the committed repo file:
|
|
11
|
+
* it only ever touches the `docs` key, and is never routed through
|
|
12
|
+
* `writeConfigToken`/the home-config writers.
|
|
13
|
+
*
|
|
14
|
+
* Kept free of citty/console so it unit-tests directly against a temp dir.
|
|
15
|
+
*/
|
|
16
|
+
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
17
|
+
import { dirname, join, resolve } from 'node:path';
|
|
18
|
+
import { AUDEN_CONFIG } from '../auden-paths.js';
|
|
19
|
+
/** Repo-relative path of the docs subscription config. */
|
|
20
|
+
export const REPO_CONFIG_RELATIVE_PATH = '.auden/config.json';
|
|
21
|
+
/** Absolute path of a repo's `.auden/config.json`, rooted at `cwd`. */
|
|
22
|
+
export function repoConfigPath(cwd) {
|
|
23
|
+
return join(cwd, REPO_CONFIG_RELATIVE_PATH);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* True when `cwd`'s repo config path resolves to the *same file* as the
|
|
27
|
+
* machine-level `~/.auden/config.json` token store — i.e. `cwd` is the home
|
|
28
|
+
* directory. Reading/writing there would treat the token file as a repo config
|
|
29
|
+
* and (on write) strip the bearer token, breaking future authenticated
|
|
30
|
+
* commands. Callers must refuse the repo-config path in that case.
|
|
31
|
+
*/
|
|
32
|
+
export function collidesWithHomeConfig(cwd) {
|
|
33
|
+
return resolve(repoConfigPath(cwd)) === resolve(AUDEN_CONFIG);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Normalize an arbitrary value into a clean list of bundle slugs: keep strings
|
|
37
|
+
* only, trim each, drop empties, de-duplicate while preserving first-seen
|
|
38
|
+
* order. Shared by the reader and the merge/write path so a hand-edited config
|
|
39
|
+
* and a `--bundle` flag are cleaned identically.
|
|
40
|
+
*/
|
|
41
|
+
export function normalizeBundleSlugs(value) {
|
|
42
|
+
if (!Array.isArray(value))
|
|
43
|
+
return [];
|
|
44
|
+
const seen = new Set();
|
|
45
|
+
const out = [];
|
|
46
|
+
for (const entry of value) {
|
|
47
|
+
if (typeof entry !== 'string')
|
|
48
|
+
continue;
|
|
49
|
+
const slug = entry.trim();
|
|
50
|
+
if (slug === '' || seen.has(slug))
|
|
51
|
+
continue;
|
|
52
|
+
seen.add(slug);
|
|
53
|
+
out.push(slug);
|
|
54
|
+
}
|
|
55
|
+
return out;
|
|
56
|
+
}
|
|
57
|
+
async function readParsedRepoConfig(cwd) {
|
|
58
|
+
let raw;
|
|
59
|
+
try {
|
|
60
|
+
raw = await readFile(repoConfigPath(cwd), 'utf8');
|
|
61
|
+
}
|
|
62
|
+
catch (err) {
|
|
63
|
+
if (err.code === 'ENOENT') {
|
|
64
|
+
return { parsed: {}, missing: true, malformed: false };
|
|
65
|
+
}
|
|
66
|
+
// Other read errors (permissions, etc.) — treat as malformed so a writer
|
|
67
|
+
// is forced to handle it explicitly rather than clobbering the file.
|
|
68
|
+
return { parsed: {}, missing: false, malformed: true };
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
const parsed = JSON.parse(raw);
|
|
72
|
+
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
|
|
73
|
+
return {
|
|
74
|
+
parsed: parsed,
|
|
75
|
+
missing: false,
|
|
76
|
+
malformed: false,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
return { parsed: {}, missing: false, malformed: true };
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
return { parsed: {}, missing: false, malformed: true };
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Read a repo's docs-bundle subscription. Returns an empty list on a missing or
|
|
87
|
+
* malformed config so callers can treat "not subscribed" uniformly; `missing`
|
|
88
|
+
* / `malformed` distinguish the two for messaging.
|
|
89
|
+
*/
|
|
90
|
+
export async function readRepoDocsConfig(cwd) {
|
|
91
|
+
// In the home directory the "repo config" path IS the token store — never
|
|
92
|
+
// read it as a subscription config (see collidesWithHomeConfig).
|
|
93
|
+
if (collidesWithHomeConfig(cwd)) {
|
|
94
|
+
return { bundles: [], missing: true, malformed: false, hasToken: false };
|
|
95
|
+
}
|
|
96
|
+
const { parsed, missing, malformed } = await readParsedRepoConfig(cwd);
|
|
97
|
+
const docs = parsed['docs'];
|
|
98
|
+
const bundles = docs && typeof docs === 'object' && !Array.isArray(docs)
|
|
99
|
+
? normalizeBundleSlugs(docs['bundles'])
|
|
100
|
+
: [];
|
|
101
|
+
return { bundles, missing, malformed, hasToken: 'token' in parsed };
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Persist a repo's docs-bundle subscription, preserving every other key already
|
|
105
|
+
* in the file (a future `project` identity field, hand-added keys) — but never a
|
|
106
|
+
* `token`, which is stripped defensively so this committed file can't leak a
|
|
107
|
+
* credential. Refuses to overwrite a file that exists but is malformed, rather
|
|
108
|
+
* than silently discarding it.
|
|
109
|
+
*/
|
|
110
|
+
export async function writeRepoDocsBundles(cwd, bundles) {
|
|
111
|
+
// Never write to the home token store (cwd === home) — that would strip the
|
|
112
|
+
// bearer token and rewrite it as a repo config.
|
|
113
|
+
if (collidesWithHomeConfig(cwd)) {
|
|
114
|
+
throw new Error(`Refusing to write a repo docs config at ${repoConfigPath(cwd)} — it is the ` +
|
|
115
|
+
'home token store (~/.auden/config.json). Run `auden pull` from inside a repository.');
|
|
116
|
+
}
|
|
117
|
+
const { parsed, malformed } = await readParsedRepoConfig(cwd);
|
|
118
|
+
if (malformed) {
|
|
119
|
+
throw new Error(`Refusing to overwrite malformed repo config at ${repoConfigPath(cwd)}. ` +
|
|
120
|
+
'Fix or remove the file before re-running.');
|
|
121
|
+
}
|
|
122
|
+
// Strip any bearer token before it can be written back into the committed
|
|
123
|
+
// file — the whole point of a separate repo config is that it never holds one.
|
|
124
|
+
const removedToken = 'token' in parsed;
|
|
125
|
+
delete parsed['token'];
|
|
126
|
+
const existingDocs = parsed['docs'] && typeof parsed['docs'] === 'object' && !Array.isArray(parsed['docs'])
|
|
127
|
+
? parsed['docs']
|
|
128
|
+
: {};
|
|
129
|
+
parsed['docs'] = { ...existingDocs, bundles: normalizeBundleSlugs(bundles) };
|
|
130
|
+
const path = repoConfigPath(cwd);
|
|
131
|
+
await mkdir(dirname(path), { recursive: true });
|
|
132
|
+
await writeFile(path, JSON.stringify(parsed, null, 2) + '\n');
|
|
133
|
+
return { removedToken };
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Union an existing subscription with newly-selected slugs, cleaned and
|
|
137
|
+
* de-duplicated. `docs enable` is additive: re-running it to add one bundle
|
|
138
|
+
* must never drop the others already subscribed.
|
|
139
|
+
*/
|
|
140
|
+
export function mergeBundleSubscriptions(existing, added) {
|
|
141
|
+
return normalizeBundleSlugs([...existing, ...added]);
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=repo-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repo-config.js","sourceRoot":"","sources":["../../src/docs/repo-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,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AC,MAAM,CAA6B;QAC7C,CAAC,CAAC,EAAE,CAAA;IACR,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,YAAY,EAAE,OAAO,EAAE,oBAAoB,CAAC,OAAO,CAAC,EAAE,CAAA;IAE5E,MAAM,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC,CAAA;IAChC,MAAM,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAC/C,MAAM,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;IAC7D,OAAO,EAAE,YAAY,EAAE,CAAA;AACzB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,QAAkB,EAAE,KAAe;IAC1E,OAAO,oBAAoB,CAAC,CAAC,GAAG,QAAQ,EAAE,GAAG,KAAK,CAAC,CAAC,CAAA;AACtD,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core logic for `auden docs status`: show which bundles the current repo
|
|
3
|
+
* subscribes to and whether each has been materialized locally yet. Slice 1a is
|
|
4
|
+
* pull-only with no per-file sidecar, so "state" is deliberately coarse —
|
|
5
|
+
* subscribed, and materialized (N files) or not-yet-pulled. The richer
|
|
6
|
+
* three-point in-sync/ahead/behind state arrives with the link sidecar (Slice 2).
|
|
7
|
+
*
|
|
8
|
+
* Kept free of citty/console — the command injects the filesystem read.
|
|
9
|
+
*/
|
|
10
|
+
export type DocsStatusRow = {
|
|
11
|
+
bundle: string;
|
|
12
|
+
/** Local directory the bundle materializes into. */
|
|
13
|
+
dir: string;
|
|
14
|
+
/** True when that directory exists on disk. */
|
|
15
|
+
exists: boolean;
|
|
16
|
+
/** Count of `.md` files present in the directory (0 when missing). */
|
|
17
|
+
materialized: number;
|
|
18
|
+
};
|
|
19
|
+
export type DocsStatusDeps = {
|
|
20
|
+
/**
|
|
21
|
+
* List a directory's entries, or return `null` when it does not exist. Any
|
|
22
|
+
* other read error should propagate so a genuine fault isn't reported as
|
|
23
|
+
* "not yet pulled".
|
|
24
|
+
*/
|
|
25
|
+
listDir: (dir: string) => Promise<string[] | null>;
|
|
26
|
+
};
|
|
27
|
+
/** Build a status row per subscribed bundle. */
|
|
28
|
+
export declare function computeDocsStatus(cwd: string, bundles: string[], deps: DocsStatusDeps): Promise<DocsStatusRow[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Render the status as plain lines. Returns a guidance message when the repo
|
|
31
|
+
* has no subscription yet, so the command prints something actionable either
|
|
32
|
+
* way.
|
|
33
|
+
*/
|
|
34
|
+
export declare function formatDocsStatus(rows: DocsStatusRow[]): string;
|
|
35
|
+
//# sourceMappingURL=status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/docs/status.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAA;IACd,oDAAoD;IACpD,GAAG,EAAE,MAAM,CAAA;IACX,+CAA+C;IAC/C,MAAM,EAAE,OAAO,CAAA;IACf,sEAAsE;IACtE,YAAY,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B;;;;OAIG;IACH,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAA;CACnD,CAAA;AAED,gDAAgD;AAChD,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EAAE,EACjB,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,aAAa,EAAE,CAAC,CAiB1B;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,MAAM,CAY9D"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core logic for `auden docs status`: show which bundles the current repo
|
|
3
|
+
* subscribes to and whether each has been materialized locally yet. Slice 1a is
|
|
4
|
+
* pull-only with no per-file sidecar, so "state" is deliberately coarse —
|
|
5
|
+
* subscribed, and materialized (N files) or not-yet-pulled. The richer
|
|
6
|
+
* three-point in-sync/ahead/behind state arrives with the link sidecar (Slice 2).
|
|
7
|
+
*
|
|
8
|
+
* Kept free of citty/console — the command injects the filesystem read.
|
|
9
|
+
*/
|
|
10
|
+
import { defaultPullDir } from '../context/pull.js';
|
|
11
|
+
/** Build a status row per subscribed bundle. */
|
|
12
|
+
export async function computeDocsStatus(cwd, bundles, deps) {
|
|
13
|
+
const rows = [];
|
|
14
|
+
for (const bundle of bundles) {
|
|
15
|
+
const dir = defaultPullDir(bundle, cwd);
|
|
16
|
+
const entries = await deps.listDir(dir);
|
|
17
|
+
rows.push({
|
|
18
|
+
bundle,
|
|
19
|
+
dir,
|
|
20
|
+
exists: entries !== null,
|
|
21
|
+
// Case-insensitive: writeItemsToDir preserves a name that already ends in
|
|
22
|
+
// .MD/.Md (its own extension check is case-insensitive), so those count too.
|
|
23
|
+
materialized: entries
|
|
24
|
+
? entries.filter((e) => e.toLowerCase().endsWith('.md')).length
|
|
25
|
+
: 0,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return rows;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Render the status as plain lines. Returns a guidance message when the repo
|
|
32
|
+
* has no subscription yet, so the command prints something actionable either
|
|
33
|
+
* way.
|
|
34
|
+
*/
|
|
35
|
+
export function formatDocsStatus(rows) {
|
|
36
|
+
if (rows.length === 0) {
|
|
37
|
+
return 'This repo is not subscribed to any doc bundles. Run `auden pull <bundle>` to subscribe.';
|
|
38
|
+
}
|
|
39
|
+
const lines = ['Subscribed doc bundles:'];
|
|
40
|
+
for (const row of rows) {
|
|
41
|
+
const state = row.exists
|
|
42
|
+
? `${row.materialized} file(s) in ${row.dir}`
|
|
43
|
+
: 'not yet pulled — run `auden sync`';
|
|
44
|
+
lines.push(` ${row.bundle} — ${state}`);
|
|
45
|
+
}
|
|
46
|
+
return lines.join('\n');
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/docs/status.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAqBnD,gDAAgD;AAChD,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,GAAW,EACX,OAAiB,EACjB,IAAoB;IAEpB,MAAM,IAAI,GAAoB,EAAE,CAAA;IAChC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,GAAG,GAAG,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;QACvC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;QACvC,IAAI,CAAC,IAAI,CAAC;YACR,MAAM;YACN,GAAG;YACH,MAAM,EAAE,OAAO,KAAK,IAAI;YACxB,0EAA0E;YAC1E,6EAA6E;YAC7E,YAAY,EAAE,OAAO;gBACnB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM;gBAC/D,CAAC,CAAC,CAAC;SACN,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAqB;IACpD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,yFAAyF,CAAA;IAClG,CAAC;IACD,MAAM,KAAK,GAAG,CAAC,yBAAyB,CAAC,CAAA;IACzC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM;YACtB,CAAC,CAAC,GAAG,GAAG,CAAC,YAAY,eAAe,GAAG,CAAC,GAAG,EAAE;YAC7C,CAAC,CAAC,mCAAmC,CAAA;QACvC,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,MAAM,MAAM,KAAK,EAAE,CAAC,CAAA;IAC1C,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Subscription helpers shared by `auden pull` (subscribe-on-pull) and any other
|
|
3
|
+
* caller that records a repo's doc-bundle subscription. The subscription itself
|
|
4
|
+
* is just `docs.bundles` in the repo `.auden/config.json` (see repo-config.ts);
|
|
5
|
+
* `auden sync`'s docs phase reads it and keeps those bundles fresh.
|
|
6
|
+
*
|
|
7
|
+
* Kept free of citty/console so it unit-tests directly against a temp dir.
|
|
8
|
+
*/
|
|
9
|
+
export type BundleChoice = {
|
|
10
|
+
slug: string;
|
|
11
|
+
name: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Parse an interactive selection line into slugs. Tokens are split on commas
|
|
15
|
+
* and whitespace; a token that is a 1-based index into `choices` resolves to
|
|
16
|
+
* that bundle's slug, anything else is treated as a literal slug. De-duplicated,
|
|
17
|
+
* order preserved.
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseSelectionInput(input: string, choices: BundleChoice[]): string[];
|
|
20
|
+
export type SubscribeResult = {
|
|
21
|
+
ok: true;
|
|
22
|
+
/** Full resulting subscription (existing ∪ added). */
|
|
23
|
+
subscribed: string[];
|
|
24
|
+
/** Slugs newly added this call (not already subscribed). */
|
|
25
|
+
added: string[];
|
|
26
|
+
/** True when a stray `token` key was stripped from the repo config on write. */
|
|
27
|
+
removedToken: boolean;
|
|
28
|
+
} | {
|
|
29
|
+
ok: false;
|
|
30
|
+
reason: 'malformed-config' | 'home-collision' | 'write-failed';
|
|
31
|
+
message?: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Record a repo's subscription to `bundles`, additively — existing
|
|
35
|
+
* subscriptions are never dropped. Writes when the set actually grows, or when a
|
|
36
|
+
* stray `token` must be stripped from the committed config; otherwise the file
|
|
37
|
+
* is left byte-for-byte untouched (no spurious git diff). Never throws — every
|
|
38
|
+
* failure becomes an `ok:false` reason so the caller can warn without aborting
|
|
39
|
+
* the surrounding command (a pull still succeeds even if the subscription can't
|
|
40
|
+
* be recorded):
|
|
41
|
+
* - `malformed-config` — the config exists but isn't valid JSON.
|
|
42
|
+
* - `home-collision` — `cwd` is the home dir, where the repo config would be
|
|
43
|
+
* the token store; we refuse rather than clobber the bearer token.
|
|
44
|
+
* - `write-failed` — a filesystem error (read-only repo, race, etc.).
|
|
45
|
+
*/
|
|
46
|
+
export declare function subscribeBundles(cwd: string, bundles: string[]): Promise<SubscribeResult>;
|
|
47
|
+
//# sourceMappingURL=subscribe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscribe.d.ts","sourceRoot":"","sources":["../../src/docs/subscribe.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AASH,MAAM,MAAM,YAAY,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAEzD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,MAAM,EAAE,CAsBpF;AAED,MAAM,MAAM,eAAe,GACvB;IACE,EAAE,EAAE,IAAI,CAAA;IACR,sDAAsD;IACtD,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,4DAA4D;IAC5D,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,gFAAgF;IAChF,YAAY,EAAE,OAAO,CAAA;CACtB,GACD;IACE,EAAE,EAAE,KAAK,CAAA;IACT,MAAM,EAAE,kBAAkB,GAAG,gBAAgB,GAAG,cAAc,CAAA;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAEL;;;;;;;;;;;;GAYG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,eAAe,CAAC,CA2B1B"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Subscription helpers shared by `auden pull` (subscribe-on-pull) and any other
|
|
3
|
+
* caller that records a repo's doc-bundle subscription. The subscription itself
|
|
4
|
+
* is just `docs.bundles` in the repo `.auden/config.json` (see repo-config.ts);
|
|
5
|
+
* `auden sync`'s docs phase reads it and keeps those bundles fresh.
|
|
6
|
+
*
|
|
7
|
+
* Kept free of citty/console so it unit-tests directly against a temp dir.
|
|
8
|
+
*/
|
|
9
|
+
import { collidesWithHomeConfig, mergeBundleSubscriptions, readRepoDocsConfig, writeRepoDocsBundles, } from './repo-config.js';
|
|
10
|
+
/**
|
|
11
|
+
* Parse an interactive selection line into slugs. Tokens are split on commas
|
|
12
|
+
* and whitespace; a token that is a 1-based index into `choices` resolves to
|
|
13
|
+
* that bundle's slug, anything else is treated as a literal slug. De-duplicated,
|
|
14
|
+
* order preserved.
|
|
15
|
+
*/
|
|
16
|
+
export function parseSelectionInput(input, choices) {
|
|
17
|
+
const slugs = new Set(choices.map((c) => c.slug));
|
|
18
|
+
const seen = new Set();
|
|
19
|
+
const out = [];
|
|
20
|
+
for (const token of input.split(/[\s,]+/)) {
|
|
21
|
+
const t = token.trim();
|
|
22
|
+
if (t === '')
|
|
23
|
+
continue;
|
|
24
|
+
let slug = t;
|
|
25
|
+
// Exact slug match wins over index parsing, so a numeric-only slug (e.g. a
|
|
26
|
+
// bundle literally named "2026") selects that bundle instead of being read
|
|
27
|
+
// as the 2026th choice.
|
|
28
|
+
if (!slugs.has(t) && /^\d+$/.test(t)) {
|
|
29
|
+
const idx = Number.parseInt(t, 10) - 1;
|
|
30
|
+
if (idx < 0 || idx >= choices.length)
|
|
31
|
+
continue; // out-of-range number: ignore
|
|
32
|
+
slug = choices[idx].slug;
|
|
33
|
+
}
|
|
34
|
+
if (!seen.has(slug)) {
|
|
35
|
+
seen.add(slug);
|
|
36
|
+
out.push(slug);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return out;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Record a repo's subscription to `bundles`, additively — existing
|
|
43
|
+
* subscriptions are never dropped. Writes when the set actually grows, or when a
|
|
44
|
+
* stray `token` must be stripped from the committed config; otherwise the file
|
|
45
|
+
* is left byte-for-byte untouched (no spurious git diff). Never throws — every
|
|
46
|
+
* failure becomes an `ok:false` reason so the caller can warn without aborting
|
|
47
|
+
* the surrounding command (a pull still succeeds even if the subscription can't
|
|
48
|
+
* be recorded):
|
|
49
|
+
* - `malformed-config` — the config exists but isn't valid JSON.
|
|
50
|
+
* - `home-collision` — `cwd` is the home dir, where the repo config would be
|
|
51
|
+
* the token store; we refuse rather than clobber the bearer token.
|
|
52
|
+
* - `write-failed` — a filesystem error (read-only repo, race, etc.).
|
|
53
|
+
*/
|
|
54
|
+
export async function subscribeBundles(cwd, bundles) {
|
|
55
|
+
if (collidesWithHomeConfig(cwd)) {
|
|
56
|
+
return { ok: false, reason: 'home-collision' };
|
|
57
|
+
}
|
|
58
|
+
const existing = await readRepoDocsConfig(cwd);
|
|
59
|
+
if (existing.malformed) {
|
|
60
|
+
return { ok: false, reason: 'malformed-config' };
|
|
61
|
+
}
|
|
62
|
+
const existingSet = new Set(existing.bundles);
|
|
63
|
+
const added = bundles.filter((slug) => !existingSet.has(slug));
|
|
64
|
+
const subscribed = mergeBundleSubscriptions(existing.bundles, bundles);
|
|
65
|
+
// Skip the write only when nothing changed AND there's no stray token to
|
|
66
|
+
// strip — otherwise a token copied into an already-subscribed repo config
|
|
67
|
+
// would never be removed (writeRepoDocsBundles is the only path that strips it).
|
|
68
|
+
if (added.length === 0 && !existing.hasToken) {
|
|
69
|
+
return { ok: true, subscribed, added, removedToken: false };
|
|
70
|
+
}
|
|
71
|
+
try {
|
|
72
|
+
const { removedToken } = await writeRepoDocsBundles(cwd, subscribed);
|
|
73
|
+
return { ok: true, subscribed, added, removedToken };
|
|
74
|
+
}
|
|
75
|
+
catch (err) {
|
|
76
|
+
return {
|
|
77
|
+
ok: false,
|
|
78
|
+
reason: 'write-failed',
|
|
79
|
+
message: err instanceof Error ? err.message : String(err),
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=subscribe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscribe.js","sourceRoot":"","sources":["../../src/docs/subscribe.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,kBAAkB,CAAA;AAIzB;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAa,EAAE,OAAuB;IACxE,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;IACjD,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAA;IAC9B,MAAM,GAAG,GAAa,EAAE,CAAA;IACxB,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1C,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;QACtB,IAAI,CAAC,KAAK,EAAE;YAAE,SAAQ;QACtB,IAAI,IAAI,GAAG,CAAC,CAAA;QACZ,2EAA2E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,CAAC,CAAA;IAC9D,MAAM,UAAU,GAAG,wBAAwB,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IACtE,yEAAyE;IACzE,0EAA0E;IAC1E,iFAAiF;IACjF,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;QAC7C,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,CAAA;IAC7D,CAAC;IACD,IAAI,CAAC;QACH,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,oBAAoB,CAAC,GAAG,EAAE,UAAU,CAAC,CAAA;QACpE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,CAAA;IACtD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,cAAc;YACtB,OAAO,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;SAC1D,CAAA;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The docs phase of `auden sync`: for each bundle a repo subscribes to, pull
|
|
3
|
+
* its canonical items into `.auden/context/<bundle>/` and keep them fresh.
|
|
4
|
+
* Pull-only (Slice 1a) — this is the "repos stay fresh" heartbeat; local edits
|
|
5
|
+
* pushing back is a later slice.
|
|
6
|
+
*
|
|
7
|
+
* Reuses the shipped `pullBundleToDir`/`defaultPullDir` (the `auden pull`
|
|
8
|
+
* engine) so a subscribed sync and a manual `auden pull` write identically.
|
|
9
|
+
* Each bundle is pulled independently: one bundle's failure is captured and
|
|
10
|
+
* reported, never aborting the others — mirroring the per-batch resilience of
|
|
11
|
+
* the push loop and the guide-bundle pull's own try/catch.
|
|
12
|
+
*
|
|
13
|
+
* Kept free of citty/console so it unit-tests against a mocked client.
|
|
14
|
+
*/
|
|
15
|
+
import type { ContextClient } from '../mcp/client.js';
|
|
16
|
+
import type { WriteItemsDeps } from '../mcp/write-items.js';
|
|
17
|
+
/**
|
|
18
|
+
* Server-side maximum items a single pull returns (`MAX_LIMIT` in the items
|
|
19
|
+
* endpoint). Without an explicit limit the endpoint defaults to 100, so a
|
|
20
|
+
* subscribed bundle with more than 100 docs would silently materialize only the
|
|
21
|
+
* newest 100. Request the max, and flag when a bundle hits the ceiling — the
|
|
22
|
+
* endpoint has no cursor pagination, so beyond this we surface the truncation
|
|
23
|
+
* rather than pretend the bundle is fully synced (no silent caps).
|
|
24
|
+
*/
|
|
25
|
+
export declare const MAX_BUNDLE_PULL = 500;
|
|
26
|
+
export type DocsSyncBundleResult = {
|
|
27
|
+
bundle: string;
|
|
28
|
+
/** Directory the bundle materialized into. */
|
|
29
|
+
dir: string;
|
|
30
|
+
/** Number of items the bundle returned (including skipped null-content ones). */
|
|
31
|
+
items: number;
|
|
32
|
+
/** Number of files actually written to disk. */
|
|
33
|
+
written: number;
|
|
34
|
+
/** True when the bundle returned the server cap — more docs may exist unpulled. */
|
|
35
|
+
truncated: boolean;
|
|
36
|
+
/** Present when this bundle failed to pull; the others still ran. */
|
|
37
|
+
error?: string;
|
|
38
|
+
};
|
|
39
|
+
export type DocsSyncResult = {
|
|
40
|
+
results: DocsSyncBundleResult[];
|
|
41
|
+
/** True when at least one bundle failed to pull. */
|
|
42
|
+
hadError: boolean;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Pull every subscribed bundle into its default local directory under `cwd`.
|
|
46
|
+
* `deps` injects the filesystem for tests.
|
|
47
|
+
*/
|
|
48
|
+
export declare function syncSubscribedDocs(client: ContextClient, bundles: string[], cwd: string, deps?: WriteItemsDeps): Promise<DocsSyncResult>;
|
|
49
|
+
/**
|
|
50
|
+
* One legible line per bundle for the sync output (Planning Principle 9 — what
|
|
51
|
+
* moved is never ambiguous). Failures read as warnings; a successful pull says
|
|
52
|
+
* how many files landed where.
|
|
53
|
+
*/
|
|
54
|
+
export declare function formatDocsSyncLine(result: DocsSyncBundleResult): string;
|
|
55
|
+
//# sourceMappingURL=sync-docs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-docs.d.ts","sourceRoot":"","sources":["../../src/docs/sync-docs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAE3D;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,MAAM,CAAA;AAElC,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,CAAA;IACd,8CAA8C;IAC9C,GAAG,EAAE,MAAM,CAAA;IACX,iFAAiF;IACjF,KAAK,EAAE,MAAM,CAAA;IACb,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAA;IACf,mFAAmF;IACnF,SAAS,EAAE,OAAO,CAAA;IAClB,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,oBAAoB,EAAE,CAAA;IAC/B,oDAAoD;IACpD,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAA;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,MAAM,EAAE,EACjB,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,cAAmB,GACxB,OAAO,CAAC,cAAc,CAAC,CA8BzB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAWvE"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The docs phase of `auden sync`: for each bundle a repo subscribes to, pull
|
|
3
|
+
* its canonical items into `.auden/context/<bundle>/` and keep them fresh.
|
|
4
|
+
* Pull-only (Slice 1a) — this is the "repos stay fresh" heartbeat; local edits
|
|
5
|
+
* pushing back is a later slice.
|
|
6
|
+
*
|
|
7
|
+
* Reuses the shipped `pullBundleToDir`/`defaultPullDir` (the `auden pull`
|
|
8
|
+
* engine) so a subscribed sync and a manual `auden pull` write identically.
|
|
9
|
+
* Each bundle is pulled independently: one bundle's failure is captured and
|
|
10
|
+
* reported, never aborting the others — mirroring the per-batch resilience of
|
|
11
|
+
* the push loop and the guide-bundle pull's own try/catch.
|
|
12
|
+
*
|
|
13
|
+
* Kept free of citty/console so it unit-tests against a mocked client.
|
|
14
|
+
*/
|
|
15
|
+
import { defaultPullDir, pullBundleToDir } from '../context/pull.js';
|
|
16
|
+
/**
|
|
17
|
+
* Server-side maximum items a single pull returns (`MAX_LIMIT` in the items
|
|
18
|
+
* endpoint). Without an explicit limit the endpoint defaults to 100, so a
|
|
19
|
+
* subscribed bundle with more than 100 docs would silently materialize only the
|
|
20
|
+
* newest 100. Request the max, and flag when a bundle hits the ceiling — the
|
|
21
|
+
* endpoint has no cursor pagination, so beyond this we surface the truncation
|
|
22
|
+
* rather than pretend the bundle is fully synced (no silent caps).
|
|
23
|
+
*/
|
|
24
|
+
export const MAX_BUNDLE_PULL = 500;
|
|
25
|
+
/**
|
|
26
|
+
* Pull every subscribed bundle into its default local directory under `cwd`.
|
|
27
|
+
* `deps` injects the filesystem for tests.
|
|
28
|
+
*/
|
|
29
|
+
export async function syncSubscribedDocs(client, bundles, cwd, deps = {}) {
|
|
30
|
+
const results = [];
|
|
31
|
+
for (const bundle of bundles) {
|
|
32
|
+
const dir = defaultPullDir(bundle, cwd);
|
|
33
|
+
try {
|
|
34
|
+
const { items, written } = await pullBundleToDir(client, { bundle, limit: MAX_BUNDLE_PULL }, dir, deps);
|
|
35
|
+
results.push({
|
|
36
|
+
bundle,
|
|
37
|
+
dir,
|
|
38
|
+
items: items.length,
|
|
39
|
+
written: written.length,
|
|
40
|
+
truncated: items.length >= MAX_BUNDLE_PULL,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
results.push({
|
|
45
|
+
bundle,
|
|
46
|
+
dir,
|
|
47
|
+
items: 0,
|
|
48
|
+
written: 0,
|
|
49
|
+
truncated: false,
|
|
50
|
+
error: err instanceof Error ? err.message : String(err),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return { results, hadError: results.some((r) => r.error !== undefined) };
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* One legible line per bundle for the sync output (Planning Principle 9 — what
|
|
58
|
+
* moved is never ambiguous). Failures read as warnings; a successful pull says
|
|
59
|
+
* how many files landed where.
|
|
60
|
+
*/
|
|
61
|
+
export function formatDocsSyncLine(result) {
|
|
62
|
+
if (result.error) {
|
|
63
|
+
return ` warning: docs "${result.bundle}" — ${result.error} — skipping.`;
|
|
64
|
+
}
|
|
65
|
+
const skipped = result.items - result.written;
|
|
66
|
+
const skippedNote = skipped > 0 ? ` (${skipped} item(s) without text content skipped, e.g. assets)` : '';
|
|
67
|
+
const truncatedNote = result.truncated
|
|
68
|
+
? ` — note: hit the ${MAX_BUNDLE_PULL}-item limit, older docs may be unpulled`
|
|
69
|
+
: '';
|
|
70
|
+
return ` pulled ${result.written} doc(s) from "${result.bundle}" → ${result.dir}${skippedNote}${truncatedNote}`;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=sync-docs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-docs.js","sourceRoot":"","sources":["../../src/docs/sync-docs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAKpE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM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C;QACjB,OAAO,oBAAoB,MAAM,CAAC,MAAM,OAAO,MAAM,CAAC,KAAK,cAAc,CAAA;IAC3E,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,OAAO,CAAA;IAC7C,MAAM,WAAW,GACf,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,OAAO,qDAAqD,CAAC,CAAC,CAAC,EAAE,CAAA;IACtF,MAAM,aAAa,GAAG,MAAM,CAAC,SAAS;QACpC,CAAC,CAAC,oBAAoB,eAAe,yCAAyC;QAC9E,CAAC,CAAC,EAAE,CAAA;IACN,OAAO,YAAY,MAAM,CAAC,OAAO,iBAAiB,MAAM,CAAC,MAAM,OAAO,MAAM,CAAC,GAAG,GAAG,WAAW,GAAG,aAAa,EAAE,CAAA;AAClH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "auden",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Local-first CLI for Auden — evaluates AI coding agent actions against your guides on-device and syncs verdicts to your dashboard.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"test": "vitest run"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@auden.to/eval-core": "0.1.0-alpha.
|
|
59
|
-
"@auden.to/projections": "0.1.0-alpha.
|
|
60
|
-
"@auden.to/protocol": "0.1.0-alpha.
|
|
58
|
+
"@auden.to/eval-core": "0.1.0-alpha.5",
|
|
59
|
+
"@auden.to/projections": "0.1.0-alpha.5",
|
|
60
|
+
"@auden.to/protocol": "0.1.0-alpha.5",
|
|
61
61
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
62
62
|
"citty": "^0.1.6",
|
|
63
63
|
"diff": "^9.0.0"
|