automovie 0.1.0 → 0.3.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 (160) hide show
  1. package/README.md +28 -16
  2. package/lib/AUTOMOVIE_CAPTURE_OPTIONS.d.ts +6 -0
  3. package/lib/AUTOMOVIE_CAPTURE_OPTIONS.js +16 -0
  4. package/lib/AUTOMOVIE_CAPTURE_OPTIONS.js.map +1 -0
  5. package/lib/AUTOMOVIE_INSPECT_OPTIONS.d.ts +6 -0
  6. package/lib/AUTOMOVIE_INSPECT_OPTIONS.js +14 -0
  7. package/lib/AUTOMOVIE_INSPECT_OPTIONS.js.map +1 -0
  8. package/lib/AUTOMOVIE_RENDER_OPTIONS.d.ts +6 -0
  9. package/lib/AUTOMOVIE_RENDER_OPTIONS.js +15 -0
  10. package/lib/AUTOMOVIE_RENDER_OPTIONS.js.map +1 -0
  11. package/lib/AUTOMOVIE_REVIEW_OPTIONS.d.ts +6 -0
  12. package/lib/AUTOMOVIE_REVIEW_OPTIONS.js +14 -0
  13. package/lib/AUTOMOVIE_REVIEW_OPTIONS.js.map +1 -0
  14. package/lib/AutoMovieCaptureBackend.d.ts +9 -0
  15. package/lib/{IAutoMoviePackageManager.js → AutoMovieCaptureBackend.js} +1 -1
  16. package/lib/AutoMovieCaptureBackend.js.map +1 -0
  17. package/lib/AutoMovieCaptureHost.d.ts +115 -0
  18. package/lib/AutoMovieCaptureHost.js +234 -0
  19. package/lib/AutoMovieCaptureHost.js.map +1 -0
  20. package/lib/AutoMovieCommand.d.ts +24 -13
  21. package/lib/IAutoMovieChromium.d.ts +84 -0
  22. package/lib/IAutoMovieChromium.js +3 -0
  23. package/lib/IAutoMovieChromium.js.map +1 -0
  24. package/lib/captureAutoMovie.d.ts +23 -0
  25. package/lib/captureAutoMovie.js +133 -0
  26. package/lib/captureAutoMovie.js.map +1 -0
  27. package/lib/deriveAutoMovieProjectName.d.ts +1 -1
  28. package/lib/deriveAutoMovieProjectName.js +1 -1
  29. package/lib/findAutoMovieFreePort.d.ts +14 -0
  30. package/lib/findAutoMovieFreePort.js +61 -0
  31. package/lib/findAutoMovieFreePort.js.map +1 -0
  32. package/lib/formatAutoMovieInspectUrl.d.ts +14 -0
  33. package/lib/formatAutoMovieInspectUrl.js +24 -0
  34. package/lib/formatAutoMovieInspectUrl.js.map +1 -0
  35. package/lib/index.d.ts +30 -2
  36. package/lib/index.js +30 -2
  37. package/lib/index.js.map +1 -1
  38. package/lib/inspectAutoMovie.d.ts +19 -0
  39. package/lib/inspectAutoMovie.js +97 -0
  40. package/lib/inspectAutoMovie.js.map +1 -0
  41. package/lib/launchAutoMovieChromium.d.ts +28 -0
  42. package/lib/launchAutoMovieChromium.js +42 -0
  43. package/lib/launchAutoMovieChromium.js.map +1 -0
  44. package/lib/loadAutoMovieProductionModule.d.ts +14 -0
  45. package/lib/loadAutoMovieProductionModule.js +61 -0
  46. package/lib/loadAutoMovieProductionModule.js.map +1 -0
  47. package/lib/planAutoMovieChromiumLaunch.d.ts +27 -0
  48. package/lib/planAutoMovieChromiumLaunch.js +34 -0
  49. package/lib/planAutoMovieChromiumLaunch.js.map +1 -0
  50. package/lib/planAutoMovieModulePageViteConfig.d.ts +37 -0
  51. package/lib/planAutoMovieModulePageViteConfig.js +27 -0
  52. package/lib/planAutoMovieModulePageViteConfig.js.map +1 -0
  53. package/lib/readAutoMovieAddArguments.d.ts +1 -1
  54. package/lib/readAutoMovieAddArguments.js +1 -1
  55. package/lib/readAutoMovieCaptureHostOptions.d.ts +36 -0
  56. package/lib/readAutoMovieCaptureHostOptions.js +57 -0
  57. package/lib/readAutoMovieCaptureHostOptions.js.map +1 -0
  58. package/lib/readAutoMovieCommandArguments.d.ts +1 -1
  59. package/lib/readAutoMovieCommandArguments.js +10 -5
  60. package/lib/readAutoMovieCommandArguments.js.map +1 -1
  61. package/lib/readAutoMovieCreateArguments.d.ts +1 -1
  62. package/lib/readAutoMovieCreateArguments.js +1 -1
  63. package/lib/readAutoMovieInspectHostOptions.d.ts +29 -0
  64. package/lib/readAutoMovieInspectHostOptions.js +48 -0
  65. package/lib/readAutoMovieInspectHostOptions.js.map +1 -0
  66. package/lib/readAutoMovieRenderOptions.d.ts +33 -0
  67. package/lib/readAutoMovieRenderOptions.js +51 -0
  68. package/lib/readAutoMovieRenderOptions.js.map +1 -0
  69. package/lib/readAutoMovieReviewOptions.d.ts +27 -0
  70. package/lib/readAutoMovieReviewOptions.js +54 -0
  71. package/lib/readAutoMovieReviewOptions.js.map +1 -0
  72. package/lib/readAutoMovieRevision.d.ts +12 -0
  73. package/lib/readAutoMovieRevision.js +32 -0
  74. package/lib/readAutoMovieRevision.js.map +1 -0
  75. package/lib/readAutoMovieVideoProbe.d.ts +23 -0
  76. package/lib/readAutoMovieVideoProbe.js +39 -0
  77. package/lib/readAutoMovieVideoProbe.js.map +1 -0
  78. package/lib/recordAutoMoviePlayback.d.ts +37 -0
  79. package/lib/recordAutoMoviePlayback.js +131 -0
  80. package/lib/recordAutoMoviePlayback.js.map +1 -0
  81. package/lib/renderAutoMovie.d.ts +21 -0
  82. package/lib/renderAutoMovie.js +95 -0
  83. package/lib/renderAutoMovie.js.map +1 -0
  84. package/lib/renderAutoMovieScaffoldNextSteps.d.ts +3 -5
  85. package/lib/renderAutoMovieScaffoldNextSteps.js +5 -14
  86. package/lib/renderAutoMovieScaffoldNextSteps.js.map +1 -1
  87. package/lib/renderAutoMovieVideo.d.ts +35 -0
  88. package/lib/renderAutoMovieVideo.js +110 -0
  89. package/lib/renderAutoMovieVideo.js.map +1 -0
  90. package/lib/resolveAutoMovieFfmpeg.d.ts +19 -0
  91. package/lib/resolveAutoMovieFfmpeg.js +32 -0
  92. package/lib/resolveAutoMovieFfmpeg.js.map +1 -0
  93. package/lib/reviewAutoMovie.d.ts +21 -0
  94. package/lib/reviewAutoMovie.js +71 -0
  95. package/lib/reviewAutoMovie.js.map +1 -0
  96. package/lib/run.d.ts +14 -11
  97. package/lib/run.js +139 -67
  98. package/lib/run.js.map +1 -1
  99. package/lib/runAutoMovieFfmpeg.d.ts +14 -0
  100. package/lib/runAutoMovieFfmpeg.js +40 -0
  101. package/lib/runAutoMovieFfmpeg.js.map +1 -0
  102. package/lib/serveAutoMovieDrawPage.d.ts +28 -0
  103. package/lib/serveAutoMovieDrawPage.js +108 -0
  104. package/lib/serveAutoMovieDrawPage.js.map +1 -0
  105. package/lib/serveAutoMovieInspectorPage.d.ts +32 -0
  106. package/lib/serveAutoMovieInspectorPage.js +52 -0
  107. package/lib/serveAutoMovieInspectorPage.js.map +1 -0
  108. package/lib/writeAutoMovieModulePage.d.ts +38 -0
  109. package/lib/writeAutoMovieModulePage.js +75 -0
  110. package/lib/writeAutoMovieModulePage.js.map +1 -0
  111. package/package.json +26 -5
  112. package/src/AUTOMOVIE_CAPTURE_OPTIONS.ts +12 -0
  113. package/src/AUTOMOVIE_INSPECT_OPTIONS.ts +10 -0
  114. package/src/AUTOMOVIE_RENDER_OPTIONS.ts +11 -0
  115. package/src/AUTOMOVIE_REVIEW_OPTIONS.ts +10 -0
  116. package/src/AutoMovieCaptureBackend.ts +9 -0
  117. package/src/AutoMovieCaptureHost.ts +276 -0
  118. package/src/AutoMovieCommand.ts +28 -13
  119. package/src/IAutoMovieChromium.ts +89 -0
  120. package/src/captureAutoMovie.ts +150 -0
  121. package/src/deriveAutoMovieProjectName.ts +1 -1
  122. package/src/findAutoMovieFreePort.ts +27 -0
  123. package/src/formatAutoMovieInspectUrl.ts +25 -0
  124. package/src/index.ts +30 -2
  125. package/src/inspectAutoMovie.ts +82 -0
  126. package/src/launchAutoMovieChromium.ts +61 -0
  127. package/src/loadAutoMovieProductionModule.ts +30 -0
  128. package/src/planAutoMovieChromiumLaunch.ts +45 -0
  129. package/src/planAutoMovieModulePageViteConfig.ts +53 -0
  130. package/src/readAutoMovieAddArguments.ts +1 -1
  131. package/src/readAutoMovieCaptureHostOptions.ts +76 -0
  132. package/src/readAutoMovieCommandArguments.ts +6 -4
  133. package/src/readAutoMovieCreateArguments.ts +1 -1
  134. package/src/readAutoMovieInspectHostOptions.ts +66 -0
  135. package/src/readAutoMovieRenderOptions.ts +67 -0
  136. package/src/readAutoMovieReviewOptions.ts +70 -0
  137. package/src/readAutoMovieRevision.ts +29 -0
  138. package/src/readAutoMovieVideoProbe.ts +55 -0
  139. package/src/recordAutoMoviePlayback.ts +182 -0
  140. package/src/renderAutoMovie.ts +87 -0
  141. package/src/renderAutoMovieScaffoldNextSteps.ts +4 -18
  142. package/src/renderAutoMovieVideo.ts +127 -0
  143. package/src/resolveAutoMovieFfmpeg.ts +33 -0
  144. package/src/reviewAutoMovie.ts +65 -0
  145. package/src/run.ts +154 -105
  146. package/src/runAutoMovieFfmpeg.ts +50 -0
  147. package/src/serveAutoMovieDrawPage.ts +105 -0
  148. package/src/serveAutoMovieInspectorPage.ts +82 -0
  149. package/src/writeAutoMovieModulePage.ts +83 -0
  150. package/lib/IAutoMoviePackageManager.d.ts +0 -14
  151. package/lib/IAutoMoviePackageManager.js.map +0 -1
  152. package/lib/readAutoMovieSyncArguments.d.ts +0 -13
  153. package/lib/readAutoMovieSyncArguments.js +0 -49
  154. package/lib/readAutoMovieSyncArguments.js.map +0 -1
  155. package/lib/selectAutoMoviePackageManager.d.ts +0 -23
  156. package/lib/selectAutoMoviePackageManager.js +0 -70
  157. package/lib/selectAutoMoviePackageManager.js.map +0 -1
  158. package/src/IAutoMoviePackageManager.ts +0 -15
  159. package/src/readAutoMovieSyncArguments.ts +0 -48
  160. package/src/selectAutoMoviePackageManager.ts +0 -45
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AutoMovieCaptureHost.js","sourceRoot":"","sources":["../src/AutoMovieCaptureHost.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAY,EAAE,6CAAyB;AACvC,MAAY,IAAI,sCAAkB;AAIlC,uEAAoE;AACpE,mFAAgF;AAChF,mEAAgE;AAChE,qEAAkE;AAElE,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,CAAC,OAAO,CAAC,KAAK;gBAC1B,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO;aAC/B,CAAC,CAAC;YACL,OAAO,MAAM,MAAM,CAAC,mBAAmB,CAAC;gBACtC,IAAI;gBACJ,IAAI,EAAE,CACJ,IAA2B,EACQ,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC;gBACnE,MAAM;gBACN,QAAQ,EAAE,IAAA,6CAAqB,EAAC,IAAI,CAAC,IAAI,CAAC;gBAC1C,KAAK,EAAE,MAAM;gBACb,GAAG,CAAC,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;aACnE,CAAC,CAAC;QACL,CAAC;gBAAS,CAAC;YACT,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;QACxB,CAAC;IACH,CAAC;IAED;;;;;;;;;;OAUG;IACI,KAAK,CAAC,KAAK;QAChB,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QAC7B,CAAC;gBAAS,CAAC;YACT,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAC1B,CAAC;IACH,CAAC;CACF"}
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * One admitted CLI request, discriminated by `command`.
3
3
  *
