@tracecode/harness 0.5.1 → 0.6.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +29 -3
  3. package/dist/browser.cjs +974 -19
  4. package/dist/browser.cjs.map +1 -1
  5. package/dist/browser.d.cts +3 -2
  6. package/dist/browser.d.ts +3 -2
  7. package/dist/browser.js +974 -19
  8. package/dist/browser.js.map +1 -1
  9. package/dist/cli.cjs +24 -0
  10. package/dist/cli.cjs.map +1 -1
  11. package/dist/cli.js +24 -0
  12. package/dist/cli.js.map +1 -1
  13. package/dist/core.cjs +611 -4
  14. package/dist/core.cjs.map +1 -1
  15. package/dist/core.d.cts +20 -6
  16. package/dist/core.d.ts +20 -6
  17. package/dist/core.js +605 -4
  18. package/dist/core.js.map +1 -1
  19. package/dist/index.cjs +1004 -19
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.cts +3 -3
  22. package/dist/index.d.ts +3 -3
  23. package/dist/index.js +998 -19
  24. package/dist/index.js.map +1 -1
  25. package/dist/internal/browser.cjs +211 -0
  26. package/dist/internal/browser.cjs.map +1 -1
  27. package/dist/internal/browser.d.cts +62 -6
  28. package/dist/internal/browser.d.ts +62 -6
  29. package/dist/internal/browser.js +210 -0
  30. package/dist/internal/browser.js.map +1 -1
  31. package/dist/javascript.d.cts +2 -2
  32. package/dist/javascript.d.ts +2 -2
  33. package/dist/{runtime-types-DtaaAhHL.d.ts → runtime-types-89nchXlY.d.cts} +8 -4
  34. package/dist/{runtime-types--lBQ6rYu.d.cts → runtime-types-CCQ-ZLc9.d.ts} +8 -4
  35. package/dist/{types-DwIYM3Ku.d.cts → types-zyvpJKCi.d.cts} +1 -0
  36. package/dist/{types-DwIYM3Ku.d.ts → types-zyvpJKCi.d.ts} +1 -0
  37. package/package.json +11 -5
  38. package/workers/java/.build/classes/harness/browser/JavaRewriteLibrary.class +0 -0
  39. package/workers/java/java-worker.js +712 -0
  40. package/workers/java/src/harness/browser/JavaRewriteLibrary.java +54 -0
  41. package/workers/javascript/javascript-worker.js +343 -63
  42. package/workers/python/generated-python-harness-snippets.js +3 -3
  43. package/workers/python/pyodide-worker.js +419 -68
  44. package/workers/python/runtime-core.js +52 -3
  45. package/workers/vendor/java-browser-spike-helper.jar +0 -0
  46. package/workers/vendor/java-practice-rewriter.jar +0 -0
  47. package/workers/vendor/java-rewrite-bridge.jar +0 -0
  48. package/workers/vendor/javaparser-core-3.25.10.jar +0 -0
  49. package/workers/vendor/jdk.compiler-17.jar +0 -0
@@ -1,6 +1,6 @@
1
- import { E as ExecutionResult, a as CodeExecutionResult } from './types-DwIYM3Ku.cjs';
1
+ import { E as ExecutionResult, a as CodeExecutionResult } from './types-zyvpJKCi.js';
2
2
 
3
- type Language = 'python' | 'javascript' | 'typescript';
3
+ type Language = 'python' | 'javascript' | 'typescript' | 'java';
4
4
  type RuntimeExecutionStyle = 'function' | 'solution-method' | 'ops-class';
5
5
  type RuntimeMaturity = 'experimental' | 'beta' | 'stable';
