@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,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent output formatters. Every unattended agent streams machine-readable
|
|
3
|
+
* events on stdout; each formatter turns its agent's stream into the same
|
|
4
|
+
* concise one-line activity summaries so the control center's live log reads
|
|
5
|
+
* the same whichever agent is running, and reports tool calls so stage
|
|
6
|
+
* progress can be derived from what the agent does.
|
|
7
|
+
*/
|
|
8
|
+
import type { AgentName, AgentUsage } from './types.js';
|
|
9
|
+
export interface AgentLogFormatter {
|
|
10
|
+
/** Why the agent stopped without a successful result, once it reported one. */
|
|
11
|
+
stopReason: string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* True when the agent stopped because of a transient failure outside the
|
|
14
|
+
* task, such as an API server error mid-response, so the same session can
|
|
15
|
+
* be resumed instead of the run failing.
|
|
16
|
+
*/
|
|
17
|
+
transientFailure?: boolean;
|
|
18
|
+
/** The agent's own session id, when it reported one, so the session can be resumed. */
|
|
19
|
+
sessionId?: string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Token usage this agent session has reported so far, or undefined until the
|
|
22
|
+
* stream carries any. One formatter is one process launch, so `sessions` is
|
|
23
|
+
* always 1 here; callers merge resumed sessions with `mergeAgentUsage`.
|
|
24
|
+
*/
|
|
25
|
+
readonly usage: AgentUsage | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Called for every tool call the agent makes. Tool names and inputs are
|
|
28
|
+
* normalized to Claude's vocabulary (`Bash` with `command`, `Write` with
|
|
29
|
+
* `file_path`, `mcp__<server>__<tool>`) so one classifier serves every agent.
|
|
30
|
+
*/
|
|
31
|
+
onToolCall: ((tool: string, input: JsonRecord) => void) | undefined;
|
|
32
|
+
push(chunk: Buffer | string): string[];
|
|
33
|
+
finish(): string[];
|
|
34
|
+
/**
|
|
35
|
+
* What the agent is doing while its stream is quiet. Once nothing has been
|
|
36
|
+
* written for the heartbeat interval this returns one progress line naming
|
|
37
|
+
* the current phase and how long it has lasted — thinking, writing a long
|
|
38
|
+
* reply, or waiting for a tool call — so a silent stretch reads as
|
|
39
|
+
* progress instead of a hang. Callers poll it on a timer; `push` also
|
|
40
|
+
* checks it, so a stream that is busy but prints nothing reports too.
|
|
41
|
+
*/
|
|
42
|
+
heartbeat(now?: number): string[];
|
|
43
|
+
}
|
|
44
|
+
export interface AgentLogFormatterOptions {
|
|
45
|
+
/** Clock override for tests. */
|
|
46
|
+
now?: () => number;
|
|
47
|
+
/** Quiet time before a heartbeat line is written. */
|
|
48
|
+
heartbeatMs?: number;
|
|
49
|
+
}
|
|
50
|
+
/** Quiet time before a formatter names what the agent is doing. */
|
|
51
|
+
export declare const AGENT_LOG_HEARTBEAT_MS = 30000;
|
|
52
|
+
export declare function createAgentLogFormatter(agent: AgentName, options?: AgentLogFormatterOptions): AgentLogFormatter;
|
|
53
|
+
export type JsonRecord = Record<string, unknown>;
|
|
54
|
+
/**
|
|
55
|
+
* Combine the usage of several agent sessions (a run that resumed, or the
|
|
56
|
+
* plan and authoring phases of one request) into one total. Counters,
|
|
57
|
+
* sessions, turns, and durations add up; the context high-water mark is the
|
|
58
|
+
* largest seen; cost is present when any part reported one.
|
|
59
|
+
*/
|
|
60
|
+
export declare function mergeAgentUsage(...parts: Array<AgentUsage | undefined>): AgentUsage | undefined;
|
|
61
|
+
/** `1234` → `1.2k`, `1_234_567` → `1.2M`; whole thousands drop the `.0`. */
|
|
62
|
+
export declare function formatTokenCount(count: number): string;
|
|
63
|
+
/**
|
|
64
|
+
* One line for the UI: `1.2M tokens · 98% cached · $1.42 · 3 sessions`. Cost
|
|
65
|
+
* is omitted when the agent never reported one; sessions when there was one.
|
|
66
|
+
*/
|
|
67
|
+
export declare function formatAgentUsage(usage: AgentUsage): string;
|
|
68
|
+
/** Convert Claude Code's JSONL stream into concise, durable UI log lines. */
|
|
69
|
+
export declare class ClaudeStreamLogFormatter implements AgentLogFormatter {
|
|
70
|
+
private buffer;
|
|
71
|
+
private readonly blocks;
|
|
72
|
+
private readonly tools;
|
|
73
|
+
private readonly now;
|
|
74
|
+
private readonly pulse;
|
|
75
|
+
private streamedContent;
|
|
76
|
+
private lastText;
|
|
77
|
+
/** Why Claude stopped without a successful result, once its result event arrives. */
|
|
78
|
+
stopReason: string | undefined;
|
|
79
|
+
/** True when the stop was a transient API failure rather than a task outcome. */
|
|
80
|
+
transientFailure: boolean;
|
|
81
|
+
/** Claude's session id from its init event, so a cut-off session can be resumed. */
|
|
82
|
+
sessionId: string | undefined;
|
|
83
|
+
/** Called for every tool call Claude makes, with the parsed input when it is readable. */
|
|
84
|
+
onToolCall: ((tool: string, input: JsonRecord) => void) | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Usage per assistant message id. With `--include-partial-messages` the same
|
|
87
|
+
* assistant message is emitted once per content block, each carrying that
|
|
88
|
+
* message's usage, so the last report per id wins instead of adding up.
|
|
89
|
+
*/
|
|
90
|
+
private readonly messageUsage;
|
|
91
|
+
/** Assistant messages that carried usage but no id; nothing to de-duplicate on. */
|
|
92
|
+
private anonymousUsage;
|
|
93
|
+
private maxContextTokens;
|
|
94
|
+
/** The result event's cumulative usage, preferred over the running sum once it arrives. */
|
|
95
|
+
private resultTokens;
|
|
96
|
+
private resultTurns;
|
|
97
|
+
private resultDurationMs;
|
|
98
|
+
private resultCostUsd;
|
|
99
|
+
private readonly clock;
|
|
100
|
+
constructor(options?: AgentLogFormatterOptions);
|
|
101
|
+
heartbeat(now?: number): string[];
|
|
102
|
+
get usage(): AgentUsage | undefined;
|
|
103
|
+
push(chunk: Buffer | string): string[];
|
|
104
|
+
finish(): string[];
|
|
105
|
+
private formatLine;
|
|
106
|
+
private formatStreamEvent;
|
|
107
|
+
/** Claude Code runs the tool as soon as its call is complete; the result arrives as a user message. */
|
|
108
|
+
private beginToolCall;
|
|
109
|
+
/** A block or tool result just ended: the next event is either another tool result or Claude's own. */
|
|
110
|
+
private awaitNextStep;
|
|
111
|
+
private recordAssistantUsage;
|
|
112
|
+
/**
|
|
113
|
+
* The result event's totals: its `usage` object when present, else the sum
|
|
114
|
+
* of its per-model `modelUsage` map, else nothing (the running sum stands).
|
|
115
|
+
*/
|
|
116
|
+
private recordResultUsage;
|
|
117
|
+
private formatAssistantMessage;
|
|
118
|
+
private formatToolResults;
|
|
119
|
+
private formatSystem;
|
|
120
|
+
private formatResult;
|
|
121
|
+
private textLines;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Failures that come from the Claude API or the network rather than from the
|
|
125
|
+
* task: the session is intact and continues where it stopped when resumed.
|
|
126
|
+
*/
|
|
127
|
+
export declare function isTransientClaudeApiFailure(text: string): boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Codex `exec --json` emits one JSON object per line: thread and turn
|
|
130
|
+
* lifecycle events plus `item.started` / `item.completed` for each message,
|
|
131
|
+
* command, file change, and MCP call.
|
|
132
|
+
*/
|
|
133
|
+
export declare class CodexStreamLogFormatter implements AgentLogFormatter {
|
|
134
|
+
private readonly lines;
|
|
135
|
+
/** Items Codex has started, by id, with the time they started. */
|
|
136
|
+
private readonly startedItems;
|
|
137
|
+
private readonly now;
|
|
138
|
+
private readonly pulse;
|
|
139
|
+
private lastText;
|
|
140
|
+
stopReason: string | undefined;
|
|
141
|
+
onToolCall: ((tool: string, input: JsonRecord) => void) | undefined;
|
|
142
|
+
/** Sum of every `turn.completed` usage, or the last cumulative `token_count` total when the stream carries one. */
|
|
143
|
+
private tokens;
|
|
144
|
+
private turns;
|
|
145
|
+
private maxContextTokens;
|
|
146
|
+
private readonly clock;
|
|
147
|
+
constructor(options?: AgentLogFormatterOptions);
|
|
148
|
+
heartbeat(now?: number): string[];
|
|
149
|
+
get usage(): AgentUsage | undefined;
|
|
150
|
+
/**
|
|
151
|
+
* Codex counts cached prompt tokens inside `input_tokens`; Claude reports
|
|
152
|
+
* them separately. Split them out so "input" means uncached input for every
|
|
153
|
+
* agent and the four counters add up to the total either way.
|
|
154
|
+
*/
|
|
155
|
+
private static tokensOf;
|
|
156
|
+
push(chunk: Buffer | string): string[];
|
|
157
|
+
finish(): string[];
|
|
158
|
+
private formatLine;
|
|
159
|
+
private itemStarted;
|
|
160
|
+
private itemCompleted;
|
|
161
|
+
private activity;
|
|
162
|
+
/** Report the call in Claude's tool vocabulary so one classifier fits all agents. */
|
|
163
|
+
private reportTool;
|
|
164
|
+
private textLines;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Gemini CLI `--output-format stream-json` emits init, message, tool_use,
|
|
168
|
+
* tool_result, error, and result events. Assistant text arrives as deltas
|
|
169
|
+
* that are joined until the next event of another kind.
|
|
170
|
+
*/
|
|
171
|
+
export declare class GeminiStreamLogFormatter implements AgentLogFormatter {
|
|
172
|
+
private readonly lines;
|
|
173
|
+
private readonly tools;
|
|
174
|
+
private readonly now;
|
|
175
|
+
private readonly pulse;
|
|
176
|
+
private assistantText;
|
|
177
|
+
private lastText;
|
|
178
|
+
stopReason: string | undefined;
|
|
179
|
+
onToolCall: ((tool: string, input: JsonRecord) => void) | undefined;
|
|
180
|
+
/** Set from the result event's `stats` when it carries token counts; Gemini reports nothing per message. */
|
|
181
|
+
usage: AgentUsage | undefined;
|
|
182
|
+
private readonly clock;
|
|
183
|
+
constructor(options?: AgentLogFormatterOptions);
|
|
184
|
+
heartbeat(now?: number): string[];
|
|
185
|
+
push(chunk: Buffer | string): string[];
|
|
186
|
+
finish(): string[];
|
|
187
|
+
private formatLine;
|
|
188
|
+
private reportTool;
|
|
189
|
+
private flushText;
|
|
190
|
+
private textLines;
|
|
191
|
+
}
|
|
192
|
+
export declare function compactLogText(value: string, maximum?: number): string;
|
|
193
|
+
export declare function formatLogDuration(milliseconds: number): string;
|
|
194
|
+
export declare function jsonRecord(value: unknown): JsonRecord | undefined;
|
|
195
|
+
export declare function stringField(record: JsonRecord, key: string): string | undefined;
|
|
196
|
+
export declare function numberField(record: JsonRecord, key: string): number | undefined;
|
|
197
|
+
//# sourceMappingURL=agent-log.d.ts.map
|