document360-writer 0.5.85 → 0.5.87
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 +108 -108
- package/package.json +3 -3
- package/dist/cli.d.ts +0 -2
- package/dist/commands/allowProd.d.ts +0 -3
- package/dist/commands/audit.d.ts +0 -2
- package/dist/commands/capture-setup.d.ts +0 -12
- package/dist/commands/catchup.d.ts +0 -63
- package/dist/commands/clear.d.ts +0 -3
- package/dist/commands/convert.d.ts +0 -35
- package/dist/commands/devhints.d.ts +0 -125
- package/dist/commands/doctor.d.ts +0 -13
- package/dist/commands/document.d.ts +0 -19
- package/dist/commands/draft.d.ts +0 -27
- package/dist/commands/exit.d.ts +0 -2
- package/dist/commands/genre.d.ts +0 -3
- package/dist/commands/help.d.ts +0 -2
- package/dist/commands/inbox.d.ts +0 -11
- package/dist/commands/index.d.ts +0 -28
- package/dist/commands/init.d.ts +0 -9
- package/dist/commands/lint.d.ts +0 -8
- package/dist/commands/login.d.ts +0 -4
- package/dist/commands/logout.d.ts +0 -5
- package/dist/commands/logsCli.d.ts +0 -2
- package/dist/commands/mcp.d.ts +0 -2
- package/dist/commands/model.d.ts +0 -17
- package/dist/commands/profile.d.ts +0 -6
- package/dist/commands/project.d.ts +0 -3
- package/dist/commands/publish.d.ts +0 -57
- package/dist/commands/pull.d.ts +0 -45
- package/dist/commands/rename.d.ts +0 -5
- package/dist/commands/reorder.d.ts +0 -8
- package/dist/commands/reset.d.ts +0 -31
- package/dist/commands/resume.d.ts +0 -3
- package/dist/commands/review.d.ts +0 -9
- package/dist/commands/roadmap.d.ts +0 -10
- package/dist/commands/scope.d.ts +0 -9
- package/dist/commands/screenshot.d.ts +0 -44
- package/dist/commands/structure.d.ts +0 -6
- package/dist/commands/update.d.ts +0 -18
- package/dist/commands/workspace.d.ts +0 -3
- package/dist/commands/write.d.ts +0 -73
- package/dist/d360/authCli.d.ts +0 -13
- package/dist/d360/portalLink.d.ts +0 -18
- package/dist/d360/profileCli.d.ts +0 -3
- package/dist/d360/projectCli.d.ts +0 -17
- package/dist/d360/workspaceCli.d.ts +0 -17
- package/dist/lib/authPreflight.d.ts +0 -14
- package/dist/lib/categoryChoices.d.ts +0 -23
- package/dist/lib/checklist.d.ts +0 -30
- package/dist/lib/clipboard.d.ts +0 -1
- package/dist/lib/colors.d.ts +0 -10
- package/dist/lib/commandSuggest.d.ts +0 -7
- package/dist/lib/crashHandler.d.ts +0 -2
- package/dist/lib/diffRender.d.ts +0 -8
- package/dist/lib/hyperlink.d.ts +0 -5
- package/dist/lib/inputLayout.d.ts +0 -19
- package/dist/lib/mascot.d.ts +0 -5
- package/dist/lib/mdRender.d.ts +0 -7
- package/dist/lib/modelChoices.d.ts +0 -14
- package/dist/lib/nextActions.d.ts +0 -104
- package/dist/lib/paste.d.ts +0 -19
- package/dist/lib/pickOptions.d.ts +0 -18
- package/dist/lib/quickOptions.d.ts +0 -24
- package/dist/lib/readyState.d.ts +0 -19
- package/dist/lib/streaming.d.ts +0 -23
- package/dist/lib/syncRender.d.ts +0 -10
- package/dist/lib/toolFormat.d.ts +0 -30
- package/dist/lib/upgradeTable.d.ts +0 -5
- package/dist/oneShot.d.ts +0 -7
- package/dist/repl.d.ts +0 -18
- package/dist/tui/App.d.ts +0 -9
- package/dist/tui/HelpModal.d.ts +0 -7
- package/dist/tui/catalog.d.ts +0 -17
- package/dist/tui/helpContent.d.ts +0 -35
- package/dist/tui/index.d.ts +0 -3
- package/dist/tui/itemRender.d.ts +0 -79
- package/dist/tui/termTitle.d.ts +0 -28
- package/dist/tui/transcriptStore.d.ts +0 -5
package/dist/lib/streaming.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Streaming-markdown flush support. While the agent streams, completed paragraphs are
|
|
3
|
-
* flushed into the static (markdown-rendered) transcript so what scrolls out of the
|
|
4
|
-
* viewport is already pretty — Ink can only repaint what's still on screen, so raw
|
|
5
|
-
* streamed text left in scrollback stays raw forever (Claude Code flushes the same way).
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Cut position after the last blank line that lies outside any ``` fence, or 0 when
|
|
9
|
-
* there's no safe cut yet. Text before the cut is a complete run of markdown blocks
|
|
10
|
-
* (a fence keeps code blocks intact; tables/lists have no internal blank lines).
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Tail of the live streaming buffer, capped to ~maxRows visual rows so the dynamic
|
|
14
|
-
* region can never outgrow the viewport — Ink erases the live area by line count, and
|
|
15
|
-
* anything that scrolls off-screen leaves un-repaintable raw frames in scrollback.
|
|
16
|
-
* Row usage is estimated as ceil(len/width) per source line (Ink word-wraps, so this
|
|
17
|
-
* is approximate — callers should leave headroom when picking maxRows).
|
|
18
|
-
*/
|
|
19
|
-
export declare function liveTail(text: string, maxRows: number, width: number): {
|
|
20
|
-
text: string;
|
|
21
|
-
truncated: boolean;
|
|
22
|
-
};
|
|
23
|
-
export declare function streamCut(text: string): number;
|
package/dist/lib/syncRender.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* git-status-style rendering of a SyncStatusReport. Pure ANSI-string lines —
|
|
3
|
-
* the REPL console.logs them; the TUI pushes them as one note (Ink-safe).
|
|
4
|
-
*/
|
|
5
|
-
import type { SyncStatusReport } from 'document360-engine';
|
|
6
|
-
/** Human-friendly elapsed time: "0.8s", "12.3s", "1m 30s". */
|
|
7
|
-
export declare function formatDuration(ms: number): string;
|
|
8
|
-
/** `elapsedMs` (optional) appends "· synced in <t>" to the footer — surfaces the manifest fast path's win
|
|
9
|
-
(a quiet sync is ~1 call → sub-second; a full fetch is visibly longer). */
|
|
10
|
-
export declare function renderSyncReport(report: SyncStatusReport, elapsedMs?: number): string[];
|
package/dist/lib/toolFormat.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Claude Code-style formatting of tool calls and results for terminal display.
|
|
3
|
-
* Pure functions — shared by the Ink TUI and the plain REPL renderer.
|
|
4
|
-
*
|
|
5
|
-
* ● Bash(npm run build)
|
|
6
|
-
* ⎿ first lines of output…
|
|
7
|
-
* … +12 lines
|
|
8
|
-
*/
|
|
9
|
-
/** `sep` goes between title and `(arg)`: built-ins are tight (`Bash(…)`, Claude Code
|
|
10
|
-
* style); MCP titles read as words, so they get a space (`Document360: get article (…)`). */
|
|
11
|
-
export type ToolHeader = {
|
|
12
|
-
title: string;
|
|
13
|
-
sep: '' | ' ';
|
|
14
|
-
arg: string | null;
|
|
15
|
-
};
|
|
16
|
-
export type ToolResultView = {
|
|
17
|
-
lines: string[];
|
|
18
|
-
hidden: number;
|
|
19
|
-
};
|
|
20
|
-
/** "user-docs/99-troubleshooting/01-login.md" → "Troubleshooting" — the category
|
|
21
|
-
NAME derived locally from the article path (no API call; GUIDs are unreadable). */
|
|
22
|
-
export declare function prettyCategoryFromPath(localPath: unknown): string | null;
|
|
23
|
-
/**
|
|
24
|
-
* Header line for a tool call: display title + inline argument summary.
|
|
25
|
-
* Returns null for internal tools that should stay hidden.
|
|
26
|
-
*/
|
|
27
|
-
export declare function formatToolUse(name: string, input: Record<string, unknown>): ToolHeader | null;
|
|
28
|
-
/** Preview of a tool result: first `maxLines` lines + how many were held back.
|
|
29
|
-
`toolName`/`input` (the paired tool call) unlock curated per-tool summaries. */
|
|
30
|
-
export declare function formatToolResult(output: string, maxLines?: number, toolName?: string, input?: Record<string, unknown>): ToolResultView;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { UpgradeAction } from 'document360-engine';
|
|
2
|
-
/** Greedy word-wrap; long unbreakable tokens get their own (possibly overlong-safe) split. */
|
|
3
|
-
export declare function wrapText(text: string, width: number): string[];
|
|
4
|
-
/** Render the upgrade notice as bordered cards. Empty input → []. */
|
|
5
|
-
export declare function upgradeTableLines(applied: UpgradeAction[]): string[];
|
package/dist/oneShot.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type AuthMode } from 'document360-engine';
|
|
2
|
-
/**
|
|
3
|
-
* Headless one-shot mode (`d360-writer --prompt "..."`), the writer's `claude -p`.
|
|
4
|
-
* Answer text streams to STDOUT (pipeable); banner, auth notice, tool indicators,
|
|
5
|
-
* and token counts go to STDERR. Exit codes: 0 success, 1 agent error, 2 usage.
|
|
6
|
-
*/
|
|
7
|
-
export declare function runOnce(cwd: string, prompt: string, authMode: AuthMode, resumeName?: string, profileName?: string, yes?: boolean): Promise<never>;
|
package/dist/repl.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { type AuthMode } from 'document360-engine';
|
|
2
|
-
export type ReplContext = {
|
|
3
|
-
cwd: string;
|
|
4
|
-
/** The --profile override for this session, if any (else the repo default resolves). */
|
|
5
|
-
profileName?: string;
|
|
6
|
-
/** Whether production writes are authorized this session (armed by /allow-prod). */
|
|
7
|
-
allowProdWrites: () => boolean;
|
|
8
|
-
restartAgent: () => void;
|
|
9
|
-
/** Switch the live session's model without restarting (conversation continues). */
|
|
10
|
-
setModel: (model?: string) => Promise<void>;
|
|
11
|
-
/** UUID of the live session record, once the first exchange has registered it. */
|
|
12
|
-
currentUuid: () => string | null;
|
|
13
|
-
/** Stash a name from /rename run before the first message; applied when the session registers. */
|
|
14
|
-
setPendingName: (name: string) => void;
|
|
15
|
-
/** Pause the REPL's readline while another stdin consumer (e.g. the /resume picker) runs. */
|
|
16
|
-
withPausedInput: <T>(fn: () => Promise<T>) => Promise<T>;
|
|
17
|
-
};
|
|
18
|
-
export declare function runRepl(cwd?: string, authMode?: AuthMode, profileName?: string): Promise<void>;
|
package/dist/tui/App.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type ResolvedAuth } from 'document360-engine';
|
|
3
|
-
export type AppProps = {
|
|
4
|
-
cwd: string;
|
|
5
|
-
auth: ResolvedAuth;
|
|
6
|
-
profileName?: string;
|
|
7
|
-
version: string;
|
|
8
|
-
};
|
|
9
|
-
export declare function App({ cwd, auth, profileName: initialProfile, version }: AppProps): React.ReactElement;
|
package/dist/tui/HelpModal.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/** Interactive /help — a Claude-Code-style tabbed modal. Tab/←/→ (or 1-5) switch sections, esc closes.
|
|
3
|
-
Key routing + the `helpModal` state live in App.tsx (mirrors the other pickers). */
|
|
4
|
-
export declare function HelpModal({ tab, width }: {
|
|
5
|
-
tab: number;
|
|
6
|
-
width: number;
|
|
7
|
-
}): React.ReactElement;
|
package/dist/tui/catalog.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export type CommandGroup = 'start' | 'docs' | 'publish' | 'setup' | 'session';
|
|
2
|
-
export type CommandSpec = {
|
|
3
|
-
name: string;
|
|
4
|
-
usage: string;
|
|
5
|
-
desc: string;
|
|
6
|
-
group: CommandGroup;
|
|
7
|
-
};
|
|
8
|
-
export declare const COMMANDS: CommandSpec[];
|
|
9
|
-
/** A one-line description for a quick-list option (full command line, e.g. "/publish --all"). Curated
|
|
10
|
-
map first, then the catalog `desc` by base command, else ''. */
|
|
11
|
-
export declare function describeQuickOption(cmdLine: string): string;
|
|
12
|
-
/** Commands whose body filters as you type `/<prefix>`. */
|
|
13
|
-
export declare function filterCommands(input: string): CommandSpec[];
|
|
14
|
-
/** True when the usage has a REQUIRED argument (`<...>` outside optional `[...]`
|
|
15
|
-
brackets). "/rename <name>" requires one; "/pull [<path> | --status]" does not —
|
|
16
|
-
palette Enter must submit the latter bare instead of waiting for input forever. */
|
|
17
|
-
export declare function requiresArgument(usage: string): boolean;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export type HelpRow = {
|
|
2
|
-
t: 'head';
|
|
3
|
-
s: string;
|
|
4
|
-
} | {
|
|
5
|
-
t: 'text';
|
|
6
|
-
s: string;
|
|
7
|
-
} | {
|
|
8
|
-
t: 'dim';
|
|
9
|
-
s: string;
|
|
10
|
-
} | {
|
|
11
|
-
t: 'sub';
|
|
12
|
-
s: string;
|
|
13
|
-
} | {
|
|
14
|
-
t: 'good';
|
|
15
|
-
s: string;
|
|
16
|
-
} | {
|
|
17
|
-
t: 'step';
|
|
18
|
-
n: number;
|
|
19
|
-
s: string;
|
|
20
|
-
} | {
|
|
21
|
-
t: 'cmd';
|
|
22
|
-
name: string;
|
|
23
|
-
s: string;
|
|
24
|
-
} | {
|
|
25
|
-
t: 'gap';
|
|
26
|
-
};
|
|
27
|
-
export type HelpTab = {
|
|
28
|
-
key: string;
|
|
29
|
-
label: string;
|
|
30
|
-
rows: HelpRow[];
|
|
31
|
-
};
|
|
32
|
-
export declare const HELP_TABS: HelpTab[];
|
|
33
|
-
/** Flatten every tab to plain strings — the classic REPL has no modal, so it prints the
|
|
34
|
-
sections linearly under their headers. */
|
|
35
|
-
export declare function renderHelpPlain(): string[];
|
package/dist/tui/index.d.ts
DELETED
package/dist/tui/itemRender.d.ts
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
export type BannerInfo = {
|
|
2
|
-
version: string;
|
|
3
|
-
claude: string;
|
|
4
|
-
/** Resolved model name (alias or full id — always concrete; 'sonnet' on auto, SNAG-0262). */
|
|
5
|
-
model: string;
|
|
6
|
-
/** Where the model came from, e.g. '.d360-writer/config.json', '/model setting', 'env'. */
|
|
7
|
-
modelSource: string;
|
|
8
|
-
who: string | null;
|
|
9
|
-
/** Session-health parenthetical shown after `who` (expiry / refreshing note). */
|
|
10
|
-
sessionHint: string | null;
|
|
11
|
-
profile: string;
|
|
12
|
-
apiUrl: string;
|
|
13
|
-
project: string;
|
|
14
|
-
cwd: string;
|
|
15
|
-
prod: boolean;
|
|
16
|
-
loggedOut: boolean;
|
|
17
|
-
/** False when the repo has no .d360-writer/config.json — show "run /init", never a default
|
|
18
|
-
profile or a machine-global session that the repo never opted into. */
|
|
19
|
-
configured: boolean;
|
|
20
|
-
/** Writer-mode boundary line, e.g. 'writer · edits limited to user-docs/ + config'. */
|
|
21
|
-
mode: string;
|
|
22
|
-
};
|
|
23
|
-
export type Item = {
|
|
24
|
-
kind: 'banner';
|
|
25
|
-
info: BannerInfo;
|
|
26
|
-
} | {
|
|
27
|
-
kind: 'user';
|
|
28
|
-
text: string;
|
|
29
|
-
} | {
|
|
30
|
-
kind: 'assistant';
|
|
31
|
-
text: string;
|
|
32
|
-
} | {
|
|
33
|
-
kind: 'tool';
|
|
34
|
-
title: string;
|
|
35
|
-
sep: string;
|
|
36
|
-
arg: string | null;
|
|
37
|
-
} | {
|
|
38
|
-
kind: 'tool-result';
|
|
39
|
-
lines: string[];
|
|
40
|
-
hidden: number;
|
|
41
|
-
isError: boolean;
|
|
42
|
-
} | {
|
|
43
|
-
kind: 'diff';
|
|
44
|
-
added: number;
|
|
45
|
-
removed: number;
|
|
46
|
-
lines: string[];
|
|
47
|
-
hidden: number;
|
|
48
|
-
} | {
|
|
49
|
-
kind: 'link';
|
|
50
|
-
lines: string[];
|
|
51
|
-
} | {
|
|
52
|
-
kind: 'preview';
|
|
53
|
-
name: string;
|
|
54
|
-
text: string;
|
|
55
|
-
} | {
|
|
56
|
-
kind: 'note';
|
|
57
|
-
text: string;
|
|
58
|
-
tone: 'info' | 'warn' | 'error' | 'ok';
|
|
59
|
-
} | {
|
|
60
|
-
kind: 'done';
|
|
61
|
-
seconds: number;
|
|
62
|
-
tokens: number;
|
|
63
|
-
costUsd: number;
|
|
64
|
-
ok: boolean;
|
|
65
|
-
};
|
|
66
|
-
export declare function formatDuration(seconds: number): string;
|
|
67
|
-
/** Cost in USD, terse for the footer/done line. Sub-cent shows 4 dp so a cheap turn isn't "$0.00". */
|
|
68
|
-
export declare function formatUsd(usd: number): string;
|
|
69
|
-
/** Output-token count, terse — the subscription-mode counterpart to formatUsd (no $ to show
|
|
70
|
-
when the user isn't metered per token). k/M past 1k/1M so a big run stays readable. */
|
|
71
|
-
export declare function formatTokens(tokens: number): string;
|
|
72
|
-
/**
|
|
73
|
-
* Render one item to an ANSI string. Each item owns the single blank line ABOVE
|
|
74
|
-
* itself (leading \n) — except tool-result/link, which attach directly under their
|
|
75
|
-
* tool header, and the banner, which is always first.
|
|
76
|
-
*/
|
|
77
|
-
export declare function renderItem(item: Item, width: number): string;
|
|
78
|
-
/** Re-render the whole transcript (resize replay). */
|
|
79
|
-
export declare function renderTranscript(items: Item[], width: number): string;
|
package/dist/tui/termTitle.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Terminal tab status — so you can tell, across several open tabs, which d360-writer is
|
|
3
|
-
* busy and which is waiting (Claude-Code style). Two OSC sequences, both SAFE to write
|
|
4
|
-
* while Ink is mounted: they set the window title / tab-progress and emit NO visible cells
|
|
5
|
-
* and NO cursor movement, so they don't race Ink's frame tracking (unlike clear/cursor
|
|
6
|
-
* escapes — see gotchas-writer-tui.md). On non-supporting terminals they're ignored.
|
|
7
|
-
*/
|
|
8
|
-
/** OSC 0 — set the window/tab title. BEL-terminated (Windows Terminal accepts it). */
|
|
9
|
-
export declare const titleSeq: (text: string) => string;
|
|
10
|
-
/**
|
|
11
|
-
* OSC 9;4 — Windows-Terminal/ConEmu tab progress indicator:
|
|
12
|
-
* 0 = clear · 1 = normal/green (done) · 3 = indeterminate (busy, pulsing).
|
|
13
|
-
*/
|
|
14
|
-
export declare const progressSeq: (state: 0 | 1 | 3) => string;
|
|
15
|
-
export declare function setTitle(text: string): void;
|
|
16
|
-
export declare function setProgress(state: 0 | 1 | 3): void;
|
|
17
|
-
/**
|
|
18
|
-
* Busy title prefix — a single dot bouncing left↔right (Claude-Code style: ". " / " ."), which
|
|
19
|
-
* reads as a calm "processing" pulse rather than a growing trail. Two frames, alternated.
|
|
20
|
-
*/
|
|
21
|
-
export declare const BUSY_FRAMES: readonly ["· ", " ·"];
|
|
22
|
-
/**
|
|
23
|
-
* The idle/done tab mark — d360-writer's brand "icon" next to the PowerShell profile icon (the
|
|
24
|
-
* purple analog of Claude Code's green done-icon). It's a title glyph, not the OSC 9;4 progress
|
|
25
|
-
* ring, because that ring only renders in fixed states (green/red/yellow) and can't be purple;
|
|
26
|
-
* a title emoji also lets the profile icon stay visible (we clear the ring when idle).
|
|
27
|
-
*/
|
|
28
|
-
export declare const BRAND_GLYPH = "\uD83D\uDFE3";
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Item } from './itemRender.js';
|
|
2
|
-
/** Save the renderable transcript. The banner is dropped — replay shows the live banner. */
|
|
3
|
-
export declare function saveTranscript(cwd: string, uuid: string, items: Item[]): void;
|
|
4
|
-
/** Load a saved transcript (the items to replay), or [] if none / unreadable. */
|
|
5
|
-
export declare function loadTranscript(cwd: string, uuid: string): Item[];
|