6
6
  interface RuntimeCapabilities {
@@ -31,6 +31,7 @@ interface RuntimeCapabilities {
31
31
  maxTraceSteps: boolean;
32
32
  maxLineEvents: boolean;
33
33
  maxSingleLineHits: boolean;
34
+ maxStoredEvents: boolean;
34
35
  minimalTrace: boolean;
35
36
  };
36
37
  fidelity: {
@@ -60,10 +61,13 @@ interface RuntimeCapabilities {
60
61
  stepVisualization: boolean;
61
62
  };
62
63
  }
63
- interface TraceExecutionOptions {
64
+ interface TraceBudget {
64
65
  maxTraceSteps?: number;
65
66
  maxLineEvents?: number;
66
67
  maxSingleLineHits?: number;
68
+ maxStoredEvents?: number;
69
+ }
70
+ interface TraceExecutionOptions extends TraceBudget {
67
71
  minimalTrace?: boolean;
68
72
  }
69
73
  interface LanguageRuntimeProfile {
@@ -82,4 +86,4 @@ interface RuntimeClient {
82
86
  executeCodeInterviewMode(code: string, functionName: string, inputs: Record<string, unknown>, executionStyle?: RuntimeExecutionStyle): Promise<CodeExecutionResult>;
83
87
  }
84
88
 
85
- export type { Language as L, RuntimeCapabilities as R, TraceExecutionOptions as T, LanguageRuntimeProfile as a, RuntimeClient as b, RuntimeExecutionStyle as c, RuntimeMaturity as d };
89
+ export type { Language as L, RuntimeCapabilities as R, TraceBudget as T, LanguageRuntimeProfile as a, RuntimeClient as b, RuntimeExecutionStyle as c, RuntimeMaturity as d, TraceExecutionOptions as e };
@@ -86,6 +86,7 @@ interface ExecutionResult {
86
86
  executionTimeMs: number;
87
87
  consoleOutput: string[];
88
88
  traceLimitExceeded?: boolean;
89
+ maxTraceSteps?: number;
89
90
  timeoutReason?: 'trace-limit' | 'line-limit' | 'single-line-limit' | 'recursion-limit' | 'memory-limit' | 'client-timeout';
90
91
  lineEventCount?: number;
91
92
  traceStepCount?: number;
@@ -86,6 +86,7 @@ interface ExecutionResult {
86
86
  executionTimeMs: number;
87
87
  consoleOutput: string[];
88
88
  traceLimitExceeded?: boolean;
89
+ maxTraceSteps?: number;
89
90
  timeoutReason?: 'trace-limit' | 'line-limit' | 'single-line-limit' | 'recursion-limit' | 'memory-limit' | 'client-timeout';
90
91
  lineEventCount?: number;
91
92
  traceStepCount?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tracecode/harness",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "license": "AGPL-3.0-only",
5
5
  "homepage": "https://tracecode.app",
6
6
  "repository": {
@@ -71,14 +71,20 @@
71
71
  "test:browser-harness": "pnpm exec tsx tests/test-browser-harness.ts",
72
72
  "test:asset-sync": "pnpm exec tsx tests/test-asset-sync.ts",
73
73
  "test:example-app": "pnpm exec tsx tests/test-example-app.ts",
74
+ "test:java-example-app": "pnpm exec tsx tests/test-java-example-app.ts",
74
75
  "test:example-app-packaged": "pnpm exec tsx tests/test-example-app-packaged.ts",
76
+ "test:java-example-app-packaged": "pnpm exec tsx tests/test-java-example-app-packaged.ts",
75
77
  "test:standalone-boundary": "pnpm exec tsx tests/test-standalone-boundary.ts",
76
78
  "test:trace-adapters": "pnpm exec tsx tests/test-trace-adapters.ts",
77
- "test:python-harness-sync": "pnpm exec tsx scripts/generate-python-harness-artifacts.ts --check && pnpm exec tsx tests/test-python-harness-sync.ts",
78
- "test:javascript-runtime": "pnpm exec tsx tests/test-javascript-runtime.ts",
79
+ "test:python-sync": "pnpm exec tsx scripts/generate-python-harness-artifacts.ts --check && pnpm exec tsx tests/test-python-harness-sync.ts",
80
+ "test:java-sync": "pnpm exec tsx tests/test-java-harness-sync.ts",
81
+ "test:js-runtime": "pnpm exec tsx tests/test-javascript-runtime.ts",
82
+ "test:python-harness-sync": "pnpm run test:python-sync",
83
+ "test:java-harness-sync": "pnpm run test:java-sync",
84
+ "test:javascript-runtime": "pnpm run test:js-runtime",
79
85
  "test:runtime-contract": "pnpm exec tsx tests/test-runtime-contract.ts",
80
- "test:ci": "pnpm typecheck && pnpm test:trace-adapters && pnpm test:python-harness-sync && pnpm test:javascript-runtime && pnpm test:runtime-contract && pnpm test:standalone-boundary && pnpm build && pnpm test:packaged-surface && pnpm test:smoke && pnpm test:asset-sync",
81
- "test": "pnpm typecheck && pnpm test:trace-adapters && pnpm test:python-harness-sync && pnpm test:javascript-runtime && pnpm test:runtime-contract && pnpm test:standalone-boundary && pnpm build && pnpm test:packaged-surface && pnpm test:smoke && pnpm test:browser-harness && pnpm test:asset-sync && pnpm test:example-app && pnpm test:example-app-packaged"
86
+ "test:ci": "pnpm typecheck && pnpm test:trace-adapters && pnpm test:python-sync && pnpm test:java-sync && pnpm test:js-runtime && pnpm test:runtime-contract && pnpm test:standalone-boundary && pnpm build && pnpm test:packaged-surface && pnpm test:smoke && pnpm test:asset-sync",
87
+ "test": "pnpm typecheck && pnpm test:trace-adapters && pnpm test:python-sync && pnpm test:java-sync && pnpm test:js-runtime && pnpm test:runtime-contract && pnpm test:standalone-boundary && pnpm build && pnpm test:packaged-surface && pnpm test:smoke && pnpm test:browser-harness && pnpm test:asset-sync && pnpm test:example-app && pnpm test:java-example-app && pnpm test:example-app-packaged && pnpm test:java-example-app-packaged"
82
88
  },
83
89
  "devDependencies": {
84
90
  "@types/node": "^20.0.0",