thinkwell 0.4.5 → 0.5.0-alpha.2

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.
Files changed (77) hide show
  1. package/README.md +3 -5
  2. package/bin/thinkwell +130 -174
  3. package/dist/agent.d.ts +82 -56
  4. package/dist/agent.d.ts.map +1 -1
  5. package/dist/agent.js +178 -174
  6. package/dist/agent.js.map +1 -1
  7. package/dist/cli/build.d.ts +15 -43
  8. package/dist/cli/build.d.ts.map +1 -1
  9. package/dist/cli/build.js +199 -1231
  10. package/dist/cli/build.js.map +1 -1
  11. package/dist/cli/bundle.d.ts +61 -0
  12. package/dist/cli/bundle.d.ts.map +1 -0
  13. package/dist/cli/bundle.js +1299 -0
  14. package/dist/cli/bundle.js.map +1 -0
  15. package/dist/cli/check.d.ts +19 -0
  16. package/dist/cli/check.d.ts.map +1 -0
  17. package/dist/cli/check.js +248 -0
  18. package/dist/cli/check.js.map +1 -0
  19. package/dist/cli/commands.d.ts +30 -0
  20. package/dist/cli/commands.d.ts.map +1 -0
  21. package/dist/cli/commands.js +64 -0
  22. package/dist/cli/commands.js.map +1 -0
  23. package/dist/cli/compiler-host.d.ts +109 -0
  24. package/dist/cli/compiler-host.d.ts.map +1 -0
  25. package/dist/cli/compiler-host.js +173 -0
  26. package/dist/cli/compiler-host.js.map +1 -0
  27. package/dist/cli/fmt.d.ts +13 -0
  28. package/dist/cli/fmt.d.ts.map +1 -0
  29. package/dist/cli/fmt.js +14 -0
  30. package/dist/cli/fmt.js.map +1 -0
  31. package/dist/cli/init-command.js +12 -12
  32. package/dist/cli/init-command.js.map +1 -1
  33. package/dist/cli/loader.d.ts +0 -21
  34. package/dist/cli/loader.d.ts.map +1 -1
  35. package/dist/cli/loader.js +1 -50
  36. package/dist/cli/loader.js.map +1 -1
  37. package/dist/cli/schema.d.ts +2 -0
  38. package/dist/cli/schema.d.ts.map +1 -1
  39. package/dist/cli/schema.js +11 -4
  40. package/dist/cli/schema.js.map +1 -1
  41. package/dist/cli/workspace.d.ts +82 -0
  42. package/dist/cli/workspace.d.ts.map +1 -0
  43. package/dist/cli/workspace.js +248 -0
  44. package/dist/cli/workspace.js.map +1 -0
  45. package/dist/index.d.ts +6 -3
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +3 -3
  48. package/dist/index.js.map +1 -1
  49. package/dist/think-builder.d.ts +50 -2
  50. package/dist/think-builder.d.ts.map +1 -1
  51. package/dist/think-builder.js +137 -14
  52. package/dist/think-builder.js.map +1 -1
  53. package/dist/thought-event.d.ts +80 -0
  54. package/dist/thought-event.d.ts.map +1 -0
  55. package/dist/thought-event.js +2 -0
  56. package/dist/thought-event.js.map +1 -0
  57. package/dist/thought-stream.d.ts +45 -0
  58. package/dist/thought-stream.d.ts.map +1 -0
  59. package/dist/thought-stream.js +99 -0
  60. package/dist/thought-stream.js.map +1 -0
  61. package/dist-pkg/acp.cjs +37 -11
  62. package/dist-pkg/thinkwell.cjs +49 -18
  63. package/package.json +4 -9
  64. package/dist/cli/index.d.ts +0 -11
  65. package/dist/cli/index.d.ts.map +0 -1
  66. package/dist/cli/index.js +0 -11
  67. package/dist/cli/index.js.map +0 -1
  68. package/dist/cli/main-pkg.d.ts +0 -18
  69. package/dist/cli/main-pkg.d.ts.map +0 -1
  70. package/dist/cli/main.d.ts +0 -14
  71. package/dist/cli/main.d.ts.map +0 -1
  72. package/dist/cli/main.js +0 -256
  73. package/dist/cli/main.js.map +0 -1
  74. package/dist/cli/types-command.d.ts +0 -8
  75. package/dist/cli/types-command.d.ts.map +0 -1
  76. package/dist/cli/types-command.js +0 -110
  77. package/dist/cli/types-command.js.map +0 -1
