automovie 0.0.0 → 0.2.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.
- package/README.md +145 -18
- package/lib/AUTOMOVIE_CAPTURE_OPTIONS.d.ts +6 -0
- package/lib/AUTOMOVIE_CAPTURE_OPTIONS.js +16 -0
- package/lib/AUTOMOVIE_CAPTURE_OPTIONS.js.map +1 -0
- package/lib/AUTOMOVIE_INSPECT_OPTIONS.d.ts +6 -0
- package/lib/AUTOMOVIE_INSPECT_OPTIONS.js +14 -0
- package/lib/AUTOMOVIE_INSPECT_OPTIONS.js.map +1 -0
- package/lib/AUTOMOVIE_RENDER_OPTIONS.d.ts +6 -0
- package/lib/AUTOMOVIE_RENDER_OPTIONS.js +15 -0
- package/lib/AUTOMOVIE_RENDER_OPTIONS.js.map +1 -0
- package/lib/AUTOMOVIE_REVIEW_OPTIONS.d.ts +6 -0
- package/lib/AUTOMOVIE_REVIEW_OPTIONS.js +14 -0
- package/lib/AUTOMOVIE_REVIEW_OPTIONS.js.map +1 -0
- package/lib/AutoMovieCaptureBackend.d.ts +9 -0
- package/lib/{IAutoMoviePackageManager.js → AutoMovieCaptureBackend.js} +1 -1
- package/lib/AutoMovieCaptureBackend.js.map +1 -0
- package/lib/AutoMovieCaptureHost.d.ts +114 -0
- package/lib/AutoMovieCaptureHost.js +219 -0
- package/lib/AutoMovieCaptureHost.js.map +1 -0
- package/lib/AutoMovieCommand.d.ts +24 -13
- package/lib/IAutoMovieChromium.d.ts +75 -0
- package/lib/IAutoMovieChromium.js +3 -0
- package/lib/IAutoMovieChromium.js.map +1 -0
- package/lib/captureAutoMovie.d.ts +23 -0
- package/lib/captureAutoMovie.js +133 -0
- package/lib/captureAutoMovie.js.map +1 -0
- package/lib/deriveAutoMovieProjectName.d.ts +1 -1
- package/lib/deriveAutoMovieProjectName.js +1 -1
- package/lib/findAutoMovieFreePort.d.ts +14 -0
- package/lib/findAutoMovieFreePort.js +61 -0
- package/lib/findAutoMovieFreePort.js.map +1 -0
- package/lib/formatAutoMovieInspectUrl.d.ts +14 -0
- package/lib/formatAutoMovieInspectUrl.js +24 -0
- package/lib/formatAutoMovieInspectUrl.js.map +1 -0
- package/lib/index.d.ts +30 -2
- package/lib/index.js +30 -2
- package/lib/index.js.map +1 -1
- package/lib/inspectAutoMovie.d.ts +19 -0
- package/lib/inspectAutoMovie.js +97 -0
- package/lib/inspectAutoMovie.js.map +1 -0
- package/lib/launchAutoMovieChromium.d.ts +28 -0
- package/lib/launchAutoMovieChromium.js +42 -0
- package/lib/launchAutoMovieChromium.js.map +1 -0
- package/lib/loadAutoMovieProductionModule.d.ts +14 -0
- package/lib/loadAutoMovieProductionModule.js +61 -0
- package/lib/loadAutoMovieProductionModule.js.map +1 -0
- package/lib/planAutoMovieChromiumLaunch.d.ts +27 -0
- package/lib/planAutoMovieChromiumLaunch.js +34 -0
- package/lib/planAutoMovieChromiumLaunch.js.map +1 -0
- package/lib/planAutoMovieModulePageViteConfig.d.ts +37 -0
- package/lib/planAutoMovieModulePageViteConfig.js +27 -0
- package/lib/planAutoMovieModulePageViteConfig.js.map +1 -0
- package/lib/readAutoMovieAddArguments.d.ts +1 -1
- package/lib/readAutoMovieAddArguments.js +1 -1
- package/lib/readAutoMovieCaptureHostOptions.d.ts +36 -0
- package/lib/readAutoMovieCaptureHostOptions.js +57 -0
- package/lib/readAutoMovieCaptureHostOptions.js.map +1 -0
- package/lib/readAutoMovieCommandArguments.d.ts +1 -1
- package/lib/readAutoMovieCommandArguments.js +10 -5
- package/lib/readAutoMovieCommandArguments.js.map +1 -1
- package/lib/readAutoMovieCreateArguments.d.ts +1 -1
- package/lib/readAutoMovieCreateArguments.js +1 -1
- package/lib/readAutoMovieInspectHostOptions.d.ts +29 -0
- package/lib/readAutoMovieInspectHostOptions.js +48 -0
- package/lib/readAutoMovieInspectHostOptions.js.map +1 -0
- package/lib/readAutoMovieRenderOptions.d.ts +33 -0
- package/lib/readAutoMovieRenderOptions.js +51 -0
- package/lib/readAutoMovieRenderOptions.js.map +1 -0
- package/lib/readAutoMovieReviewOptions.d.ts +27 -0
- package/lib/readAutoMovieReviewOptions.js +54 -0
- package/lib/readAutoMovieReviewOptions.js.map +1 -0
- package/lib/readAutoMovieRevision.d.ts +12 -0
- package/lib/readAutoMovieRevision.js +32 -0
- package/lib/readAutoMovieRevision.js.map +1 -0
- package/lib/readAutoMovieVideoProbe.d.ts +23 -0
- package/lib/readAutoMovieVideoProbe.js +39 -0
- package/lib/readAutoMovieVideoProbe.js.map +1 -0
- package/lib/recordAutoMoviePlayback.d.ts +37 -0
- package/lib/recordAutoMoviePlayback.js +122 -0
- package/lib/recordAutoMoviePlayback.js.map +1 -0
- package/lib/renderAutoMovie.d.ts +21 -0
- package/lib/renderAutoMovie.js +95 -0
- package/lib/renderAutoMovie.js.map +1 -0
- package/lib/renderAutoMovieScaffoldNextSteps.d.ts +3 -5
- package/lib/renderAutoMovieScaffoldNextSteps.js +5 -14
- package/lib/renderAutoMovieScaffoldNextSteps.js.map +1 -1
- package/lib/renderAutoMovieVideo.d.ts +35 -0
- package/lib/renderAutoMovieVideo.js +110 -0
- package/lib/renderAutoMovieVideo.js.map +1 -0
- package/lib/resolveAutoMovieFfmpeg.d.ts +19 -0
- package/lib/resolveAutoMovieFfmpeg.js +32 -0
- package/lib/resolveAutoMovieFfmpeg.js.map +1 -0
- package/lib/reviewAutoMovie.d.ts +21 -0
- package/lib/reviewAutoMovie.js +71 -0
- package/lib/reviewAutoMovie.js.map +1 -0
- package/lib/run.d.ts +14 -11
- package/lib/run.js +103 -67
- package/lib/run.js.map +1 -1
- package/lib/runAutoMovieFfmpeg.d.ts +14 -0
- package/lib/runAutoMovieFfmpeg.js +40 -0
- package/lib/runAutoMovieFfmpeg.js.map +1 -0
- package/lib/serveAutoMovieDrawPage.d.ts +28 -0
- package/lib/serveAutoMovieDrawPage.js +108 -0
- package/lib/serveAutoMovieDrawPage.js.map +1 -0
- package/lib/serveAutoMovieInspectorPage.d.ts +32 -0
- package/lib/serveAutoMovieInspectorPage.js +52 -0
- package/lib/serveAutoMovieInspectorPage.js.map +1 -0
- package/lib/writeAutoMovieModulePage.d.ts +38 -0
- package/lib/writeAutoMovieModulePage.js +75 -0
- package/lib/writeAutoMovieModulePage.js.map +1 -0
- package/package.json +27 -6
- package/src/AUTOMOVIE_CAPTURE_OPTIONS.ts +12 -0
- package/src/AUTOMOVIE_INSPECT_OPTIONS.ts +10 -0
- package/src/AUTOMOVIE_RENDER_OPTIONS.ts +11 -0
- package/src/AUTOMOVIE_REVIEW_OPTIONS.ts +10 -0
- package/src/AutoMovieCaptureBackend.ts +9 -0
- package/src/AutoMovieCaptureHost.ts +245 -0
- package/src/AutoMovieCommand.ts +28 -13
- package/src/IAutoMovieChromium.ts +78 -0
- package/src/captureAutoMovie.ts +148 -0
- package/src/deriveAutoMovieProjectName.ts +1 -1
- package/src/findAutoMovieFreePort.ts +27 -0
- package/src/formatAutoMovieInspectUrl.ts +25 -0
- package/src/index.ts +30 -2
- package/src/inspectAutoMovie.ts +81 -0
- package/src/launchAutoMovieChromium.ts +61 -0
- package/src/loadAutoMovieProductionModule.ts +30 -0
- package/src/planAutoMovieChromiumLaunch.ts +45 -0
- package/src/planAutoMovieModulePageViteConfig.ts +53 -0
- package/src/readAutoMovieAddArguments.ts +1 -1
- package/src/readAutoMovieCaptureHostOptions.ts +76 -0
- package/src/readAutoMovieCommandArguments.ts +6 -4
- package/src/readAutoMovieCreateArguments.ts +1 -1
- package/src/readAutoMovieInspectHostOptions.ts +66 -0
- package/src/readAutoMovieRenderOptions.ts +67 -0
- package/src/readAutoMovieReviewOptions.ts +70 -0
- package/src/readAutoMovieRevision.ts +29 -0
- package/src/readAutoMovieVideoProbe.ts +55 -0
- package/src/recordAutoMoviePlayback.ts +168 -0
- package/src/renderAutoMovie.ts +86 -0
- package/src/renderAutoMovieScaffoldNextSteps.ts +4 -18
- package/src/renderAutoMovieVideo.ts +127 -0
- package/src/resolveAutoMovieFfmpeg.ts +33 -0
- package/src/reviewAutoMovie.ts +65 -0
- package/src/run.ts +116 -105
- package/src/runAutoMovieFfmpeg.ts +50 -0
- package/src/serveAutoMovieDrawPage.ts +105 -0
- package/src/serveAutoMovieInspectorPage.ts +82 -0
- package/src/writeAutoMovieModulePage.ts +83 -0
- package/lib/IAutoMoviePackageManager.d.ts +0 -14
- package/lib/IAutoMoviePackageManager.js.map +0 -1
- package/lib/readAutoMovieSyncArguments.d.ts +0 -13
- package/lib/readAutoMovieSyncArguments.js +0 -49
- package/lib/readAutoMovieSyncArguments.js.map +0 -1
- package/lib/selectAutoMoviePackageManager.d.ts +0 -23
- package/lib/selectAutoMoviePackageManager.js +0 -70
- package/lib/selectAutoMoviePackageManager.js.map +0 -1
- package/src/IAutoMoviePackageManager.ts +0 -15
- package/src/readAutoMovieSyncArguments.ts +0 -48
- package/src/selectAutoMoviePackageManager.ts +0 -45
|
@@ -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,
|
|
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>;
|
|
@@ -0,0 +1,97 @@
|
|
|
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.inspectAutoMovie = inspectAutoMovie;
|
|
37
|
+
const fs = __importStar(require("node:fs"));
|
|
38
|
+
const path = __importStar(require("node:path"));
|
|
39
|
+
const formatAutoMovieInspectUrl_1 = require("./formatAutoMovieInspectUrl");
|
|
40
|
+
const loadAutoMovieProductionModule_1 = require("./loadAutoMovieProductionModule");
|
|
41
|
+
const readAutoMovieInspectHostOptions_1 = require("./readAutoMovieInspectHostOptions");
|
|
42
|
+
const serveAutoMovieInspectorPage_1 = require("./serveAutoMovieInspectorPage");
|
|
43
|
+
/**
|
|
44
|
+
* 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.
|
|
45
|
+
*
|
|
46
|
+
* 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.
|
|
47
|
+
*
|
|
48
|
+
* @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.
|
|
49
|
+
* @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.
|
|
50
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure Read, serve, print, wait, close.
|
|
51
|
+
* @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.
|
|
52
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms One server for the command's life.
|
|
53
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work One page per command.
|
|
54
|
+
* @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.
|
|
55
|
+
*/
|
|
56
|
+
async function inspectAutoMovie(props) {
|
|
57
|
+
const { root } = props;
|
|
58
|
+
const render = (0, loadAutoMovieProductionModule_1.loadAutoMovieProductionModule)(root, "@automovie/render");
|
|
59
|
+
const options = (0, readAutoMovieInspectHostOptions_1.readAutoMovieInspectHostOptions)(render.readAutoMovieCaptureArguments(props.args));
|
|
60
|
+
const request = render.parseAutoMovieCapturePlanRequest(options.request);
|
|
61
|
+
// The module's props, read before anything is served.
|
|
62
|
+
let data = null;
|
|
63
|
+
if (options.props !== null) {
|
|
64
|
+
const file = path.resolve(root, options.props);
|
|
65
|
+
try {
|
|
66
|
+
data = JSON.parse(fs.readFileSync(file, "utf8"));
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
throw new Error(`Inspect --props ${file} is not a readable JSON file`, {
|
|
70
|
+
cause: error,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// Vite's CommonJS entry warns once per load; the command loads it on purpose.
|
|
75
|
+
process.env.VITE_CJS_IGNORE_WARNING = "true";
|
|
76
|
+
const page = await (0, serveAutoMovieInspectorPage_1.serveAutoMovieInspectorPage)({
|
|
77
|
+
root,
|
|
78
|
+
module: options.module,
|
|
79
|
+
vite: (0, loadAutoMovieProductionModule_1.loadAutoMovieProductionModule)(root, "vite"),
|
|
80
|
+
port: options.port,
|
|
81
|
+
props: data,
|
|
82
|
+
});
|
|
83
|
+
process.stdout.write(`inspect ${options.module}: ${(0, formatAutoMovieInspectUrl_1.formatAutoMovieInspectUrl)(page.url, render.formatAutoMovieCapturePlanRequest(request))}\nPress Ctrl+C to stop.\n`);
|
|
84
|
+
// Serve until interrupted.
|
|
85
|
+
await new Promise((resolve) => {
|
|
86
|
+
const stop = () => {
|
|
87
|
+
process.off("SIGINT", stop);
|
|
88
|
+
process.off("SIGTERM", stop);
|
|
89
|
+
resolve(undefined);
|
|
90
|
+
};
|
|
91
|
+
process.on("SIGINT", stop);
|
|
92
|
+
process.on("SIGTERM", stop);
|
|
93
|
+
});
|
|
94
|
+
await page.close();
|
|
95
|
+
return 0;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=inspectAutoMovie.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspectAutoMovie.js","sourceRoot":"","sources":["../src/inspectAutoMovie.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,MAAY,EAAE,oCAAgB;AAC9B,MAAY,IAAI,sCAAkB;AAElC,2EAAwE;AACxE,mFAAgF;AAChF,uFAAoF;AACpF,+EAA4E;AAE5E;;;;;;;;;;;;GAYG;AACI,KAAK,2BAA2B,KAMtC;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,sDAAsD;IACtD,IAAI,IAAI,GAAY,IAAI,CAAC;IACzB,IAAI,OAAO,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;QAC3B,MAAM,IAAI,GAAW,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QACvD,IAAI,CAAC;YACH,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAY,CAAC;QAC9D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,mBAAmB,IAAI,8BAA8B,EAAE;gBACrE,KAAK,EAAE,KAAK;aACb,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,8EAA8E;IAC9E,OAAO,CAAC,GAAG,CAAC,uBAAuB,GAAG,MAAM,CAAC;IAC7C,MAAM,IAAI,GACR,MAAM,IAAA,yDAA2B,EAAC;QAChC,IAAI;QACJ,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,IAAI,EAAE,IAAA,6DAA6B,EAAC,IAAI,EAAE,MAAM,CAAC;QACjD,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,KAAK,EAAE,IAAI;KACZ,CAAC,CAAC;IACL,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,WAAW,OAAO,CAAC,MAAM,KAAK,IAAA,qDAAyB,EAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,iCAAiC,CAAC,OAAO,CAAC,CAAC,2BAA2B,CAChJ,CAAC;IAEF,2BAA2B;IAC3B,MAAM,IAAI,OAAO,CAAY,CAAC,OAAmC,EAAQ,EAAE;QACzE,MAAM,IAAI,GAAe,GAAS,EAAE;YAClC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YAC5B,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;YAC7B,OAAO,CAAC,SAAS,CAAC,CAAC;QACrB,CAAC,CAAC;QACF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC3B,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IACH,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;IACnB,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { AutoMovieCaptureBackend } from "./AutoMovieCaptureBackend";
|
|
2
|
+
import type { IAutoMovieChromium } from "./IAutoMovieChromium";
|
|
3
|
+
/**
|
|
4
|
+
* Launch headless Chromium for a capture backend, and describe the launch the way a record names it: the backend, then the Chromium version.
|
|
5
|
+
*
|
|
6
|
+
* A launch that fails because the browser executable is missing is rethrown as an error naming `npx playwright-core install chromium-headless-shell` and `CHROME_PATH`; any other failure is rethrown with the backend named.
|
|
7
|
+
*
|
|
8
|
+
* @evidence contracts/development/common.md#meaningful-documentation States what is launched, the description's form and both failures.
|
|
9
|
+
* @evidence contracts/development/implementation.md#principled-implementation Switches come from `planAutoMovieChromiumLaunch`; Playwright reports a missing browser as an executable that does not exist, which is the message matched, so only that case is turned into the install instruction.
|
|
10
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure Plan, launch, describe.
|
|
11
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No other browser or backend is tried after a failure.
|
|
12
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms One launch.
|
|
13
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each capture host launches its own browser.
|
|
14
|
+
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources The returned browser is the caller's to close; a failed launch leaves none.
|
|
15
|
+
*/
|
|
16
|
+
export declare function launchAutoMovieChromium(props: {
|
|
17
|
+
/** Playwright's `chromium`, loaded from the production. */
|
|
18
|
+
chromium: IAutoMovieChromium;
|
|
19
|
+
/** How the browser draws. */
|
|
20
|
+
backend: AutoMovieCaptureBackend;
|
|
21
|
+
/** The environment, read for `CHROME_PATH`. */
|
|
22
|
+
env: Readonly<Record<string, string | undefined>>;
|
|
23
|
+
}): Promise<{
|
|
24
|
+
/** The launched browser. */
|
|
25
|
+
browser: IAutoMovieChromium.IBrowser;
|
|
26
|
+
/** The backend and Chromium version, such as `swiftshader; Chromium 131.0.6778.33`. */
|
|
27
|
+
backend: string;
|
|
28
|
+
}>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.launchAutoMovieChromium = launchAutoMovieChromium;
|
|
4
|
+
const planAutoMovieChromiumLaunch_1 = require("./planAutoMovieChromiumLaunch");
|
|
5
|
+
/** The command that installs the Chromium build the production's `playwright-core` pins for headless use; `playwright-core`'s own command, so the revision is the one the production launches. */
|
|
6
|
+
const INSTALL = "npx playwright-core install chromium-headless-shell";
|
|
7
|
+
/**
|
|
8
|
+
* Launch headless Chromium for a capture backend, and describe the launch the way a record names it: the backend, then the Chromium version.
|
|
9
|
+
*
|
|
10
|
+
* A launch that fails because the browser executable is missing is rethrown as an error naming `npx playwright-core install chromium-headless-shell` and `CHROME_PATH`; any other failure is rethrown with the backend named.
|
|
11
|
+
*
|
|
12
|
+
* @evidence contracts/development/common.md#meaningful-documentation States what is launched, the description's form and both failures.
|
|
13
|
+
* @evidence contracts/development/implementation.md#principled-implementation Switches come from `planAutoMovieChromiumLaunch`; Playwright reports a missing browser as an executable that does not exist, which is the message matched, so only that case is turned into the install instruction.
|
|
14
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure Plan, launch, describe.
|
|
15
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No other browser or backend is tried after a failure.
|
|
16
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms One launch.
|
|
17
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each capture host launches its own browser.
|
|
18
|
+
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources The returned browser is the caller's to close; a failed launch leaves none.
|
|
19
|
+
*/
|
|
20
|
+
async function launchAutoMovieChromium(props) {
|
|
21
|
+
const plan = (0, planAutoMovieChromiumLaunch_1.planAutoMovieChromiumLaunch)(props.backend, props.env);
|
|
22
|
+
let browser;
|
|
23
|
+
try {
|
|
24
|
+
browser = await props.chromium.launch({
|
|
25
|
+
headless: true,
|
|
26
|
+
args: plan.args,
|
|
27
|
+
...(plan.executablePath === undefined
|
|
28
|
+
? {}
|
|
29
|
+
: { executablePath: plan.executablePath }),
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
34
|
+
if (/executable doesn't exist|executable does not exist/iu.test(message))
|
|
35
|
+
throw new Error(`No Chromium is installed for capture; run ${INSTALL} in the production, or set CHROME_PATH to a Chromium executable`, { cause: error });
|
|
36
|
+
throw new Error(`Chromium did not start for the ${plan.name} backend`, {
|
|
37
|
+
cause: error,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return { browser, backend: `${plan.name}; Chromium ${browser.version()}` };
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=launchAutoMovieChromium.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launchAutoMovieChromium.js","sourceRoot":"","sources":["../src/launchAutoMovieChromium.ts"],"names":[],"mappings":";;;AAEA,+EAA4E;AAE5E,kMAAkM;AAClM,MAAM,OAAO,GAAW,qDAAqD,CAAC;AAE9E;;;;;;;;;;;;GAYG;AACI,KAAK,kCAAkC,KAS7C;IAOC,MAAM,IAAI,GACR,IAAA,yDAA2B,EAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACxD,IAAI,OAAoC,CAAC;IACzC,IAAI,CAAC;QACH,OAAO,GAAG,MAAM,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;YACpC,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,GAAG,CAAC,IAAI,CAAC,cAAc,KAAK,SAAS;gBACnC,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC,EAAE,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC;SAC7C,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GACX,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACzD,IAAI,sDAAsD,CAAC,IAAI,CAAC,OAAO,CAAC;YACtE,MAAM,IAAI,KAAK,CACb,6CAA6C,OAAO,iEAAiE,EACrH,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;QACJ,MAAM,IAAI,KAAK,CAAC,kCAAkC,IAAI,CAAC,IAAI,UAAU,EAAE;YACrE,KAAK,EAAE,KAAK;SACb,CAAC,CAAC;IACL,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI,cAAc,OAAO,CAAC,OAAO,EAAE,EAAE,EAAE,CAAC;AAC7E,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Load a package as the production at `root` resolves it, for the capture host's optional peers: `@automovie/render`, `vite`, `playwright-core` and `ffmpeg-static`.
|
|
3
|
+
*
|
|
4
|
+
* The command itself depends on none of them, so `npx automovie create` installs nothing a capture needs; a production that captures installs them, and this resolves the copies it installed. It throws naming the package and the production when it is not installed there.
|
|
5
|
+
*
|
|
6
|
+
* @evidence contracts/development/common.md#meaningful-documentation States which packages it serves, why they come from the production, and the refusal.
|
|
7
|
+
* @evidence contracts/development/implementation.md#principled-implementation `createRequire` anchored at the production's `package.json` applies Node's resolution from that folder, the same copy the production's own scripts import.
|
|
8
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure One anchored require.
|
|
9
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No copy beside the command is tried, so a capture never draws with a renderer the production did not install.
|
|
10
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms One resolution; Node caches the module.
|
|
11
|
+
* @evidence contracts/development/implementation.md#reuse-equivalent-work Node's module cache serves a second load of the same package.
|
|
12
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The module stays in Node's cache for the process, as any import does.
|
|
13
|
+
*/
|
|
14
|
+
export declare function loadAutoMovieProductionModule(root: string, id: string): unknown;
|
|
@@ -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.loadAutoMovieProductionModule = loadAutoMovieProductionModule;
|
|
37
|
+
const node_module_1 = require("node:module");
|
|
38
|
+
const path = __importStar(require("node:path"));
|
|
39
|
+
/**
|
|
40
|
+
* Load a package as the production at `root` resolves it, for the capture host's optional peers: `@automovie/render`, `vite`, `playwright-core` and `ffmpeg-static`.
|
|
41
|
+
*
|
|
42
|
+
* The command itself depends on none of them, so `npx automovie create` installs nothing a capture needs; a production that captures installs them, and this resolves the copies it installed. It throws naming the package and the production when it is not installed there.
|
|
43
|
+
*
|
|
44
|
+
* @evidence contracts/development/common.md#meaningful-documentation States which packages it serves, why they come from the production, and the refusal.
|
|
45
|
+
* @evidence contracts/development/implementation.md#principled-implementation `createRequire` anchored at the production's `package.json` applies Node's resolution from that folder, the same copy the production's own scripts import.
|
|
46
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure One anchored require.
|
|
47
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No copy beside the command is tried, so a capture never draws with a renderer the production did not install.
|
|
48
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms One resolution; Node caches the module.
|
|
49
|
+
* @evidence contracts/development/implementation.md#reuse-equivalent-work Node's module cache serves a second load of the same package.
|
|
50
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The module stays in Node's cache for the process, as any import does.
|
|
51
|
+
*/
|
|
52
|
+
function loadAutoMovieProductionModule(root, id) {
|
|
53
|
+
const load = (0, node_module_1.createRequire)(path.join(root, "package.json"));
|
|
54
|
+
try {
|
|
55
|
+
return load(id);
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
throw new Error(`${id} is not installed in ${root}; capture loads it from the production, so add it to the production's dependencies`, { cause: error });
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=loadAutoMovieProductionModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadAutoMovieProductionModule.js","sourceRoot":"","sources":["../src/loadAutoMovieProductionModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA4C;AAC5C,MAAY,IAAI,sCAAkB;AAElC;;;;;;;;;;;;GAYG;AACH,uCACE,IAAY,EACZ,EAAU;IAEV,MAAM,IAAI,GAAmB,IAAA,2BAAa,EAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC;IAC5E,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,GAAG,EAAE,wBAAwB,IAAI,oFAAoF,EACrH,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { AutoMovieCaptureBackend } from "./AutoMovieCaptureBackend";
|
|
2
|
+
/**
|
|
3
|
+
* The Chromium switches and executable for a capture backend.
|
|
4
|
+
*
|
|
5
|
+
* | Backend | Switches | Named |
|
|
6
|
+
* | --- | --- | --- |
|
|
7
|
+
* | `software` | `--use-gl=angle --use-angle=swiftshader` | `swiftshader` |
|
|
8
|
+
* | `gpu` | `--use-gl=angle --use-angle=default --ignore-gpu-blocklist` | `gpu` |
|
|
9
|
+
*
|
|
10
|
+
* The executable is `CHROME_PATH` when the environment sets it to a non-blank path, else the Chromium build Playwright pins, which `executablePath` leaves absent.
|
|
11
|
+
*
|
|
12
|
+
* @evidence contracts/development/common.md#meaningful-documentation Tabulates each backend's switches and name and states where the executable comes from.
|
|
13
|
+
* @evidence contracts/development/implementation.md#principled-implementation Chromium's SwiftShader documentation selects the software backend through ANGLE with exactly these two switches, and Playwright already adds `--enable-unsafe-swiftshader`; `--use-angle=default` lets ANGLE pick the platform's GPU backend, such as Direct3D 11 on Windows, and the blocklist switch keeps a headless browser from refusing it.
|
|
14
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure One table lookup and one environment read.
|
|
15
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No backend is chosen from the machine; the caller states it, and the record names what the browser reported.
|
|
16
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Constant.
|
|
17
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A pure mapping.
|
|
18
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Returns fresh arrays and keeps nothing.
|
|
19
|
+
*/
|
|
20
|
+
export declare function planAutoMovieChromiumLaunch(backend: AutoMovieCaptureBackend, env: Readonly<Record<string, string | undefined>>): {
|
|
21
|
+
/** Switches passed to Chromium. */
|
|
22
|
+
args: string[];
|
|
23
|
+
/** Executable to launch, or absent for Playwright's own build. */
|
|
24
|
+
executablePath?: string;
|
|
25
|
+
/** The backend's name as the record states it. */
|
|
26
|
+
name: string;
|
|
27
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.planAutoMovieChromiumLaunch = planAutoMovieChromiumLaunch;
|
|
4
|
+
/**
|
|
5
|
+
* The Chromium switches and executable for a capture backend.
|
|
6
|
+
*
|
|
7
|
+
* | Backend | Switches | Named |
|
|
8
|
+
* | --- | --- | --- |
|
|
9
|
+
* | `software` | `--use-gl=angle --use-angle=swiftshader` | `swiftshader` |
|
|
10
|
+
* | `gpu` | `--use-gl=angle --use-angle=default --ignore-gpu-blocklist` | `gpu` |
|
|
11
|
+
*
|
|
12
|
+
* The executable is `CHROME_PATH` when the environment sets it to a non-blank path, else the Chromium build Playwright pins, which `executablePath` leaves absent.
|
|
13
|
+
*
|
|
14
|
+
* @evidence contracts/development/common.md#meaningful-documentation Tabulates each backend's switches and name and states where the executable comes from.
|
|
15
|
+
* @evidence contracts/development/implementation.md#principled-implementation Chromium's SwiftShader documentation selects the software backend through ANGLE with exactly these two switches, and Playwright already adds `--enable-unsafe-swiftshader`; `--use-angle=default` lets ANGLE pick the platform's GPU backend, such as Direct3D 11 on Windows, and the blocklist switch keeps a headless browser from refusing it.
|
|
16
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure One table lookup and one environment read.
|
|
17
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No backend is chosen from the machine; the caller states it, and the record names what the browser reported.
|
|
18
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Constant.
|
|
19
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A pure mapping.
|
|
20
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Returns fresh arrays and keeps nothing.
|
|
21
|
+
*/
|
|
22
|
+
function planAutoMovieChromiumLaunch(backend, env) {
|
|
23
|
+
const chrome = env.CHROME_PATH?.trim();
|
|
24
|
+
return {
|
|
25
|
+
args: backend === "software"
|
|
26
|
+
? ["--use-gl=angle", "--use-angle=swiftshader"]
|
|
27
|
+
: ["--use-gl=angle", "--use-angle=default", "--ignore-gpu-blocklist"],
|
|
28
|
+
...(chrome === undefined || chrome === ""
|
|
29
|
+
? {}
|
|
30
|
+
: { executablePath: chrome }),
|
|
31
|
+
name: backend === "software" ? "swiftshader" : "gpu",
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=planAutoMovieChromiumLaunch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planAutoMovieChromiumLaunch.js","sourceRoot":"","sources":["../src/planAutoMovieChromiumLaunch.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,qCACE,OAAgC,EAChC,GAAiD;IAWjD,MAAM,MAAM,GAAuB,GAAG,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC;IAC3D,OAAO;QACL,IAAI,EACF,OAAO,KAAK,UAAU;YACpB,CAAC,CAAC,CAAC,gBAAgB,EAAE,yBAAyB,CAAC;YAC/C,CAAC,CAAC,CAAC,gBAAgB,EAAE,qBAAqB,EAAE,wBAAwB,CAAC;QACzE,GAAG,CAAC,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,EAAE;YACvC,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC;QAC/B,IAAI,EAAE,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK;KACrD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Vite configuration every page `writeAutoMovieModulePage` writes is served or built with: the page's folder as the root, the production's configuration file and public folder, quiet logging, and the page itself as the dependency scanner's entry.
|
|
3
|
+
*
|
|
4
|
+
* The page lives under `node_modules/.cache/automovie/`, and Vite's own entry search skips everything under `node_modules`, so without an entry it finds none, logs "Could not auto-determine entry point" and skips pre-bundling, which makes the first load of a development server slow. `optimizeDeps.entries` is `index.html`, a name without glob characters, which Vite resolves against the root as it is instead of globbing with that skip; it also wins over the production's own `build.rollupOptions.input`, so the scan starts from this page rather than the production's. A host adds its own `server`, `build` or `base` beside these members.
|
|
5
|
+
*
|
|
6
|
+
* @evidence contracts/development/common.md#meaningful-documentation States every member, why the entry is needed and why it is written as a plain name, its precedence over the production's input, and what a host adds.
|
|
7
|
+
* @evidence contracts/development/implementation.md#principled-implementation Vite's scanner takes explicit `optimizeDeps.entries` first, resolving a pattern without glob characters directly against `root`, and only globs with the `node_modules` skip otherwise; naming the page's own `index.html` makes the scan start where the page does, whatever folder holds it.
|
|
8
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure One record from the written page, shared by the draw page's build and the inspector's development server.
|
|
9
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The production's configuration file is loaded, not replaced; only the root, the public folder and the scan entry are set for the page.
|
|
10
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Constant.
|
|
11
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A pure function of one page.
|
|
12
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Returns a fresh record and keeps nothing.
|
|
13
|
+
*/
|
|
14
|
+
export declare function planAutoMovieModulePageViteConfig(page: {
|
|
15
|
+
/** The page's folder, the root it is served from. */
|
|
16
|
+
folder: string;
|
|
17
|
+
/** The production's `vite.config.ts`, or `false` when it has none. */
|
|
18
|
+
configFile: string | false;
|
|
19
|
+
/** The production's `public` folder, or `false` when it has none. */
|
|
20
|
+
publicDir: string | false;
|
|
21
|
+
}): {
|
|
22
|
+
/** The page's folder. */
|
|
23
|
+
root: string;
|
|
24
|
+
/** The production's configuration file, or `false`. */
|
|
25
|
+
configFile: string | false;
|
|
26
|
+
/** The production's public folder, or `false`. */
|
|
27
|
+
publicDir: string | false;
|
|
28
|
+
/** Only warnings and errors. */
|
|
29
|
+
logLevel: "warn";
|
|
30
|
+
/** Keep earlier output on screen. */
|
|
31
|
+
clearScreen: false;
|
|
32
|
+
/** The dependency scanner's entry. */
|
|
33
|
+
optimizeDeps: {
|
|
34
|
+
/** The page's own `index.html`, relative to `root`. */
|
|
35
|
+
entries: string[];
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.planAutoMovieModulePageViteConfig = planAutoMovieModulePageViteConfig;
|
|
4
|
+
/**
|
|
5
|
+
* The Vite configuration every page `writeAutoMovieModulePage` writes is served or built with: the page's folder as the root, the production's configuration file and public folder, quiet logging, and the page itself as the dependency scanner's entry.
|
|
6
|
+
*
|
|
7
|
+
* The page lives under `node_modules/.cache/automovie/`, and Vite's own entry search skips everything under `node_modules`, so without an entry it finds none, logs "Could not auto-determine entry point" and skips pre-bundling, which makes the first load of a development server slow. `optimizeDeps.entries` is `index.html`, a name without glob characters, which Vite resolves against the root as it is instead of globbing with that skip; it also wins over the production's own `build.rollupOptions.input`, so the scan starts from this page rather than the production's. A host adds its own `server`, `build` or `base` beside these members.
|
|
8
|
+
*
|
|
9
|
+
* @evidence contracts/development/common.md#meaningful-documentation States every member, why the entry is needed and why it is written as a plain name, its precedence over the production's input, and what a host adds.
|
|
10
|
+
* @evidence contracts/development/implementation.md#principled-implementation Vite's scanner takes explicit `optimizeDeps.entries` first, resolving a pattern without glob characters directly against `root`, and only globs with the `node_modules` skip otherwise; naming the page's own `index.html` makes the scan start where the page does, whatever folder holds it.
|
|
11
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure One record from the written page, shared by the draw page's build and the inspector's development server.
|
|
12
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The production's configuration file is loaded, not replaced; only the root, the public folder and the scan entry are set for the page.
|
|
13
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Constant.
|
|
14
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A pure function of one page.
|
|
15
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Returns a fresh record and keeps nothing.
|
|
16
|
+
*/
|
|
17
|
+
function planAutoMovieModulePageViteConfig(page) {
|
|
18
|
+
return {
|
|
19
|
+
root: page.folder,
|
|
20
|
+
configFile: page.configFile,
|
|
21
|
+
publicDir: page.publicDir,
|
|
22
|
+
logLevel: "warn",
|
|
23
|
+
clearScreen: false,
|
|
24
|
+
optimizeDeps: { entries: ["index.html"] },
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=planAutoMovieModulePageViteConfig.js.map
|