4
- * `help` and `version` carry nothing because they are standalone requests. `create`, `add` and `sync` carry their targets exactly as typed; `run` resolves them against the working directory. An explicit `name` is carried as typed; `run` chooses the name when it is absent.
4
+ * `help` and `version` carry nothing because they are standalone requests. `create` and `add` carry their targets exactly as typed; `run` resolves them against the working directory. An explicit `name` is carried as typed; `run` chooses the name when it is absent.
5
5
  *
6
- * @evidence contracts/development/design.md#principled-representation Each variant carries exactly what its command needs after admission, so `run` performs no further argument parsing.
6
+ * @evidence contracts/development/design.md#principled-representation Each variant carries exactly what its command needs after admission, so `run` performs no further argument parsing, except `capture`, `inspect`, `render` and `review`, whose options are read by the production's renderer's option reader once that renderer is loaded.
7
7
  * @evidence contracts/development/design.md#minimal-and-owned-surface A closed union over the command name lets `run` switch on one field, and the workspace family is a closed pair instead of a free path.
8
- * @evidence contracts/development/design.md#prohibited-design-shortcuts No variant has an escape field for unparsed tokens.
8
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts No variant other than `capture`, `inspect`, `render` and `review` carries unparsed tokens, and theirs are read by the one option reader every host shares rather than a second grammar here.
9
9
  * @evidence contracts/development/common.md#meaningful-documentation Every variant and member states its meaning and who resolves it.
