document360-writer 0.5.17 → 0.5.18
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/cli.js +84 -84
- package/dist/commands/catchup.d.ts +39 -2
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { computeSyncStatus, planPull, applyPull } from 'document360-engine';
|
|
1
2
|
import type { ReplContext } from '../repl.js';
|
|
2
3
|
import type { SlashCommandResult } from './index.js';
|
|
3
4
|
export type PendingSummary = {
|
|
@@ -17,6 +18,42 @@ export declare function parseCatchUpArgs(args: string[]): {
|
|
|
17
18
|
export declare function buildCatchUpPrompt({ publish }: {
|
|
18
19
|
publish: boolean;
|
|
19
20
|
}): string;
|
|
20
|
-
/**
|
|
21
|
-
|
|
21
|
+
/** Outcome of the Phase-0 portal reconcile (catch-up pulls portal changes BEFORE the agent writes). */
|
|
22
|
+
export type PortalReconcileResult = {
|
|
23
|
+
/** Repo-relative paths whose clean portal edits were pulled into local (lossless — local was unchanged). */
|
|
24
|
+
pulled: string[];
|
|
25
|
+
/** Paths changed in BOTH places — left untouched for the user to resolve. */
|
|
26
|
+
conflicts: string[];
|
|
27
|
+
/** Titles of NEW portal articles not local yet — surfaced, not imported (import lands with P3/manifest). */
|
|
28
|
+
untrackedRemote: string[];
|
|
29
|
+
/** Per-article pull failures (left for /sync pull). */
|
|
30
|
+
failed: {
|
|
31
|
+
path: string;
|
|
32
|
+
error: string;
|
|
33
|
+
}[];
|
|
34
|
+
/** Set when the status check itself failed — catch-up still proceeds (the agent re-checks). */
|
|
35
|
+
error?: string;
|
|
36
|
+
};
|
|
37
|
+
/** Injectable seam (tests). Defaults to the real engine sync primitives. */
|
|
38
|
+
export type ReconcileDeps = {
|
|
39
|
+
status: typeof computeSyncStatus;
|
|
40
|
+
plan: typeof planPull;
|
|
41
|
+
apply: typeof applyPull;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Phase 0 of /catch-up — reconcile the portal with TODAY's per-article sync, BEFORE the agent works:
|
|
45
|
+
* auto-pull clean `remote-ahead` (lossless — local unchanged), and surface `conflict` (skipped — never
|
|
46
|
+
* overwrite) + `untracked-remote` (new portal articles can't be imported yet). Best-effort: a status
|
|
47
|
+
* failure returns `{ error }` and catch-up proceeds (the agent's own d360_sync_status still gates). The
|
|
48
|
+
* manifest (portal-aware-sync P1.1) will make the status check cheap once it ships on the environment.
|
|
49
|
+
*/
|
|
50
|
+
export declare function reconcilePortal(opts: {
|
|
51
|
+
cwd: string;
|
|
52
|
+
profileName?: string;
|
|
53
|
+
}, deps?: ReconcileDeps): Promise<PortalReconcileResult>;
|
|
54
|
+
/** Human summary of the reconcile, each line tagged for tone (✓ ok · ℹ info · ⚠ warn). Empty when the
|
|
55
|
+
portal was already in sync (nothing to report). */
|
|
56
|
+
export declare function reconcileSummaryLines(r: PortalReconcileResult): string[];
|
|
57
|
+
/** Classic-REPL `/catch-up`. Reconciles the portal first (Phase 0), then forwards the queued-work prompt
|
|
58
|
+
(the double-check) — even with no local queue it still runs, to catch code changes the builder didn't hint. */
|
|
22
59
|
export declare function catchupCommand(args: string[], ctx?: ReplContext): Promise<SlashCommandResult>;
|
package/package.json
CHANGED