document360-writer 0.5.36 → 0.5.38

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.
@@ -10,13 +10,15 @@ export declare const MAX_WRITE_CONCURRENCY = 8;
10
10
  export declare function resolveConcurrency(requested?: number): number;
11
11
  /** Parse /write args. The default ACTION is to write — `/write` starts immediately. `--preview` asks
12
12
  for the plan + cost estimate only (no spend). `--scope <cat>` (or `--scope=…`) narrows, `--concurrency
13
- <n>` tunes parallelism, a bare `<path>` writes one article. `--run`/`--all`/`--yes` are accepted as
14
- legacy no-ops (writing is the default now) so old quick-options / muscle memory don't error. */
13
+ <n>` tunes parallelism, a bare `<path>` writes one article. `--rewrite` (alias `--force`) regenerates
14
+ ALREADY-written articles in scope too (the normal scope/all run skips written ones) the iterate loop
15
+ after a plan/playbook change. `--run`/`--all`/`--yes` are accepted as legacy no-ops. */
15
16
  export declare function parseWriteArgs(args: string[]): {
16
17
  scope?: string;
17
18
  path?: string;
18
19
  preview: boolean;
19
20
  concurrency?: number;
21
+ rewrite: boolean;
20
22
  };
21
23
  /** Drop a leading `<docsDir>/` so a path given repo-relative matches the docsDir-relative plan keys. */
22
24
  export declare function toPlanRelative(p: string, docsDir: string): string;
@@ -28,8 +30,13 @@ export declare function pendingArticles(cwd: string, docsDir: string, paths: str
28
30
  1-byte floor keeps every planned article in the estimate so its per-article overhead counts. */
29
31
  export declare function sizeWriteTargets(cwd: string, entries: DocsPlanEntry[], paths: string[]): TargetFile[];
30
32
  /** The agent prompt for one partition: author each listed article from the plan. Each is
31
- independent; purpose + sources are looked up from the pinned plan, grounded in source. */
32
- export declare function buildWritePrompt(partition: Partition, docsDir: string): string;
33
+ independent; purpose + sources are looked up from the pinned plan, grounded in source.
34
+ `rewrite` the targets already exist (a `--rewrite`/single-path re-author): tell the agent to rebuild
35
+ from plan + sources + the active doc-type playbook, NOT to preserve or lightly-edit the old file — else
36
+ it anchors on the prior (possibly junior) output and reproduces it (dogfood P-A A5). */
37
+ export declare function buildWritePrompt(partition: Partition, docsDir: string, opts?: {
38
+ rewrite?: boolean;
39
+ }): string;
33
40
  /** Preview lines for `/write --preview`: the partition plan + the cost band, before any spend. */
34
41
  export declare function previewLines(partitions: Partition[], estimate: CostEstimate, concurrency: number): string[];
35
42
  /**
@@ -45,11 +52,13 @@ export declare function summaryLines(results: PartitionResult[], partitions: Par
45
52
  export declare function selectWriteTargets(cwd: string, entries: DocsPlanEntry[], args: {
46
53
  scope?: string;
47
54
  path?: string;
55
+ rewrite?: boolean;
48
56
  }): {
49
57
  docsDir: string;
50
58
  targets: string[];
51
59
  planCount: number;
52
60
  reason?: string;
61
+ rewriting?: boolean;
53
62
  };
54
63
  /**
55
64
  * Classic-REPL `/write` — parity with the TUI handler (App.tsx): `/write [--scope x]` writes the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "document360-writer",
3
- "version": "0.5.36",
3
+ "version": "0.5.38",
4
4
  "description": "Standalone documentation agent CLI. Reads your code, writes your docs. Specialized for Document360 publishing.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -34,7 +34,7 @@
34
34
  "@inquirer/prompts": "^8.4.3",
35
35
  "commander": "^14.0.3",
36
36
  "diff": "^8.0.4",
37
- "document360-engine": "^0.2.75",
37
+ "document360-engine": "^0.2.76",
38
38
  "ink": "^5.2.1",
39
39
  "picocolors": "^1.1.1",
40
40
  "react": "^18.3.1",