@docsxai/engine 0.2.0 → 0.3.0-rc.1

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 (89) hide show
  1. package/README.md +26 -6
  2. package/dist/address-class.d.ts +14 -0
  3. package/dist/address-class.js +151 -0
  4. package/dist/auth/api-login.js +6 -2
  5. package/dist/backend-client-contracts.d.ts +2 -0
  6. package/dist/calibrate.js +5 -0
  7. package/dist/cli-commands-authoring.js +23 -4
  8. package/dist/cli-commands-backend.js +2 -2
  9. package/dist/cli-commands-docpack.d.ts +5 -0
  10. package/dist/cli-commands-docpack.js +70 -24
  11. package/dist/cli-commands-pack.d.ts +2 -0
  12. package/dist/cli-commands-pack.js +69 -0
  13. package/dist/cli-commands-session.js +92 -88
  14. package/dist/cli-retired.d.ts +6 -0
  15. package/dist/cli-retired.js +12 -0
  16. package/dist/cli-usage.d.ts +1 -1
  17. package/dist/cli-usage.js +53 -5
  18. package/dist/cli-verify.d.ts +14 -0
  19. package/dist/cli-verify.js +54 -0
  20. package/dist/cli.js +14 -1
  21. package/dist/deprecation.d.ts +19 -0
  22. package/dist/deprecation.js +32 -0
  23. package/dist/diagnose.d.ts +25 -0
  24. package/dist/diagnose.js +69 -3
  25. package/dist/diff-compute.js +1 -0
  26. package/dist/doc-pack-io.d.ts +14 -0
  27. package/dist/doc-pack-io.js +121 -14
  28. package/dist/doc-pack.d.ts +2165 -181
  29. package/dist/doc-pack.js +152 -42
  30. package/dist/doctor-checks.d.ts +1 -1
  31. package/dist/doctor-checks.js +29 -5
  32. package/dist/driver-budget.d.ts +6 -0
  33. package/dist/driver-budget.js +15 -0
  34. package/dist/egress-guard.d.ts +58 -0
  35. package/dist/egress-guard.js +136 -0
  36. package/dist/environment-spec.d.ts +67 -0
  37. package/dist/environment-spec.js +38 -0
  38. package/dist/export/playwright-test.js +42 -10
  39. package/dist/flow-file.d.ts +7 -1
  40. package/dist/flow-file.js +21 -1
  41. package/dist/flow-halt.d.ts +16 -0
  42. package/dist/flow-halt.js +76 -0
  43. package/dist/flow-hidden.d.ts +9 -0
  44. package/dist/flow-hidden.js +20 -0
  45. package/dist/flow-lint.js +91 -1
  46. package/dist/flow-matrix-lint.d.ts +10 -0
  47. package/dist/flow-matrix-lint.js +40 -0
  48. package/dist/flow-matrix.d.ts +44 -0
  49. package/dist/flow-matrix.js +238 -0
  50. package/dist/flow-name-rules.d.ts +15 -0
  51. package/dist/flow-name-rules.js +39 -0
  52. package/dist/flow-runtime.d.ts +67 -21
  53. package/dist/flow-runtime.js +72 -110
  54. package/dist/flow-success.d.ts +3 -0
  55. package/dist/flow-success.js +37 -0
  56. package/dist/flow-tree.d.ts +2 -0
  57. package/dist/flow-tree.js +17 -5
  58. package/dist/flow-wait.d.ts +3 -0
  59. package/dist/flow-wait.js +22 -0
  60. package/dist/index.d.ts +6 -0
  61. package/dist/index.js +6 -0
  62. package/dist/matrix-spec.d.ts +145 -0
  63. package/dist/matrix-spec.js +120 -0
  64. package/dist/obstacles.d.ts +33 -0
  65. package/dist/obstacles.js +72 -0
  66. package/dist/page-hide.d.ts +10 -0
  67. package/dist/page-hide.js +45 -0
  68. package/dist/page-nearby-boxes.d.ts +9 -0
  69. package/dist/page-nearby-boxes.js +92 -0
  70. package/dist/page-settle.d.ts +39 -0
  71. package/dist/page-settle.js +142 -0
  72. package/dist/playwright-driver.d.ts +30 -8
  73. package/dist/playwright-driver.js +88 -18
  74. package/dist/run-flows.d.ts +40 -0
  75. package/dist/run-flows.js +129 -0
  76. package/dist/upload-path.d.ts +15 -0
  77. package/dist/upload-path.js +63 -0
  78. package/dist/verify-compare.d.ts +43 -0
  79. package/dist/verify-compare.js +237 -0
  80. package/dist/verify-determinism.d.ts +16 -0
  81. package/dist/verify-determinism.js +88 -0
  82. package/dist/verify-report.d.ts +53 -0
  83. package/dist/verify-report.js +141 -0
  84. package/dist/verify-tree.d.ts +27 -0
  85. package/dist/verify-tree.js +95 -0
  86. package/dist/viewer-bin.d.ts +6 -0
  87. package/dist/viewer-bin.js +24 -0
  88. package/dist/workspace.d.ts +8 -0
  89. package/package.json +7 -6
