@milenyumai/film-kit 1.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026
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 ADDED
@@ -0,0 +1,89 @@
1
+ # ShotForge Agent Configuration
2
+
3
+ ShotForge artık bir **agent configuration npm paketi**dir.
4
+ Amaç: Cursor, Claude Code, VS Code Copilot ve Google Antigravity için proje içinde doğru kural/skill dosyalarını otomatik oluşturmak.
5
+
6
+ Bu paket **shot üreten bir CLI değildir**.
7
+ Editördeki AI ajanlarına `/generate` davranışını öğreten yapı dosyalarını yazar.
8
+
9
+ ## Ne Oluşturur?
10
+
11
+ ### Cursor
12
+ - `./.cursorrules` (legacy)
13
+ - `./.cursor/rules/global.mdc`
14
+ - (ortak sözleşme) `./AGENTS.md`
15
+
16
+ ### Claude Code
17
+ - `./CLAUDE.md`
18
+ - `./.claude/CLAUDE.md`
19
+ - `./.claude/rules/generate-flow.md`
20
+ - `./.claude/rules/output-contract.md`
21
+ - `./.claude/settings.json`
22
+ - `./.claude/settings.local.json`
23
+
24
+ ### VS Code Copilot
25
+ - `./.github/copilot-instructions.md`
26
+ - `./.github/instructions/shotforge.instructions.md`
27
+
28
+ ### Google Antigravity
29
+ - `./.agent/skills/shotforge-generate/SKILL.md`
30
+
31
+ ## Kurulum
32
+
33
+ ```bash
34
+ npm i -D @your-scope/shotforge-agent-config
35
+ ```
36
+
37
+ Kurulumdan sonra paket `postinstall` ile proje köküne dosyaları yazmaya çalışır.
38
+
39
+ ## Opsiyonel Proje Konfigürasyonu
40
+
41
+ Proje köküne `shotforge-agent.config.json` koyarsan varsayılanları özelleştirebilirsin:
42
+
43
+ ```json
44
+ {
45
+ "outputDir": "./shots",
46
+ "scenarioHint": "scenario.md",
47
+ "platforms": ["cursor", "claude", "copilot", "antigravity"],
48
+ "overwrite": false,
49
+ "includeAgentsMd": true
50
+ }
51
+ ```
52
+
53
+ ## Programatik Kullanım (CLI yok)
54
+
55
+ İstersen Node içinden direkt çağırabilirsin:
56
+
57
+ ```ts
58
+ import { configureAgents } from "@your-scope/shotforge-agent-config";
59
+
60
+ await configureAgents({
61
+ rootDir: process.cwd(),
62
+ outputDir: "./shots",
63
+ scenarioHint: "scenario.md",
64
+ platforms: ["cursor", "claude", "copilot", "antigravity"],
65
+ overwrite: false
66
+ });
67
+ ```
68
+
69
+ ## Editör Davranış Sözleşmesi
70
+
71
+ Yazılan dosyalar editör AI'ına şu kontratı verir:
72
+ - Kullanıcı `/generate` dediğinde seçili/aktif senaryo dosyasını oku.
73
+ - `./shots/bible.md` ve `./shots/S01.md ...` formatında markdown çıktısı üret.
74
+ - Shot dosyalarında prompt + cinematography + continuity bilgisi olsun.
75
+
76
+ ## Global Skill Notu (Antigravity)
77
+
78
+ Bu paket varsayılan olarak sadece workspace içine yazar.
79
+ Global skill yolu bilgi amaçlı:
80
+ - `~/.gemini/antigravity/skills/<skill-adı>/SKILL.md`
81
+
82
+ ## Geliştirme
83
+
84
+ ```bash
85
+ npm install
86
+ npm run typecheck
87
+ npm test
88
+ npm run build
89
+ ```
@@ -0,0 +1,2 @@
1
+ export { configureAgents } from "./lib/configure.js";
2
+ export type { AgentConfigOptions, ConfigureResult, SupportedPlatform } from "./lib/types.js";
package/build/index.js ADDED
@@ -0,0 +1 @@
1
+ export { configureAgents } from "./lib/configure.js";
@@ -0,0 +1,2 @@
1
+ import type { AgentConfigOptions, ConfigureResult } from "./types.js";
2
+ export declare function configureAgents(options?: AgentConfigOptions): Promise<ConfigureResult>;
@@ -0,0 +1,119 @@
1
+ import { join, dirname } from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
+ import { readdir, readFile } from "node:fs/promises";
4
+ import { exists, readJsonIfExists, writeText } from "./fs.js";
5
+ import { resolveOptions } from "./defaults.js";
6
+ import { buildProjectFiles } from "./templates.js";
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = dirname(__filename);
9
+ /**
10
+ * Resolve the path to the package's content/ directory.
11
+ * Works both in development (src/lib/) and in the published package (build/lib/).
12
+ */
13
+ function getContentDir() {
14
+ // __dirname is either src/lib or build/lib — go up two levels to package root
15
+ return join(__dirname, "..", "..", "content");
16
+ }
17
+ /**
18
+ * Recursively collect all files in a directory, returning relative paths.
19
+ */
20
+ async function collectFiles(dir, prefix = "") {
21
+ const entries = await readdir(dir, { withFileTypes: true });
22
+ const results = [];
23
+ for (const entry of entries) {
24
+ const abs = join(dir, entry.name);
25
+ const rel = prefix ? `${prefix}/${entry.name}` : entry.name;
26
+ if (entry.isDirectory()) {
27
+ const nested = await collectFiles(abs, rel);
28
+ results.push(...nested);
29
+ }
30
+ else if (entry.isFile()) {
31
+ results.push({ relativePath: rel, absolutePath: abs });
32
+ }
33
+ }
34
+ return results;
35
+ }
36
+ /**
37
+ * Copy content files from the package's content/ directory into the target project's .agent/ directory.
38
+ */
39
+ async function copyContentFiles(rootDir, overwrite, templateVars) {
40
+ const contentDir = getContentDir();
41
+ const contentExists = await exists(contentDir);
42
+ if (!contentExists) {
43
+ return { written: [], skipped: [] };
44
+ }
45
+ const files = await collectFiles(contentDir);
46
+ const written = [];
47
+ const skipped = [];
48
+ for (const file of files) {
49
+ const targetRelative = `.agent/${file.relativePath}`;
50
+ const targetAbsolute = join(rootDir, targetRelative);
51
+ const targetExists = await exists(targetAbsolute);
52
+ if (targetExists && !overwrite) {
53
+ skipped.push(targetRelative);
54
+ continue;
55
+ }
56
+ const rawContent = await readFile(file.absolutePath, "utf8");
57
+ const content = renderContentTemplate(rawContent, templateVars);
58
+ await writeText(targetAbsolute, content);
59
+ written.push(targetRelative);
60
+ }
61
+ return { written, skipped };
62
+ }
63
+ function renderContentTemplate(content, vars) {
64
+ return content
65
+ .replaceAll("$OUTPUT_DIR", vars.outputDir)
66
+ .replaceAll("$SCENARIO_HINT", vars.scenarioHint)
67
+ .replaceAll("$ARGUMENTS", "");
68
+ }
69
+ export async function configureAgents(options = {}) {
70
+ const rootDir = options.rootDir ?? process.cwd();
71
+ const packageConfigPath = join(rootDir, "shotforge-agent.config.json");
72
+ const fromFile = await readJsonIfExists(packageConfigPath);
73
+ const merged = { rootDir };
74
+ const outputDir = options.outputDir ?? fromFile?.outputDir;
75
+ const scenarioHint = options.scenarioHint ?? fromFile?.scenarioHint;
76
+ const platforms = options.platforms ?? fromFile?.platforms;
77
+ const overwrite = options.overwrite ?? fromFile?.overwrite;
78
+ const includeAgentsMd = options.includeAgentsMd ?? fromFile?.includeAgentsMd;
79
+ const copyContent = options.copyContent ?? fromFile?.copyContent;
80
+ if (outputDir !== undefined)
81
+ merged.outputDir = outputDir;
82
+ if (scenarioHint !== undefined)
83
+ merged.scenarioHint = scenarioHint;
84
+ if (platforms !== undefined)
85
+ merged.platforms = platforms;
86
+ if (overwrite !== undefined)
87
+ merged.overwrite = overwrite;
88
+ if (includeAgentsMd !== undefined)
89
+ merged.includeAgentsMd = includeAgentsMd;
90
+ if (copyContent !== undefined)
91
+ merged.copyContent = copyContent;
92
+ const resolved = resolveOptions(merged);
93
+ // 1. Copy content files (.agent/ system) if enabled
94
+ const contentResult = resolved.copyContent
95
+ ? await copyContentFiles(resolved.rootDir, resolved.overwrite, {
96
+ outputDir: resolved.outputDir,
97
+ scenarioHint: resolved.scenarioHint
98
+ })
99
+ : { written: [], skipped: [] };
100
+ // 2. Generate platform-specific config files
101
+ const files = buildProjectFiles(resolved);
102
+ const written = [...contentResult.written];
103
+ const skipped = [...contentResult.skipped];
104
+ for (const [relativePath, content] of Object.entries(files)) {
105
+ const absolutePath = join(resolved.rootDir, relativePath);
106
+ const fileExists = await exists(absolutePath);
107
+ if (fileExists && !resolved.overwrite) {
108
+ skipped.push(relativePath);
109
+ continue;
110
+ }
111
+ await writeText(absolutePath, content);
112
+ written.push(relativePath);
113
+ }
114
+ return {
115
+ rootDir: resolved.rootDir,
116
+ written,
117
+ skipped
118
+ };
119
+ }
@@ -0,0 +1,2 @@
1
+ import type { AgentConfigOptions, ResolvedAgentConfig } from "./types.js";
2
+ export declare function resolveOptions(input: AgentConfigOptions): ResolvedAgentConfig;
@@ -0,0 +1,12 @@
1
+ const ALL_PLATFORMS = ["cursor", "claude", "copilot", "antigravity"];
2
+ export function resolveOptions(input) {
3
+ return {
4
+ rootDir: input.rootDir ?? process.cwd(),
5
+ outputDir: input.outputDir ?? "./outputs",
6
+ scenarioHint: input.scenarioHint ?? "scenario.md",
7
+ platforms: (input.platforms && input.platforms.length > 0 ? input.platforms : ALL_PLATFORMS).slice(),
8
+ overwrite: input.overwrite ?? false,
9
+ includeAgentsMd: input.includeAgentsMd ?? true,
10
+ copyContent: input.copyContent ?? true
11
+ };
12
+ }
@@ -0,0 +1,3 @@
1
+ export declare function exists(path: string): Promise<boolean>;
2
+ export declare function readJsonIfExists<T>(path: string): Promise<T | undefined>;
3
+ export declare function writeText(path: string, content: string): Promise<void>;
@@ -0,0 +1,23 @@
1
+ import { access, mkdir, readFile, writeFile } from "node:fs/promises";
2
+ import { constants } from "node:fs";
3
+ import { dirname } from "node:path";
4
+ export async function exists(path) {
5
+ try {
6
+ await access(path, constants.F_OK);
7
+ return true;
8
+ }
9
+ catch {
10
+ return false;
11
+ }
12
+ }
13
+ export async function readJsonIfExists(path) {
14
+ if (!(await exists(path))) {
15
+ return undefined;
16
+ }
17
+ const text = await readFile(path, "utf8");
18
+ return JSON.parse(text);
19
+ }
20
+ export async function writeText(path, content) {
21
+ await mkdir(dirname(path), { recursive: true });
22
+ await writeFile(path, content, "utf8");
23
+ }
@@ -0,0 +1,2 @@
1
+ import type { ResolvedAgentConfig } from "./types.js";
2
+ export declare function buildProjectFiles(config: ResolvedAgentConfig): Record<string, string>;