@ninkch/dsh-artcraft 0.0.0-stage → 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/LICENSE ADDED
@@ -0,0 +1,209 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
203
+
204
+ ----------------------------------------------------------------------
205
+
206
+ The above Apache License, Version 2.0 applies to this project
207
+ (dsh-artcraft / @ninkch/dsh-artcraft).
208
+
209
+ Copyright 2026 NINKCH
package/NOTICE.md ADDED
@@ -0,0 +1,72 @@
1
+ # Third-party notices
2
+
3
+ ## ArtCraft (PhotoCraft / FilmCraft / EffectCraft — getartcraft.com)
4
+
5
+ The ArtCraft applications that this plugin drives are distributed by the ArtCraft team under the
6
+ **ArtCraft License (WIP)** — a "fair source" license. The text below is reproduced **verbatim** as
7
+ published by the project (~ Brandon Thomas). This plugin contains **no ArtCraft code**; it only
8
+ drives the apps' public automation surfaces (headless CLI + JSON control channel).
9
+
10
+ ---
11
+
12
+ ## ArtCraft License (WIP)
13
+
14
+ (Warning: This isn't a real lawyery license full of legitimate legalese yet, but we'll take care of that ASAP.)
15
+
16
+ ArtCraft is a form of "fair source" software. It's like free beer in that we give you the code, but there are a few small limitations on what you can do with it.
17
+
18
+ First, what you can do with ArtCraft:
19
+
20
+ You do not have to pay us to use ArtCraft. It's free.
21
+
22
+ You can back up, copy, modify, compile, and use the code for your own private personal purposes.
23
+
24
+ You can do anything you want with the media you create with ArtCraft. Generated assets are yours.
25
+
26
+ What you can't do with ArtCraft:
27
+
28
+ You cannot sell the ArtCraft software commercially (eg. as your own software).
29
+
30
+ You cannot use the ArtCraft code to develop a competing business or product (eg. selling AI image and video tools).
31
+
32
+ You cannot fork ArtCraft and remove ArtCraft community, donation links, or paid model services. We intend to make money to improve ArtCraft for everyone.
33
+
34
+ You cannot use the ArtCraft name, logo, or mascot characters to promote your business without permission.
35
+
36
+ This license means you can see what we're doing and not be at risk of having the rug pulled out from under you (eg. if our founders die, if our business collapses, if zombies or space aliens invade). It also gives you a really great way to customize the software or lend a hand in reporting (or even fixing) bugs.
37
+
38
+ Our desire is to support artists, designers, and filmmakers. We want to help you build your own creative studios and businesses. We want to give you creative software you can use forever.
39
+
40
+ ArtCraft is free. We do offer models available through us where you can pay us and support our development, but we also offer the ability for you to use other providers - and we'll keep adding more options so you have maximum flexibility.
41
+
42
+ ### Our Promise
43
+
44
+ All development and business plans will be communicated openly with the community.
45
+
46
+ Except for minor test scripts or a few small places where we might need to use licensed 3rd party code, all of our engineering efforts will live in a single publicly available monorepo. You can see everything we do and even benefit from using it for personal use. We plan on building a lot more than what you see today, and you'll get all of it.
47
+
48
+ We will not "rug pull" our users. If our business shuts down, gets acquired, or otherwise changes, the tools we create will always continue to function in the same way.
49
+
50
+ If the business ends and our founders quit working in this space, we'll make it so the software transitions to an OSI-approved open source license. (We don't intend to quit!)
51
+
52
+ ### Why not OSI Open Source?
53
+
54
+ Philosophical answer: The OSI is an industry body led by hyperscalers. They poach from open source all the time, yet hyperscaler systems and code (AWS, GCP, YouTube, etc.) remain closed source. The tiniest nuggets are open, but the vast machinery surrounding it - systems, user behaviors, funnels, at-scale moneymakers - is totally closed.
55
+
56
+ Practical answer: OSI licenses make it exceptionally challenging to grow big things commercially. And many of the licenses leave room for hyperscalers to reach in and cherry-pick pieces for themselves that they can better commercialize than the original authors.
57
+
58
+ Then there's completely open source software that doesn't even attempt to be a business.
59
+
60
+ We love software like Blender, but (1) developing ArtCraft is our full-time job, (2) we want to build something at scale that is much bigger than what you presently see, and (3) this will eventually become much more capital intensive than just writing code - we want to train novel models that work directly in conjunction with the user interface.
61
+
62
+ If and when we do get to scale, we intend to keep every bit of our work in the open, including the models. Available for use, inspection, learning, fitting onto consumer GPU hardware, and more.
63
+
64
+ Not having a way to make money is unfortunately what killed Stability.ai. Stability.ai walked so that others could eventually run. (Black Forest Labs, et al.) We're not egotistical enough to count ourselves in that party yet, but we believe in the original Stability.ai ethos and that their model can work with a few tweaks.
65
+
66
+ We want to build big and incredible tools the world hasn't seen before. We want to keep them free and entirely source available. You don't have to pay us, but if you do, all of your investment goes right back into the engineering and the tools. We're writing code you can clone and keep.
67
+
68
+ ### Inspiration
69
+
70
+ We took inspiration for this from Fair Source, Fair Code, the Defold License, and Hacker News discussions. The folks at Obsidian have some pretty good thoughts on this as well.
71
+
72
+ ~ Brandon Thomas
package/README.md CHANGED
@@ -1,3 +1,308 @@
1
- # Temporary Holding Version
1
+ <div align="center">
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
+ # ArtCraft Bridge
4
+
5
+ **Drive the open-source ArtCraft studio apps — PhotoCraft, FilmCraft, EffectCraft — from DeepSeek Harness, in chat or from your own UI.**
6
+
7
+ [English](README.md) | [简体中文](README.zh-CN.md)
8
+
9
+ `@ninkch/dsh-artcraft` · a [DeepSeek Harness](https://github.com/deepseek-ai) plugin · Apache-2.0
10
+
11
+ </div>
12
+
13
+ ---
14
+
15
+ ## Why this exists
16
+
17
+ [ArtCraft](https://getartcraft.com/apps) is a family of free, fair-source reinventions of Adobe's
18
+ studio tools, written from scratch in pure Rust: **PhotoCraft** (Photoshop), **FilmCraft**
19
+ (Premiere Pro), **EffectCraft** (After Effects) and more. They share one superpower that most
20
+ desktop apps don't have: **every menu item, slider and dialog is a command**, and the exact same
21
+ commands can be driven from a headless CLI, a JSON control channel, or an MCP server. The apps
22
+ were built for agents from day one.
23
+
24
+ This plugin brings that surface into DeepSeek Harness, so an AI agent can *operate* the apps —
25
+ not just talk about them:
26
+
27
+ - **In chat** — four agent tools let any Harness session check the toolchain, run CLI commands,
28
+ send control-channel commands to a running app, and read/write files in a dedicated data root.
29
+ - **In the browser** — a same-origin HTTP API (`/artcraft/api/*`) that any Harness web UI can call,
30
+ no CORS, no keys. It was built for [无限画布 / infinite-canvas](../dsh-infinite_canvas/README.md),
31
+ a node-based AI short-drama storyboard canvas, but any front end can use it.
32
+ - **On disk** — one `dataRoot` per machine where assets, project files and rendered output live,
33
+ laid out per project (`media/ · craft/ · out/`), so generative pipelines and the desktop apps
34
+ meet on common ground.
35
+
36
+ A typical AI short-drama loop looks like this: generate storyboard frames with a model →
37
+ batch color-grade and sharpen them in PhotoCraft → render an animated title in EffectCraft →
38
+ assemble the final cut in FilmCraft with grading, mixing and burned-in subtitles → export H.264.
39
+ Every step after "generate" runs through this plugin, headless.
40
+
41
+ ## How it fits together
42
+
43
+ ```
44
+ ┌──────────────── DeepSeek Harness web UI (browser) ────────────────┐
45
+ │ e.g. infinite-canvas: ① upload assets ② start jobs ③ fetch │
46
+ └─────────────────────────────┬─────────────────────────────────────┘
47
+ ▼ same-origin fetch, no CORS
48
+ ┌──────────────── DSH Host · @ninkch/dsh-artcraft ────────────────┐
49
+ │ HTTP routes /artcraft/api/* + agent tools artcraft_* │
50
+ │ → child processes (the CLIs) → TCP control channel │
51
+ └──────┬───────────────────────┬───────────────────────┬───────────┘
52
+ ▼ ▼ ▼
53
+ photocraft-cli filmcraft-cli effectcraft-cli
54
+ batch grading, PSD EDL/XML in-out, .ecproj (JSON) render,
55
+ headless edits cut · grade · mix Lottie export
56
+ └───────────────────────┴───────────────────────┘
57
+ ▼
58
+ <dataRoot>/<project>/{media, craft, out}
59
+ ```
60
+
61
+ Everything runs locally. No cloud round-trips, no accounts, no telemetry.
62
+
63
+ ## Requirements
64
+
65
+ - **DeepSeek Harness** (desktop), any platform the Harness supports.
66
+ - **ArtCraft apps** — grab what you need from [getartcraft.com](https://getartcraft.com/apps)
67
+ or the [storytold GitHub releases](https://github.com/storytold). The portable/installer builds
68
+ ship the CLI binaries on Windows and Linux (`photocraft-cli.exe` …); macOS ships them as a
69
+ separate notarized zip. Versions tested: PhotoCraft 0.6, FilmCraft 0.5, EffectCraft (early).
70
+ - Nothing else. No Python, no FFmpeg — the ArtCraft apps bring their own codecs.
71
+
72
+ ## Setup
73
+
74
+ **1. Get the plugin onto disk** (this repository). Any folder works; keeping it inside the Harness
75
+ workspace next to your other local plugins is the convention.
76
+
77
+ **2. Register it with your Harness profile.** A Harness profile is a pnpm package at
78
+ `C:\Users\<you>\.dsh\profiles\<profile>\` (desktop profile by default). Two edits:
79
+
80
+ ```jsonc
81
+ // package.json in the profile
82
+ {
83
+ "dependencies": {
84
+ // ...existing deps...
85
+ "@ninkch/dsh-artcraft": "^0.1.1", // ← from npm
86
+ // or, for local development, a link into this repository:
87
+ // "@ninkch/dsh-artcraft": "link:D:/code/deepseek-plugin/dsh-artcraft"
88
+ },
89
+ "dsh": { "profile": { "bundles": [
90
+ // ...existing bundles...
91
+ "@ninkch/dsh-artcraft" // ← add the name
92
+ ] } }
93
+ }
94
+ ```
95
+
96
+ Then link and restart the Harness once (Host-side code loads at startup):
97
+
98
+ ```sh
99
+ pnpm install --dir C:/Users/<you>/.dsh/profiles/desktop
100
+ ```
101
+
102
+ > If your Harness build ships a plugin manager UI that installs from a folder, that works too —
103
+ > it ends up writing exactly the two lines above.
104
+
105
+ **3. Configure** `artcraft.config.json` next to `index.js` (copy from
106
+ `artcraft.config.json.example`; the file is git-ignored and re-read on every request — no restart
107
+ needed for path changes):
108
+
109
+ ```jsonc
110
+ {
111
+ "dataRoot": "D:/craft-workspace", // where assets & renders live
112
+ "bins": {
113
+ // three accepted forms: a directory (the <name>-cli binary is appended),
114
+ // a full path to the executable, or a bare name looked up on PATH
115
+ "photocraft": "C:/craft/photocraft-0.6.0-windows-x64-portable",
116
+ "filmcraft": "C:/craft/filmcraft-0.5.0-windows-x64-portable",
117
+ "effectcraft": "C:/craft/effectcraft-windows-x64-portable"
118
+ },
119
+ "control": { "filmcraft": 9876, "effectcraft": 9877 }
120
+ }
121
+ ```
122
+
123
+ **4. Verify.** In any Harness chat, ask your agent to run `artcraft_status`. Green lights across
124
+ `bins.*.found` and you're done.
125
+
126
+ ## Driving it from chat
127
+
128
+ The plugin registers four tools. The agent composes them, so plain language works:
129
+
130
+ > *"Color-grade every PNG in `demo/media` with a soft S-curve and smart sharpening at 80, put the
131
+ > results in `demo/out/graded`."*
132
+
133
+ Behind that sentence the agent will typically do:
134
+
135
+ ```
136
+ artcraft_cli { bin:"photocraft", args:["batch","--actions","demo/craft/grade.json",
137
+ "--in","demo/media","--out","demo/out/graded"] }
138
+ ```
139
+
140
+ | Tool | What it does |
141
+ |---|---|
142
+ | `artcraft_status` | Toolchain health check: which CLIs resolved, data root, control ports, running jobs |
143
+ | `artcraft_cli` | Run any CLI subcommand synchronously (`photocraft-cli run/batch`, `filmcraft-cli commands`, …) |
144
+ | `artcraft_control` | One command over the JSON control channel of a *running* FilmCraft / EffectCraft |
145
+ | `artcraft_fs` | list / stat / read / write / mkdir inside `dataRoot` (writing `grade.json`, fetching a rendered `.ecproj`, …) |
146
+
147
+ ## Driving it from the browser
148
+
149
+ Same-origin HTTP, JSON in and out. The workhorse pattern is the **job lifecycle** — start, poll,
150
+ fetch — which keeps long renders off the request cycle:
151
+
152
+ ```
153
+ POST /artcraft/api/job { "bin":"effectcraft",
154
+ "args":["render","--comp","Main",
155
+ "--out","demo/out/intro.mp4","demo/craft/intro.ecproj"],
156
+ "outputs":["demo/out/intro.mp4"] }
157
+ → { "id":"7f2c…" }
158
+
159
+ GET /artcraft/api/job?id=7f2c…&tail=30
160
+ → { "status":"running|done|failed|timeout",
161
+ "stdout":"…last lines…", "stderr":"…",
162
+ "outputs":[{"rel":"demo/out/intro.mp4","exists":true,"size":812345}] }
163
+
164
+ GET /artcraft/api/file?rel=demo/out/intro.mp4 → raw bytes (streamed)
165
+ POST /artcraft/api/job/cancel { "id":"7f2c…" }
166
+ ```
167
+
168
+ Full route list:
169
+
170
+ | Route | Purpose |
171
+ |---|---|
172
+ | `GET /artcraft/api/status` | Toolchain health (same payload as `artcraft_status`) |
173
+ | `GET /artcraft/api/projects` | Project directories under `dataRoot` |
174
+ | `POST /artcraft/api/fs?action=write&rel=…` | Write a file — raw body (Blob upload) or JSON `{rel, text\|base64}` |
175
+ | `GET /artcraft/api/fs?op=list\|stat\|readtext&rel=…` | Read directories, metadata, small text files |
176
+ | `GET /artcraft/api/file?rel=…` | Download a file — streamed, up to 2 GB |
177
+ | `POST /artcraft/api/job` · `GET ?id=…` · `POST /artcraft/api/job/cancel` | Job lifecycle with output statting and tail logs |
178
+ | `POST /artcraft/api/control` | Synchronous control-channel call |
179
+
180
+ Uploads are capped at 320 MB per request (Blob direct, no base64 needed for the raw path);
181
+ downloads stream up to 2 GB. Path arguments are always relative to `dataRoot` and confined to it.
182
+
183
+ ## The control channel: drive a running app
184
+
185
+ CLI runs are headless and one-shot. When you'd rather watch and fine-tune — grading a scene,
186
+ scrubbing a cut — start the desktop app with its control channel and speak to it live:
187
+
188
+ ```sh
189
+ filmcraft --control 9876 # or set FILMCRAFT_CONTROL_PORT; loopback only
190
+ ```
191
+
192
+ ```jsonc
193
+ POST /artcraft/api/control
194
+ { "app": "filmcraft", "method": "engine.execute",
195
+ "params": { "command": "timeline.place",
196
+ "params": { "item": 1, "track": "V1", "seconds": 0, "duration": 1270080000000 } } }
197
+
198
+ // a Lumetri curve on clip 87 …
199
+ { "command": "effects.setParam",
200
+ "params": { "clip": 87, "effect": "lumetri", "param": "curve_luma",
201
+ "value": [[0,0],[0.25,0.21],[0.75,0.82],[1,1]] } }
202
+
203
+ // …and a look at what the app shows
204
+ { "method": "ui.screenshot", "params": { "path": "frame.png" } }
205
+ ```
206
+
207
+ Time accepts `seconds`, `frame` or `timecode` (internally FilmCraft counts ticks at
208
+ 254,016,000,000/s). `filmcraft-cli commands` lists the 650+ engine commands; the protocol is
209
+ documented in [filmcraft/docs/control-protocol.md](https://github.com/storytold/filmcraft/blob/main/docs/control-protocol.md).
210
+ EffectCraft listens the same way on its own port (default 9877).
211
+
212
+ > PhotoCraft's control channel is an authenticated variant and is deliberately **not** proxied
213
+ > here — for PhotoCraft the headless CLI covers everything this plugin needs.
214
+
215
+ ## Working with 无限画布 (infinite-canvas)
216
+
217
+ The two plugins are decoupled — they meet only on HTTP and the disk layout. The canvas:
218
+
219
+ 1. syncs its generated assets (IndexedDB blobs) into `<project>/media/`,
220
+ 2. starts PhotoCraft/FilmCraft/EffectCraft jobs with per-project files in `<project>/craft/`,
221
+ 3. fetches finished renders from `<project>/out/` back into its asset library.
222
+
223
+ If you're building a similar front end, mirror that contract: project slug as folder name, keep
224
+ the `media · craft · out` triad, and everything composes.
225
+
226
+ ## Recipes
227
+
228
+ **Uniform grading across storyboard frames** — `demo/craft/grade.json`:
229
+
230
+ ```json
231
+ { "actions": [
232
+ { "cmd": "layer.newAdjustmentLayer.curves", "params": { "points": [[0,0],[64,48],[192,212],[255,255]] } },
233
+ { "cmd": "filter.sharpen.smartSharpen", "params": { "amount": 80 } }
234
+ ] }
235
+ ```
236
+
237
+ ```sh
238
+ photocraft-cli batch --actions demo/craft/grade.json --in demo/media --out demo/out/graded
239
+ ```
240
+
241
+ **Final cut without a browser recorder** — the canvas exports its storyboard as a
242
+ Final Cut Pro 7 XML (`xmeml`) or CMX3600 EDL into `demo/craft/timeline.xml`; FilmCraft imports
243
+ it, links media from `demo/media/`, and exports H.264 (hardware NVENC on Windows), ProRes, DNxHR
244
+ with EBU R128 loudness normalization and burned-in captions. Interchange is where FilmCraft's
245
+ automation really pays off — EDL/XML are plain text your pipeline already knows how to write.
246
+
247
+ **Animated titles as code** — EffectCraft projects (`.ecproj`) are versioned JSON, so a model can
248
+ write one outright or fill a template. Render to MP4/ProRes — ProRes 4444 with alpha drops
249
+ straight onto a FilmCraft track as a graphics layer — or export **Lottie** and play it inline in
250
+ a web UI.
251
+
252
+ ## Troubleshooting
253
+
254
+ - **`bins.*.found: false`** — check the path forms above; the CLI must exist next to the app
255
+ (or be on `PATH`). Changes to `artcraft.config.json` apply on the next request.
256
+ - **404 on `/artcraft/api/*`** — the bundle isn't registered with the profile (see Setup) or the
257
+ Harness hasn't been restarted since registration. `artcraft_status` from chat is the quick probe.
258
+ - **Control channel refused** — the app must be running with `--control <port>`; the channel is
259
+ loopback-only and unauthenticated, so nothing else will answer on that port.
260
+ - **A job hangs** — `GET /artcraft/api/job` lists everything with logs; cancel by id. Plugin
261
+ reloads kill all child jobs by design.
262
+ - **Path escape errors** — by design: every filesystem argument must resolve inside `dataRoot`.
263
+
264
+ ## Security & trust model
265
+
266
+ The HTTP surface has **no authentication** and rides on the Harness web server, which listens on
267
+ loopback only — treat the port as trusted-local and don't expose it to a network; put a reverse
268
+ proxy with auth in front if you must. Child processes are locked to the three allow-listed
269
+ binaries; file access is locked to `dataRoot`; the control channel only ever dials `127.0.0.1`.
270
+
271
+ ## Publishing
272
+
273
+ This plugin is published to npm as **`@ninkch/dsh-artcraft`** (scoped packages publish with
274
+ `npm publish --access public`). To consume it, add the package name to your Harness profile's
275
+ `dependencies` and `dsh.profile.bundles` (see Setup) — `pnpm install` in the profile does the
276
+ rest. For local development, swap the dependency for a `"link:<path-to-this-repo>"` instead.
277
+ The three places that must agree on the package name are the profile `package.json`
278
+ (dependency + bundles) and this repo's `cordis.patch.yml`.
279
+
280
+ GitHub: this repository is self-contained; `README.md` is English-first with a
281
+ [简体中文](README.zh-CN.md) companion.
282
+
283
+ **Releases run through npm Trusted Publishing** (GitHub Actions OIDC — no tokens, no OTP):
284
+ `.github/workflows/publish.yml` fires on `v*` tags; the trusted publisher on the npm package
285
+ points at `NINKCH/dsh-artcraft` / `publish.yml`. To cut a release: bump `version`, commit,
286
+ `git tag v0.x.y && git push origin v0.x.y`.
287
+
288
+ ## License
289
+
290
+ **This plugin (`@ninkch/dsh-artcraft`): Apache-2.0** — see [LICENSE](LICENSE). It ships none of the
291
+ ArtCraft apps' code — it only drives their public automation surfaces (headless CLI + JSON
292
+ control channel).
293
+
294
+ **The ArtCraft apps themselves** are *not* OSI open source: they are distributed under the
295
+ **ArtCraft License (WIP)**, a "fair source" license ([verbatim text](NOTICE.md)). The short
296
+ version for anyone building on them:
297
+
298
+ - ✅ free to use; back up, copy, modify and compile for private purposes
299
+ - ✅ **every piece of media you create with the apps is yours** — your rendered episodes are
300
+ commercial assets, full stop
301
+ - ❌ no selling the apps as your own software, no competing products built from their code
302
+ - ❌ no stripping community/donation links from a fork; no using the ArtCraft name, logo or
303
+ mascots to promote a business without permission
304
+ - 🤝 the team's public promise: if the business ever ends, the software transitions to an
305
+ OSI-approved open-source license
306
+
307
+ Practical reading for an AI short-drama studio: run the apps locally, leave their community
308
+ links alone, and sell your films — not the apps.