toolcraft 0.0.90 → 0.0.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.compile-check.js +8 -1
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +1 -0
- package/dist/error-report.d.ts +11 -0
- package/dist/error-report.js +12 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { S } from "toolcraft-schema";
|
|
2
2
|
import { defineCommand, defineGroup } from "./index.js";
|
|
3
|
-
import { createCLICommandTreeSnapshot, runCLI } from "./cli.js";
|
|
3
|
+
import { createCLICommandTreeSnapshot, renderErrorReport, runCLI } from "./cli.js";
|
|
4
4
|
const ignoredCommand = defineCommand({
|
|
5
5
|
name: "deploy",
|
|
6
6
|
params: S.Object({
|
|
@@ -45,4 +45,11 @@ const ignoredSnapshot = createCLICommandTreeSnapshot(ignoredRoot, {
|
|
|
45
45
|
version: ignoredOptions.version,
|
|
46
46
|
});
|
|
47
47
|
void ignoredSnapshot;
|
|
48
|
+
const ignoredRenderedReport = renderErrorReport({
|
|
49
|
+
command: ignoredCommand,
|
|
50
|
+
env: {},
|
|
51
|
+
error: new Error("fixture"),
|
|
52
|
+
version: "1.0.0",
|
|
53
|
+
});
|
|
54
|
+
void ignoredRenderedReport;
|
|
48
55
|
void ignoredServiceOptions;
|
package/dist/cli.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { configureTheme } from "toolcraft-design";
|
|
|
3
3
|
import type { Group, LogLevel, RuntimeLoggerInput } from "./index.js";
|
|
4
4
|
import { type ErrorReportsOption } from "./error-report.js";
|
|
5
5
|
import type { HumanInLoopRuntimeOptions } from "./human-in-loop/types.js";
|
|
6
|
+
export { renderErrorReport } from "./error-report.js";
|
|
7
|
+
export type { ErrorReportRenderContext, ErrorReportRenderResult } from "./error-report.js";
|
|
6
8
|
export { configureTheme };
|
|
7
9
|
type Casing = "kebab" | "snake";
|
|
8
10
|
export interface CLIControls {
|
package/dist/cli.js
CHANGED
|
@@ -16,6 +16,7 @@ import { renderSourceSnippet } from "./source-snippet.js";
|
|
|
16
16
|
import { enableSourceMaps, formatDebugStack } from "./stack-trim.js";
|
|
17
17
|
import { suggest } from "./suggest.js";
|
|
18
18
|
import { throwValidationErrors } from "./validation-errors.js";
|
|
19
|
+
export { renderErrorReport } from "./error-report.js";
|
|
19
20
|
configureTheme({ brand: "blue", label: "Toolcraft" });
|
|
20
21
|
export { configureTheme };
|
|
21
22
|
const RESERVED_SERVICE_NAMES = new Set([
|
package/dist/error-report.d.ts
CHANGED
|
@@ -18,6 +18,11 @@ export interface ErrorReportResult {
|
|
|
18
18
|
absolutePath: string;
|
|
19
19
|
displayPath: string;
|
|
20
20
|
}
|
|
21
|
+
export type ErrorReportRenderContext = Omit<ErrorReportContext, "errorReports" | "projectRoot">;
|
|
22
|
+
export interface ErrorReportRenderResult {
|
|
23
|
+
content: string;
|
|
24
|
+
redactedKeys: string[];
|
|
25
|
+
}
|
|
21
26
|
interface HttpErrorLike {
|
|
22
27
|
name: "HttpError";
|
|
23
28
|
message: string;
|
|
@@ -35,5 +40,11 @@ interface HttpErrorLike {
|
|
|
35
40
|
};
|
|
36
41
|
}
|
|
37
42
|
declare function hasHttpContext(error: unknown): error is HttpErrorLike;
|
|
43
|
+
/**
|
|
44
|
+
* Renders the exact redacted content used by `writeErrorReport` without checking report enablement
|
|
45
|
+
* or writing to the filesystem. `redactedKeys` lists every environment variable declared by the
|
|
46
|
+
* command's secrets in declaration order, including variables that are currently unset.
|
|
47
|
+
*/
|
|
48
|
+
export declare function renderErrorReport(context: ErrorReportRenderContext): ErrorReportRenderResult;
|
|
38
49
|
export declare function writeErrorReport(context: ErrorReportContext): Promise<ErrorReportResult | undefined>;
|
|
39
50
|
export { hasHttpContext };
|
package/dist/error-report.js
CHANGED
|
@@ -410,6 +410,17 @@ function buildReport(context) {
|
|
|
410
410
|
}
|
|
411
411
|
return `${lines.join("\n")}\n`;
|
|
412
412
|
}
|
|
413
|
+
/**
|
|
414
|
+
* Renders the exact redacted content used by `writeErrorReport` without checking report enablement
|
|
415
|
+
* or writing to the filesystem. `redactedKeys` lists every environment variable declared by the
|
|
416
|
+
* command's secrets in declaration order, including variables that are currently unset.
|
|
417
|
+
*/
|
|
418
|
+
export function renderErrorReport(context) {
|
|
419
|
+
return {
|
|
420
|
+
content: buildReport(context),
|
|
421
|
+
redactedKeys: commandSecretEnvNames(context.command?.secrets)
|
|
422
|
+
};
|
|
423
|
+
}
|
|
413
424
|
export async function writeErrorReport(context) {
|
|
414
425
|
const env = context.env ?? process.env;
|
|
415
426
|
if (!reportsEnabled(context.errorReports, env) || isSkippedError(context.error)) {
|
|
@@ -423,7 +434,7 @@ export async function writeErrorReport(context) {
|
|
|
423
434
|
if (reportDirMustStayWithinProject(context.errorReports)) {
|
|
424
435
|
await assertReportDirWithinProject(projectRoot, reportDir);
|
|
425
436
|
}
|
|
426
|
-
await writeFile(absolutePath,
|
|
437
|
+
await writeFile(absolutePath, renderErrorReport(context).content);
|
|
427
438
|
return {
|
|
428
439
|
absolutePath,
|
|
429
440
|
displayPath: relativeDisplayPath(projectRoot, absolutePath)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toolcraft",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.91",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"postpack": "node ../../scripts/manage-bundled-workspace-deps.mjs cleanup . toolcraft-design @poe-code/frontmatter @poe-code/agent-mcp-config @poe-code/agent-human-in-loop @poe-code/task-list @poe-code/agent-defs @poe-code/config-mutations @poe-code/process-runner tiny-mcp-client mcp-oauth auth-store"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"toolcraft-schema": "0.0.
|
|
59
|
+
"toolcraft-schema": "0.0.91",
|
|
60
60
|
"commander": "^13.1.0",
|
|
61
61
|
"fast-string-width": "^3.0.2",
|
|
62
62
|
"fast-wrap-ansi": "^0.2.0",
|