automovie 0.0.0-stage → 0.1.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 (67) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +152 -2
  3. package/lib/AUTOMOVIE_DEFAULT_PROJECT_NAME.d.ts +4 -0
  4. package/lib/AUTOMOVIE_DEFAULT_PROJECT_NAME.js +8 -0
  5. package/lib/AUTOMOVIE_DEFAULT_PROJECT_NAME.js.map +1 -0
  6. package/lib/AutoMovieCommand.d.ts +48 -0
  7. package/lib/AutoMovieCommand.js +3 -0
  8. package/lib/AutoMovieCommand.js.map +1 -0
  9. package/lib/IAutoMoviePackageManager.d.ts +14 -0
  10. package/lib/IAutoMoviePackageManager.js +3 -0
  11. package/lib/IAutoMoviePackageManager.js.map +1 -0
  12. package/lib/bin.d.ts +2 -0
  13. package/lib/bin.js +11 -0
  14. package/lib/bin.js.map +1 -0
  15. package/lib/deriveAutoMovieProjectName.d.ts +16 -0
  16. package/lib/deriveAutoMovieProjectName.js +65 -0
  17. package/lib/deriveAutoMovieProjectName.js.map +1 -0
  18. package/lib/index.d.ts +13 -0
  19. package/lib/index.js +30 -0
  20. package/lib/index.js.map +1 -0
  21. package/lib/promptAutoMovieProjectName.d.ts +16 -0
  22. package/lib/promptAutoMovieProjectName.js +69 -0
  23. package/lib/promptAutoMovieProjectName.js.map +1 -0
  24. package/lib/readAutoMovieAddArguments.d.ts +19 -0
  25. package/lib/readAutoMovieAddArguments.js +69 -0
  26. package/lib/readAutoMovieAddArguments.js.map +1 -0
  27. package/lib/readAutoMovieCommandArguments.d.ts +19 -0
  28. package/lib/readAutoMovieCommandArguments.js +46 -0
  29. package/lib/readAutoMovieCommandArguments.js.map +1 -0
  30. package/lib/readAutoMovieCreateArguments.d.ts +19 -0
  31. package/lib/readAutoMovieCreateArguments.js +62 -0
  32. package/lib/readAutoMovieCreateArguments.js.map +1 -0
  33. package/lib/readAutoMovieNameOption.d.ts +18 -0
  34. package/lib/readAutoMovieNameOption.js +26 -0
  35. package/lib/readAutoMovieNameOption.js.map +1 -0
  36. package/lib/readAutoMovieSyncArguments.d.ts +13 -0
  37. package/lib/readAutoMovieSyncArguments.js +49 -0
  38. package/lib/readAutoMovieSyncArguments.js.map +1 -0
  39. package/lib/renderAutoMovieScaffoldNextSteps.d.ts +20 -0
  40. package/lib/renderAutoMovieScaffoldNextSteps.js +48 -0
  41. package/lib/renderAutoMovieScaffoldNextSteps.js.map +1 -0
  42. package/lib/run.d.ts +24 -0
  43. package/lib/run.js +196 -0
  44. package/lib/run.js.map +1 -0
  45. package/lib/selectAutoMoviePackageManager.d.ts +23 -0
  46. package/lib/selectAutoMoviePackageManager.js +70 -0
  47. package/lib/selectAutoMoviePackageManager.js.map +1 -0
  48. package/lib/selectAutoMovieProjectName.d.ts +24 -0
  49. package/lib/selectAutoMovieProjectName.js +63 -0
  50. package/lib/selectAutoMovieProjectName.js.map +1 -0
  51. package/package.json +55 -3
  52. package/src/AUTOMOVIE_DEFAULT_PROJECT_NAME.ts +4 -0
  53. package/src/AutoMovieCommand.ts +64 -0
  54. package/src/IAutoMoviePackageManager.ts +15 -0
  55. package/src/bin.ts +9 -0
  56. package/src/deriveAutoMovieProjectName.ts +31 -0
  57. package/src/index.ts +13 -0
  58. package/src/promptAutoMovieProjectName.ts +35 -0
  59. package/src/readAutoMovieAddArguments.ts +77 -0
  60. package/src/readAutoMovieCommandArguments.ts +48 -0
  61. package/src/readAutoMovieCreateArguments.ts +62 -0
  62. package/src/readAutoMovieNameOption.ts +22 -0
  63. package/src/readAutoMovieSyncArguments.ts +48 -0
  64. package/src/renderAutoMovieScaffoldNextSteps.ts +58 -0
  65. package/src/run.ts +220 -0
  66. package/src/selectAutoMoviePackageManager.ts +45 -0
  67. package/src/selectAutoMovieProjectName.ts +35 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jeongho Nam
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,153 @@
1
- # Temporary Holding Version
1
+ # AutoMovie
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/samchon/automovie/blob/master/LICENSE)
4
+ [![NPM Version](https://img.shields.io/npm/v/automovie.svg)](https://www.npmjs.com/package/automovie)
5
+ [![Build Status](https://github.com/samchon/automovie/workflows/build/badge.svg)](https://github.com/samchon/automovie/actions?query=workflow%3Abuild)
6
+
7
+ Your coding agent writes a film's screenplay and programs its staging, motion and camera; AutoMovie computes that code into the same frames every time, as a motion hint for video diffusion or as a film rendered directly.
8
+
9
+ - **Made for the motion hint.** Every part serves one output: the best hint a video diffusion model can be given of who is where, what they do, what they touch and when.
10
+ - **Simple rendering, precise motion.** People are a polygon man and sets are coarse meshes on purpose; the accuracy goes into the performance, its contacts and its timing.
11
+ - **Everything is code.** The agent writes the screenplay as text and the film as TypeScript against typed packages, so a motion is a module: tested once, accepted on stills, reused by any scene and any body.
12
+ - **The same frames every time.** The engine computes each frame from the code and a seed, so a defect is found on a still, corrected at its cause and recomputed, never regenerated.
13
+ - **No LLM and no server inside.** You bring the coding agent, the image or video models a production uses, and the machine that renders.
14
+
15
+ ## What AutoMovie is
16
+
17
+ AutoMovie is a set of npm packages and a scaffold for a production, the project of one film. `automovie create` installs the scaffold: an `AGENTS.md` and `CLAUDE.md`, the skills that tell the agent how a film is researched, written, programmed, rendered and reviewed, the contracts its work answers, and an empty Viewer. You open it in any coding agent that reads those files and direct it in natural language: what to make, what you fix, what you delegate. The agent records your decisions in `PROJECT.md` and `docs/instructions`, decides delegated choices itself, and asks only when a fixed condition conflicts or an undelegated decision blocks it.
18
+
19
+ ### Simple rendering, precise motion
20
+
21
+ A motion hint tells a video model where each person is, what they do, what they touch and when; the model supplies the surfaces. So a production draws every person as a polygon man, plain primitives over the joints of the body `@automovie/human` prepares, and every other subject as the simplest form that identifies it, and detail is an option a delivery switches on, never something a scene depends on. A polygon man has no face, so the screenplay writes attention as the turn of a head and torso, and what the hint cannot carry reaches a generated film through reference images and the prompt.
22
+
23
+ The motion is where the accuracy goes. Every movement is a goal for hands, feet and hips on their targets, a fist on the struck region, each foot on the floor at its step, both hands on a grip, scaled to the body that performs it, with contacts and reactions computed by the engine.
24
+
25
+ ### Motion as code
26
+
27
+ The cast, sets, performance, staging and camera are TypeScript the agent writes against `@automovie/interface`, the typed authoring AST, and `@automovie/motions`, the vocabulary of human actions. An action is a law that brings the body onto its targets, so one chain of actions fits people of different stature and proportion, and an action can be interrupted mid-motion. A production composes each person's performance from that vocabulary, writes a law of its own only for what the vocabulary lacks, tests it against its study, and accepts every module in catalog cases on stills before a scene uses it. A scene then only composes accepted modules, and a defect the scene shows is fixed in the module and its case, never patched in the scene.
28
+
29
+ ### The motion hint
30
+
31
+ The hint reaches a video model as a hint video and the control channels that model takes, such as pose, depth, normal, outline or a semantic mask, rendered from the same performance and aligned frame for frame. Some models restyle the hint video, some read it as a reference for motion and camera, and open models follow pose or depth passes exactly. An accurate hint does not decide what the model makes of it, so generated takes are inspected against the hint at matched frames, and the agent's report says what it verified and what only you watched.
32
+
33
+ ### Inspect and correct
34
+
35
+ `@automovie/engine` computes what each frame contains: poses within range of motion, sampled motion, staging and cuts, physics, light and sound. The same input produces the same frames in the browser Viewer, in a Node frame capture that needs no GPU, and in the exported video, so the agent judges a film on stills at the seconds that matter, every contact and cut included, fixes the module at fault, and judges the correction at the same second and camera. You watch the playback and listen, which the agent cannot.
36
+
37
+ ### No LLM and no server
38
+
39
+ AutoMovie contains no LLM and no server. The agent is yours; the engine, the motion vocabulary and the Viewer are libraries the production imports; an image or video model, when a production uses one, is reached through the provider you choose and record in `PROJECT.md`; the render runs on your machine through Chrome and FFmpeg.
40
+
41
+ ## How a film is made
42
+
43
+ ```mermaid
44
+ flowchart LR
45
+ subgraph short[Short]
46
+ brief[Brief]
47
+ end
48
+ subgraph series[Series]
49
+ settings[Settings] --> treatments[Treatments] --> scripts[Scripts]
50
+ end
51
+ brief --> screenplay[Screenplay]
52
+ scripts --> screenplay
53
+ screenplay --> code[Staging, motion and camera as code]
54
+ code --> hint[Motion-hint video]
55
+ hint -.-> film[Finished film]
56
+ code -.-> film
57
+ ```
58
+
59
+ A short runs brief → screenplay and a series settings → treatments → scripts → screenplay; in a workspace the production's folder, `movies/shorts/<name>` or `movies/series/<name>`, fixes the route. The agent follows one chain, and each link cites the decisions of the link above it, so no scene exists without a written basis and no decision goes unrealized. Each layer is inspected, repaired by cause and reviewed independently before the next starts, and a gap found downstream is repaired in the layer that owns it.
60
+
61
+ Before writing, the agent studies every practice and style the film shows, a sport, a craft, a crowd's conduct, a camera style, and keeps the sources under `references/`, because a law written without a study invents the practice.
62
+
63
+ ### A short: brief, then screenplay
64
+
65
+ A short is a film of a few minutes whose events fit one screenplay. Its brief is its canon: the fixed conditions such as running time and frame, and the decisions about world, cast, crowds, props, sets, cinematography and sound that its films share, one file per subject with an anchor per decision that every screenplay cites. Several shorts can share one brief and one world.
66
+
67
+ ### A series: settings, treatments, scripts, then screenplay
68
+
69
+ A series, a feature or an episode spans causes, setups and payoffs over many scenes, so it is written in four layers. Settings are the facts about the world and its people, places and objects, with their baseline states, relationships and what each one knows. Treatments decide the events: causes, choices, consequences, setup and payoff, and when the audience learns what. Scripts partition the events into scenes and execute each one: dialogue, action, reactions, stage, light, sound and view.
70
+
71
+ ### The screenplay
72
+
73
+ On both routes the screenplay composes what the audience sees and hears, beat by beat, with each action named as one the installed motion vocabulary performs or as a law the research describes. It is the last place a decision is made; code only realizes it. A separate expression pass then rewrites how it is seen and heard with its meaning frozen.
74
+
75
+ ### Staging, motion and camera as code
76
+
77
+ The agent builds the cast and sets as coarse entities, composes each person's performance from actions such as walk, approach, look, gesture, sit, pick up, punch and guard, and writes a law of its own, with its study and tests, for an animal, a vehicle, a crowd moving as a mass, a camera or a light. Each main scene is composed segment by segment from the accepted modules and staged for the camera, and the sound of each shot is described for the video prompt.
78
+
79
+ ### The motion-hint video
80
+
81
+ The production's Viewer plays, pauses and seeks the same performance the export uses, a Node capture draws stills of any second from any view, and the render exports the film through Chrome and FFmpeg on your machine. The agent assembles the film in the screenplay's order, renders the control channels from the same performance, inspects stills from the source and from the encoded file, and hands off the fixed inputs, the commands that reproduce it and the remaining limits. The whole hint is complete when every main scene is programmed and the whole video is assembled; stills or pilot clips do not complete it.
82
+
83
+ ### A finished film
84
+
85
+ A production can end at the screenplay or the hint, or go on to a film: rendered directly in 3D from the same code, or generated by a video model from the hint. For a generated film the agent chooses the model with you, plans each shot within the model's limits, writes the prompts, and inspects and assembles the accepted takes.
86
+
87
+ The generated production [README](https://github.com/samchon/automovie/blob/master/packages/template/scaffold/production/README.md) owns these steps, their commands and the project layout.
88
+
89
+ ## Setup
90
+
91
+ ### A single production
92
+
93
+ ```bash
94
+ npx automovie create <directory>
95
+ cd <directory>
96
+ npm install
97
+ ```
98
+
99
+ Open the directory in your coding agent and tell it what to make. The new production holds the instructions, contracts, configuration and an empty Viewer, and no film.
100
+
101
+ ### A workspace
102
+
103
+ ```bash
104
+ npx automovie create <directory> --workspace
105
+ cd <directory>
106
+ pnpm install
107
+ pnpm automovie add shorts/<name>
108
+ pnpm install
109
+ ```
110
+
111
+ A workspace keeps several productions under one `AGENTS.md`, `CLAUDE.md` and `.agents/skills`, with its own packages for code they share. Open the production's directory in your coding agent as above.
112
+
113
+ ## Commands
114
+
115
+ ```text
116
+ npx automovie create <directory> [--workspace] [--name <name>] [--force]
117
+ pnpm automovie add <shorts|series>/<name> [--name <name>] [--force]
118
+ npx automovie sync <directory> [--check] [--baseline <directory>]
119
+ ```
120
+
121
+ ### create
122
+
123
+ `create` installs a single production. With `--workspace` it installs a pnpm workspace root instead, with a `pnpm-workspace.yaml` whose members are `movies/shorts/*`, `movies/series/*` and `packages/*` and whose catalogs pin every production dependency. The package name is `--name` when given and otherwise comes from the directory name.
124
+
125
+ ### add
126
+
127
+ `add` runs at a workspace root, the directory holding `pnpm-workspace.yaml`. `add shorts/<name>` writes a production into `movies/shorts/<name>` and `add series/<name>` into `movies/series/<name>`; `pnpm install` again links it. The production takes its dependencies from the root's catalogs and its skills from the root's `.agents/skills`.
128
+
129
+ `create` and `add` refuse a non-empty target unless `--force` is given, which replaces files at the same paths.
130
+
131
+ ### sync
132
+
133
+ `sync` updates the generated instructions after upgrading `automovie`, on a single production or a workspace root. It rewrites `AGENTS.md`, `CLAUDE.md` and the bundled skills and leaves the contracts, your own skills, `PROJECT.md`, the README, configuration, source and written content as they are. `--check` writes nothing and exits 1 while updates or conflicts remain, and `--baseline <directory>` names the instruction files the project was installed from. An instruction file you edited is reported as a conflict and nothing is written until you restore it, keeping your edit in a skill of your own.
134
+
135
+ ## Packages
136
+
137
+ | Package | Purpose |
138
+ | --- | --- |
139
+ | [`automovie`](https://github.com/samchon/automovie/tree/master/packages/cli) | The CLI that installs and updates the scaffold |
140
+ | [`@automovie/interface`](https://github.com/samchon/automovie/tree/master/packages/interface) | The authoring AST: the types a coding agent fills in |
141
+ | [`@automovie/engine`](https://github.com/samchon/automovie/tree/master/packages/engine) | Deterministic validation and computation of everything a frame contains |
142
+ | [`@automovie/human`](https://github.com/samchon/automovie/tree/master/packages/human) | The body of a person, its skeleton and contact profile, generated by code from typed parameters (being rebuilt) |
143
+ | [`@automovie/motions`](https://github.com/samchon/automovie/tree/master/packages/motions) | Human actions, such as walk, sit and pick up, as deterministic laws scaled to the body |
144
+ | [`@automovie/ingest`](https://github.com/samchon/automovie/tree/master/packages/ingest) | Deterministic import of glTF, GLB, VRM, WAVE and PPM inputs |
145
+ | [`@automovie/recovery`](https://github.com/samchon/automovie/tree/master/packages/recovery) | Curves recovered from a reference mesh, and geometry rebuilt from them |
146
+ | [`@automovie/viewer`](https://github.com/samchon/automovie/tree/master/packages/viewer) | Three.js display, capture and inspection |
147
+ | [`@automovie/render`](https://github.com/samchon/automovie/tree/master/packages/render) | Frame schedules, edit timelines and encoder plans, with capture and encoding supplied by the calling program |
148
+ | [`@automovie/evidence`](https://github.com/samchon/automovie/tree/master/packages/evidence) | Checks that a production's code and writing answer their checklists |
149
+ | [`@automovie/template`](https://github.com/samchon/automovie/tree/master/packages/template) | The scaffold every production starts from |
150
+
151
+ ## License
152
+
153
+ [MIT](https://github.com/samchon/automovie/blob/master/LICENSE)
@@ -0,0 +1,4 @@
1
+ /**
2
+ * The project name used when none is typed and none can be derived: offered as the prompt's default, used as-is without a terminal, and the fallback for a directory name with no usable character.
3
+ */
4
+ export declare const AUTOMOVIE_DEFAULT_PROJECT_NAME: string;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AUTOMOVIE_DEFAULT_PROJECT_NAME = void 0;
4
+ /**
5
+ * The project name used when none is typed and none can be derived: offered as the prompt's default, used as-is without a terminal, and the fallback for a directory name with no usable character.
6
+ */
7
+ exports.AUTOMOVIE_DEFAULT_PROJECT_NAME = "automovie-examples";
8
+ //# sourceMappingURL=AUTOMOVIE_DEFAULT_PROJECT_NAME.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AUTOMOVIE_DEFAULT_PROJECT_NAME.js","sourceRoot":"","sources":["../src/AUTOMOVIE_DEFAULT_PROJECT_NAME.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,8BAA8B,GAAW,oBAAoB,CAAC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * One admitted CLI request, discriminated by `command`.
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.
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.
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.
9
+ * @evidence contracts/development/common.md#meaningful-documentation Every variant and member states its meaning and who resolves it.
10
+ */
11
+ export type AutoMovieCommand = {
12
+ /** Print the usage text. */
13
+ command: "help";
14
+ } | {
15
+ /** Print this package's version. */
16
+ command: "version";
17
+ } | {
18
+ /** Install a single production, or with `workspace` a workspace root, into `directory`. */
19
+ command: "create";
20
+ /** Target directory as typed, never blank; `run` resolves it against the working directory. */
21
+ directory: string;
22
+ /** Install a pnpm workspace root instead of a single production. */
23
+ workspace: boolean;
24
+ /** Admit a non-empty target, as `publishFiles`' `force` option defines it. */
25
+ force: boolean;
26
+ /** Package name as typed; absent, `run` derives or asks for one. */
27
+ name?: string;
28
+ } | {
29
+ /** Add one production to the workspace whose root is the working directory. */
30
+ command: "add";
31
+ /** `shorts` for brief → screenplay, `series` for the whole long route. */
32
+ family: "shorts" | "series";
33
+ /** The production's directory under `movies/<family>`, one admitted path segment. */
34
+ directory: string;
35
+ /** Admit a non-empty production directory, as `publishFiles`' `force` option defines it. */
36
+ force: boolean;
37
+ /** Package name as typed; absent, `run` derives one from the directory segment. */
38
+ name?: string;
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;
48
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=AutoMovieCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AutoMovieCommand.js","sourceRoot":"","sources":["../src/AutoMovieCommand.ts"],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The package manager a created production's next steps name, with the enclosing pnpm workspace root when one exists.
3
+ *
4
+ * @evidence contracts/development/design.md#principled-representation The manager and the optional workspace root are exactly what `renderAutoMovieScaffoldNextSteps` needs to print the install location and script commands.
5
+ * @evidence contracts/development/design.md#minimal-and-owned-surface A closed pair of managers, the two the scaffold documents; `selectAutoMoviePackageManager` produces it and the next-steps renderer consumes it.
6
+ * @evidence contracts/development/design.md#prohibited-design-shortcuts No free-form manager string or command template lets a caller print undocumented commands.
7
+ * @evidence contracts/development/common.md#meaningful-documentation Each member states what it controls in the printed steps.
8
+ */
9
+ export interface IAutoMoviePackageManager {
10
+ /** The manager whose install and script commands the next steps print. */
11
+ manager: "npm" | "pnpm";
12
+ /** Absolute root of the enclosing pnpm workspace, where `pnpm install` runs. */
13
+ workspace?: string;
14
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IAutoMoviePackageManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAutoMoviePackageManager.js","sourceRoot":"","sources":["../src/IAutoMoviePackageManager.ts"],"names":[],"mappings":""}
package/lib/bin.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/lib/bin.js ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const run_1 = require("./run");
5
+ // The executable entry runs unconditionally: a `require.main === module` guard
6
+ // is false under ttsx, whose bootstrap is the main module and loads this file
7
+ // by `require`, so `pnpm start` would exit without running.
8
+ void (0, run_1.run)(process.argv).then((code) => {
9
+ process.exitCode = code;
10
+ });
11
+ //# sourceMappingURL=bin.js.map
package/lib/bin.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";;;AACA,+BAA4B;AAE5B,+EAA+E;AAC/E,8EAA8E;AAC9E,4DAA4D;AAC5D,KAAK,IAAA,SAAG,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAY,EAAQ,EAAE;IACjD,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;AAC1B,CAAC,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Derive a lowercase project-name candidate from the target directory's basename.
3
+ *
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
+ *
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.
7
+ *
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
+ * @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.
10
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No directory name is special-cased; the fallback applies whenever normalization leaves an empty candidate, including an all-underscore basename whose characters are removed by leading trim.
11
+ * @evidence contracts/development/common.md#meaningful-documentation The comment states each transformation in order, the limit, the fallback, the caller and consumer, and the difference between an unchanged npm reserved name and a device name refused by the renderer.
12
+ * @evidence contracts/development/implementation.md#efficient-algorithms Time and space are linear in the basename's length: one lowercase pass, one replacement and one slice; the final trim's trailing alternative can rescan a run of `-` and `.` that does not end the string, which is quadratic only within that run and bounded by the 214-character cut.
13
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work `run` derives one name per scaffold request, so no equivalent derivation is requested twice.
14
+ * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function returns a new string and keeps no state, handle, or task.
15
+ */
16
+ export declare function deriveAutoMovieProjectName(targetDir: string): string;
@@ -0,0 +1,65 @@
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.deriveAutoMovieProjectName = deriveAutoMovieProjectName;
37
+ const path = __importStar(require("node:path"));
38
+ const AUTOMOVIE_DEFAULT_PROJECT_NAME_1 = require("./AUTOMOVIE_DEFAULT_PROJECT_NAME");
39
+ /** Longest package name npm accepts. */
40
+ const NPM_NAME_LIMIT = 214;
41
+ /**
42
+ * Derive a lowercase project-name candidate from the target directory's basename.
43
+ *
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
+ *
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.
47
+ *
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
+ * @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.
50
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No directory name is special-cased; the fallback applies whenever normalization leaves an empty candidate, including an all-underscore basename whose characters are removed by leading trim.
51
+ * @evidence contracts/development/common.md#meaningful-documentation The comment states each transformation in order, the limit, the fallback, the caller and consumer, and the difference between an unchanged npm reserved name and a device name refused by the renderer.
52
+ * @evidence contracts/development/implementation.md#efficient-algorithms Time and space are linear in the basename's length: one lowercase pass, one replacement and one slice; the final trim's trailing alternative can rescan a run of `-` and `.` that does not end the string, which is quadratic only within that run and bounded by the 214-character cut.
53
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work `run` derives one name per scaffold request, so no equivalent derivation is requested twice.
54
+ * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The function returns a new string and keeps no state, handle, or task.
55
+ */
56
+ function deriveAutoMovieProjectName(targetDir) {
57
+ const name = path
58
+ .basename(targetDir)
59
+ .toLowerCase()
60
+ .replace(/[^a-z0-9._-]+/g, "-")
61
+ .slice(0, NPM_NAME_LIMIT)
62
+ .replace(/^[-._]+|[-.]+$/g, "");
63
+ return name.length === 0 ? AUTOMOVIE_DEFAULT_PROJECT_NAME_1.AUTOMOVIE_DEFAULT_PROJECT_NAME : name;
64
+ }
65
+ //# sourceMappingURL=deriveAutoMovieProjectName.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deriveAutoMovieProjectName.js","sourceRoot":"","sources":["../src/deriveAutoMovieProjectName.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,IAAI,sCAAkB;AAElC,qFAAkF;AAElF,wCAAwC;AACxC,MAAM,cAAc,GAAW,GAAG,CAAC;AAEnC;;;;;;;;;;;;;;GAcG;AACH,oCAA2C,SAAiB;IAC1D,MAAM,IAAI,GAAW,IAAI;SACtB,QAAQ,CAAC,SAAS,CAAC;SACnB,WAAW,EAAE;SACb,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC;SAC9B,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC;SACxB,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;IAClC,OAAO,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,+DAA8B,CAAC,CAAC,CAAC,IAAI,CAAC;AACnE,CAAC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ export * from "./AutoMovieCommand";
2
+ export * from "./readAutoMovieCommandArguments";
3
+ export * from "./deriveAutoMovieProjectName";
4
+ export * from "./AUTOMOVIE_DEFAULT_PROJECT_NAME";
5
+ export * from "./readAutoMovieCreateArguments";
6
+ export * from "./readAutoMovieAddArguments";
7
+ export * from "./readAutoMovieNameOption";
8
+ export * from "./selectAutoMovieProjectName";
9
+ export * from "./IAutoMoviePackageManager";
10
+ export * from "./selectAutoMoviePackageManager";
11
+ export * from "./promptAutoMovieProjectName";
12
+ export * from "./run";
13
+ export * from "./renderAutoMovieScaffoldNextSteps";
package/lib/index.js ADDED
@@ -0,0 +1,30 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./AutoMovieCommand"), exports);
18
+ __exportStar(require("./readAutoMovieCommandArguments"), exports);
19
+ __exportStar(require("./deriveAutoMovieProjectName"), exports);
20
+ __exportStar(require("./AUTOMOVIE_DEFAULT_PROJECT_NAME"), exports);
21
+ __exportStar(require("./readAutoMovieCreateArguments"), exports);
22
+ __exportStar(require("./readAutoMovieAddArguments"), exports);
23
+ __exportStar(require("./readAutoMovieNameOption"), exports);
24
+ __exportStar(require("./selectAutoMovieProjectName"), exports);
25
+ __exportStar(require("./IAutoMoviePackageManager"), exports);
26
+ __exportStar(require("./selectAutoMoviePackageManager"), exports);
27
+ __exportStar(require("./promptAutoMovieProjectName"), exports);
28
+ __exportStar(require("./run"), exports);
29
+ __exportStar(require("./renderAutoMovieScaffoldNextSteps"), exports);
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Ask the terminal for a project name, offering {@link AUTOMOVIE_DEFAULT_PROJECT_NAME}.
3
+ *
4
+ * Without an interactive terminal on both standard input and output, no question is asked and the default is returned, so scripted runs never wait. A blank answer also takes the default; any other answer is returned as typed for the template's name rule to admit.
5
+ *
6
+ * @returns The answered or default name.
7
+ *
8
+ * @evidence contracts/development/implementation.md#principled-implementation `isTTY` on both streams identifies an interactive terminal; the readline interface is closed in `finally`, so standard input is released even when the question fails.
9
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure The prompt is the CLI's only interactive I/O, separate from the pure name decision.
10
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The answer is not normalized here; the template's one name rule admits it.
11
+ * @evidence contracts/development/common.md#meaningful-documentation The comment states when the question is asked, the default, and how a blank answer is treated.
12
+ * @evidence contracts/development/implementation.md#efficient-algorithms One question and one trim.
13
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each request asks at most once.
14
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The readline interface is closed before returning.
15
+ */
16
+ export declare function promptAutoMovieProjectName(): Promise<string>;
@@ -0,0 +1,69 @@
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.promptAutoMovieProjectName = promptAutoMovieProjectName;
37
+ const readline = __importStar(require("node:readline/promises"));
38
+ const AUTOMOVIE_DEFAULT_PROJECT_NAME_1 = require("./AUTOMOVIE_DEFAULT_PROJECT_NAME");
39
+ /**
40
+ * Ask the terminal for a project name, offering {@link AUTOMOVIE_DEFAULT_PROJECT_NAME}.
41
+ *
42
+ * Without an interactive terminal on both standard input and output, no question is asked and the default is returned, so scripted runs never wait. A blank answer also takes the default; any other answer is returned as typed for the template's name rule to admit.
43
+ *
44
+ * @returns The answered or default name.
45
+ *
46
+ * @evidence contracts/development/implementation.md#principled-implementation `isTTY` on both streams identifies an interactive terminal; the readline interface is closed in `finally`, so standard input is released even when the question fails.
47
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure The prompt is the CLI's only interactive I/O, separate from the pure name decision.
48
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The answer is not normalized here; the template's one name rule admits it.
49
+ * @evidence contracts/development/common.md#meaningful-documentation The comment states when the question is asked, the default, and how a blank answer is treated.
50
+ * @evidence contracts/development/implementation.md#efficient-algorithms One question and one trim.
51
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work Each request asks at most once.
52
+ * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The readline interface is closed before returning.
53
+ */
54
+ async function promptAutoMovieProjectName() {
55
+ if (process.stdin.isTTY !== true || process.stdout.isTTY !== true)
56
+ return AUTOMOVIE_DEFAULT_PROJECT_NAME_1.AUTOMOVIE_DEFAULT_PROJECT_NAME;
57
+ const terminal = readline.createInterface({
58
+ input: process.stdin,
59
+ output: process.stdout,
60
+ });
61
+ try {
62
+ const answer = await terminal.question(`Project name (${AUTOMOVIE_DEFAULT_PROJECT_NAME_1.AUTOMOVIE_DEFAULT_PROJECT_NAME}): `);
63
+ return answer.trim() === "" ? AUTOMOVIE_DEFAULT_PROJECT_NAME_1.AUTOMOVIE_DEFAULT_PROJECT_NAME : answer;
64
+ }
65
+ finally {
66
+ terminal.close();
67
+ }
68
+ }
69
+ //# sourceMappingURL=promptAutoMovieProjectName.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promptAutoMovieProjectName.js","sourceRoot":"","sources":["../src/promptAutoMovieProjectName.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,QAAQ,mDAA+B;AAEnD,qFAAkF;AAElF;;;;;;;;;;;;;;GAcG;AACI,KAAK;IACV,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,KAAK,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI;QAC/D,OAAO,+DAA8B,CAAC;IACxC,MAAM,QAAQ,GAAuB,QAAQ,CAAC,eAAe,CAAC;QAC5D,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC,CAAC;IACH,IAAI,CAAC;QACH,MAAM,MAAM,GAAW,MAAM,QAAQ,CAAC,QAAQ,CAC5C,iBAAiB,+DAA8B,KAAK,CACrD,CAAC;QACF,OAAO,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,+DAA8B,CAAC,CAAC,CAAC,MAAM,CAAC;IACxE,CAAC;YAAS,CAAC;QACT,QAAQ,CAAC,KAAK,EAAE,CAAC;IACnB,CAAC;AACH,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { AutoMovieCommand } from "./AutoMovieCommand";
2
+ /**
3
+ * Admit one `add` request: exactly one `shorts/<directory>` or `series/<directory>` target with optional single `--force` and `--name <name>`, in any order.
4
+ *
5
+ * The target is split at its one `/`; the family must be `shorts` or `series`, and the directory must be one segment that the template's project-name rule admits unchanged, so `movies/<family>/<directory>` cannot leave the workspace. Every refusal throws an `Error` whose message names the correction.
6
+ *
7
+ * @param args The tokens after `add`.
8
+ * @returns The admitted request.
9
+ * @throws On an unknown or repeated option, a missing name value, a target count other than one, an unknown family, or a refused directory segment.
10
+ *
11
+ * @evidence contracts/development/implementation.md#principled-implementation The directory segment passes the same portable-segment rule as a project name and must equal its trimmed form, so no separator, `.`, `..` or padding reaches the joined path.
12
+ * @evidence contracts/development/implementation.md#clear-and-simple-structure The add grammar is separate from create and sync; the template owns the segment rule and `run` owns the workspace path.
13
+ * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No family is inferred from the name and no workspace is searched for; the family is typed explicitly.
14
+ * @evidence contracts/development/common.md#meaningful-documentation The comment states the grammar, the family pair, the segment rule and why it matters, and what throws.
15
+ * @evidence contracts/development/implementation.md#efficient-algorithms One scan over the tokens and one split of the target.
16
+ * @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work This pure parser owns no cross-request effect to reuse.
17
+ * @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources Local strings and arrays expire after return and no handle is acquired.
18
+ */
19
+ export declare function readAutoMovieAddArguments(args: readonly string[]): AutoMovieCommand;