document360-writer 0.5.70 → 0.5.72

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.
@@ -1,4 +1,4 @@
1
- import { computeSyncStatus, planPull, applyPull } from 'document360-engine';
1
+ import { computeSyncStatus, planPull, applyPull, planImport, applyImport } from 'document360-engine';
2
2
  import type { ReplContext } from '../repl.js';
3
3
  import type { SlashCommandResult } from './index.js';
4
4
  export type PendingSummary = {
@@ -18,15 +18,15 @@ export declare function parseCatchUpArgs(args: string[]): {
18
18
  export declare function buildCatchUpPrompt({ publish }: {
19
19
  publish: boolean;
20
20
  }): string;
21
- /** Outcome of the Phase-0 portal reconcile (catch-up pulls portal changes BEFORE the agent writes). */
21
+ /** Outcome of the Phase-0 portal reconcile (catch-up brings the portal fully down BEFORE the agent writes). */
22
22
  export type PortalReconcileResult = {
23
23
  /** Repo-relative paths whose clean portal edits were pulled into local (lossless — local was unchanged). */
24
24
  pulled: string[];
25
+ /** Repo-relative paths of NEW portal articles imported into local drafts (were untracked-remote). */
26
+ imported: string[];
25
27
  /** Paths changed in BOTH places — left untouched for the user to resolve. */
26
28
  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 /pull). */
29
+ /** Per-article pull/import failures (left for /pull). */
30
30
  failed: {
31
31
  path: string;
32
32
  error: string;
@@ -39,13 +39,16 @@ export type ReconcileDeps = {
39
39
  status: typeof computeSyncStatus;
40
40
  plan: typeof planPull;
41
41
  apply: typeof applyPull;
42
+ planImport: typeof planImport;
43
+ applyImport: typeof applyImport;
42
44
  };
43
45
  /**
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.
46
+ * Phase 0 of /catch-up — bring the portal FULLY down before the agent works, so "/catch-up" is the one
47
+ * command a returning user needs (pull + process). Auto-pull clean `remote-ahead` (lossless — local
48
+ * unchanged) AND import `untracked-remote` (new portal-authored articles local drafts), the same way
49
+ * bare /pull does; `conflict` is surfaced + skipped (never overwrite a copy we can't trust). Best-effort:
50
+ * a status failure returns `{ error }` and catch-up proceeds (the agent's own d360_sync_status still gates).
51
+ * The hidden feedback category is excluded upstream (computeSyncStatus), so its articles never import here.
49
52
  */
50
53
  export declare function reconcilePortal(opts: {
51
54
  cwd: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "document360-writer",
3
- "version": "0.5.70",
3
+ "version": "0.5.72",
4
4
  "description": "Standalone documentation agent CLI. Reads your code, writes your docs. Specialized for Document360 publishing.",
5
5
  "type": "module",
6
6
  "bin": {