voratiq 0.1.0-beta.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/LICENSE +21 -0
- package/README.md +59 -0
- package/dist/auth/providers/claude/constants.d.ts +7 -0
- package/dist/auth/providers/claude/constants.js +9 -0
- package/dist/auth/providers/claude/credentials.d.ts +5 -0
- package/dist/auth/providers/claude/credentials.js +112 -0
- package/dist/auth/providers/claude/error.d.ts +5 -0
- package/dist/auth/providers/claude/error.js +6 -0
- package/dist/auth/providers/claude/keychain.d.ts +4 -0
- package/dist/auth/providers/claude/keychain.js +158 -0
- package/dist/auth/providers/claude.d.ts +2 -0
- package/dist/auth/providers/claude.js +124 -0
- package/dist/auth/providers/codex.d.ts +2 -0
- package/dist/auth/providers/codex.js +93 -0
- package/dist/auth/providers/gemini.d.ts +2 -0
- package/dist/auth/providers/gemini.js +159 -0
- package/dist/auth/providers/index.d.ts +2 -0
- package/dist/auth/providers/index.js +16 -0
- package/dist/auth/providers/messages.d.ts +1 -0
- package/dist/auth/providers/messages.js +3 -0
- package/dist/auth/providers/secret-staging.d.ts +14 -0
- package/dist/auth/providers/secret-staging.js +72 -0
- package/dist/auth/providers/teardown.d.ts +2 -0
- package/dist/auth/providers/teardown.js +6 -0
- package/dist/auth/providers/types.d.ts +31 -0
- package/dist/auth/providers/types.js +1 -0
- package/dist/auth/providers/utils.d.ts +20 -0
- package/dist/auth/providers/utils.js +148 -0
- package/dist/auth/runtime.d.ts +2 -0
- package/dist/auth/runtime.js +17 -0
- package/dist/auth/staging.d.ts +8 -0
- package/dist/auth/staging.js +7 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +142 -0
- package/dist/cli/apply.d.ts +14 -0
- package/dist/cli/apply.js +38 -0
- package/dist/cli/commander-utils.d.ts +3 -0
- package/dist/cli/commander-utils.js +27 -0
- package/dist/cli/confirmation.d.ts +14 -0
- package/dist/cli/confirmation.js +16 -0
- package/dist/cli/errors.d.ts +5 -0
- package/dist/cli/errors.js +16 -0
- package/dist/cli/init.d.ts +10 -0
- package/dist/cli/init.js +41 -0
- package/dist/cli/list.d.ts +14 -0
- package/dist/cli/list.js +48 -0
- package/dist/cli/output.d.ts +14 -0
- package/dist/cli/output.js +62 -0
- package/dist/cli/prune.d.ts +14 -0
- package/dist/cli/prune.js +54 -0
- package/dist/cli/review.d.ts +12 -0
- package/dist/cli/review.js +33 -0
- package/dist/cli/run.d.ts +13 -0
- package/dist/cli/run.js +51 -0
- package/dist/commands/apply/command.d.ts +9 -0
- package/dist/commands/apply/command.js +135 -0
- package/dist/commands/apply/errors.d.ts +35 -0
- package/dist/commands/apply/errors.js +73 -0
- package/dist/commands/apply/types.d.ts +13 -0
- package/dist/commands/apply/types.js +1 -0
- package/dist/commands/errors.d.ts +4 -0
- package/dist/commands/errors.js +7 -0
- package/dist/commands/fetch.d.ts +8 -0
- package/dist/commands/fetch.js +25 -0
- package/dist/commands/init/agents.d.ts +3 -0
- package/dist/commands/init/agents.js +159 -0
- package/dist/commands/init/command.d.ts +2 -0
- package/dist/commands/init/command.js +40 -0
- package/dist/commands/init/environment.d.ts +2 -0
- package/dist/commands/init/environment.js +76 -0
- package/dist/commands/init/evals.d.ts +4 -0
- package/dist/commands/init/evals.js +219 -0
- package/dist/commands/init/types.d.ts +48 -0
- package/dist/commands/init/types.js +1 -0
- package/dist/commands/list/command.d.ts +13 -0
- package/dist/commands/list/command.js +60 -0
- package/dist/commands/prune/command.d.ts +2 -0
- package/dist/commands/prune/command.js +336 -0
- package/dist/commands/prune/errors.d.ts +20 -0
- package/dist/commands/prune/errors.js +39 -0
- package/dist/commands/prune/types.d.ts +42 -0
- package/dist/commands/prune/types.js +1 -0
- package/dist/commands/review/command.d.ts +10 -0
- package/dist/commands/review/command.js +26 -0
- package/dist/commands/run/agent-execution.d.ts +19 -0
- package/dist/commands/run/agent-execution.js +63 -0
- package/dist/commands/run/agents/auth-stage.d.ts +23 -0
- package/dist/commands/run/agents/auth-stage.js +108 -0
- package/dist/commands/run/agents/chat-preserver.d.ts +9 -0
- package/dist/commands/run/agents/chat-preserver.js +35 -0
- package/dist/commands/run/agents/eval-runner.d.ts +19 -0
- package/dist/commands/run/agents/eval-runner.js +27 -0
- package/dist/commands/run/agents/failures.d.ts +7 -0
- package/dist/commands/run/agents/failures.js +32 -0
- package/dist/commands/run/agents/lifecycle.d.ts +9 -0
- package/dist/commands/run/agents/lifecycle.js +157 -0
- package/dist/commands/run/agents/preparation.d.ts +2 -0
- package/dist/commands/run/agents/preparation.js +123 -0
- package/dist/commands/run/agents/run-context.d.ts +46 -0
- package/dist/commands/run/agents/run-context.js +193 -0
- package/dist/commands/run/agents/sandbox-launcher.d.ts +44 -0
- package/dist/commands/run/agents/sandbox-launcher.js +211 -0
- package/dist/commands/run/agents/types.d.ts +47 -0
- package/dist/commands/run/agents/types.js +1 -0
- package/dist/commands/run/agents/watchdog.d.ts +39 -0
- package/dist/commands/run/agents/watchdog.js +172 -0
- package/dist/commands/run/agents/workspace-prep.d.ts +17 -0
- package/dist/commands/run/agents/workspace-prep.js +78 -0
- package/dist/commands/run/agents.d.ts +14 -0
- package/dist/commands/run/agents.js +47 -0
- package/dist/commands/run/argv.d.ts +1 -0
- package/dist/commands/run/argv.js +19 -0
- package/dist/commands/run/command.d.ts +14 -0
- package/dist/commands/run/command.js +170 -0
- package/dist/commands/run/errors.d.ts +61 -0
- package/dist/commands/run/errors.js +86 -0
- package/dist/commands/run/id.d.ts +1 -0
- package/dist/commands/run/id.js +22 -0
- package/dist/commands/run/lifecycle.d.ts +19 -0
- package/dist/commands/run/lifecycle.js +186 -0
- package/dist/commands/run/phases.d.ts +11 -0
- package/dist/commands/run/phases.js +1 -0
- package/dist/commands/run/prompts.d.ts +4 -0
- package/dist/commands/run/prompts.js +16 -0
- package/dist/commands/run/record-init.d.ts +15 -0
- package/dist/commands/run/record-init.js +29 -0
- package/dist/commands/run/reports.d.ts +14 -0
- package/dist/commands/run/reports.js +63 -0
- package/dist/commands/run/sandbox-registry.d.ts +4 -0
- package/dist/commands/run/sandbox-registry.js +54 -0
- package/dist/commands/run/sandbox.d.ts +16 -0
- package/dist/commands/run/sandbox.js +96 -0
- package/dist/commands/run/shim/agent-manifest.d.ts +7 -0
- package/dist/commands/run/shim/agent-manifest.js +1 -0
- package/dist/commands/run/shim/run-agent-shim.d.ts +1 -0
- package/dist/commands/run/shim/run-agent-shim.js +232 -0
- package/dist/commands/run/shim/run-agent-shim.mjs +10 -0
- package/dist/commands/run/validation.d.ts +20 -0
- package/dist/commands/run/validation.js +60 -0
- package/dist/configs/agents/defaults.d.ts +9 -0
- package/dist/configs/agents/defaults.js +55 -0
- package/dist/configs/agents/errors.d.ts +40 -0
- package/dist/configs/agents/errors.js +78 -0
- package/dist/configs/agents/loader.d.ts +8 -0
- package/dist/configs/agents/loader.js +137 -0
- package/dist/configs/agents/types.d.ts +39 -0
- package/dist/configs/agents/types.js +31 -0
- package/dist/configs/environment/detect.d.ts +17 -0
- package/dist/configs/environment/detect.js +79 -0
- package/dist/configs/environment/errors.d.ts +12 -0
- package/dist/configs/environment/errors.js +26 -0
- package/dist/configs/environment/loader.d.ts +10 -0
- package/dist/configs/environment/loader.js +80 -0
- package/dist/configs/environment/types.d.ts +21 -0
- package/dist/configs/environment/types.js +98 -0
- package/dist/configs/evals/defaults.d.ts +8 -0
- package/dist/configs/evals/defaults.js +28 -0
- package/dist/configs/evals/detect.d.ts +10 -0
- package/dist/configs/evals/detect.js +224 -0
- package/dist/configs/evals/errors.d.ts +16 -0
- package/dist/configs/evals/errors.js +29 -0
- package/dist/configs/evals/loader.d.ts +9 -0
- package/dist/configs/evals/loader.js +46 -0
- package/dist/configs/evals/types.d.ts +42 -0
- package/dist/configs/evals/types.js +74 -0
- package/dist/configs/sandbox/defaults.d.ts +14 -0
- package/dist/configs/sandbox/defaults.js +54 -0
- package/dist/configs/sandbox/errors.d.ts +5 -0
- package/dist/configs/sandbox/errors.js +8 -0
- package/dist/configs/sandbox/loader.d.ts +6 -0
- package/dist/configs/sandbox/loader.js +192 -0
- package/dist/configs/sandbox/merge.d.ts +9 -0
- package/dist/configs/sandbox/merge.js +94 -0
- package/dist/configs/sandbox/schemas.d.ts +58 -0
- package/dist/configs/sandbox/schemas.js +72 -0
- package/dist/configs/sandbox/types.d.ts +34 -0
- package/dist/configs/sandbox/types.js +1 -0
- package/dist/configs/shared/loader-factory.d.ts +19 -0
- package/dist/configs/shared/loader-factory.js +33 -0
- package/dist/configs/shared/yaml-error-formatter.d.ts +40 -0
- package/dist/configs/shared/yaml-error-formatter.js +41 -0
- package/dist/evals/runner.d.ts +16 -0
- package/dist/evals/runner.js +132 -0
- package/dist/preflight/errors.d.ts +10 -0
- package/dist/preflight/errors.js +21 -0
- package/dist/preflight/index.d.ts +30 -0
- package/dist/preflight/index.js +157 -0
- package/dist/records/enhanced.d.ts +38 -0
- package/dist/records/enhanced.js +139 -0
- package/dist/records/errors.d.ts +23 -0
- package/dist/records/errors.js +43 -0
- package/dist/records/history-lock.d.ts +27 -0
- package/dist/records/history-lock.js +184 -0
- package/dist/records/mutators.d.ts +17 -0
- package/dist/records/mutators.js +144 -0
- package/dist/records/persistence.d.ts +95 -0
- package/dist/records/persistence.js +459 -0
- package/dist/records/types.d.ts +238 -0
- package/dist/records/types.js +131 -0
- package/dist/render/interactions/confirmation.d.ts +19 -0
- package/dist/render/interactions/confirmation.js +63 -0
- package/dist/render/transcripts/apply.d.ts +2 -0
- package/dist/render/transcripts/apply.js +52 -0
- package/dist/render/transcripts/init.d.ts +18 -0
- package/dist/render/transcripts/init.js +84 -0
- package/dist/render/transcripts/list.d.ts +3 -0
- package/dist/render/transcripts/list.js +44 -0
- package/dist/render/transcripts/prune.d.ts +16 -0
- package/dist/render/transcripts/prune.js +50 -0
- package/dist/render/transcripts/review.d.ts +2 -0
- package/dist/render/transcripts/review.js +36 -0
- package/dist/render/transcripts/run.d.ts +25 -0
- package/dist/render/transcripts/run.js +295 -0
- package/dist/render/transcripts/shared.d.ts +12 -0
- package/dist/render/transcripts/shared.js +41 -0
- package/dist/render/utils/agents.d.ts +28 -0
- package/dist/render/utils/agents.js +261 -0
- package/dist/render/utils/badges.d.ts +20 -0
- package/dist/render/utils/badges.js +37 -0
- package/dist/render/utils/errors.d.ts +2 -0
- package/dist/render/utils/errors.js +14 -0
- package/dist/render/utils/records.d.ts +1 -0
- package/dist/render/utils/records.js +32 -0
- package/dist/render/utils/runs.d.ts +16 -0
- package/dist/render/utils/runs.js +50 -0
- package/dist/render/utils/table.d.ts +12 -0
- package/dist/render/utils/table.js +32 -0
- package/dist/render/utils/transcript.d.ts +14 -0
- package/dist/render/utils/transcript.js +44 -0
- package/dist/status/colors.d.ts +10 -0
- package/dist/status/colors.js +33 -0
- package/dist/status/index.d.ts +37 -0
- package/dist/status/index.js +30 -0
- package/dist/testing/test-hooks.d.ts +7 -0
- package/dist/testing/test-hooks.js +16 -0
- package/dist/utils/binaries.d.ts +1 -0
- package/dist/utils/binaries.js +13 -0
- package/dist/utils/cli-root.d.ts +2 -0
- package/dist/utils/cli-root.js +42 -0
- package/dist/utils/colors.d.ts +2 -0
- package/dist/utils/colors.js +23 -0
- package/dist/utils/diff.d.ts +9 -0
- package/dist/utils/diff.js +61 -0
- package/dist/utils/env.d.ts +10 -0
- package/dist/utils/env.js +56 -0
- package/dist/utils/errors.d.ts +31 -0
- package/dist/utils/errors.js +53 -0
- package/dist/utils/fs.d.ts +13 -0
- package/dist/utils/fs.js +70 -0
- package/dist/utils/git.d.ts +40 -0
- package/dist/utils/git.js +126 -0
- package/dist/utils/output.d.ts +4 -0
- package/dist/utils/output.js +12 -0
- package/dist/utils/path.d.ts +11 -0
- package/dist/utils/path.js +84 -0
- package/dist/utils/process.d.ts +37 -0
- package/dist/utils/process.js +152 -0
- package/dist/utils/terminal.d.ts +5 -0
- package/dist/utils/terminal.js +5 -0
- package/dist/utils/validators.d.ts +1 -0
- package/dist/utils/validators.js +15 -0
- package/dist/utils/version.d.ts +1 -0
- package/dist/utils/version.js +25 -0
- package/dist/utils/yaml-reader.d.ts +14 -0
- package/dist/utils/yaml-reader.js +41 -0
- package/dist/utils/yaml.d.ts +33 -0
- package/dist/utils/yaml.js +75 -0
- package/dist/workspace/agents.d.ts +33 -0
- package/dist/workspace/agents.js +189 -0
- package/dist/workspace/chat/artifacts.d.ts +14 -0
- package/dist/workspace/chat/artifacts.js +157 -0
- package/dist/workspace/chat/sources.d.ts +5 -0
- package/dist/workspace/chat/sources.js +80 -0
- package/dist/workspace/chat/types.d.ts +1 -0
- package/dist/workspace/chat/types.js +1 -0
- package/dist/workspace/cleanup.d.ts +4 -0
- package/dist/workspace/cleanup.js +12 -0
- package/dist/workspace/credential-guard.d.ts +4 -0
- package/dist/workspace/credential-guard.js +71 -0
- package/dist/workspace/dependencies.d.ts +23 -0
- package/dist/workspace/dependencies.js +190 -0
- package/dist/workspace/errors.d.ts +16 -0
- package/dist/workspace/errors.js +43 -0
- package/dist/workspace/layout.d.ts +30 -0
- package/dist/workspace/layout.js +124 -0
- package/dist/workspace/prune.d.ts +8 -0
- package/dist/workspace/prune.js +29 -0
- package/dist/workspace/run.d.ts +14 -0
- package/dist/workspace/run.js +28 -0
- package/dist/workspace/sandbox-requirements.d.ts +17 -0
- package/dist/workspace/sandbox-requirements.js +69 -0
- package/dist/workspace/setup.d.ts +3 -0
- package/dist/workspace/setup.js +81 -0
- package/dist/workspace/shim.d.ts +4 -0
- package/dist/workspace/shim.js +65 -0
- package/dist/workspace/structure.d.ts +77 -0
- package/dist/workspace/structure.js +134 -0
- package/dist/workspace/templates.d.ts +9 -0
- package/dist/workspace/templates.js +66 -0
- package/dist/workspace/types.d.ts +4 -0
- package/dist/workspace/types.js +1 -0
- package/package.json +82 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { formatErrorMessage } from "../../utils/output.js";
|
|
2
|
+
import { renderTranscript } from "./transcript.js";
|
|
3
|
+
export function renderCliError(error) {
|
|
4
|
+
const sections = [];
|
|
5
|
+
const primary = [formatErrorMessage(error.headline)];
|
|
6
|
+
if (error.detailLines.length > 0) {
|
|
7
|
+
primary.push("", ...error.detailLines);
|
|
8
|
+
}
|
|
9
|
+
sections.push(primary);
|
|
10
|
+
if (error.hintLines.length > 0) {
|
|
11
|
+
sections.push([...error.hintLines]);
|
|
12
|
+
}
|
|
13
|
+
return renderTranscript({ sections });
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatRunTimestamp(isoTimestamp: string): string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const RUN_TIME_ZONE = "America/Los_Angeles";
|
|
2
|
+
const RUN_TIMESTAMP_FORMAT = new Intl.DateTimeFormat("en-CA", {
|
|
3
|
+
timeZone: RUN_TIME_ZONE,
|
|
4
|
+
year: "numeric",
|
|
5
|
+
month: "2-digit",
|
|
6
|
+
day: "2-digit",
|
|
7
|
+
hour: "2-digit",
|
|
8
|
+
minute: "2-digit",
|
|
9
|
+
hour12: false,
|
|
10
|
+
});
|
|
11
|
+
export function formatRunTimestamp(isoTimestamp) {
|
|
12
|
+
try {
|
|
13
|
+
const date = new Date(isoTimestamp);
|
|
14
|
+
if (Number.isNaN(date.getTime())) {
|
|
15
|
+
return isoTimestamp;
|
|
16
|
+
}
|
|
17
|
+
const parts = RUN_TIMESTAMP_FORMAT.formatToParts(date);
|
|
18
|
+
const lookup = (type) => parts.find((part) => part.type === type)?.value;
|
|
19
|
+
const year = lookup("year");
|
|
20
|
+
const month = lookup("month");
|
|
21
|
+
const day = lookup("day");
|
|
22
|
+
const hour = lookup("hour");
|
|
23
|
+
const minute = lookup("minute");
|
|
24
|
+
if (!year || !month || !day || !hour || !minute) {
|
|
25
|
+
return isoTimestamp;
|
|
26
|
+
}
|
|
27
|
+
return `${year}-${month}-${day} ${hour}:${minute}`;
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return isoTimestamp;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { RunStatus } from "../../status/index.js";
|
|
2
|
+
export interface RunDisplayInfo {
|
|
3
|
+
runId: string;
|
|
4
|
+
status?: RunStatus;
|
|
5
|
+
specPath?: string;
|
|
6
|
+
workspacePath?: string;
|
|
7
|
+
createdAt?: string;
|
|
8
|
+
baseRevisionSha?: string;
|
|
9
|
+
}
|
|
10
|
+
type RunMetadataRow = {
|
|
11
|
+
label: string;
|
|
12
|
+
value: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function getRunMetadata(info: RunDisplayInfo): RunMetadataRow[];
|
|
15
|
+
export declare function buildRunMetadataSection(info: RunDisplayInfo): string[];
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { getRunStatusStyle } from "../../status/colors.js";
|
|
2
|
+
import { colorize } from "../../utils/colors.js";
|
|
3
|
+
import { formatRunBadge } from "./badges.js";
|
|
4
|
+
import { renderTable } from "./table.js";
|
|
5
|
+
export function getRunMetadata(info) {
|
|
6
|
+
const detailRows = [
|
|
7
|
+
{ label: "Created", value: info.createdAt },
|
|
8
|
+
{ label: "Spec", value: info.specPath },
|
|
9
|
+
{ label: "Workspace", value: info.workspacePath },
|
|
10
|
+
{
|
|
11
|
+
label: "Base Revision",
|
|
12
|
+
value: info.baseRevisionSha
|
|
13
|
+
? info.baseRevisionSha.slice(0, 8)
|
|
14
|
+
: undefined,
|
|
15
|
+
},
|
|
16
|
+
];
|
|
17
|
+
return detailRows.filter((row) => typeof row.value === "string" && row.value.length > 0);
|
|
18
|
+
}
|
|
19
|
+
export function buildRunMetadataSection(info) {
|
|
20
|
+
const lines = [];
|
|
21
|
+
const badge = formatRunBadge(info.runId);
|
|
22
|
+
if (info.status) {
|
|
23
|
+
const statusStyle = getRunStatusStyle(info.status);
|
|
24
|
+
lines.push(`${badge} ${colorize(info.status.toUpperCase(), statusStyle.cli)}`);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
lines.push(badge);
|
|
28
|
+
}
|
|
29
|
+
const detailRows = getRunMetadata(info);
|
|
30
|
+
if (detailRows.length > 0) {
|
|
31
|
+
const tableLines = renderTable({
|
|
32
|
+
columns: [
|
|
33
|
+
{
|
|
34
|
+
header: "FIELD",
|
|
35
|
+
accessor: (row) => row.label,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
header: "VALUE",
|
|
39
|
+
accessor: (row) => row.value ?? "—",
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
rows: detailRows,
|
|
43
|
+
});
|
|
44
|
+
const [, ...bodyLines] = tableLines;
|
|
45
|
+
if (bodyLines.length > 0) {
|
|
46
|
+
lines.push("", ...bodyLines);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return lines;
|
|
50
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface TableColumn<Row> {
|
|
2
|
+
header: string;
|
|
3
|
+
accessor: (row: Row) => string;
|
|
4
|
+
align?: "left" | "right";
|
|
5
|
+
}
|
|
6
|
+
interface RenderTableOptions<Row> {
|
|
7
|
+
columns: readonly TableColumn<Row>[];
|
|
8
|
+
rows: readonly Row[];
|
|
9
|
+
columnGap?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function renderTable<Row>({ columns, rows, columnGap, }: RenderTableOptions<Row>): string[];
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const ESCAPE_CHARACTER = String.fromCharCode(27);
|
|
2
|
+
const ANSI_PATTERN = new RegExp(`${ESCAPE_CHARACTER}\\[[0-9;]*m`, "g");
|
|
3
|
+
function visibleLength(value) {
|
|
4
|
+
return value.replace(ANSI_PATTERN, "").length;
|
|
5
|
+
}
|
|
6
|
+
function padValue(value, width, align = "left") {
|
|
7
|
+
const length = visibleLength(value);
|
|
8
|
+
if (length >= width) {
|
|
9
|
+
return value;
|
|
10
|
+
}
|
|
11
|
+
const padding = " ".repeat(width - length);
|
|
12
|
+
return align === "right" ? padding + value : value + padding;
|
|
13
|
+
}
|
|
14
|
+
export function renderTable({ columns, rows, columnGap = " ", }) {
|
|
15
|
+
if (columns.length === 0) {
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
18
|
+
const widths = columns.map((column) => {
|
|
19
|
+
const headerLength = visibleLength(column.header);
|
|
20
|
+
const rowLengths = rows.map((row) => visibleLength(column.accessor(row)));
|
|
21
|
+
return Math.max(headerLength, ...rowLengths);
|
|
22
|
+
});
|
|
23
|
+
const headerLine = columns
|
|
24
|
+
.map((column, index) => padValue(column.header, widths[index], column.align))
|
|
25
|
+
.join(columnGap);
|
|
26
|
+
const lines = [headerLine];
|
|
27
|
+
for (const row of rows) {
|
|
28
|
+
const values = columns.map((column, index) => padValue(column.accessor(row), widths[index], column.align));
|
|
29
|
+
lines.push(values.join(columnGap));
|
|
30
|
+
}
|
|
31
|
+
return lines;
|
|
32
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface TranscriptMetadataEntry {
|
|
2
|
+
label: string;
|
|
3
|
+
value?: string | null;
|
|
4
|
+
}
|
|
5
|
+
export interface TranscriptHintOptions {
|
|
6
|
+
message: string;
|
|
7
|
+
requireRerunSuffix?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface TranscriptOptions {
|
|
10
|
+
metadata?: TranscriptMetadataEntry[];
|
|
11
|
+
sections?: string[][];
|
|
12
|
+
hint?: TranscriptHintOptions;
|
|
13
|
+
}
|
|
14
|
+
export declare function renderTranscript({ metadata, sections, hint, }: TranscriptOptions): string;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export function renderTranscript({ metadata = [], sections = [], hint, }) {
|
|
2
|
+
const lines = [];
|
|
3
|
+
const metadataLines = metadata
|
|
4
|
+
.filter((entry) => {
|
|
5
|
+
return typeof entry.value === "string" && entry.value.length > 0;
|
|
6
|
+
})
|
|
7
|
+
.map((entry) => `${entry.label}: ${entry.value}`);
|
|
8
|
+
if (metadataLines.length > 0) {
|
|
9
|
+
lines.push(...metadataLines, "");
|
|
10
|
+
}
|
|
11
|
+
sections.forEach((block, index) => {
|
|
12
|
+
if (block.length === 0) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
lines.push(...block);
|
|
16
|
+
if (index < sections.length - 1) {
|
|
17
|
+
lines.push("");
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
if (hint) {
|
|
21
|
+
const resolvedHint = resolveHint(hint);
|
|
22
|
+
if (sections.length > 0 || metadataLines.length > 0) {
|
|
23
|
+
lines.push("");
|
|
24
|
+
}
|
|
25
|
+
lines.push(resolvedHint);
|
|
26
|
+
}
|
|
27
|
+
return trimTrailingBlankLines(lines).join("\n");
|
|
28
|
+
}
|
|
29
|
+
function withRerunHint(message) {
|
|
30
|
+
return message.endsWith(" and rerun.") ? message : `${message} and rerun.`;
|
|
31
|
+
}
|
|
32
|
+
function resolveHint(hint) {
|
|
33
|
+
if (hint.requireRerunSuffix) {
|
|
34
|
+
return withRerunHint(hint.message);
|
|
35
|
+
}
|
|
36
|
+
return hint.message;
|
|
37
|
+
}
|
|
38
|
+
function trimTrailingBlankLines(lines) {
|
|
39
|
+
let end = lines.length;
|
|
40
|
+
while (end > 0 && lines[end - 1]?.trim() === "") {
|
|
41
|
+
end -= 1;
|
|
42
|
+
}
|
|
43
|
+
return lines.slice(0, end);
|
|
44
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EvalStatus } from "../configs/evals/types.js";
|
|
2
|
+
import type { TerminalColor } from "../utils/colors.js";
|
|
3
|
+
import type { AgentStatus, RunStatus } from "./index.js";
|
|
4
|
+
interface StatusStyle {
|
|
5
|
+
cli: TerminalColor;
|
|
6
|
+
}
|
|
7
|
+
export declare function getAgentStatusStyle(status: AgentStatus): StatusStyle;
|
|
8
|
+
export declare function getEvalStatusStyle(status: EvalStatus): StatusStyle;
|
|
9
|
+
export declare function getRunStatusStyle(status: RunStatus): StatusStyle;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const agentStatusStyles = {
|
|
2
|
+
succeeded: { cli: "green" },
|
|
3
|
+
failed: { cli: "red" },
|
|
4
|
+
errored: { cli: "red" },
|
|
5
|
+
skipped: { cli: "yellow" },
|
|
6
|
+
aborted: { cli: "yellow" },
|
|
7
|
+
running: { cli: "cyan" },
|
|
8
|
+
queued: { cli: "gray" },
|
|
9
|
+
};
|
|
10
|
+
const evalStatusStyles = {
|
|
11
|
+
succeeded: { cli: "green" },
|
|
12
|
+
failed: { cli: "red" },
|
|
13
|
+
errored: { cli: "red" },
|
|
14
|
+
skipped: { cli: "gray" },
|
|
15
|
+
};
|
|
16
|
+
const runStatusStyles = {
|
|
17
|
+
succeeded: { cli: "green" },
|
|
18
|
+
failed: { cli: "red" },
|
|
19
|
+
errored: { cli: "red" },
|
|
20
|
+
aborted: { cli: "yellow" },
|
|
21
|
+
pruned: { cli: "gray" },
|
|
22
|
+
running: { cli: "cyan" },
|
|
23
|
+
queued: { cli: "gray" },
|
|
24
|
+
};
|
|
25
|
+
export function getAgentStatusStyle(status) {
|
|
26
|
+
return agentStatusStyles[status];
|
|
27
|
+
}
|
|
28
|
+
export function getEvalStatusStyle(status) {
|
|
29
|
+
return evalStatusStyles[status];
|
|
30
|
+
}
|
|
31
|
+
export function getRunStatusStyle(status) {
|
|
32
|
+
return runStatusStyles[status];
|
|
33
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const RUN_STATUS_VALUES: readonly ["queued", "running", "succeeded", "failed", "errored", "aborted", "pruned"];
|
|
3
|
+
export type RunStatus = (typeof RUN_STATUS_VALUES)[number];
|
|
4
|
+
export declare const AGENT_STATUS_VALUES: readonly ["queued", "running", "succeeded", "failed", "errored", "skipped", "aborted"];
|
|
5
|
+
export type AgentStatus = (typeof AGENT_STATUS_VALUES)[number];
|
|
6
|
+
export declare const EVAL_STATUS_VALUES: readonly ["succeeded", "failed", "errored", "skipped"];
|
|
7
|
+
export type EvalStatus = (typeof EVAL_STATUS_VALUES)[number];
|
|
8
|
+
export declare const APPLY_STATUS_VALUES: readonly ["succeeded", "failed"];
|
|
9
|
+
export type ApplyStatus = (typeof APPLY_STATUS_VALUES)[number];
|
|
10
|
+
export declare const runStatusSchema: z.ZodEnum<{
|
|
11
|
+
queued: "queued";
|
|
12
|
+
running: "running";
|
|
13
|
+
succeeded: "succeeded";
|
|
14
|
+
failed: "failed";
|
|
15
|
+
errored: "errored";
|
|
16
|
+
aborted: "aborted";
|
|
17
|
+
pruned: "pruned";
|
|
18
|
+
}>;
|
|
19
|
+
export declare const agentStatusSchema: z.ZodEnum<{
|
|
20
|
+
queued: "queued";
|
|
21
|
+
running: "running";
|
|
22
|
+
succeeded: "succeeded";
|
|
23
|
+
failed: "failed";
|
|
24
|
+
errored: "errored";
|
|
25
|
+
aborted: "aborted";
|
|
26
|
+
skipped: "skipped";
|
|
27
|
+
}>;
|
|
28
|
+
export declare const evalStatusSchema: z.ZodEnum<{
|
|
29
|
+
succeeded: "succeeded";
|
|
30
|
+
failed: "failed";
|
|
31
|
+
errored: "errored";
|
|
32
|
+
skipped: "skipped";
|
|
33
|
+
}>;
|
|
34
|
+
export declare const applyStatusEnum: z.ZodEnum<{
|
|
35
|
+
succeeded: "succeeded";
|
|
36
|
+
failed: "failed";
|
|
37
|
+
}>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const RUN_STATUS_VALUES = [
|
|
3
|
+
"queued",
|
|
4
|
+
"running",
|
|
5
|
+
"succeeded",
|
|
6
|
+
"failed",
|
|
7
|
+
"errored",
|
|
8
|
+
"aborted",
|
|
9
|
+
"pruned",
|
|
10
|
+
];
|
|
11
|
+
export const AGENT_STATUS_VALUES = [
|
|
12
|
+
"queued",
|
|
13
|
+
"running",
|
|
14
|
+
"succeeded",
|
|
15
|
+
"failed",
|
|
16
|
+
"errored",
|
|
17
|
+
"skipped",
|
|
18
|
+
"aborted",
|
|
19
|
+
];
|
|
20
|
+
export const EVAL_STATUS_VALUES = [
|
|
21
|
+
"succeeded",
|
|
22
|
+
"failed",
|
|
23
|
+
"errored",
|
|
24
|
+
"skipped",
|
|
25
|
+
];
|
|
26
|
+
export const APPLY_STATUS_VALUES = ["succeeded", "failed"];
|
|
27
|
+
export const runStatusSchema = z.enum(RUN_STATUS_VALUES);
|
|
28
|
+
export const agentStatusSchema = z.enum(AGENT_STATUS_VALUES);
|
|
29
|
+
export const evalStatusSchema = z.enum(EVAL_STATUS_VALUES);
|
|
30
|
+
export const applyStatusEnum = z.enum(APPLY_STATUS_VALUES);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Explicit opt-in for test-only global hooks. Calling this keeps production
|
|
3
|
+
* bundles clean while giving Jest helpers a single switch to flip.
|
|
4
|
+
*/
|
|
5
|
+
export declare function enableTestHookRegistration(): void;
|
|
6
|
+
export declare function isTestHookRegistrationEnabled(): boolean;
|
|
7
|
+
export declare function assertTestHookRegistrationEnabled(feature: string): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
let testHookRegistrationEnabled = false;
|
|
2
|
+
/**
|
|
3
|
+
* Explicit opt-in for test-only global hooks. Calling this keeps production
|
|
4
|
+
* bundles clean while giving Jest helpers a single switch to flip.
|
|
5
|
+
*/
|
|
6
|
+
export function enableTestHookRegistration() {
|
|
7
|
+
testHookRegistrationEnabled = true;
|
|
8
|
+
}
|
|
9
|
+
export function isTestHookRegistrationEnabled() {
|
|
10
|
+
return testHookRegistrationEnabled;
|
|
11
|
+
}
|
|
12
|
+
export function assertTestHookRegistrationEnabled(feature) {
|
|
13
|
+
if (!testHookRegistrationEnabled) {
|
|
14
|
+
throw new Error(`Test hooks for ${feature} are unavailable. Call enableTestHookRegistration() before accessing ${feature} helpers.`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function detectBinary(command: string): string | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
export function detectBinary(command) {
|
|
3
|
+
const result = spawnSync("bash", ["-lc", `command -v ${command}`], {
|
|
4
|
+
encoding: "utf8",
|
|
5
|
+
});
|
|
6
|
+
if (result.status === 0) {
|
|
7
|
+
const path = result.stdout.trim();
|
|
8
|
+
if (path.length > 0) {
|
|
9
|
+
return path;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { dirname, resolve as resolveNative } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
const PACKAGE_JSON_FILENAME = "package.json";
|
|
5
|
+
const CLI_ROOT_ERROR_MESSAGE = "Unable to locate Voratiq CLI root directory. Ensure the Voratiq binary is running from its install directory.";
|
|
6
|
+
let cachedCliRoot;
|
|
7
|
+
export function resolveCliAssetRoot() {
|
|
8
|
+
if (cachedCliRoot) {
|
|
9
|
+
return cachedCliRoot;
|
|
10
|
+
}
|
|
11
|
+
const helperDirectory = fileURLToPath(new URL(".", import.meta.url));
|
|
12
|
+
const derivedRoot = ascendToPackageRoot(helperDirectory);
|
|
13
|
+
if (derivedRoot) {
|
|
14
|
+
cachedCliRoot = derivedRoot;
|
|
15
|
+
return cachedCliRoot;
|
|
16
|
+
}
|
|
17
|
+
throw buildResolutionError(`Attempted discovery starting from "${helperDirectory}".`);
|
|
18
|
+
}
|
|
19
|
+
export function getCliAssetPath(...segments) {
|
|
20
|
+
const root = resolveCliAssetRoot();
|
|
21
|
+
return resolveNative(root, ...segments);
|
|
22
|
+
}
|
|
23
|
+
function ascendToPackageRoot(start) {
|
|
24
|
+
let current = start;
|
|
25
|
+
while (true) {
|
|
26
|
+
if (isValidCliRoot(current)) {
|
|
27
|
+
return current;
|
|
28
|
+
}
|
|
29
|
+
const parent = dirname(current);
|
|
30
|
+
if (parent === current) {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
current = parent;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function isValidCliRoot(candidate) {
|
|
37
|
+
const packagePath = resolveNative(candidate, PACKAGE_JSON_FILENAME);
|
|
38
|
+
return existsSync(packagePath);
|
|
39
|
+
}
|
|
40
|
+
function buildResolutionError(detail) {
|
|
41
|
+
return new Error(`${CLI_ROOT_ERROR_MESSAGE} ${detail}`);
|
|
42
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
export function colorize(text, color) {
|
|
3
|
+
if (!text) {
|
|
4
|
+
return text;
|
|
5
|
+
}
|
|
6
|
+
switch (color) {
|
|
7
|
+
case "red":
|
|
8
|
+
return chalk.red(text);
|
|
9
|
+
case "green":
|
|
10
|
+
return chalk.green(text);
|
|
11
|
+
case "yellow":
|
|
12
|
+
return chalk.yellow(text);
|
|
13
|
+
case "blue":
|
|
14
|
+
return chalk.blue(text);
|
|
15
|
+
case "magenta":
|
|
16
|
+
return chalk.magenta(text);
|
|
17
|
+
case "cyan":
|
|
18
|
+
return chalk.cyan(text);
|
|
19
|
+
case "gray":
|
|
20
|
+
default:
|
|
21
|
+
return chalk.gray(text);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalize git shortstat output before persisting.
|
|
3
|
+
* Trims surrounding whitespace and guards against oversized strings.
|
|
4
|
+
*/
|
|
5
|
+
export declare function normalizeDiffStatistics(value?: string | null): string | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Produce a compact representation such as `3f +12/-2` for the CHANGES column.
|
|
8
|
+
*/
|
|
9
|
+
export declare function formatCompactDiffStatistics(value?: string | null): string | undefined;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
const MAX_DIFF_STATISTICS_LENGTH = 256;
|
|
2
|
+
const FILES_CHANGED_PATTERN = /(\d+)\s+file/;
|
|
3
|
+
const INSERTIONS_PATTERN = /(\d+)\s+insertion/;
|
|
4
|
+
const DELETIONS_PATTERN = /(\d+)\s+deletion/;
|
|
5
|
+
/**
|
|
6
|
+
* Normalize git shortstat output before persisting.
|
|
7
|
+
* Trims surrounding whitespace and guards against oversized strings.
|
|
8
|
+
*/
|
|
9
|
+
export function normalizeDiffStatistics(value) {
|
|
10
|
+
if (typeof value !== "string") {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
const trimmed = value.trim();
|
|
14
|
+
if (trimmed.length === 0) {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
if (trimmed.length > MAX_DIFF_STATISTICS_LENGTH) {
|
|
18
|
+
return trimmed.slice(0, MAX_DIFF_STATISTICS_LENGTH);
|
|
19
|
+
}
|
|
20
|
+
return trimmed;
|
|
21
|
+
}
|
|
22
|
+
function extractStat(pattern, input) {
|
|
23
|
+
const match = input.match(pattern);
|
|
24
|
+
if (!match) {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
const parsed = Number.parseInt(match[1], 10);
|
|
28
|
+
return Number.isNaN(parsed) ? undefined : parsed;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Produce a compact representation such as `3f +12/-2` for the CHANGES column.
|
|
32
|
+
*/
|
|
33
|
+
export function formatCompactDiffStatistics(value) {
|
|
34
|
+
const normalized = normalizeDiffStatistics(value);
|
|
35
|
+
if (!normalized) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
const files = extractStat(FILES_CHANGED_PATTERN, normalized);
|
|
39
|
+
const insertions = extractStat(INSERTIONS_PATTERN, normalized);
|
|
40
|
+
const deletions = extractStat(DELETIONS_PATTERN, normalized);
|
|
41
|
+
if (files === undefined &&
|
|
42
|
+
insertions === undefined &&
|
|
43
|
+
deletions === undefined) {
|
|
44
|
+
return normalized;
|
|
45
|
+
}
|
|
46
|
+
const parts = [];
|
|
47
|
+
if (files !== undefined) {
|
|
48
|
+
parts.push(`${files}f`);
|
|
49
|
+
}
|
|
50
|
+
const delta = [];
|
|
51
|
+
if (insertions !== undefined) {
|
|
52
|
+
delta.push(`+${insertions}`);
|
|
53
|
+
}
|
|
54
|
+
if (deletions !== undefined) {
|
|
55
|
+
delta.push(`-${deletions}`);
|
|
56
|
+
}
|
|
57
|
+
if (delta.length > 0) {
|
|
58
|
+
parts.push(delta.join("/"));
|
|
59
|
+
}
|
|
60
|
+
return parts.join(" ") || normalized;
|
|
61
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface EnvironmentFilterOptions {
|
|
2
|
+
allow?: readonly string[];
|
|
3
|
+
prefixes?: readonly string[];
|
|
4
|
+
}
|
|
5
|
+
export interface ComposeEnvironmentOptions extends EnvironmentFilterOptions {
|
|
6
|
+
base?: NodeJS.ProcessEnv;
|
|
7
|
+
includeBase?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function composeRestrictedEnvironment(overrides?: NodeJS.ProcessEnv, options?: ComposeEnvironmentOptions): NodeJS.ProcessEnv;
|
|
10
|
+
export declare function filterEnvironmentVariables(source: NodeJS.ProcessEnv, options?: EnvironmentFilterOptions): NodeJS.ProcessEnv;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const DEFAULT_ALLOWED_VARIABLES = [
|
|
2
|
+
"CI",
|
|
3
|
+
"COLUMNS",
|
|
4
|
+
"HOME",
|
|
5
|
+
"HOSTNAME",
|
|
6
|
+
"LANG",
|
|
7
|
+
"LC_ALL",
|
|
8
|
+
"LC_CTYPE",
|
|
9
|
+
"LC_MESSAGES",
|
|
10
|
+
"NODE_OPTIONS",
|
|
11
|
+
"PATH",
|
|
12
|
+
"PWD",
|
|
13
|
+
"SHELL",
|
|
14
|
+
"HTTP_PROXY",
|
|
15
|
+
"HTTPS_PROXY",
|
|
16
|
+
"ALL_PROXY",
|
|
17
|
+
"NO_PROXY",
|
|
18
|
+
"NODE_EXTRA_CA_CERTS",
|
|
19
|
+
"SSL_CERT_FILE",
|
|
20
|
+
"TERM",
|
|
21
|
+
"TMP",
|
|
22
|
+
"TMPDIR",
|
|
23
|
+
"TEMP",
|
|
24
|
+
"TZ",
|
|
25
|
+
"USER",
|
|
26
|
+
"USERNAME",
|
|
27
|
+
"ANTHROPIC_API_KEY",
|
|
28
|
+
"GEMINI_API_KEY",
|
|
29
|
+
"GOOGLE_API_KEY",
|
|
30
|
+
];
|
|
31
|
+
const DEFAULT_ALLOWED_PREFIXES = ["LC_", "VORATIQ_", "SRT_"];
|
|
32
|
+
export function composeRestrictedEnvironment(overrides, options = {}) {
|
|
33
|
+
const includeBase = options.includeBase ?? true;
|
|
34
|
+
const baseEnv = includeBase
|
|
35
|
+
? filterEnvironmentVariables(options.base ?? process.env, options)
|
|
36
|
+
: {};
|
|
37
|
+
return overrides ? { ...baseEnv, ...overrides } : baseEnv;
|
|
38
|
+
}
|
|
39
|
+
export function filterEnvironmentVariables(source, options = {}) {
|
|
40
|
+
const allowedKeys = new Set(options.allow ?? DEFAULT_ALLOWED_VARIABLES);
|
|
41
|
+
const allowedPrefixes = options.prefixes ?? DEFAULT_ALLOWED_PREFIXES;
|
|
42
|
+
const filtered = {};
|
|
43
|
+
for (const [key, value] of Object.entries(source)) {
|
|
44
|
+
if (value === undefined) {
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
if (allowedKeys.has(key)) {
|
|
48
|
+
filtered[key] = value;
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
if (allowedPrefixes.some((prefix) => key.startsWith(prefix))) {
|
|
52
|
+
filtered[key] = value;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return filtered;
|
|
56
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare class GitRepositoryError extends Error {
|
|
2
|
+
constructor(message: string);
|
|
3
|
+
}
|
|
4
|
+
export declare class ValidationError extends Error {
|
|
5
|
+
constructor(message: string);
|
|
6
|
+
}
|
|
7
|
+
export interface HintedErrorOptions {
|
|
8
|
+
readonly detailLines?: readonly string[];
|
|
9
|
+
readonly hintLines?: readonly string[];
|
|
10
|
+
readonly cause?: unknown;
|
|
11
|
+
}
|
|
12
|
+
export declare class HintedError extends Error {
|
|
13
|
+
readonly headline: string;
|
|
14
|
+
readonly detailLines: readonly string[];
|
|
15
|
+
readonly hintLines: readonly string[];
|
|
16
|
+
constructor(headline: string, options?: HintedErrorOptions);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Base class for errors that include a messageForDisplay() method.
|
|
20
|
+
* Reduces boilerplate for errors that return their stored message unchanged.
|
|
21
|
+
*/
|
|
22
|
+
export declare abstract class DisplayableError extends HintedError {
|
|
23
|
+
protected readonly displayMessage: string;
|
|
24
|
+
constructor(message: string, options?: HintedErrorOptions);
|
|
25
|
+
messageForDisplay(): string;
|
|
26
|
+
}
|
|
27
|
+
export declare class GitHeadRequiredError extends HintedError {
|
|
28
|
+
constructor();
|
|
29
|
+
}
|
|
30
|
+
export declare function toErrorMessage(error: unknown): string;
|
|
31
|
+
export declare function toError(error: unknown): Error;
|