10
10
  */
11
11
  export type AutoMovieCommand = {
@@ -21,7 +21,7 @@ export type AutoMovieCommand = {
21
21
  directory: string;
22
22
  /** Install a pnpm workspace root instead of a single production. */
23
23
  workspace: boolean;
24
- /** Admit a non-empty target, as `publishFiles`' `force` option defines it. */
24
+ /** Admit a non-empty target, writing over same-path files and keeping the rest. */
25
25
  force: boolean;
26
26
  /** Package name as typed; absent, `run` derives or asks for one. */
27
27
  name?: string;
@@ -32,17 +32,28 @@ export type AutoMovieCommand = {
32
32
  family: "shorts" | "series";
33
33
  /** The production's directory under `movies/<family>`, one admitted path segment. */
34
34
  directory: string;
35
- /** Admit a non-empty production directory, as `publishFiles`' `force` option defines it. */
35
+ /** Admit a non-empty production directory, writing over same-path files and keeping the rest. */
36
36
  force: boolean;
37
37
  /** Package name as typed; absent, `run` derives one from the directory segment. */
38
38
  name?: string;
39
39
  } | {
40
- /** Update only generated instructions. */
41
- command: "sync";
42
- /** The directory holding `AGENTS.md`, resolved by run. */
43
- directory: string;
44
- /** Inspect pending changes and conflicts without writing. */
45
- check: boolean;
46
- /** Explicit prior adopted instruction root; the files it supplies govern over stored sync state. */
47
- baseline?: string;
40
+ /** Capture stills of a subject or a video file in the production at the working directory. */
41
+ command: "capture";
42
+ /** The tokens after `capture`, as typed; `run` reads them through the production's request grammar, which only the production's `@automovie/render` holds. */
43
+ args: string[];
44
+ } | {
45
+ /** Serve the inspector page over a subject module of the production or package at the working directory. */
46
+ command: "inspect";
47
+ /** The tokens after `inspect`, as typed; `run` reads them through the production's request grammar, as for `capture`. */
48
+ args: string[];
49
+ } | {
50
+ /** Render one subject of the production at the working directory into a video. */
51
+ command: "render";
52
+ /** The tokens after `render`, as typed; `run` reads them with the production's option reader. */
53
+ args: string[];
54
+ } | {
55
+ /** Record real-time playback of the production's running inspector page. */
56
+ command: "review";
57
+ /** The tokens after `review`, as typed; `run` reads them with the production's option reader. */
58
+ args: string[];
48
59
  };
@@ -0,0 +1,84 @@
1
+ import type { IAutoMovieDrawPage } from "@automovie/render";
2
+ /**
3
+ * The part of `playwright-core`'s `chromium` the capture host calls, declared structurally so the command loads the production's own Playwright at run time and a test passes a double.
4
+ *
5
+ * @evidence contracts/development/design.md#principled-representation Playwright's own call shapes: launch with switches, then pages and a version from the browser.
6
+ * @evidence contracts/development/design.md#minimal-and-owned-surface Exactly what `launchAutoMovieChromium` and the capture host call; the page is the draw session's structural page.
7
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts No Playwright type is imported, so the command compiles and installs without Playwright, which is an optional peer.
8
+ * @evidence contracts/development/common.md#meaningful-documentation States who satisfies it and why it is structural.
9
+ */
10
+ export interface IAutoMovieChromium {
11
+ /**
12
+ * Start a headless browser with the given switches, from `executablePath` when given.
13
+ *
14
+ * @evidence contracts/development/common.md#meaningful-documentation States what is started and from where.
15
+ * @evidenceExclude contracts/development/implementation.md#principled-implementation A signature has no body; Playwright answers.
16
+ * @evidenceExclude contracts/development/implementation.md#clear-and-simple-structure A signature has no body; Playwright answers.
17
+ * @evidenceExclude contracts/development/implementation.md#prohibited-implementation-shortcuts A signature has no body; Playwright answers.
18
+ * @evidenceExclude contracts/development/implementation.md#efficient-algorithms A signature has no body; Playwright answers.
19
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A signature has no body; Playwright answers.
20
+ * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources A signature has no body; Playwright answers.
21
+ */
22
+ launch(options: {
23
+ headless: true;
24
+ args: string[];
25
+ executablePath?: string;
26
+ }): Promise<IAutoMovieChromium.IBrowser>;
27
+ }
28
+ export declare namespace IAutoMovieChromium {
29
+ /**
30
+ * A launched browser: its version, its pages, and its end.
31
+ *
32
+ * @evidence contracts/development/design.md#principled-representation Playwright's `Browser` call shapes.
33
+ * @evidence contracts/development/design.md#minimal-and-owned-surface The three calls the host makes.
34
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts Structural, as its parent.
35
+ * @evidence contracts/development/common.md#meaningful-documentation States what it is.
36
+ */
37
+ interface IBrowser {
38
+ /**
39
+ * The browser's version, such as `131.0.6778.33`.
40
+ *
41
+ * @evidence contracts/development/common.md#meaningful-documentation States what is returned.
42
+ * @evidenceExclude contracts/development/implementation.md#principled-implementation A signature has no body; Playwright answers.
43
+ * @evidenceExclude contracts/development/implementation.md#clear-and-simple-structure A signature has no body; Playwright answers.
44
+ * @evidenceExclude contracts/development/implementation.md#prohibited-implementation-shortcuts A signature has no body; Playwright answers.
45
+ * @evidenceExclude contracts/development/implementation.md#efficient-algorithms A signature has no body; Playwright answers.
46
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A signature has no body; Playwright answers.
47
+ * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources A signature has no body; Playwright answers.
48
+ */
49
+ version(): string;
50
+ /**
51
+ * Open a fresh page.
52
+ *
53
+ * @evidence contracts/development/common.md#meaningful-documentation States the effect.
54
+ * @evidenceExclude contracts/development/implementation.md#principled-implementation A signature has no body; Playwright answers.
55
+ * @evidenceExclude contracts/development/implementation.md#clear-and-simple-structure A signature has no body; Playwright answers.
56
+ * @evidenceExclude contracts/development/implementation.md#prohibited-implementation-shortcuts A signature has no body; Playwright answers.
57
+ * @evidenceExclude contracts/development/implementation.md#efficient-algorithms A signature has no body; Playwright answers.
58
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A signature has no body; Playwright answers.
59
+ * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources A signature has no body; Playwright answers.
60
+ */
61
+ newPage(): Promise<IAutoMovieDrawPage & {
62
+ /** Optional browser diagnostics; portable draw-only drivers need not emit browser events. */
63
+ on?: {
64
+ (event: "pageerror", listener: (error: Error) => void): unknown;
65
+ (event: "console", listener: (message: {
66
+ type(): string;
67
+ text(): string;
68
+ }) => void): unknown;
69
+ };
70
+ }>;
71
+ /**
72
+ * End the browser and every page it holds.
73
+ *
74
+ * @evidence contracts/development/common.md#meaningful-documentation States the effect.
75
+ * @evidenceExclude contracts/development/implementation.md#principled-implementation A signature has no body; Playwright answers.
76
+ * @evidenceExclude contracts/development/implementation.md#clear-and-simple-structure A signature has no body; Playwright answers.
77
+ * @evidenceExclude contracts/development/implementation.md#prohibited-implementation-shortcuts A signature has no body; Playwright answers.
78
+ * @evidenceExclude contracts/development/implementation.md#efficient-algorithms A signature has no body; Playwright answers.
79
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A signature has no body; Playwright answers.
80
+ * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources A signature has no body; Playwright answers.
81
+ */
82
+ close(): Promise<void>;
83
+ }
84
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IAutoMovieChromium.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAutoMovieChromium.js","sourceRoot":"","sources":["../src/IAutoMovieChromium.ts"],"names":[],"mappings":""}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Run `automovie capture` in a production: read the options through the request grammar, capture a subject drawn by the draw page or a video file's own frames, print what was written, and resolve to the exit status.
3
+ *
4
+ * Options are read by `readAutoMovieCaptureArguments` and split by `readAutoMovieCaptureHostOptions`; the rest is the request `parseAutoMovieCapturePlanRequest` reads, so the command takes exactly the keys of a page's address. With `--module` the subject is drawn through `AutoMovieCaptureHost`, its module called with the JSON of `--props` when given; with `--file` the file is probed by FFmpeg and captured by `runAutoMovieVideoCapture`, its subject named by `subject` or the file's name. Both write into `--out`, or `media/capture/<subject>`.
5
+ *
6
+ * It prints the folder and how many cells were drawn, the backend, every sheet, every cell not drawn with its cause, and each unmatched or changed comparison entry. The status is 1 when any cell was not drawn, because an undrawn cell is unverified evidence, and 0 otherwise; a refusal throws to `run`, which prints it.
7
+ *
8
+ * @evidence contracts/development/common.md#meaningful-documentation States how options are read and split, both sources, where they write, what is printed, and the exit status with its reason.
9
+ * @evidence contracts/development/implementation.md#principled-implementation Every rule of a capture is the render package's; the command loads that package from the production, supplies the browser or FFmpeg, and reports.
10
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Read, then one branch per source, then one report.
11
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts An unknown option is refused by the request reader instead of ignored, and FFmpeg is resolved only for a video so a drawn capture never needs it.
12
+ * @evidence contracts/development/implementation.md#efficient-algorithms One host or two FFmpeg runs plus the probe; printing is linear in the record.
13
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work One capture per command.
14
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The host is closed on every outcome.
15
+ */
16
+ export declare function captureAutoMovie(props: {
17
+ /** The tokens after `capture`. */
18
+ args: readonly string[];
19
+ /** The production's root folder, the working directory. */
20
+ root: string;
21
+ /** The environment, read for `CHROME_PATH` and `FFMPEG_PATH`. */
22
+ env: Readonly<Record<string, string | undefined>>;
23
+ }): Promise<number>;
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.captureAutoMovie = captureAutoMovie;
37
+ const fs = __importStar(require("node:fs/promises"));
38
+ const path = __importStar(require("node:path"));
39
+ const AutoMovieCaptureHost_1 = require("./AutoMovieCaptureHost");
40
+ const loadAutoMovieProductionModule_1 = require("./loadAutoMovieProductionModule");
41
+ const readAutoMovieCaptureHostOptions_1 = require("./readAutoMovieCaptureHostOptions");
42
+ const readAutoMovieRevision_1 = require("./readAutoMovieRevision");
43
+ const readAutoMovieVideoProbe_1 = require("./readAutoMovieVideoProbe");
44
+ const resolveAutoMovieFfmpeg_1 = require("./resolveAutoMovieFfmpeg");
45
+ const runAutoMovieFfmpeg_1 = require("./runAutoMovieFfmpeg");
46
+ /**
47
+ * Run `automovie capture` in a production: read the options through the request grammar, capture a subject drawn by the draw page or a video file's own frames, print what was written, and resolve to the exit status.
48
+ *
49
+ * Options are read by `readAutoMovieCaptureArguments` and split by `readAutoMovieCaptureHostOptions`; the rest is the request `parseAutoMovieCapturePlanRequest` reads, so the command takes exactly the keys of a page's address. With `--module` the subject is drawn through `AutoMovieCaptureHost`, its module called with the JSON of `--props` when given; with `--file` the file is probed by FFmpeg and captured by `runAutoMovieVideoCapture`, its subject named by `subject` or the file's name. Both write into `--out`, or `media/capture/<subject>`.
50
+ *
51
+ * It prints the folder and how many cells were drawn, the backend, every sheet, every cell not drawn with its cause, and each unmatched or changed comparison entry. The status is 1 when any cell was not drawn, because an undrawn cell is unverified evidence, and 0 otherwise; a refusal throws to `run`, which prints it.
52
+ *
53
+ * @evidence contracts/development/common.md#meaningful-documentation States how options are read and split, both sources, where they write, what is printed, and the exit status with its reason.
54
+ * @evidence contracts/development/implementation.md#principled-implementation Every rule of a capture is the render package's; the command loads that package from the production, supplies the browser or FFmpeg, and reports.
55
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Read, then one branch per source, then one report.
56
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts An unknown option is refused by the request reader instead of ignored, and FFmpeg is resolved only for a video so a drawn capture never needs it.
57
+ * @evidence contracts/development/implementation.md#efficient-algorithms One host or two FFmpeg runs plus the probe; printing is linear in the record.
58
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work One capture per command.
59
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The host is closed on every outcome.
60
+ */
61
+ async function captureAutoMovie(props) {
62
+ const { root } = props;
63
+ const render = (0, loadAutoMovieProductionModule_1.loadAutoMovieProductionModule)(root, "@automovie/render");
64
+ const options = (0, readAutoMovieCaptureHostOptions_1.readAutoMovieCaptureHostOptions)(render.readAutoMovieCaptureArguments(props.args));
65
+ const request = render.parseAutoMovieCapturePlanRequest(options.request);
66
+ let record;
67
+ let backend;
68
+ let folder;
69
+ if (options.file !== null) {
70
+ // A video file: probe it, then capture its own frames.
71
+ const ffmpeg = (0, resolveAutoMovieFfmpeg_1.resolveAutoMovieFfmpeg)({
72
+ env: props.env,
73
+ load: (id) => (0, loadAutoMovieProductionModule_1.loadAutoMovieProductionModule)(root, id),
74
+ });
75
+ const file = path.resolve(root, options.file);
76
+ const probe = (0, readAutoMovieVideoProbe_1.readAutoMovieVideoProbe)(await (0, runAutoMovieFfmpeg_1.runAutoMovieFfmpeg)(ffmpeg, ["-hide_banner", "-i", file], () => true));
77
+ const name = request.subject ?? path.parse(file).name;
78
+ folder = path.resolve(root, options.out ?? path.join("media", "capture", name));
79
+ record = await render.runAutoMovieVideoCapture({
80
+ file,
81
+ subject: { name, ...probe },
82
+ request,
83
+ storage: fs,
84
+ root: folder,
85
+ run: async (args) => {
86
+ await (0, runAutoMovieFfmpeg_1.runAutoMovieFfmpeg)(ffmpeg, args);
87
+ },
88
+ revision: (0, readAutoMovieRevision_1.readAutoMovieRevision)(root),
89
+ });
90
+ backend = `ffmpeg ${ffmpeg}`;
91
+ }
92
+ else {
93
+ // A drawn subject, through the draw page in headless Chromium.
94
+ const host = await AutoMovieCaptureHost_1.AutoMovieCaptureHost.open({
95
+ root,
96
+ module: options.module,
97
+ backend: options.backend,
98
+ env: props.env,
99
+ });
100
+ try {
101
+ record = await host.capture({
102
+ request,
103
+ props: options.props === null
104
+ ? null
105
+ : JSON.parse(await fs.readFile(path.resolve(root, options.props), "utf8")),
106
+ ...(options.out === null ? {} : { out: options.out }),
107
+ });
108
+ }
109
+ finally {
110
+ await host.close();
111
+ }
112
+ backend = host.backend;
113
+ folder = path.resolve(root, options.out ?? path.join("media", "capture", record.subject.name));
114
+ }
115
+ // What was written, and what was not drawn.
116
+ const failed = record.rows.filter((row) => row.state === "failed");
117
+ const lines = [
118
+ `capture ${record.subject.name}: ${record.rows.length - failed.length} of ${record.rows.length} cells drawn into ${folder}`,
119
+ `backend ${backend}`,
120
+ ...record.sheets.map((sheet) => path.join(folder, sheet)),
121
+ ...failed.map((row) => `not drawn ${row.name}: ${row.cause}`),
122
+ ...(record.comparison === null
123
+ ? []
124
+ : record.comparison.entries.flatMap((entry) => entry.state === "unmatched"
125
+ ? [`unmatched ${entry.current ?? entry.earlier}: ${entry.cause}`]
126
+ : entry.mode === "difference" && entry.changed !== 0
127
+ ? [`changed ${entry.current}: ${entry.changed} pixels`]
128
+ : [])),
129
+ ];
130
+ process.stdout.write(`${lines.join("\n")}\n`);
131
+ return failed.length === 0 ? 0 : 1;
132
+ }
133
+ //# sourceMappingURL=captureAutoMovie.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"captureAutoMovie.js","sourceRoot":"","sources":["../src/captureAutoMovie.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAY,EAAE,6CAAyB;AACvC,MAAY,IAAI,sCAAkB;AAElC,iEAA8D;AAC9D,mFAAgF;AAChF,uFAAoF;AACpF,mEAAgE;AAChE,uEAAoE;AACpE,qEAAkE;AAClE,6DAA0D;AAE1D;;;;;;;;;;;;;;GAcG;AACI,KAAK,2BAA2B,KAStC;IACC,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IACvB,MAAM,MAAM,GAAkB,IAAA,6DAA6B,EACzD,IAAI,EACJ,mBAAmB,CACH,CAAC;IACnB,MAAM,OAAO,GACX,IAAA,iEAA+B,EAC7B,MAAM,CAAC,6BAA6B,CAAC,KAAK,CAAC,IAAI,CAAC,CACjD,CAAC;IACJ,MAAM,OAAO,GACX,MAAM,CAAC,gCAAgC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAE3D,IAAI,MAA+D,CAAC;IACpE,IAAI,OAAe,CAAC;IACpB,IAAI,MAAc,CAAC;IACnB,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;QAC1B,uDAAuD;QACvD,MAAM,MAAM,GAAW,IAAA,+CAAsB,EAAC;YAC5C,GAAG,EAAE,KAAK,CAAC,GAAG;YACd,IAAI,EAAE,CAAC,EAAU,EAAW,EAAE,CAAC,IAAA,6DAA6B,EAAC,IAAI,EAAE,EAAE,CAAC;SACvE,CAAC,CAAC;QACH,MAAM,IAAI,GAAW,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC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GAAG,CAAC,MAAM,CAAC,UAAU,KAAK,IAAI;YAC5B,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,CAC/B,CAAC,KAAsC,EAAY,EAAE,CACnD,KAAK,CAAC,KAAK,KAAK,WAAW;gBACzB,CAAC,CAAC,CAAC,aAAa,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,KAAK,KAAK,CAAC,KAAK,EAAE,CAAC;gBACjE,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,YAAY,IAAI,KAAK,CAAC,OAAO,KAAK,CAAC;oBAClD,CAAC,CAAC,CAAC,WAAW,KAAK,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,SAAS,CAAC;oBACvD,CAAC,CAAC,EAAE,CACX,CAAC;KACP,CAAC;IACF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9C,OAAO,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrC,CAAC"}
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * The basename is lowercased, each run of characters other than `a-z`, `0-9`, `.`, `_` and `-` becomes one `-`, the result is cut to npm's 214-character limit, and leading `-`, `.` or `_` and trailing `-` or `.` are removed. A basename with nothing left, such as a filesystem root, yields `AUTOMOVIE_DEFAULT_PROJECT_NAME`. `selectAutoMovieProjectName` passes a `create` request's absolute target, `run` passes an `add` request's directory segment, and `run` hands the result to the template renderer as the project name.
5
5
  *
6
- * This transformation does not validate npm's reserved names; `node_modules` and `favicon.ico` remain unchanged. Windows device names such as `con` also remain unchanged and are refused by `renderScaffold` before publication.
6
+ * This transformation does not validate npm's reserved names; `node_modules` and `favicon.ico` remain unchanged. Windows device names such as `con` also remain unchanged and are refused by `createAutoMovieScaffold` before any file is written.
7
7
  *
8
8
  * @evidence contracts/development/implementation.md#principled-implementation Lowercasing and character replacement produce an unscoped-name candidate from the basename in the host's path syntax, then the 214-character cut precedes trimming so the result stays within that limit. This is normalization rather than complete npm admission: reserved names remain unchanged, while the downstream scaffold renderer separately refuses Windows device names.
9
9
  * @evidence contracts/development/implementation.md#clear-and-simple-structure One pure function owns the directory-to-name rule, so `run` keeps only dispatch and the rule is checked without publishing a scaffold.
@@ -43,7 +43,7 @@ const NPM_NAME_LIMIT = 214;
43
43
  *
44
44
  * The basename is lowercased, each run of characters other than `a-z`, `0-9`, `.`, `_` and `-` becomes one `-`, the result is cut to npm's 214-character limit, and leading `-`, `.` or `_` and trailing `-` or `.` are removed. A basename with nothing left, such as a filesystem root, yields `AUTOMOVIE_DEFAULT_PROJECT_NAME`. `selectAutoMovieProjectName` passes a `create` request's absolute target, `run` passes an `add` request's directory segment, and `run` hands the result to the template renderer as the project name.
45
45
  *
46
- * This transformation does not validate npm's reserved names; `node_modules` and `favicon.ico` remain unchanged. Windows device names such as `con` also remain unchanged and are refused by `renderScaffold` before publication.
46
+ * This transformation does not validate npm's reserved names; `node_modules` and `favicon.ico` remain unchanged. Windows device names such as `con` also remain unchanged and are refused by `createAutoMovieScaffold` before any file is written.
47
47
  *
48
48
  * @evidence contracts/development/implementation.md#principled-implementation Lowercasing and character replacement produce an unscoped-name candidate from the basename in the host's path syntax, then the 214-character cut precedes trimming so the result stays within that limit. This is normalization rather than complete npm admission: reserved names remain unchanged, while the downstream scaffold renderer separately refuses Windows device names.
49
49
  * @evidence contracts/development/implementation.md#clear-and-simple-structure One pure function owns the directory-to-name rule, so `run` keeps only dispatch and the rule is checked without publishing a scaffold.
@@ -0,0 +1,14 @@
1
+ /**
2
+ * A TCP port the operating system reports free on 127.0.0.1 at the moment of asking, for a page server that must not take another server's port.
3
+ *
4
+ * The port is free only at that moment; the server that takes it listens with `strictPort`, so a port taken meanwhile fails the start instead of moving elsewhere.
5
+ *
6
+ * @evidence contracts/development/common.md#meaningful-documentation States what is returned, the race it leaves and how a caller closes it.
7
+ * @evidence contracts/development/implementation.md#principled-implementation Listening on port 0 asks the operating system for an unused ephemeral port, which the address then reports.
8
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Listen, read the address, close.
9
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No fixed port is guessed.
10
+ * @evidence contracts/development/implementation.md#efficient-algorithms One listen and one close.
11
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each server asks once.
12
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The probing server is closed before the promise resolves.
13
+ */
14
+ export declare function findAutoMovieFreePort(): Promise<number>;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.findAutoMovieFreePort = findAutoMovieFreePort;
37
+ const net = __importStar(require("node:net"));
38
+ /**
39
+ * A TCP port the operating system reports free on 127.0.0.1 at the moment of asking, for a page server that must not take another server's port.
40
+ *
41
+ * The port is free only at that moment; the server that takes it listens with `strictPort`, so a port taken meanwhile fails the start instead of moving elsewhere.
42
+ *
43
+ * @evidence contracts/development/common.md#meaningful-documentation States what is returned, the race it leaves and how a caller closes it.
44
+ * @evidence contracts/development/implementation.md#principled-implementation Listening on port 0 asks the operating system for an unused ephemeral port, which the address then reports.
45
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Listen, read the address, close.
46
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No fixed port is guessed.
47
+ * @evidence contracts/development/implementation.md#efficient-algorithms One listen and one close.
48
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each server asks once.
49
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The probing server is closed before the promise resolves.
50
+ */
51
+ function findAutoMovieFreePort() {
52
+ return new Promise((resolve, reject) => {
53
+ const server = net.createServer();
54
+ server.once("error", reject);
55
+ server.listen(0, "127.0.0.1", () => {
56
+ const address = server.address();
57
+ server.close(() => resolve(address.port));
58
+ });
59
+ });
60
+ }
61
+ //# sourceMappingURL=findAutoMovieFreePort.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findAutoMovieFreePort.js","sourceRoot":"","sources":["../src/findAutoMovieFreePort.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,GAAG,qCAAiB;AAEhC;;;;;;;;;;;;GAYG;AACH;IACE,OAAO,IAAI,OAAO,CAChB,CAAC,OAA+B,EAAE,MAA8B,EAAQ,EAAE;QACxE,MAAM,MAAM,GAAe,GAAG,CAAC,YAAY,EAAE,CAAC;QAC9C,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC7B,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,EAAE,GAAS,EAAE;YACvC,MAAM,OAAO,GAAoB,MAAM,CAAC,OAAO,EAAqB,CAAC;YACrE,MAAM,CAAC,KAAK,CAAC,GAAS,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The address of a served inspector page that opens on a request: the page's base address with the request's named text values as its query.
3
+ *
4
+ * `values` are the pairs `formatAutoMovieCapturePlanRequest` writes, in its order; they are joined by `URLSearchParams`, which the page reads back with the same decoder. The request that asks for nothing is the base address alone.
5
+ *
6
+ * @evidence contracts/development/common.md#meaningful-documentation States what the address holds, where the pairs come from, how they are encoded and the empty case.
7
+ * @evidence contracts/development/implementation.md#principled-implementation `URLSearchParams` writes `application/x-www-form-urlencoded`, which the page's `URLSearchParams` decodes to the same pairs, so the page reads the request the command was given.
8
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure One encoding and one join.
9
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No key is written here; the grammar's writer chose them.
10
+ * @evidence contracts/development/implementation.md#efficient-algorithms Linear in the pairs' length.
11
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A pure conversion.
12
+ * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Returns a fresh string and keeps nothing.
13
+ */
14
+ export declare function formatAutoMovieInspectUrl(base: string, values: readonly (readonly [key: string, value: string])[]): string;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatAutoMovieInspectUrl = formatAutoMovieInspectUrl;
4
+ /**
5
+ * The address of a served inspector page that opens on a request: the page's base address with the request's named text values as its query.
6
+ *
7
+ * `values` are the pairs `formatAutoMovieCapturePlanRequest` writes, in its order; they are joined by `URLSearchParams`, which the page reads back with the same decoder. The request that asks for nothing is the base address alone.
8
+ *
9
+ * @evidence contracts/development/common.md#meaningful-documentation States what the address holds, where the pairs come from, how they are encoded and the empty case.
10
+ * @evidence contracts/development/implementation.md#principled-implementation `URLSearchParams` writes `application/x-www-form-urlencoded`, which the page's `URLSearchParams` decodes to the same pairs, so the page reads the request the command was given.
11
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure One encoding and one join.
12
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No key is written here; the grammar's writer chose them.
13
+ * @evidence contracts/development/implementation.md#efficient-algorithms Linear in the pairs' length.
14
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A pure conversion.
15
+ * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Returns a fresh string and keeps nothing.
16
+ */
17
+ function formatAutoMovieInspectUrl(base, values) {
18
+ const query = new URLSearchParams(values.map(([key, value]) => [
19
+ key,
20
+ value,
21
+ ])).toString();
22
+ return query === "" ? base : `${base}?${query}`;
23
+ }
24
+ //# sourceMappingURL=formatAutoMovieInspectUrl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatAutoMovieInspectUrl.js","sourceRoot":"","sources":["../src/formatAutoMovieInspectUrl.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;GAYG;AACH,mCACE,IAAY,EACZ,MAA0D;IAE1D,MAAM,KAAK,GAAW,IAAI,eAAe,CACvC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAA4B,EAAoB,EAAE,CAAC;QACxE,GAAG;QACH,KAAK;KACN,CAAC,CACH,CAAC,QAAQ,EAAE,CAAC;IACb,OAAO,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,KAAK,EAAE,CAAC;AAClD,CAAC"}
package/lib/index.d.ts CHANGED
@@ -6,8 +6,36 @@ export * from "./readAutoMovieCreateArguments";
6
6
  export * from "./readAutoMovieAddArguments";
7
7
  export * from "./readAutoMovieNameOption";
8
8
  export * from "./selectAutoMovieProjectName";
9
- export * from "./IAutoMoviePackageManager";
10
- export * from "./selectAutoMoviePackageManager";
11
9
  export * from "./promptAutoMovieProjectName";
12
10
  export * from "./run";
13
11
  export * from "./renderAutoMovieScaffoldNextSteps";
12
+ export * from "./AutoMovieCaptureBackend";
13
+ export * from "./AutoMovieCaptureHost";
14
+ export * from "./captureAutoMovie";
15
+ export * from "./IAutoMovieChromium";
16
+ export * from "./launchAutoMovieChromium";
17
+ export * from "./loadAutoMovieProductionModule";
18
+ export * from "./planAutoMovieChromiumLaunch";
19
+ export * from "./readAutoMovieCaptureHostOptions";
20
+ export * from "./readAutoMovieRevision";
21
+ export * from "./readAutoMovieVideoProbe";
22
+ export * from "./resolveAutoMovieFfmpeg";
23
+ export * from "./runAutoMovieFfmpeg";
24
+ export * from "./serveAutoMovieDrawPage";
25
+ export * from "./AUTOMOVIE_INSPECT_OPTIONS";
26
+ export * from "./findAutoMovieFreePort";
27
+ export * from "./formatAutoMovieInspectUrl";
28
+ export * from "./inspectAutoMovie";
29
+ export * from "./readAutoMovieInspectHostOptions";
30
+ export * from "./serveAutoMovieInspectorPage";
31
+ export * from "./writeAutoMovieModulePage";
32
+ export * from "./planAutoMovieModulePageViteConfig";
33
+ export * from "./AUTOMOVIE_CAPTURE_OPTIONS";
34
+ export * from "./AUTOMOVIE_RENDER_OPTIONS";
35
+ export * from "./AUTOMOVIE_REVIEW_OPTIONS";
36
+ export * from "./readAutoMovieRenderOptions";
37
+ export * from "./readAutoMovieReviewOptions";
38
+ export * from "./recordAutoMoviePlayback";
39
+ export * from "./renderAutoMovie";
40
+ export * from "./renderAutoMovieVideo";
41
+ export * from "./reviewAutoMovie";
package/lib/index.js CHANGED
@@ -22,9 +22,37 @@ __exportStar(require("./readAutoMovieCreateArguments"), exports);
22
22
  __exportStar(require("./readAutoMovieAddArguments"), exports);
23
23
  __exportStar(require("./readAutoMovieNameOption"), exports);
24
24
  __exportStar(require("./selectAutoMovieProjectName"), exports);
25
- __exportStar(require("./IAutoMoviePackageManager"), exports);
26
- __exportStar(require("./selectAutoMoviePackageManager"), exports);
27
25
  __exportStar(require("./promptAutoMovieProjectName"), exports);
28
26
  __exportStar(require("./run"), exports);
29
27
  __exportStar(require("./renderAutoMovieScaffoldNextSteps"), exports);
28
+ __exportStar(require("./AutoMovieCaptureBackend"), exports);
29
+ __exportStar(require("./AutoMovieCaptureHost"), exports);
30
+ __exportStar(require("./captureAutoMovie"), exports);
31
+ __exportStar(require("./IAutoMovieChromium"), exports);
32
+ __exportStar(require("./launchAutoMovieChromium"), exports);
33
+ __exportStar(require("./loadAutoMovieProductionModule"), exports);
34
+ __exportStar(require("./planAutoMovieChromiumLaunch"), exports);
35
+ __exportStar(require("./readAutoMovieCaptureHostOptions"), exports);
36
+ __exportStar(require("./readAutoMovieRevision"), exports);
37
+ __exportStar(require("./readAutoMovieVideoProbe"), exports);
38
+ __exportStar(require("./resolveAutoMovieFfmpeg"), exports);
39
+ __exportStar(require("./runAutoMovieFfmpeg"), exports);
40
+ __exportStar(require("./serveAutoMovieDrawPage"), exports);
41
+ __exportStar(require("./AUTOMOVIE_INSPECT_OPTIONS"), exports);
42
+ __exportStar(require("./findAutoMovieFreePort"), exports);
43
+ __exportStar(require("./formatAutoMovieInspectUrl"), exports);
44
+ __exportStar(require("./inspectAutoMovie"), exports);
45
+ __exportStar(require("./readAutoMovieInspectHostOptions"), exports);
46
+ __exportStar(require("./serveAutoMovieInspectorPage"), exports);
47
+ __exportStar(require("./writeAutoMovieModulePage"), exports);
48
+ __exportStar(require("./planAutoMovieModulePageViteConfig"), exports);
49
+ __exportStar(require("./AUTOMOVIE_CAPTURE_OPTIONS"), exports);
50
+ __exportStar(require("./AUTOMOVIE_RENDER_OPTIONS"), exports);
51
+ __exportStar(require("./AUTOMOVIE_REVIEW_OPTIONS"), exports);
52
+ __exportStar(require("./readAutoMovieRenderOptions"), exports);
53
+ __exportStar(require("./readAutoMovieReviewOptions"), exports);
54
+ __exportStar(require("./recordAutoMoviePlayback"), exports);
55
+ __exportStar(require("./renderAutoMovie"), exports);
56
+ __exportStar(require("./renderAutoMovieVideo"), exports);
57
+ __exportStar(require("./reviewAutoMovie"), exports);
30
58
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,kEAAgD;AAChD,+DAA6C;AAC7C,mEAAiD;AACjD,iEAA+C;AAC/C,8DAA4C;AAC5C,4DAA0C;AAC1C,+DAA6C;AAC7C,6DAA2C;AAC3C,kEAAgD;AAChD,+DAA6C;AAC7C,wCAAsB;AACtB,qEAAmD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,kEAAgD;AAChD,+DAA6C;AAC7C,mEAAiD;AACjD,iEAA+C;AAC/C,8DAA4C;AAC5C,4DAA0C;AAC1C,+DAA6C;AAC7C,+DAA6C;AAC7C,wCAAsB;AACtB,qEAAmD;AACnD,4DAA0C;AAC1C,yDAAuC;AACvC,qDAAmC;AACnC,uDAAqC;AACrC,4DAA0C;AAC1C,kEAAgD;AAChD,gEAA8C;AAC9C,oEAAkD;AAClD,0DAAwC;AACxC,4DAA0C;AAC1C,2DAAyC;AACzC,uDAAqC;AACrC,2DAAyC;AACzC,8DAA4C;AAC5C,0DAAwC;AACxC,8DAA4C;AAC5C,qDAAmC;AACnC,oEAAkD;AAClD,gEAA8C;AAC9C,6DAA2C;AAC3C,sEAAoD;AACpD,8DAA4C;AAC5C,6DAA2C;AAC3C,6DAA2C;AAC3C,+DAA6C;AAC7C,+DAA6C;AAC7C,4DAA0C;AAC1C,oDAAkC;AAClC,yDAAuC;AACvC,oDAAkC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Run `automovie inspect` in a production or package: serve the inspector page over a subject module, print its address with the request as the query, and keep serving until the process is interrupted.
3
+ *
4
+ * Options are read by the production's `readAutoMovieCaptureArguments` and split by `readAutoMovieInspectHostOptions`; the rest is read by `parseAutoMovieCapturePlanRequest`, so a request the capture command would refuse is refused here before anything is served, as is a `--props` file that is not JSON, and an accepted one is written back by `formatAutoMovieCapturePlanRequest` as the address's query. `@automovie/render`, `vite`, and through the page `@automovie/viewer`, `react` and `react-dom`, come from the production. On SIGINT or SIGTERM the server stops, the page is deleted, and the status is 0; a refusal throws to `run`, which prints it.
5
+ *
6
+ * @evidence contracts/development/common.md#meaningful-documentation States how options are read and checked, what is served and printed, which packages come from the production, how the command ends and its status.
7
+ * @evidence contracts/development/implementation.md#principled-implementation Every rule of the request is the render package's and every rule of the page the viewer's; the command loads them from the production, serves, and reports, as `automovie capture` does.
8
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure Read, serve, print, wait, close.
9
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts A request is read before the server starts, so a mistyped key never opens a page that silently ignores it.
10
+ * @evidence contracts/development/implementation.md#efficient-algorithms One server for the command's life.
11
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work One page per command.
12
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The server and its page are closed when the process is interrupted; the signal listeners are removed with them.
13
+ */
14
+ export declare function inspectAutoMovie(props: {
15
+ /** The tokens after `inspect`. */
16
+ args: readonly string[];
17
+ /** The production's or package's root folder, the working directory. */
18
+ root: string;
19
+ }): Promise<number>;