@doxbrix/doxloop 0.1.4 → 0.2.0
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/CHANGELOG.md +1153 -0
- package/README.md +422 -226
- package/assets/doxbrix-preview.css +77 -15
- package/contracts/agent-events-v1.schema.json +1 -0
- package/contracts/coverage-v1.schema.json +59 -0
- package/contracts/drift-v1.schema.json +1 -0
- package/contracts/evaluation-v1.schema.json +62 -0
- package/contracts/quality-codes-v1.json +1 -0
- package/contracts/quality-report-v1.schema.json +1 -0
- package/contracts/validation-v1.schema.json +1 -0
- package/dist/agent-failure.d.ts +36 -0
- package/dist/agent-failure.js +98 -0
- package/dist/agent-isolation.d.ts +17 -0
- package/dist/agent-isolation.js +94 -0
- package/dist/agent-log.d.ts +197 -0
- package/dist/agent-log.js +1094 -0
- package/dist/agent-process.d.ts +63 -0
- package/dist/agent-process.js +128 -0
- package/dist/agent-reply.d.ts +47 -0
- package/dist/agent-reply.js +315 -0
- package/dist/agents.d.ts +40 -4
- package/dist/agents.js +115 -11
- package/dist/api-coverage.d.ts +11 -0
- package/dist/api-coverage.js +72 -0
- package/dist/application-probe.d.ts +28 -0
- package/dist/application-probe.js +93 -0
- package/dist/application-url.d.ts +14 -0
- package/dist/application-url.js +26 -0
- package/dist/args.js +15 -0
- package/dist/artifact-deploy.d.ts +9 -0
- package/dist/artifact-deploy.js +28 -8
- package/dist/assets.d.ts +72 -0
- package/dist/assets.js +382 -0
- package/dist/auth.d.ts +10 -0
- package/dist/auth.js +38 -9
- package/dist/author.d.ts +206 -4
- package/dist/author.js +1650 -52
- package/dist/authoring-batches.d.ts +190 -0
- package/dist/authoring-batches.js +489 -0
- package/dist/authoring-postpass.d.ts +79 -0
- package/dist/authoring-postpass.js +1289 -0
- package/dist/authoring-progress.d.ts +95 -0
- package/dist/authoring-progress.js +269 -0
- package/dist/autosync.d.ts +56 -0
- package/dist/autosync.js +442 -0
- package/dist/batch-artifacts.d.ts +81 -0
- package/dist/batch-artifacts.js +412 -0
- package/dist/batch-limits.d.ts +37 -0
- package/dist/batch-limits.js +80 -0
- package/dist/branding.d.ts +41 -0
- package/dist/branding.js +229 -0
- package/dist/bundle-upload.d.ts +26 -0
- package/dist/bundle-upload.js +99 -0
- package/dist/capture-auth.d.ts +95 -0
- package/dist/capture-auth.js +204 -0
- package/dist/capture.d.ts +48 -0
- package/dist/capture.js +20 -1
- package/dist/cli.js +839 -32
- package/dist/content-links.d.ts +10 -0
- package/dist/content-links.js +49 -0
- package/dist/contract-validation.d.ts +4 -0
- package/dist/contract-validation.js +25 -0
- package/dist/coverage-actions.d.ts +8 -0
- package/dist/coverage-actions.js +71 -0
- package/dist/coverage-resolutions.d.ts +16 -0
- package/dist/coverage-resolutions.js +58 -0
- package/dist/db.d.ts +37 -0
- package/dist/db.js +288 -0
- package/dist/demo.d.ts +12 -0
- package/dist/demo.js +122 -0
- package/dist/deploy-credentials.d.ts +7 -0
- package/dist/deploy-credentials.js +76 -0
- package/dist/deploy-targets/github-pages.d.ts +3 -0
- package/dist/deploy-targets/github-pages.js +100 -0
- package/dist/deploy-targets/index.d.ts +8 -0
- package/dist/deploy-targets/index.js +78 -0
- package/dist/deploy-targets/netlify.d.ts +3 -0
- package/dist/deploy-targets/netlify.js +49 -0
- package/dist/deploy-targets/types.d.ts +32 -0
- package/dist/deploy-targets/types.js +2 -0
- package/dist/deploy-targets/vercel.d.ts +3 -0
- package/dist/deploy-targets/vercel.js +95 -0
- package/dist/deploy.d.ts +9 -0
- package/dist/deploy.js +87 -13
- package/dist/deterministic-capture.d.ts +90 -0
- package/dist/deterministic-capture.js +435 -0
- package/dist/direct-edit.d.ts +40 -0
- package/dist/direct-edit.js +159 -0
- package/dist/docs-crawl.d.ts +86 -0
- package/dist/docs-crawl.js +536 -0
- package/dist/docs-site.d.ts +49 -0
- package/dist/docs-site.js +233 -0
- package/dist/doctor.js +8 -0
- package/dist/documentation-collections.d.ts +23 -0
- package/dist/documentation-collections.js +191 -0
- package/dist/documentation-plan.d.ts +253 -0
- package/dist/documentation-plan.js +2563 -0
- package/dist/doxbrix-build.d.ts +19 -0
- package/dist/doxbrix-build.js +167 -0
- package/dist/doxbrix-markdown.d.ts +9 -0
- package/dist/doxbrix-markdown.js +115 -14
- package/dist/drift.d.ts +10 -0
- package/dist/drift.js +164 -0
- package/dist/evaluation.d.ts +46 -0
- package/dist/evaluation.js +113 -0
- package/dist/evidence-pack.d.ts +47 -0
- package/dist/evidence-pack.js +358 -0
- package/dist/evidence.d.ts +25 -0
- package/dist/evidence.js +175 -0
- package/dist/fs.d.ts +8 -2
- package/dist/fs.js +41 -11
- package/dist/generator-api.d.ts +89 -0
- package/dist/generator-preflight.d.ts +27 -0
- package/dist/generator-preflight.js +105 -0
- package/dist/generator-runtime.d.ts +7 -0
- package/dist/generator-runtime.js +17 -1
- package/dist/generators.d.ts +24 -2
- package/dist/generators.js +54 -1
- package/dist/git-delivery.d.ts +17 -0
- package/dist/git-delivery.js +123 -0
- package/dist/globs.d.ts +16 -0
- package/dist/globs.js +65 -0
- package/dist/glossary.d.ts +26 -0
- package/dist/glossary.js +179 -0
- package/dist/history.d.ts +106 -0
- package/dist/history.js +600 -0
- package/dist/html-markdown.d.ts +46 -0
- package/dist/html-markdown.js +423 -0
- package/dist/interactive.js +16 -15
- package/dist/job-events.d.ts +74 -0
- package/dist/job-events.js +377 -0
- package/dist/keep-awake.d.ts +50 -0
- package/dist/keep-awake.js +123 -0
- package/dist/local-source-snapshot.d.ts +20 -0
- package/dist/local-source-snapshot.js +61 -0
- package/dist/mintlify-detect.d.ts +3 -0
- package/dist/mintlify-detect.js +18 -0
- package/dist/mintlify-import.d.ts +75 -0
- package/dist/mintlify-import.js +190 -0
- package/dist/navigation.d.ts +98 -0
- package/dist/navigation.js +310 -0
- package/dist/openapi.d.ts +60 -0
- package/dist/openapi.js +439 -0
- package/dist/page-editor-bridge.d.ts +3 -0
- package/dist/page-editor-bridge.js +109 -0
- package/dist/page-editor-preview.d.ts +10 -0
- package/dist/page-editor-preview.js +55 -0
- package/dist/page-extension.d.ts +9 -0
- package/dist/page-extension.js +15 -0
- package/dist/page-metadata.d.ts +28 -0
- package/dist/page-metadata.js +166 -0
- package/dist/page-operations.d.ts +34 -0
- package/dist/page-operations.js +215 -0
- package/dist/page-routes.d.ts +4 -0
- package/dist/page-routes.js +61 -0
- package/dist/pages.d.ts +20 -0
- package/dist/pages.js +184 -0
- package/dist/plan-generator.d.ts +3 -0
- package/dist/plan-generator.js +21 -0
- package/dist/plan-navigation.d.ts +11 -0
- package/dist/plan-navigation.js +30 -0
- package/dist/planning-captures.d.ts +20 -0
- package/dist/planning-captures.js +143 -0
- package/dist/planning-research.d.ts +135 -0
- package/dist/planning-research.js +472 -0
- package/dist/planning-triage.d.ts +23 -0
- package/dist/planning-triage.js +131 -0
- package/dist/preview.d.ts +24 -0
- package/dist/preview.js +280 -29
- package/dist/project-detect.d.ts +36 -0
- package/dist/project-detect.js +251 -0
- package/dist/project-import.d.ts +54 -0
- package/dist/project-import.js +157 -0
- package/dist/project-lock.d.ts +6 -0
- package/dist/project-lock.js +96 -0
- package/dist/project-registry.d.ts +25 -0
- package/dist/project-registry.js +79 -0
- package/dist/project.d.ts +35 -3
- package/dist/project.js +388 -38
- package/dist/prompts.d.ts +9 -0
- package/dist/prompts.js +33 -4
- package/dist/proposal-replay.d.ts +32 -0
- package/dist/proposal-replay.js +99 -0
- package/dist/quality-claims.d.ts +8 -0
- package/dist/quality-claims.js +168 -0
- package/dist/quality-config.d.ts +5 -0
- package/dist/quality-config.js +84 -0
- package/dist/quality-contract.d.ts +37 -0
- package/dist/quality-contract.js +46 -0
- package/dist/quality-examples.d.ts +4 -0
- package/dist/quality-examples.js +233 -0
- package/dist/quality-gates.d.ts +16 -0
- package/dist/quality-gates.js +192 -0
- package/dist/quality-links.d.ts +7 -0
- package/dist/quality-links.js +149 -0
- package/dist/quality-lint.d.ts +6 -0
- package/dist/quality-lint.js +124 -0
- package/dist/quality-rendered.d.ts +11 -0
- package/dist/quality-rendered.js +222 -0
- package/dist/quality-schema.d.ts +3 -0
- package/dist/quality-schema.js +71 -0
- package/dist/release-notes.d.ts +44 -0
- package/dist/release-notes.js +183 -0
- package/dist/remote-monitor.d.ts +16 -0
- package/dist/remote-monitor.js +74 -0
- package/dist/remote-source.d.ts +34 -0
- package/dist/remote-source.js +426 -0
- package/dist/review-diff.d.ts +82 -0
- package/dist/review-diff.js +400 -0
- package/dist/review-learning.d.ts +11 -0
- package/dist/review-learning.js +60 -0
- package/dist/review-render.d.ts +38 -0
- package/dist/review-render.js +224 -0
- package/dist/review-report.d.ts +9 -0
- package/dist/review-report.js +89 -0
- package/dist/review-ui.d.ts +14 -0
- package/dist/review-ui.js +1248 -0
- package/dist/schedule.d.ts +78 -0
- package/dist/schedule.js +480 -0
- package/dist/screen-capture-provider.d.ts +52 -0
- package/dist/screen-capture-provider.js +218 -0
- package/dist/screenshot-workflow.d.ts +167 -0
- package/dist/screenshot-workflow.js +1237 -0
- package/dist/settings.d.ts +1 -1
- package/dist/settings.js +95 -7
- package/dist/site-export.d.ts +18 -0
- package/dist/site-export.js +87 -0
- package/dist/source-connectors.d.ts +33 -0
- package/dist/source-connectors.js +268 -0
- package/dist/source-discovery.d.ts +132 -0
- package/dist/source-discovery.js +823 -0
- package/dist/source-intelligence.d.ts +9 -0
- package/dist/source-intelligence.js +306 -0
- package/dist/sync-review.d.ts +28 -0
- package/dist/sync-review.js +264 -0
- package/dist/sync-runs.d.ts +192 -0
- package/dist/sync-runs.js +2244 -0
- package/dist/sync.d.ts +35 -0
- package/dist/sync.js +298 -32
- package/dist/text-diff.d.ts +9 -0
- package/dist/text-diff.js +59 -0
- package/dist/types.d.ts +946 -1
- package/dist/ui/assets/doxloop-logo-light-De7Nx7j7.png +0 -0
- package/dist/ui/assets/index-BHBYU2aG.css +1 -0
- package/dist/ui/assets/index-Cq3RPQiC.js +33 -0
- package/dist/ui/index.html +18 -0
- package/dist/ui-server.d.ts +83 -0
- package/dist/ui-server.js +3532 -0
- package/dist/usage-budget.d.ts +28 -0
- package/dist/usage-budget.js +90 -0
- package/dist/validation.d.ts +25 -1
- package/dist/validation.js +312 -26
- package/dist/workspace-tools.d.ts +54 -0
- package/dist/workspace-tools.js +123 -0
- package/docs/agent-compatibility.md +50 -28
- package/docs/ci-and-automation.md +105 -66
- package/docs/doxbrix-http-api.md +8 -1
- package/docs/existing-documentation.md +80 -0
- package/docs/generation-performance.md +108 -0
- package/docs/generator-authoring.md +68 -5
- package/docs/generator-selection.md +50 -13
- package/docs/mintlify-import.md +71 -0
- package/docs/openapi-security.md +25 -0
- package/docs/project-format.md +331 -36
- package/docs/release-quality.md +158 -0
- package/docs/releasing.md +72 -0
- package/docs/review-workflows.md +51 -0
- package/docs/security-model.md +102 -39
- package/docs/troubleshooting.md +226 -93
- package/package.json +46 -15
- package/scripts/test-auto-screenshot.mjs +172 -0
- package/skills/doxloop-authoring/SKILL.md +242 -361
- package/skills/doxloop-authoring/references/existing-documentation.md +94 -0
- package/skills/doxloop-authoring/references/navigation-architecture.md +18 -7
- package/skills/doxloop-authoring/references/page-depth.md +169 -0
- package/skills/doxloop-authoring/references/project-format.md +106 -7
- package/skills/doxloop-authoring/references/quality.md +10 -0
- package/skills/doxloop-authoring/references/screenshot-manifest.md +113 -0
- package/skills/doxloop-authoring/references/screenshots.md +149 -235
- package/skills/doxloop-authoring/references/workflows.md +76 -0
- package/skills/doxloop-doxbrix/SKILL.md +38 -22
- package/skills/doxloop-doxbrix/references/api-endpoints.md +15 -14
- package/skills/doxloop-doxbrix/references/components.md +30 -3
- package/skills/doxloop-doxbrix/references/manifest.md +3 -2
- package/vendor/doxbrix-import/LICENSE +202 -0
- package/vendor/doxbrix-import/README.md +17 -0
- package/vendor/doxbrix-import/UPSTREAM.json +47 -0
- package/vendor/doxbrix-import/dist/docs/frontmatter.d.ts +13 -0
- package/vendor/doxbrix-import/dist/docs/frontmatter.js +83 -0
- package/vendor/doxbrix-import/dist/docs/import.d.ts +21 -0
- package/vendor/doxbrix-import/dist/docs/import.js +147 -0
- package/vendor/doxbrix-import/dist/docs/manifest.d.ts +163 -0
- package/vendor/doxbrix-import/dist/docs/manifest.js +64 -0
- package/vendor/doxbrix-import/dist/docs/project.d.ts +25 -0
- package/vendor/doxbrix-import/dist/docs/project.js +77 -0
- package/vendor/doxbrix-import/dist/docs/starter.d.ts +4 -0
- package/vendor/doxbrix-import/dist/docs/starter.js +11 -0
- package/vendor/doxbrix-import/dist/importer.d.ts +227 -0
- package/vendor/doxbrix-import/dist/importer.js +1567 -0
- package/vendor/doxbrix-import/dist/mintlify-openapi.d.ts +37 -0
- package/vendor/doxbrix-import/dist/mintlify-openapi.js +305 -0
- package/vendor/doxbrix-import/dist/safe-path.d.ts +9 -0
- package/vendor/doxbrix-import/dist/safe-path.js +47 -0
- package/dist/agents.d.ts.map +0 -1
- package/dist/agents.js.map +0 -1
- package/dist/args.d.ts.map +0 -1
- package/dist/args.js.map +0 -1
- package/dist/artifact-deploy.d.ts.map +0 -1
- package/dist/artifact-deploy.js.map +0 -1
- package/dist/auth.d.ts.map +0 -1
- package/dist/auth.js.map +0 -1
- package/dist/author.d.ts.map +0 -1
- package/dist/author.js.map +0 -1
- package/dist/capture.d.ts.map +0 -1
- package/dist/capture.js.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/deploy.d.ts.map +0 -1
- package/dist/deploy.js.map +0 -1
- package/dist/deployment-visibility.d.ts.map +0 -1
- package/dist/deployment-visibility.js.map +0 -1
- package/dist/doctor.d.ts.map +0 -1
- package/dist/doctor.js.map +0 -1
- package/dist/doxbrix-markdown.d.ts.map +0 -1
- package/dist/doxbrix-markdown.js.map +0 -1
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js.map +0 -1
- package/dist/fs.d.ts.map +0 -1
- package/dist/fs.js.map +0 -1
- package/dist/generator-api.d.ts.map +0 -1
- package/dist/generator-api.js.map +0 -1
- package/dist/generator-manager.d.ts.map +0 -1
- package/dist/generator-manager.js.map +0 -1
- package/dist/generator-runtime.d.ts.map +0 -1
- package/dist/generator-runtime.js.map +0 -1
- package/dist/generators.d.ts.map +0 -1
- package/dist/generators.js.map +0 -1
- package/dist/interactive.d.ts.map +0 -1
- package/dist/interactive.js.map +0 -1
- package/dist/preview.d.ts.map +0 -1
- package/dist/preview.js.map +0 -1
- package/dist/progress.d.ts.map +0 -1
- package/dist/progress.js.map +0 -1
- package/dist/project.d.ts.map +0 -1
- package/dist/project.js.map +0 -1
- package/dist/prompts.d.ts.map +0 -1
- package/dist/prompts.js.map +0 -1
- package/dist/settings.d.ts.map +0 -1
- package/dist/settings.js.map +0 -1
- package/dist/sync.d.ts.map +0 -1
- package/dist/sync.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/validation.d.ts.map +0 -1
- package/dist/validation.js.map +0 -1
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js.map +0 -1
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { type WorkflowStageProgress, type WorkflowStageStatus } from './job-events.js';
|
|
2
|
+
import type { DocumentationPlan, DoxloopProject } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Stage identifiers shared by the plan pipeline and the authoring run, so the
|
|
5
|
+
* pipeline can announce the stages up front and the run can advance them as
|
|
6
|
+
* the agent actually writes files.
|
|
7
|
+
*/
|
|
8
|
+
export declare const AUTHORING_STAGE: {
|
|
9
|
+
readonly authoring: "authoring-pages";
|
|
10
|
+
readonly navigation: "updating-navigation";
|
|
11
|
+
readonly evidence: "recording-evidence";
|
|
12
|
+
readonly screenshots: "capturing-screenshots";
|
|
13
|
+
readonly validating: "validating";
|
|
14
|
+
};
|
|
15
|
+
export type AuthoringActivityKind = 'page' | 'navigation' | 'evidence' | 'screenshot' | 'validation';
|
|
16
|
+
export interface AuthoringActivity {
|
|
17
|
+
kind: AuthoringActivityKind;
|
|
18
|
+
/** Workspace-relative path when the activity is a file the agent wrote. */
|
|
19
|
+
path?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface WorkspaceLayout {
|
|
22
|
+
/** Content directory relative to the workspace root, '' for the root itself. */
|
|
23
|
+
contentDir: string;
|
|
24
|
+
pageExtensions: readonly string[];
|
|
25
|
+
/** Workspace-relative navigation and theme files. */
|
|
26
|
+
navigationFiles: readonly string[];
|
|
27
|
+
}
|
|
28
|
+
export declare function portableWorkspacePath(path: string): string;
|
|
29
|
+
/** Decide what a file the agent wrote says about the run's progress. */
|
|
30
|
+
export declare function classifyWorkspaceFile(rawPath: string, layout: WorkspaceLayout): AuthoringActivity | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Turn an agent tool call into an activity the file watcher cannot see: a
|
|
33
|
+
* screenshot request to the capture server, or a validation command. Every
|
|
34
|
+
* agent's log formatter reports calls in Claude's vocabulary (`Bash` with a
|
|
35
|
+
* `command`, `mcp__<server>__<tool>`); Gemini exposes MCP tools by their bare
|
|
36
|
+
* name, so a tool whose own name says "screenshot" counts as well.
|
|
37
|
+
*/
|
|
38
|
+
export declare function classifyAgentToolCall(tool: string, input: Record<string, unknown>, options?: {
|
|
39
|
+
captureServer?: string;
|
|
40
|
+
}): AuthoringActivity | undefined;
|
|
41
|
+
export declare function workspaceLayout(root: string, project: DoxloopProject): Promise<WorkspaceLayout>;
|
|
42
|
+
/** Pages an approved plan asks the agent to write or rewrite. */
|
|
43
|
+
export declare function plannedPageCount(plan: Pick<DocumentationPlan, 'pages'> | undefined): number | undefined;
|
|
44
|
+
export interface AuthoringStageEmitter {
|
|
45
|
+
(id: string, label: string, status: WorkflowStageStatus, progress?: WorkflowStageProgress): void;
|
|
46
|
+
}
|
|
47
|
+
export interface AuthoringProgressOptions {
|
|
48
|
+
/** Number of pages the run is expected to write, shown as "N of M". */
|
|
49
|
+
plannedPages?: number | undefined;
|
|
50
|
+
/** Whether the run may capture application screenshots. */
|
|
51
|
+
screenshots: boolean;
|
|
52
|
+
/** Copy for the page stage; edits and generation read differently. */
|
|
53
|
+
pageLabel?: string;
|
|
54
|
+
emit?: AuthoringStageEmitter;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Advance the workflow stages from what the agent really does: a page write
|
|
58
|
+
* starts the authoring stage and counts towards the planned total, a
|
|
59
|
+
* navigation write starts the navigation stage, and so on. Every stage is
|
|
60
|
+
* announced as pending first so the reader sees the whole path at once.
|
|
61
|
+
*/
|
|
62
|
+
export declare class AuthoringProgressTracker {
|
|
63
|
+
private readonly stages;
|
|
64
|
+
private readonly pages;
|
|
65
|
+
private readonly emit;
|
|
66
|
+
private readonly plannedPages;
|
|
67
|
+
private finished;
|
|
68
|
+
constructor(options: AuthoringProgressOptions);
|
|
69
|
+
/** Announce every stage before the agent starts. */
|
|
70
|
+
begin(): void;
|
|
71
|
+
record(activity: AuthoringActivity): void;
|
|
72
|
+
/** The agent exited: Doxloop now validates what it left behind. */
|
|
73
|
+
validating(): void;
|
|
74
|
+
/**
|
|
75
|
+
* Settle the agent's stages after a successful run. Stages that never saw
|
|
76
|
+
* activity say so instead of pretending the work happened.
|
|
77
|
+
*/
|
|
78
|
+
finish(): void;
|
|
79
|
+
pagesWritten(): number;
|
|
80
|
+
/**
|
|
81
|
+
* Pages a resumed run found finished and keeps. They count as done from
|
|
82
|
+
* the start, so the reviewer sees "35 of 35" instead of a run that seems
|
|
83
|
+
* to begin from nothing and then only ever reaches the pages it repaired.
|
|
84
|
+
*/
|
|
85
|
+
retain(paths: readonly string[]): void;
|
|
86
|
+
private start;
|
|
87
|
+
private progressFor;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Watch the run workspace so progress is derived from files for every agent,
|
|
91
|
+
* including the ones whose output Doxloop does not parse. Resolves once the
|
|
92
|
+
* watcher is armed; the returned function stops it.
|
|
93
|
+
*/
|
|
94
|
+
export declare function watchWorkspaceActivity(workspace: string, layout: WorkspaceLayout, onActivity: (activity: AuthoringActivity) => void): Promise<() => Promise<void>>;
|
|
95
|
+
//# sourceMappingURL=authoring-progress.d.ts.map
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { extname, relative } from 'node:path';
|
|
2
|
+
import chokidar from 'chokidar';
|
|
3
|
+
import { EVIDENCE_MAP_FILE } from './evidence.js';
|
|
4
|
+
import { loadGeneratorAdapter } from './generators.js';
|
|
5
|
+
import { emitWorkflowStage } from './job-events.js';
|
|
6
|
+
import { relativePath, siteConfigPath } from './project.js';
|
|
7
|
+
import { SCREENSHOT_MANIFEST_FILE } from './screenshot-workflow.js';
|
|
8
|
+
/**
|
|
9
|
+
* Stage identifiers shared by the plan pipeline and the authoring run, so the
|
|
10
|
+
* pipeline can announce the stages up front and the run can advance them as
|
|
11
|
+
* the agent actually writes files.
|
|
12
|
+
*/
|
|
13
|
+
export const AUTHORING_STAGE = {
|
|
14
|
+
authoring: 'authoring-pages',
|
|
15
|
+
navigation: 'updating-navigation',
|
|
16
|
+
evidence: 'recording-evidence',
|
|
17
|
+
screenshots: 'capturing-screenshots',
|
|
18
|
+
validating: 'validating',
|
|
19
|
+
};
|
|
20
|
+
const IMAGE_EXTENSIONS = new Set(['.png', '.jpg', '.jpeg', '.webp', '.gif', '.avif']);
|
|
21
|
+
const IGNORED_SEGMENTS = new Set(['.git', 'node_modules', '.doxloop-sources']);
|
|
22
|
+
const CAPTURE_OUTPUT_PREFIX = '.doxloop/capture-output/';
|
|
23
|
+
export function portableWorkspacePath(path) {
|
|
24
|
+
return path.replaceAll('\\', '/').replace(/^\.\//, '').replace(/^\/+/, '');
|
|
25
|
+
}
|
|
26
|
+
/** Decide what a file the agent wrote says about the run's progress. */
|
|
27
|
+
export function classifyWorkspaceFile(rawPath, layout) {
|
|
28
|
+
const path = portableWorkspacePath(rawPath);
|
|
29
|
+
if (!path || path.split('/').some((segment) => IGNORED_SEGMENTS.has(segment)))
|
|
30
|
+
return undefined;
|
|
31
|
+
if (path === portableWorkspacePath(EVIDENCE_MAP_FILE))
|
|
32
|
+
return { kind: 'evidence', path };
|
|
33
|
+
if (path === portableWorkspacePath(SCREENSHOT_MANIFEST_FILE))
|
|
34
|
+
return { kind: 'screenshot' };
|
|
35
|
+
if (path.startsWith(CAPTURE_OUTPUT_PREFIX))
|
|
36
|
+
return { kind: 'screenshot', path };
|
|
37
|
+
if (path.startsWith('.doxloop/'))
|
|
38
|
+
return undefined;
|
|
39
|
+
const extension = extname(path).toLowerCase();
|
|
40
|
+
if (IMAGE_EXTENSIONS.has(extension))
|
|
41
|
+
return { kind: 'screenshot', path };
|
|
42
|
+
const navigation = new Set(layout.navigationFiles.map(portableWorkspacePath));
|
|
43
|
+
if (navigation.has(path))
|
|
44
|
+
return { kind: 'navigation', path };
|
|
45
|
+
const content = portableWorkspacePath(layout.contentDir).replace(/\/+$/, '');
|
|
46
|
+
const insideContent = !content || path === content || path.startsWith(`${content}/`);
|
|
47
|
+
if (insideContent && layout.pageExtensions.some((candidate) => candidate.toLowerCase() === extension)) {
|
|
48
|
+
return { kind: 'page', path };
|
|
49
|
+
}
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Turn an agent tool call into an activity the file watcher cannot see: a
|
|
54
|
+
* screenshot request to the capture server, or a validation command. Every
|
|
55
|
+
* agent's log formatter reports calls in Claude's vocabulary (`Bash` with a
|
|
56
|
+
* `command`, `mcp__<server>__<tool>`); Gemini exposes MCP tools by their bare
|
|
57
|
+
* name, so a tool whose own name says "screenshot" counts as well.
|
|
58
|
+
*/
|
|
59
|
+
export function classifyAgentToolCall(tool, input, options = {}) {
|
|
60
|
+
const capturePrefix = options.captureServer ? `mcp__${options.captureServer}__` : undefined;
|
|
61
|
+
if (capturePrefix && tool.startsWith(capturePrefix)) {
|
|
62
|
+
return /screenshot|snapshot|capture/i.test(tool.slice(capturePrefix.length)) ? { kind: 'screenshot' } : undefined;
|
|
63
|
+
}
|
|
64
|
+
if (!tool.startsWith('mcp__') && /screenshot/i.test(tool))
|
|
65
|
+
return { kind: 'screenshot' };
|
|
66
|
+
if (tool === 'Bash') {
|
|
67
|
+
const command = typeof input.command === 'string' ? input.command : '';
|
|
68
|
+
if (/\bdoxloop\s+(test|quality)\b/.test(command))
|
|
69
|
+
return { kind: 'validation' };
|
|
70
|
+
}
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
export async function workspaceLayout(root, project) {
|
|
74
|
+
if (project.generator === 'doxbrix') {
|
|
75
|
+
let navigationFiles = ['docs.json'];
|
|
76
|
+
try {
|
|
77
|
+
navigationFiles = [portableWorkspacePath(relativePath(root, await siteConfigPath(root, project)))];
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
// A workspace without a site configuration yet still has pages to count.
|
|
81
|
+
}
|
|
82
|
+
return { contentDir: project.contentDir, pageExtensions: ['.md', '.mdx'], navigationFiles };
|
|
83
|
+
}
|
|
84
|
+
try {
|
|
85
|
+
const adapter = await loadGeneratorAdapter(root, project);
|
|
86
|
+
return {
|
|
87
|
+
contentDir: project.contentDir,
|
|
88
|
+
pageExtensions: adapter.project.pageExtensions,
|
|
89
|
+
navigationFiles: adapter.planning?.navigationFiles ?? [],
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
return { contentDir: project.contentDir, pageExtensions: ['.md', '.mdx'], navigationFiles: [] };
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/** Pages an approved plan asks the agent to write or rewrite. */
|
|
97
|
+
export function plannedPageCount(plan) {
|
|
98
|
+
if (!plan)
|
|
99
|
+
return undefined;
|
|
100
|
+
const count = plan.pages.filter((page) => page.action === 'create' || page.action === 'update').length;
|
|
101
|
+
return count > 0 ? count : undefined;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Advance the workflow stages from what the agent really does: a page write
|
|
105
|
+
* starts the authoring stage and counts towards the planned total, a
|
|
106
|
+
* navigation write starts the navigation stage, and so on. Every stage is
|
|
107
|
+
* announced as pending first so the reader sees the whole path at once.
|
|
108
|
+
*/
|
|
109
|
+
export class AuthoringProgressTracker {
|
|
110
|
+
stages;
|
|
111
|
+
pages = new Set();
|
|
112
|
+
emit;
|
|
113
|
+
plannedPages;
|
|
114
|
+
finished = false;
|
|
115
|
+
constructor(options) {
|
|
116
|
+
this.emit = options.emit ?? emitWorkflowStage;
|
|
117
|
+
this.plannedPages = options.plannedPages;
|
|
118
|
+
const pageLabel = options.pageLabel ?? 'Authoring approved pages';
|
|
119
|
+
this.stages = [
|
|
120
|
+
{ id: AUTHORING_STAGE.authoring, label: pageLabel, idleLabel: 'No pages were written', status: 'pending' },
|
|
121
|
+
{ id: AUTHORING_STAGE.navigation, label: 'Updating navigation and theme', idleLabel: 'Navigation and theme unchanged', status: 'pending' },
|
|
122
|
+
{ id: AUTHORING_STAGE.evidence, label: 'Recording page evidence', idleLabel: 'Page evidence unchanged', status: 'pending' },
|
|
123
|
+
...(options.screenshots
|
|
124
|
+
? [{ id: AUTHORING_STAGE.screenshots, label: 'Capturing application screenshots', idleLabel: 'No application screenshots captured', status: 'pending' }]
|
|
125
|
+
: []),
|
|
126
|
+
{ id: AUTHORING_STAGE.validating, label: 'Validating generated documentation', idleLabel: 'Validating generated documentation', status: 'pending' },
|
|
127
|
+
];
|
|
128
|
+
}
|
|
129
|
+
/** Announce every stage before the agent starts. */
|
|
130
|
+
begin() {
|
|
131
|
+
for (const stage of this.stages)
|
|
132
|
+
this.emit(stage.id, stage.label, 'pending', this.progressFor(stage.id));
|
|
133
|
+
}
|
|
134
|
+
record(activity) {
|
|
135
|
+
if (this.finished)
|
|
136
|
+
return;
|
|
137
|
+
switch (activity.kind) {
|
|
138
|
+
case 'page': {
|
|
139
|
+
if (!activity.path || this.pages.has(activity.path))
|
|
140
|
+
return;
|
|
141
|
+
this.pages.add(activity.path);
|
|
142
|
+
this.start(AUTHORING_STAGE.authoring, true);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
case 'navigation':
|
|
146
|
+
this.start(AUTHORING_STAGE.navigation);
|
|
147
|
+
return;
|
|
148
|
+
case 'evidence':
|
|
149
|
+
this.start(AUTHORING_STAGE.evidence);
|
|
150
|
+
return;
|
|
151
|
+
case 'screenshot':
|
|
152
|
+
this.start(AUTHORING_STAGE.screenshots);
|
|
153
|
+
return;
|
|
154
|
+
case 'validation':
|
|
155
|
+
this.start(AUTHORING_STAGE.validating);
|
|
156
|
+
return;
|
|
157
|
+
default:
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
/** The agent exited: Doxloop now validates what it left behind. */
|
|
162
|
+
validating() {
|
|
163
|
+
this.start(AUTHORING_STAGE.validating);
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Settle the agent's stages after a successful run. Stages that never saw
|
|
167
|
+
* activity say so instead of pretending the work happened.
|
|
168
|
+
*/
|
|
169
|
+
finish() {
|
|
170
|
+
if (this.finished)
|
|
171
|
+
return;
|
|
172
|
+
this.finished = true;
|
|
173
|
+
for (const stage of this.stages) {
|
|
174
|
+
if (stage.id === AUTHORING_STAGE.validating)
|
|
175
|
+
continue;
|
|
176
|
+
if (stage.status === 'running') {
|
|
177
|
+
stage.status = 'completed';
|
|
178
|
+
this.emit(stage.id, stage.label, 'completed', this.progressFor(stage.id));
|
|
179
|
+
}
|
|
180
|
+
else if (stage.status === 'pending') {
|
|
181
|
+
stage.status = 'completed';
|
|
182
|
+
this.emit(stage.id, stage.idleLabel, 'completed', this.progressFor(stage.id));
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
pagesWritten() {
|
|
187
|
+
return this.pages.size;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Pages a resumed run found finished and keeps. They count as done from
|
|
191
|
+
* the start, so the reviewer sees "35 of 35" instead of a run that seems
|
|
192
|
+
* to begin from nothing and then only ever reaches the pages it repaired.
|
|
193
|
+
*/
|
|
194
|
+
retain(paths) {
|
|
195
|
+
if (this.finished)
|
|
196
|
+
return;
|
|
197
|
+
let added = false;
|
|
198
|
+
for (const raw of paths) {
|
|
199
|
+
const path = portableWorkspacePath(raw);
|
|
200
|
+
if (!path || this.pages.has(path))
|
|
201
|
+
continue;
|
|
202
|
+
this.pages.add(path);
|
|
203
|
+
added = true;
|
|
204
|
+
}
|
|
205
|
+
if (added)
|
|
206
|
+
this.start(AUTHORING_STAGE.authoring, true);
|
|
207
|
+
}
|
|
208
|
+
start(id, reemit = false) {
|
|
209
|
+
const stage = this.stages.find((candidate) => candidate.id === id);
|
|
210
|
+
if (!stage)
|
|
211
|
+
return;
|
|
212
|
+
if (stage.status === 'running' && !reemit)
|
|
213
|
+
return;
|
|
214
|
+
if (stage.status !== 'running' && stage.status !== 'pending')
|
|
215
|
+
return;
|
|
216
|
+
stage.status = 'running';
|
|
217
|
+
this.emit(stage.id, stage.label, 'running', this.progressFor(stage.id));
|
|
218
|
+
}
|
|
219
|
+
progressFor(id) {
|
|
220
|
+
if (id !== AUTHORING_STAGE.authoring)
|
|
221
|
+
return undefined;
|
|
222
|
+
if (this.pages.size === 0 && this.plannedPages === undefined)
|
|
223
|
+
return undefined;
|
|
224
|
+
// Starter pages the run replaces and pages a fix session rewrites are
|
|
225
|
+
// files too; the count never reads "36 of 32".
|
|
226
|
+
const done = this.plannedPages !== undefined ? Math.min(this.pages.size, this.plannedPages) : this.pages.size;
|
|
227
|
+
return { done, ...(this.plannedPages !== undefined ? { total: this.plannedPages } : {}) };
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Watch the run workspace so progress is derived from files for every agent,
|
|
232
|
+
* including the ones whose output Doxloop does not parse. Resolves once the
|
|
233
|
+
* watcher is armed; the returned function stops it.
|
|
234
|
+
*/
|
|
235
|
+
export async function watchWorkspaceActivity(workspace, layout, onActivity) {
|
|
236
|
+
const watcher = chokidar.watch(workspace, {
|
|
237
|
+
ignoreInitial: true,
|
|
238
|
+
persistent: true,
|
|
239
|
+
ignored: (path) => {
|
|
240
|
+
const rel = portableWorkspacePath(relative(workspace, path));
|
|
241
|
+
return rel.split('/').some((segment) => IGNORED_SEGMENTS.has(segment));
|
|
242
|
+
},
|
|
243
|
+
});
|
|
244
|
+
const report = (path) => {
|
|
245
|
+
const activity = classifyWorkspaceFile(relative(workspace, path), layout);
|
|
246
|
+
if (activity)
|
|
247
|
+
onActivity(activity);
|
|
248
|
+
};
|
|
249
|
+
watcher.on('add', report);
|
|
250
|
+
watcher.on('change', report);
|
|
251
|
+
watcher.on('error', () => undefined);
|
|
252
|
+
await new Promise((resolveReady) => {
|
|
253
|
+
const timer = setTimeout(resolveReady, 5_000);
|
|
254
|
+
timer.unref?.();
|
|
255
|
+
watcher.once('ready', () => {
|
|
256
|
+
clearTimeout(timer);
|
|
257
|
+
resolveReady();
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
return async () => {
|
|
261
|
+
try {
|
|
262
|
+
await watcher.close();
|
|
263
|
+
}
|
|
264
|
+
catch {
|
|
265
|
+
// A watcher that already stopped has nothing left to release.
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
//# sourceMappingURL=authoring-progress.js.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { runAuthor } from './author.js';
|
|
2
|
+
import { type PromptIo } from './prompts.js';
|
|
3
|
+
import { installSchedule, removeSchedule, scheduleState } from './schedule.js';
|
|
4
|
+
import { type CreateSyncRunOptions } from './sync-runs.js';
|
|
5
|
+
import type { DoxloopProject, SyncConfig, SyncMode, SyncRunTrigger, SyncTrigger } from './types.js';
|
|
6
|
+
export declare function replaySyncSetupCommand(sync: SyncConfig): string;
|
|
7
|
+
export declare function parseTriggerList(raw: string): SyncTrigger[];
|
|
8
|
+
export declare function parseSyncMode(raw: string): SyncMode;
|
|
9
|
+
/** Use provider APIs whenever a remote source is configured. */
|
|
10
|
+
export declare function computeConfiguredDrift(root: string, project: DoxloopProject): Promise<import("./types.js").DriftResult>;
|
|
11
|
+
/** The native scheduler, replaceable in tests so no real job is registered. */
|
|
12
|
+
export interface SyncScheduler {
|
|
13
|
+
install: typeof installSchedule;
|
|
14
|
+
remove: typeof removeSchedule;
|
|
15
|
+
state: typeof scheduleState;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Apply a sync configuration: persist it, then make the local machine match it.
|
|
19
|
+
* Installing and removing are the same operation with different inputs, so a
|
|
20
|
+
* project can move between trigger sets without leaving orphaned jobs behind.
|
|
21
|
+
* Local folders are checked in place: a Git checkout by its HEAD commit and
|
|
22
|
+
* working tree, any other folder by the content it held at the last sync.
|
|
23
|
+
* Nothing is fetched, pulled, or written in the source, so a local folder
|
|
24
|
+
* needs no remote to be scheduled.
|
|
25
|
+
*/
|
|
26
|
+
export declare function applySyncConfig(root: string, project: DoxloopProject, sync: SyncConfig, scheduler?: SyncScheduler): Promise<string[]>;
|
|
27
|
+
export declare function runSyncSetupWizard(options: {
|
|
28
|
+
root: string;
|
|
29
|
+
project: DoxloopProject;
|
|
30
|
+
io: PromptIo;
|
|
31
|
+
}): Promise<SyncConfig | undefined>;
|
|
32
|
+
/**
|
|
33
|
+
* Prove the automation can actually run before anyone depends on it. An expired
|
|
34
|
+
* agent sign-in is the most common silent failure for unattended runs, so it is
|
|
35
|
+
* checked here rather than discovered at 09:00 three weeks later.
|
|
36
|
+
*/
|
|
37
|
+
export declare function formatSyncStatus(root: string, project: DoxloopProject): Promise<string>;
|
|
38
|
+
/**
|
|
39
|
+
* One full maintenance cycle. Detection always runs; authoring runs only when
|
|
40
|
+
* the mode allows it, the configured branch is checked out, and the run budget
|
|
41
|
+
* has not been spent.
|
|
42
|
+
*/
|
|
43
|
+
interface RunSyncOptions {
|
|
44
|
+
root: string;
|
|
45
|
+
project: DoxloopProject;
|
|
46
|
+
quiet?: boolean;
|
|
47
|
+
trigger?: SyncRunTrigger;
|
|
48
|
+
/** Test seam; production callers always use the real author runner. */
|
|
49
|
+
author?: typeof runAuthor;
|
|
50
|
+
/** Manual authoring request and controls supplied by the workspace UI. */
|
|
51
|
+
authoring?: CreateSyncRunOptions['authoring'];
|
|
52
|
+
}
|
|
53
|
+
export declare function runSyncNow(options: RunSyncOptions): Promise<number>;
|
|
54
|
+
export declare function disableSync(root: string, project: DoxloopProject): Promise<string[]>;
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=autosync.d.ts.map
|