@@ -10,6 +10,7 @@
10
10
  // map doesn't export its package.json. The chain is walked explicitly rather than via
11
11
  // `require.resolve.paths()`, which test runners extend with extra lookup dirs.)
12
12
  // 3. `docsxai-viewer` on PATH (the npm bin shim) — the legacy behavior, kept as the fallback.
13
+ import { spawn } from "node:child_process";
13
14
  import { promises as fs } from "node:fs";
14
15
  import * as path from "node:path";
15
16
  import { fileURLToPath } from "node:url";
@@ -95,3 +96,26 @@ export function formatViewerBinFailure(resolution) {
95
96
  `Install ${VIEWER_PACKAGE} next to the engine (or globally), or point ${VIEWER_BIN_ENV} at its bin script.`,
96
97
  ].join("\n");
97
98
  }
99
+ /**
100
+ * Run the viewer's CLI with `args` and resolve to its exit code. The viewer is its own package/bin;
101
+ * spawning it keeps the engine from depending on it at build time. `label` prefixes the failure
102
+ * line when the bin can't be launched.
103
+ */
104
+ export async function runViewerBin(label, args) {
105
+ const viewerBin = await resolveViewerBin();
106
+ return new Promise((resolve) => {
107
+ const child = spawn(viewerBin.command, [...viewerBin.prefixArgs, ...args], {
108
+ stdio: "inherit",
109
+ });
110
+ child.on("error", (e) => {
111
+ if (e.code === "ENOENT") {
112
+ process.stderr.write(`${label}: ${formatViewerBinFailure(viewerBin)}\n`);
113
+ }
114
+ else {
115
+ process.stderr.write(`${label}: ${e.message}\n`);
116
+ }
117
+ resolve(1);
118
+ });
119
+ child.on("exit", (code) => resolve(code ?? 1));
120
+ });
121
+ }
@@ -22,6 +22,14 @@ export interface WorkspaceConfig {
22
22
  ignore_https_errors?: boolean;
23
23
  /** Backend stub/service URL for `push`/`pull` (e.g. `http://localhost:4477`). Optional — workspaces operate fully locally without it. */
24
24
  backend_url?: string;
25
+ /** How `run` records annotations. Absent keys keep today's output. */
26
+ annotations?: {
27
+ /**
28
+ * Write per-annotation `obstacles` (boxes of nearby text and controls, screenshot pixels, the
29
+ * target excluded) so the burner keeps callouts off page content. Default false.
30
+ */
31
+ obstacles?: boolean;
32
+ };
25
33
  /** Backend workspace ID, set by `push` after first round-trip. */
26
34
  backend_workspace_id?: string;
27
35
  /** Backend project ID, set by `push` after first round-trip. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docsxai/engine",
3
- "version": "0.2.0",
3
+ "version": "0.3.0-rc.1",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -41,20 +41,21 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "fflate": "^0.8.3",
44
- "playwright-core": "^1.61.0",
44
+ "playwright-core": "^1.63.0",
45
45
  "pngjs": "^7.0.0",
46
- "yaml": "^2.5.0",
46
+ "yaml": "^2.9.1",
47
47
  "zod": "^3.23.0"
48
48
  },
49
49
  "devDependencies": {
50
- "@types/node": "^20.14.0",
50
+ "@types/node": "^20.19.43",
51
51
  "@types/pngjs": "^6.0.5",
52
+ "typescript": "^5.5.0",
52
53
  "vitest": "^2.0.0",
53
- "@docsxai/backend": "0.2.0"
54
+ "@docsxai/backend": "0.3.0-rc.1"
54
55
  },
55
56
  "author": "Kalebtec <security@kalebtec.com>",
56
57
  "engines": {
57
- "node": ">=20"
58
+ "node": ">=26"
58
59
  },
59
60
  "scripts": {
60
61
  "build": "node ../../scripts/clean-dist.mjs && tsc -b tsconfig.build.json",