@@ -1,61 +1,33 @@
1
1
  /**
2
- * Build command for creating self-contained executables from user scripts.
2
+ * Build command for tsc-based compilation with @JSONSchema transformation.
3
3
  *
4
- * This module provides the `thinkwell build` command that compiles user scripts
5
- * into standalone binaries using the same pkg-based tooling as the thinkwell CLI.
4
+ * This module provides the `thinkwell build` command that compiles a TypeScript
5
+ * project using the standard TypeScript compiler API with a custom CompilerHost.
6
+ * The CompilerHost intercepts file reads and applies @JSONSchema namespace
7
+ * injection in memory, so user source files are never modified on disk.
6
8
  *
7
- * The build process follows a two-stage pipeline:
8
- * 1. **Pre-bundle with esbuild** - Bundle user script + thinkwell packages into CJS
9
- * 2. **Compile with pkg** - Create self-contained binary with Node.js runtime
9
+ * Output (.js, .d.ts, source maps) is written to the project's configured outDir.
10
10
  */
11
- export type Target = "darwin-arm64" | "darwin-x64" | "linux-x64" | "linux-arm64" | "host";
12
11
  export interface BuildOptions {
13
- /** Entry point TypeScript/JavaScript file */
14
- entry: string;
15
- /** Output file path (default: ./<entry-basename>-<target>) */
16
- output?: string;
17
- /** Target platforms (default: ["host"]) */
18
- targets?: Target[];
19
- /** Additional files to embed as assets */
20
- include?: string[];
21
- /** Packages to exclude from bundling (kept as external imports) */
22
- external?: string[];
23
- /** Show detailed build output */
12
+ /** Path to tsconfig.json (default: ./tsconfig.json) */
13
+ project?: string;
14
+ /** Show detailed output */
24
15
  verbose?: boolean;
25
- /** Suppress all non-error output (for CI environments) */
16
+ /** Suppress all output except errors */
26
17
  quiet?: boolean;
27
- /** Show what would be built without actually building */
28
- dryRun?: boolean;
29
- /** Minify the bundled output for smaller binaries */
30
- minify?: boolean;
31
- /** Watch for changes and rebuild automatically */
18
+ /** Watch for file changes and recompile */
32
19
  watch?: boolean;
33
20
  }
34
21
  /**
35
22
  * Configuration that can be specified in package.json under "thinkwell.build".
36
23
  */
37
24
  export interface PackageJsonBuildConfig {
38
- /** Default output path */
39
- output?: string;
40
- /** Default target platforms */
41
- targets?: Target[];
42
- /** Default assets to include */
25
+ /** Glob patterns for files that should receive @JSONSchema transformation */
43
26
  include?: string[];
44
- /** Default packages to exclude from bundling */
45
- external?: string[];
46
- /** Default minification setting */
47
- minify?: boolean;
27
+ /** Glob patterns for files that should NOT receive @JSONSchema transformation */
28
+ exclude?: string[];
48
29
  }
49
- /**
50
- * Parse and validate build options from command-line arguments.
51
- */
52
- export declare function parseBuildArgs(args: string[]): BuildOptions;
53
- /**
54
- * Main build function.
55
- */
56
30
  export declare function runBuild(options: BuildOptions): Promise<void>;
57
- /**
58
- * Show help for the build command.
59
- */
31
+ export declare function parseBuildArgs(args: string[]): BuildOptions;
60
32
  export declare function showBuildHelp(): void;
61
33
  //# sourceMappingURL=build.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/cli/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA+IH,MAAM,MAAM,MAAM,GAAG,cAAc,GAAG,YAAY,GAAG,WAAW,GAAG,aAAa,GAAG,MAAM,CAAC;AA0B1F,MAAM,WAAW,YAAY;IAC3B,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,8DAA8D;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,iCAAiC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,yDAAyD;IACzD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qDAAqD;IACrD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,kDAAkD;IAClD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,0BAA0B;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,gCAAgC;IAChC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,gDAAgD;IAChD,QAAQ,CAAC,EAA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