toolcraft 0.0.90 → 0.0.92

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.
@@ -0,0 +1,65 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "packages": [
4
+ {
5
+ "name": "@poe-code/agent-defs",
6
+ "version": "0.0.1",
7
+ "license": "MIT"
8
+ },
9
+ {
10
+ "name": "@poe-code/agent-human-in-loop",
11
+ "version": "0.0.1",
12
+ "license": "MIT"
13
+ },
14
+ {
15
+ "name": "@poe-code/agent-mcp-config",
16
+ "version": "0.0.1",
17
+ "license": "MIT"
18
+ },
19
+ {
20
+ "name": "@poe-code/config-mutations",
21
+ "version": "0.0.1",
22
+ "license": "MIT"
23
+ },
24
+ {
25
+ "name": "@poe-code/frontmatter",
26
+ "version": "0.0.1",
27
+ "license": "MIT"
28
+ },
29
+ {
30
+ "name": "@poe-code/process-runner",
31
+ "version": "0.0.1",
32
+ "license": "MIT"
33
+ },
34
+ {
35
+ "name": "@poe-code/task-list",
36
+ "version": "0.0.1",
37
+ "license": "MIT"
38
+ },
39
+ {
40
+ "name": "auth-store",
41
+ "version": "0.0.1",
42
+ "license": "MIT"
43
+ },
44
+ {
45
+ "name": "mcp-oauth",
46
+ "version": "0.0.1",
47
+ "license": "MIT"
48
+ },
49
+ {
50
+ "name": "tiny-mcp-client",
51
+ "version": "0.1.0",
52
+ "license": "MIT"
53
+ },
54
+ {
55
+ "name": "toolcraft",
56
+ "version": "0.0.92",
57
+ "license": "MIT"
58
+ },
59
+ {
60
+ "name": "toolcraft-design",
61
+ "version": "0.0.2",
62
+ "license": "MIT"
63
+ }
64
+ ]
65
+ }
@@ -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([
@@ -0,0 +1,15 @@
1
+ export interface ToolcraftCompositionPackage {
2
+ name: string;
3
+ version: string;
4
+ license: string;
5
+ }
6
+ export interface ToolcraftComposition {
7
+ schemaVersion: 1;
8
+ packages: ToolcraftCompositionPackage[];
9
+ }
10
+ /**
11
+ * Loads Toolcraft's deterministic bundled-package inventory without inspecting source maps.
12
+ * The manifest includes Toolcraft and every package nested inside its published tarball with exact
13
+ * versions and licenses. Incompatible manifest shape changes increment `schemaVersion`.
14
+ */
15
+ export declare function loadToolcraftComposition(): Promise<ToolcraftComposition>;
@@ -0,0 +1,10 @@
1
+ import { readFile } from "node:fs/promises";
2
+ /**
3
+ * Loads Toolcraft's deterministic bundled-package inventory without inspecting source maps.
4
+ * The manifest includes Toolcraft and every package nested inside its published tarball with exact
5
+ * versions and licenses. Incompatible manifest shape changes increment `schemaVersion`.
6
+ */
7
+ export async function loadToolcraftComposition() {
8
+ const manifestUrl = new URL("./composition.json", import.meta.url);
9
+ return JSON.parse(await readFile(manifestUrl, "utf8"));
10
+ }
@@ -0,0 +1,65 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "packages": [
4
+ {
5
+ "name": "@poe-code/agent-defs",
6
+ "version": "0.0.1",
7
+ "license": "MIT"
8
+ },
9
+ {
10
+ "name": "@poe-code/agent-human-in-loop",
11
+ "version": "0.0.1",
12
+ "license": "MIT"
13
+ },
14
+ {
15
+ "name": "@poe-code/agent-mcp-config",
16
+ "version": "0.0.1",
17
+ "license": "MIT"
18
+ },
19
+ {
20
+ "name": "@poe-code/config-mutations",
21
+ "version": "0.0.1",
22
+ "license": "MIT"
23
+ },
24
+ {
25
+ "name": "@poe-code/frontmatter",
26
+ "version": "0.0.1",
27
+ "license": "MIT"
28
+ },
29
+ {
30
+ "name": "@poe-code/process-runner",
31
+ "version": "0.0.1",
32
+ "license": "MIT"
33
+ },
34
+ {
35
+ "name": "@poe-code/task-list",
36
+ "version": "0.0.1",
37
+ "license": "MIT"
38
+ },
39
+ {
40
+ "name": "auth-store",
41
+ "version": "0.0.1",
42
+ "license": "MIT"
43
+ },
44
+ {
45
+ "name": "mcp-oauth",
46
+ "version": "0.0.1",
47
+ "license": "MIT"
48
+ },
49
+ {
50
+ "name": "tiny-mcp-client",
51
+ "version": "0.1.0",
52
+ "license": "MIT"
53
+ },
54
+ {
55
+ "name": "toolcraft",
56
+ "version": "0.0.92",
57
+ "license": "MIT"
58
+ },
59
+ {
60
+ "name": "toolcraft-design",
61
+ "version": "0.0.2",
62
+ "license": "MIT"
63
+ }
64
+ ]
65
+ }
@@ -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 };
@@ -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, buildReport(context));
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.90",
3
+ "version": "0.0.92",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -14,6 +14,10 @@
14
14
  "types": "./dist/cli.d.ts",
15
15
  "import": "./dist/cli.js"
16
16
  },
17
+ "./composition": {
18
+ "types": "./dist/composition.d.ts",
19
+ "import": "./dist/composition.js"
20
+ },
17
21
  "./design": {
18
22
  "types": "./dist/design.d.ts",
19
23
  "import": "./dist/design.js"
@@ -48,7 +52,7 @@
48
52
  }
49
53
  },
50
54
  "scripts": {
51
- "build": "rm -rf dist && tsc",
55
+ "build": "rm -rf dist && tsc && cp src/composition.json dist/composition.json",
52
56
  "test": "cd ../.. && vitest run packages/toolcraft/src",
53
57
  "test:unit": "cd ../.. && vitest run packages/toolcraft/src",
54
58
  "lint": "cd ../.. && eslint packages/toolcraft/src --ext ts && tsc -p packages/toolcraft/tsconfig.json --noEmit",
@@ -56,7 +60,7 @@
56
60
  "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
61
  },
58
62
  "dependencies": {
59
- "toolcraft-schema": "0.0.90",
63
+ "toolcraft-schema": "0.0.92",
60
64
  "commander": "^13.1.0",
61
65
  "fast-string-width": "^3.0.2",
62
66
  "fast-wrap-ansi": "^0.2.0",
@@ -70,8 +74,10 @@
70
74
  },
71
75
  "files": [
72
76
  "LICENSE",
77
+ "composition.json",
73
78
  "dist"
74
79
  ],
80
+ "toolcraftComposition": "./composition.json",
75
81
  "engines": {
76
82
  "node": ">=18.18"
77
83
  },