comfy-ts 2.18.1 → 2.20.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 +147 -97
- package/claude-code/.claude-plugin/plugin.json +9 -0
- package/claude-code/skills/convert/SKILL.md +25 -0
- package/claude-code/skills/guide/SKILL.md +21 -0
- package/claude-code/skills/run/SKILL.md +12 -0
- package/claude-code/skills/setup/SKILL.md +15 -0
- package/claude-code/skills/workflow/SKILL.md +19 -0
- package/dist/{ServeApp-qXcQfdgT.js → ServeApp-B469W26E.js} +5 -5
- package/dist/{ServeApp-qXcQfdgT.js.map → ServeApp-B469W26E.js.map} +1 -1
- package/dist/cli.js +228 -11
- package/dist/cli.js.map +1 -1
- package/dist/{state-C067Kbew.js → exampleAssets-j1f26nGc.js} +177 -56
- package/dist/{state-C067Kbew.js.map → exampleAssets-j1f26nGc.js.map} +1 -1
- package/dist/{findDefinedWorkflow-0lG-VTEd.js → findDefinedWorkflow-B90-xFxX.js} +2 -2
- package/dist/{findDefinedWorkflow-0lG-VTEd.js.map → findDefinedWorkflow-B90-xFxX.js.map} +1 -1
- package/dist/index.cjs +92 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/index.js +92 -10
- package/dist/index.js.map +1 -1
- package/dist/{run-run-Zr699h2S.js → run-run-QEoh7Wbh.js} +5 -6
- package/dist/{run-run-Zr699h2S.js.map → run-run-QEoh7Wbh.js.map} +1 -1
- package/dist/{run-serve-DaXzoVTS.js → run-serve-CsEYPGm9.js} +4 -4
- package/dist/{run-serve-DaXzoVTS.js.map → run-serve-CsEYPGm9.js.map} +1 -1
- package/dist/{run-tui-CeM1GOJP.js → run-tui-YxiSoNvK.js} +9 -15
- package/dist/run-tui-YxiSoNvK.js.map +1 -0
- package/dist/{schemaDrift-CbsABBuk.js → schemaDrift-DaWsE-mt.js} +15 -15
- package/dist/{schemaDrift-CbsABBuk.js.map → schemaDrift-DaWsE-mt.js.map} +1 -1
- package/dist/web.d.ts +30 -20
- package/dist/web.js +83 -6
- package/dist/web.js.map +1 -1
- package/examples/README.md +17 -11
- package/examples/rvion/01-txt2img.cflow.ts +1 -1
- package/examples/rvion/02-img2img-upload.cflow.ts +1 -1
- package/examples/rvion/03-export-workflow-json.cflow.ts +1 -1
- package/examples/rvion/04-krea2-turbo-t2i.cflow.ts +1 -1
- package/examples/rvion/06-qwen-image-edit.cflow.ts +1 -1
- package/examples/rvion/07-local-llm-text-gen.cflow.ts +1 -1
- package/examples/rvion/08-qwen-image-21-t2i.cflow.ts +1 -1
- package/examples/rvion/09-qwen-image-21-edit.cflow.ts +1 -1
- package/examples/rvion/10-anima-t2i.cflow.ts +1 -1
- package/examples/rvion/11-yue2-t2a.cflow.ts +1 -1
- package/examples/rvion/12-stable-audio-3-t2a.cflow.ts +1 -1
- package/examples/rvion/13-ace-step-15-xl-t2a.cflow.ts +1 -1
- package/examples/rvion/14-video-soundtrack.cflow.ts +1 -1
- package/examples/rvion/15-tts-voice-clone.cflow.ts +1 -1
- package/examples/rvion/16-tts-voice-design.cflow.ts +1 -1
- package/guide-for-agents.md +8 -5
- package/package.json +8 -7
- package/src/cli/comfy-ts-cli.ts +12 -2
- package/src/cli/gen.ts +6 -1
- package/src/cli/serve/ServeApp.ts +4 -4
- package/src/cli/serve/web/api.ts +1 -1
- package/src/cli/skill.ts +207 -0
- package/src/cli/tui/components/Header.tsx +1 -4
- package/src/cli/tui/components/HostPanel.tsx +1 -4
- package/src/cli/tui/state/HostSt.ts +2 -2
- package/src/exampleAssets.ts +10 -4
- package/src/host/ComfyHost.ts +35 -5
- package/src/host/hostFile.ts +57 -0
- package/src/state.ts +15 -9
- package/dist/exampleAssets-BfWzygoM.js +0 -38
- package/dist/exampleAssets-BfWzygoM.js.map +0 -1
- package/dist/run-tui-CeM1GOJP.js.map +0 -1
package/examples/README.md
CHANGED
|
@@ -1,24 +1,30 @@
|
|
|
1
1
|
# comfy-ts examples
|
|
2
2
|
|
|
3
|
-
Every `*.cflow.ts` file here is a runnable workflow module
|
|
3
|
+
Every `*.cflow.ts` file here is a runnable workflow module. Run it directly with bun, run it headless with `bunx comfy-ts run <name>`, or browse them all in the TUI (`bunx comfy-ts tui` lists them under "comfy-ts examples": tweak vars, ⌃R to run).
|
|
4
4
|
|
|
5
5
|
## Layout
|
|
6
6
|
|
|
7
|
-
- `rvion/01…04-*.cflow.ts
|
|
8
|
-
- `rvion/05-comfy-cloud.cflow.ts
|
|
9
|
-
- `rvion/06-qwen-image-edit.cflow.ts
|
|
10
|
-
- `rvion/07-local-llm-text-gen.cflow.ts
|
|
11
|
-
- `rvion/08-qwen-image-21-t2i.cflow.ts` / `rvion/09-qwen-image-21-edit.cflow.ts
|
|
12
|
-
- `rvion/
|
|
13
|
-
- `rvion/
|
|
14
|
-
- `
|
|
7
|
+
- `rvion/01…04-*.cflow.ts`: the didactic sequence against a LOCAL ComfyUI host, named by id only: `comfy.host({ id: 'windows-1' })`. Run `bunx comfy-ts gen --id windows-1 --host http://<your-comfy>:8188` once: it saves the address and generates the typed SDK.
|
|
8
|
+
- `rvion/05-comfy-cloud.cflow.ts`: the same t2i against [Comfy Cloud](https://cloud.comfy.org). No local GPU needed: the typed catalog ships committed at `comfy-cloud/sdk.d.ts`.
|
|
9
|
+
- `rvion/06-qwen-image-edit.cflow.ts`: image editing (qwen image edit 2511) against the same local host.
|
|
10
|
+
- `rvion/07-local-llm-text-gen.cflow.ts`: a local LLM, no image. Core's `TextGenerate` runs a chat model loaded through `CLIPLoader`, and the text comes back in `execution.text`. `--sweep` reports which text encoders on your host actually generate.
|
|
11
|
+
- `rvion/08-qwen-image-21-t2i.cflow.ts` / `rvion/09-qwen-image-21-edit.cflow.ts`: Qwen Image 2.1 (ComfyUI ≥ 0.37) against the same local host: text to image, and instruction editing of one reference image (its `remove background` preset is the official background-removal template).
|
|
12
|
+
- `rvion/10-anima-t2i.cflow.ts`: Anima text to image. Turbo, aesthetic, base, or base + turbo lora as one choice, an anima lora stack, an optional RMBG cutout. The model file is a `v.model` choice over the anima files on your host.
|
|
13
|
+
- `rvion/11-yue2-t2a.cflow.ts`: YuE2 text to music. The first prompt line is the style and the rest is the lyrics. ABC planning is a choice (full, melody, off), and the plan shows as a text result next to the song.
|
|
14
|
+
- `rvion/12-stable-audio-3-t2a.cflow.ts`: Stable Audio 3 Medium: music, instruments, sound effects or one-shots from one description. With `reprompt` on, a local Qwen3.5 2B first rewrites the description with the official template's instructions for the chosen category.
|
|
15
|
+
- `rvion/13-ace-step-15-xl-t2a.cflow.ts`: ACE-Step 1.5 XL: a song with vocals from a caption and lyrics, with the turbo, sft or base model, and bpm, key, beats per bar and language as settings.
|
|
16
|
+
- `rvion/14-video-soundtrack.cflow.ts`: a new soundtrack on a video. The frames of one file and the audio of another are muxed back at the fps you pick. Core nodes only. `exampleMediaPath()` resolves the bundled sample video and audio it defaults to.
|
|
17
|
+
- `rvion/15-tts-voice-clone.cflow.ts`: text to speech in a cloned voice (needs the [TTS-Audio-Suite](https://github.com/diodiogod/TTS-Audio-Suite) custom node pack on the host). Pick an engine (Chatterbox Multilingual v3 by default, Qwen3-TTS, Fish Audio S2 Pro, CosyVoice3, OmniVoice) and a language, drop a voice clip and write its transcript, and the text comes back as audio in `execution.audios`. A short synthetic English voice ships in `media/`, so it runs out of the box.
|
|
18
|
+
- `rvion/16-tts-voice-design.cflow.ts`: a new voice from a written description (needs TTS-Audio-Suite, Qwen3-TTS VoiceDesign). It speaks one sample line in that voice, and the clip plus that line are what `15-tts-voice-clone` takes as `voice` and `transcript`. From the command line the flow is two runs: `comfy-ts run tts-voice-design --description "…" --line "…" --out voices/sailor.flac` writes the clip and `voices/sailor.txt`, then `comfy-ts run tts-voice-clone --voice voices/sailor.flac --prompt "…" --out lines/001.flac` speaks any line in it.
|
|
19
|
+
- `comfy-cloud/<family>-<mode>.cflow.ts`: the model zoo, 73 files for 43 model families. One clean example per model family × mode (`t2i`, `i2i`, `t2v`, `i2v`, `t2a`), each mirroring an official ComfyUI template (flux, qwen-image, z-image, wan, ltx, hidream, ace-step, stable-audio, …). A suffix after the mode names a variant of the same family (`flux2-t2i-dev`). All share `comfy-cloud/cloudHost.ts`. The full list by mode is in the [main README](../README.md#the-model-zoo-73-cloud-workflows-43-model-families).
|
|
20
|
+
- `web/`: the browser entry `comfy-ts/web` in a runnable page (`bun examples/web/serve.ts`).
|
|
15
21
|
|
|
16
22
|
## Cloud API key
|
|
17
23
|
|
|
18
|
-
Cloud examples read `COMFY_CLOUD_API_KEY` (create one at cloud.comfy.org, paid tiers). Without it everything still loads and typechecks
|
|
24
|
+
Cloud examples read `COMFY_CLOUD_API_KEY` (create one at cloud.comfy.org, paid tiers). Without it everything still loads and typechecks: only `run()` needs the key.
|
|
19
25
|
|
|
20
26
|
```sh
|
|
21
27
|
COMFY_CLOUD_API_KEY=… bun examples/rvion/05-comfy-cloud.cflow.ts "a fox in the snow" 42
|
|
22
28
|
```
|
|
23
29
|
|
|
24
|
-
Cloud runs bill compute to your account
|
|
30
|
+
Cloud runs bill compute to your account. Start with a small t2i.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { ComfyTS, v } from 'comfy-ts'
|
|
5
5
|
|
|
6
6
|
const comfy = ComfyTS.create()
|
|
7
|
-
const host = comfy.host({ id: 'windows-1'
|
|
7
|
+
const host = comfy.host({ id: 'windows-1' })
|
|
8
8
|
await host.loadSchemaFromCache() // offline import; run() connects lazily
|
|
9
9
|
|
|
10
10
|
export const txt2img = host.defineWorkflow({
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { asAbsolutePath, ComfyTS, exampleImagePath, MediaImage, v } from 'comfy-ts'
|
|
5
5
|
|
|
6
6
|
const comfy = ComfyTS.create()
|
|
7
|
-
const host = comfy.host({ id: 'windows-1'
|
|
7
|
+
const host = comfy.host({ id: 'windows-1' })
|
|
8
8
|
await host.loadSchemaFromCache() // offline import; run() connects lazily
|
|
9
9
|
|
|
10
10
|
// bundled default input (examples/images/, ships in the tarball) — the TUI picker or argv[2] swap it
|
|
@@ -6,7 +6,7 @@ import { mkdirSync, writeFileSync } from 'node:fs'
|
|
|
6
6
|
import { ComfyTS, v } from 'comfy-ts'
|
|
7
7
|
|
|
8
8
|
const comfy = ComfyTS.create()
|
|
9
|
-
const host = comfy.host({ id: 'windows-1'
|
|
9
|
+
const host = comfy.host({ id: 'windows-1' })
|
|
10
10
|
await host.loadSchemaFromCache() // no connection needed
|
|
11
11
|
|
|
12
12
|
export const exportWorkflow = host.defineWorkflow({
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { activeLoras, ComfyTS } from 'comfy-ts'
|
|
9
9
|
|
|
10
10
|
const comfy = ComfyTS.create()
|
|
11
|
-
const host = comfy.host({ id: 'windows-1'
|
|
11
|
+
const host = comfy.host({ id: 'windows-1' })
|
|
12
12
|
await host.loadSchemaFromCache() // offline import (lora options come from the cached schema); run() connects lazily
|
|
13
13
|
|
|
14
14
|
export const t2i = host.defineWorkflow({
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { asAbsolutePath, ComfyTS, exampleImagePath, MediaImage, v } from 'comfy-ts'
|
|
8
8
|
|
|
9
9
|
const comfy = ComfyTS.create()
|
|
10
|
-
const host = comfy.host({ id: 'windows-1'
|
|
10
|
+
const host = comfy.host({ id: 'windows-1' })
|
|
11
11
|
await host.loadSchemaFromCache() // offline import; run() connects lazily
|
|
12
12
|
|
|
13
13
|
// bundled default input (examples/images/, ships in the tarball) — the TUI picker or argv[2] swap it
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { ComfyTS, promptEnhancerPresets, v } from 'comfy-ts'
|
|
14
14
|
|
|
15
15
|
const comfy = ComfyTS.create()
|
|
16
|
-
const host = comfy.host({ id: 'windows-1'
|
|
16
|
+
const host = comfy.host({ id: 'windows-1' })
|
|
17
17
|
await host.loadSchemaFromCache() // offline import; run() connects lazily
|
|
18
18
|
|
|
19
19
|
// generative on this box (measured, see --sweep). Every entry is a plain text_encoders/
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { ComfyTS, v } from 'comfy-ts'
|
|
6
6
|
|
|
7
7
|
const comfy = ComfyTS.create()
|
|
8
|
-
const host = comfy.host({ id: 'windows-1'
|
|
8
|
+
const host = comfy.host({ id: 'windows-1' })
|
|
9
9
|
await host.loadSchemaFromCache() // offline import; run() connects lazily
|
|
10
10
|
|
|
11
11
|
export const qwenImage21T2i = host.defineWorkflow({
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { asAbsolutePath, ComfyTS, exampleImagePath, MediaImage, v } from 'comfy-ts'
|
|
7
7
|
|
|
8
8
|
const comfy = ComfyTS.create()
|
|
9
|
-
const host = comfy.host({ id: 'windows-1'
|
|
9
|
+
const host = comfy.host({ id: 'windows-1' })
|
|
10
10
|
await host.loadSchemaFromCache() // offline import; run() connects lazily
|
|
11
11
|
|
|
12
12
|
// bundled default input (examples/images/, ships in the tarball) — the TUI picker or argv[2] swap it
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { activeLoras, ComfyTS } from 'comfy-ts'
|
|
8
8
|
|
|
9
9
|
const comfy = ComfyTS.create()
|
|
10
|
-
const host = comfy.host({ id: 'windows-1'
|
|
10
|
+
const host = comfy.host({ id: 'windows-1' })
|
|
11
11
|
await host.loadSchemaFromCache()
|
|
12
12
|
|
|
13
13
|
const TURBO_LORA = 'anima\\anima-turbo-lora-v0.2.safetensors'
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { ComfyTS, v } from 'comfy-ts'
|
|
8
8
|
|
|
9
9
|
const comfy = ComfyTS.create()
|
|
10
|
-
const host = comfy.host({ id: 'windows-1'
|
|
10
|
+
const host = comfy.host({ id: 'windows-1' })
|
|
11
11
|
await host.loadSchemaFromCache() // offline import; run() connects lazily
|
|
12
12
|
|
|
13
13
|
export const yue2T2a = host.defineWorkflow({
|
|
@@ -8,7 +8,7 @@ import { ComfyTS, v } from 'comfy-ts'
|
|
|
8
8
|
import { SA3_CATEGORIES, sa3Reprompt } from './stableAudio3Prompts.ts'
|
|
9
9
|
|
|
10
10
|
const comfy = ComfyTS.create()
|
|
11
|
-
const host = comfy.host({ id: 'windows-1'
|
|
11
|
+
const host = comfy.host({ id: 'windows-1' })
|
|
12
12
|
await host.loadSchemaFromCache() // offline import; run() connects lazily
|
|
13
13
|
|
|
14
14
|
export const stableAudio3T2a = host.defineWorkflow({
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { ComfyTS, v } from 'comfy-ts'
|
|
9
9
|
|
|
10
10
|
const comfy = ComfyTS.create()
|
|
11
|
-
const host = comfy.host({ id: 'windows-1'
|
|
11
|
+
const host = comfy.host({ id: 'windows-1' })
|
|
12
12
|
await host.loadSchemaFromCache() // offline import; run() connects lazily
|
|
13
13
|
|
|
14
14
|
const MODELS = {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { ComfyTS, exampleMediaPath, v } from 'comfy-ts'
|
|
8
8
|
|
|
9
9
|
const comfy = ComfyTS.create()
|
|
10
|
-
const host = comfy.host({ id: 'windows-1'
|
|
10
|
+
const host = comfy.host({ id: 'windows-1' })
|
|
11
11
|
await host.loadSchemaFromCache() // offline import; run() connects lazily
|
|
12
12
|
|
|
13
13
|
// bundled defaults (examples/media/, ship in the tarball)
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { ComfyTS, exampleMediaPath, v } from 'comfy-ts'
|
|
10
10
|
|
|
11
11
|
const comfy = ComfyTS.create()
|
|
12
|
-
const host = comfy.host({ id: 'windows-1'
|
|
12
|
+
const host = comfy.host({ id: 'windows-1' })
|
|
13
13
|
await host.loadSchemaFromCache() // offline import; run() connects lazily
|
|
14
14
|
|
|
15
15
|
const ENGINES = ['chatterbox', 'qwen3', 'fishs2', 'cosyvoice3', 'omnivoice'] as const
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { ComfyTS, v } from 'comfy-ts'
|
|
9
9
|
|
|
10
10
|
const comfy = ComfyTS.create()
|
|
11
|
-
const host = comfy.host({ id: 'windows-1'
|
|
11
|
+
const host = comfy.host({ id: 'windows-1' })
|
|
12
12
|
await host.loadSchemaFromCache() // offline import; run() connects lazily
|
|
13
13
|
|
|
14
14
|
const LANGUAGES = [
|
package/guide-for-agents.md
CHANGED
|
@@ -9,19 +9,19 @@ You are working in a project that uses `comfy-ts`, a type-safe ComfyUI companion
|
|
|
9
9
|
|
|
10
10
|
```bash
|
|
11
11
|
bunx comfy-ts gen --id my-gpu --host http://127.0.0.1:8188
|
|
12
|
-
# writes .comfy-ts/hosts/my-gpu/{object_info.json,embeddings.json,sdk.d.ts}
|
|
12
|
+
# writes .comfy-ts/hosts/my-gpu/{object_info.json,embeddings.json,sdk.d.ts,host.json}
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
Or skip the CLI: a first `await host.connect()` fetches the schema and writes the same files.
|
|
15
|
+
`host.json` is the saved address: from then on `comfy.host({ id: 'my-gpu' })` finds the host, so committed code never names a machine. No saved address and no `url` or `host`/`port`: the module still imports (a loud log), and the first connect or run throws and names the `gen` command to run. Or skip the CLI: a first `await host.connect()` fetches the schema and writes the same files, except `host.json`.
|
|
16
16
|
3. Activate the generated types in tsconfig:
|
|
17
17
|
|
|
18
18
|
```jsonc
|
|
19
19
|
{ "include": ["src", ".comfy-ts/hosts/**/sdk.d.ts"] }
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
4. Gitignore `.comfy-ts/` entirely. It is local state: host schema dumps (often ~10MB, they describe that machine's models and paths), run outputs, TUI drafts and settings, lora keywords, preview cache. Everything in it is regenerable. (Exception: a private repo may commit `hosts/` to get typed CI.)
|
|
22
|
+
4. Gitignore `.comfy-ts/` entirely. It is local state: host schema dumps (often ~10MB, they describe that machine's models and paths), host addresses, run outputs, TUI drafts and settings, lora keywords, preview cache. Everything in it is regenerable. (Exception: a private repo may commit `hosts/` to get typed CI.)
|
|
23
23
|
|
|
24
|
-
Before the first codegen the builder falls back to permissive base types, so code compiles either way.
|
|
24
|
+
Before the first codegen the builder falls back to permissive base types, so code compiles either way when `noUncheckedIndexedAccess` is off. With that flag on, every `b.Node(...)` call is an error until a generated sdk.d.ts is in scope, so run the codegen first. Types sharpen once the generated sdk is in scope.
|
|
25
25
|
|
|
26
26
|
## The workflow pattern: defineWorkflow + vars + build
|
|
27
27
|
|
|
@@ -31,7 +31,7 @@ A workflow module is a `*.cflow.ts` file (that suffix is what the TUI scans for)
|
|
|
31
31
|
import { ComfyTS, v } from 'comfy-ts'
|
|
32
32
|
|
|
33
33
|
const comfy = ComfyTS.create()
|
|
34
|
-
const host = comfy.host({ id: 'my-gpu'
|
|
34
|
+
const host = comfy.host({ id: 'my-gpu' }) // the address `comfy-ts gen` saved
|
|
35
35
|
await host.loadSchemaFromCache() // offline import; run() connects lazily
|
|
36
36
|
|
|
37
37
|
export const txt2img = host.defineWorkflow({
|
|
@@ -97,8 +97,11 @@ bunx comfy-ts outline [file] [--section Name] [--lines N] # inspect a sdk.d.ts
|
|
|
97
97
|
bunx comfy-ts loras [--id <host-id>] [--host http://…] # mirror lora metadata (optional ComfyUI-Lora-Manager extension)
|
|
98
98
|
bunx comfy-ts tui [dir | module.cflow.ts] # interactive tweak & re-run
|
|
99
99
|
bunx comfy-ts run <name | module.cflow.ts> [--draft <name>] [--<var> <value>…] [--out <path>] [--json] # one generation, headless
|
|
100
|
+
bunx comfy-ts skill install [--user | --dir <skills-dir>] [--force] # Claude Code skills for this project
|
|
100
101
|
```
|
|
101
102
|
|
|
103
|
+
`comfy-ts skill install` gives Claude Code five slash commands in the project: `/comfy-ts-setup`, `/comfy-ts-workflow` (write a module), `/comfy-ts-convert` (a ComfyUI JSON into a module), `/comfy-ts-run` (one generation) and `/comfy-ts-guide` (questions, and the background Claude loads on its own). They follow this guide and never copy it. A rerun after an upgrade updates them, and a skill file you edited is kept unless you pass `--force`. Without npm, the same skills come as a Claude Code plugin: `/plugin marketplace add rvion/comfy-ts`, then `/plugin install comfy-ts@comfy-ts` (commands `/comfy-ts:setup` and so on).
|
|
104
|
+
|
|
102
105
|
`comfy-ts run` is how an agent generates: the module is found in the cwd, then in the bundled examples, by key or a unique part of it (`folder/name` narrows, like `rvion/anima`). Every var is a flag (`--prompt "…" --seed 7 --image in.png`, `--<var>-file` reads a text var from a file), `--out` says where the output goes, and `--json` prints one line with every output path. `comfy-ts run <name> --help` lists the vars. Every flag is a var name the module declares. A media var declared with `sidecarText: someTextVar` fills that text var from `<file>.txt` beside the file it is given (a voice clip's transcript, example 15).
|
|
103
106
|
|
|
104
107
|
`comfy-ts loras` writes `.comfy-ts/hosts/<id>/loras.json`: per lora, the model's real name, its civitai trigger words, tags, base model and preview url, stored raw. It is what makes `v.prompt(text, { loraKeywordsFrom: lorasVar })` inject a lora's trigger words with nothing typed by hand, and what lets the TUI find a lora by its human name. Read it yourself (`getLoraInfo`, `getLoraTriggerWords`, `getLoraDisplayName`) when a user asks which lora to pick. Absent extension or no sync yet: every getter answers empty, nothing breaks.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "comfy-ts",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "The complete TypeScript toolkit for ComfyUI and generative AI. Fully type-safe SDK with autocomplete on every node, companion CLI, TUI, agentic docs, and
|
|
3
|
+
"version": "2.20.0",
|
|
4
|
+
"description": "The complete TypeScript toolkit for ComfyUI and generative AI. Fully type-safe SDK with autocomplete on every node, companion CLI, TUI, agentic docs, and 80+ examples. Design, run and deploy creative pipelines for image, video, audio, 3d and text on any ComfyUI, local, cloud or hosted.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"comfyui",
|
|
7
7
|
"generative-ai",
|
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
"extra",
|
|
64
64
|
"README.md",
|
|
65
65
|
"guide-for-agents.md",
|
|
66
|
+
"claude-code",
|
|
66
67
|
"LICENSE"
|
|
67
68
|
],
|
|
68
69
|
"scripts": {
|
|
@@ -70,8 +71,8 @@
|
|
|
70
71
|
"build:watch": "tsdown --watch",
|
|
71
72
|
"test": "bun test --parallel --no-isolate",
|
|
72
73
|
"test:watch": "bun test --watch",
|
|
73
|
-
"typecheck": "tsc
|
|
74
|
-
"typecheck:
|
|
74
|
+
"typecheck": "tsc -p tsconfig.lib.json && tsc -p examples/web/tsconfig.json && tsc -p src/cli/serve/web/tsconfig.json",
|
|
75
|
+
"typecheck:full": "tsc --noEmit --tsBuildInfoFile node_modules/.cache/tsbuildinfo-typecheck.json && tsc -p examples/web/tsconfig.json && tsc -p src/cli/serve/web/tsconfig.json",
|
|
75
76
|
"lint": "oxlint src examples scripts tests",
|
|
76
77
|
"format": "oxfmt src examples scripts tests",
|
|
77
78
|
"format:check": "oxfmt --check src examples scripts tests",
|
|
@@ -79,8 +80,8 @@
|
|
|
79
80
|
"imports:fix": "rvt imports --fix",
|
|
80
81
|
"cycles": "rvt cycles 1",
|
|
81
82
|
"rename": "rvt rename",
|
|
82
|
-
"ci": "bun run typecheck
|
|
83
|
-
"ci:local": "bun run ci && bun run typecheck",
|
|
83
|
+
"ci": "bun run typecheck && bun run lint && bun run format:check && bun run imports:check && bun run test",
|
|
84
|
+
"ci:local": "bun run ci && bun run typecheck:full",
|
|
84
85
|
"gen:manager": "bun src/manager/script-update-manager.bun.ts",
|
|
85
86
|
"gen:sdk": "bun scripts/gen-sdk-from-cache.ts",
|
|
86
87
|
"gen:sdk:cloud": "bun src/cli/comfy-ts-cli.ts gen --id comfy-cloud --host https://cloud.comfy.org --out examples/comfy-cloud/sdk.d.ts && oxfmt examples/comfy-cloud/sdk.d.ts",
|
|
@@ -140,7 +141,7 @@
|
|
|
140
141
|
"oxfmt": "^0.60.0",
|
|
141
142
|
"oxlint": "^1.75.0",
|
|
142
143
|
"oxlint-tsgolint": "^7.0.2001",
|
|
143
|
-
"rvlib-shipkit": "^2.
|
|
144
|
+
"rvlib-shipkit": "^2.26.0",
|
|
144
145
|
"rvlib-ts-tools": "^0.3.3",
|
|
145
146
|
"tsdown": "^0.22.14",
|
|
146
147
|
"typescript": "^7.0.2"
|
package/src/cli/comfy-ts-cli.ts
CHANGED
|
@@ -5,14 +5,17 @@ import { fileURLToPath } from 'node:url'
|
|
|
5
5
|
import { runGen } from 'src/cli/gen.ts'
|
|
6
6
|
import { runLoras } from 'src/cli/loras.ts'
|
|
7
7
|
import { runOutline } from 'src/cli/outline.ts'
|
|
8
|
+
import { runSkill } from 'src/cli/skill.ts'
|
|
8
9
|
|
|
9
10
|
const HELP = `comfy-ts — typed SDK codegen for ComfyUI
|
|
10
11
|
|
|
11
12
|
Usage:
|
|
12
13
|
comfy-ts gen --id <host-id> [--host http://127.0.0.1:8188] [--api-key <key>] [--out <sdk-path>]
|
|
13
14
|
fetch object_info + embeddings from a live ComfyUI host and write
|
|
14
|
-
.comfy-ts/hosts/<host-id>/{object_info.json,embeddings.json,sdk.d.ts}
|
|
15
|
-
(
|
|
15
|
+
.comfy-ts/hosts/<host-id>/{object_info.json,embeddings.json,sdk.d.ts,host.json}
|
|
16
|
+
(host.json saves the address: code then names the host by id alone,
|
|
17
|
+
comfy.host({ id: '<host-id>' }); the api key is never written;
|
|
18
|
+
--api-key or COMFY_CLOUD_API_KEY authenticates via X-API-Key;
|
|
16
19
|
--out relocates ONLY the sdk.d.ts, e.g. a committed cloud catalog)
|
|
17
20
|
|
|
18
21
|
comfy-ts outline [file] [--lines N] [--section Name]
|
|
@@ -48,6 +51,12 @@ Usage:
|
|
|
48
51
|
dir keeps the server's names). \`comfy-ts run <name> --help\` lists the vars,
|
|
49
52
|
\`comfy-ts run\` lists the modules. --json prints one line with the paths
|
|
50
53
|
|
|
54
|
+
comfy-ts skill install [--user | --dir <skills-dir>] [--force]
|
|
55
|
+
copy the comfy-ts Claude Code skills into .claude/skills/ of the cwd
|
|
56
|
+
(--user: your personal skills folder): /comfy-ts-guide, -setup,
|
|
57
|
+
-workflow, -convert, -run. A file you edited is never overwritten
|
|
58
|
+
without --force. \`comfy-ts skill --help\` says more
|
|
59
|
+
|
|
51
60
|
comfy-ts help
|
|
52
61
|
`
|
|
53
62
|
|
|
@@ -56,6 +65,7 @@ async function main(): Promise<number> {
|
|
|
56
65
|
if (cmd === 'gen') return runGen(rest)
|
|
57
66
|
if (cmd === 'outline') return runOutline(rest)
|
|
58
67
|
if (cmd === 'loras') return runLoras(rest)
|
|
68
|
+
if (cmd === 'skill') return runSkill(rest)
|
|
59
69
|
if (cmd === 'tui' || cmd === 'serve' || cmd === 'run') {
|
|
60
70
|
// .cflow.ts workflow modules need bun: node refuses to strip types under
|
|
61
71
|
// node_modules, exactly where the packaged examples live — and the bin's
|
package/src/cli/gen.ts
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
import { mkdirSync, writeFileSync } from 'node:fs'
|
|
3
3
|
import { dirname, join, resolve } from 'pathe'
|
|
4
4
|
import { flagReader } from 'src/cli/flags.ts'
|
|
5
|
+
import { writeHostFile } from 'src/host/hostFile.ts'
|
|
6
|
+
import { renderHttpBase } from 'src/host/hostUrl.ts'
|
|
5
7
|
import { ComfySchema } from 'src/sdk-generator/ComfySchema.ts'
|
|
6
8
|
import type { ComfySchemaJSON } from 'src/sdk-generator/ComfyUIObjectInfoTypes.ts'
|
|
7
9
|
import { ComfyTS } from 'src/state.ts'
|
|
@@ -33,10 +35,13 @@ export async function runGen(args: string[]): Promise<number> {
|
|
|
33
35
|
const spec = await fetchJSON<ComfySchemaJSON>('/object_info')
|
|
34
36
|
const embeddings = await fetchJSON<string[]>('/embeddings').catch(() => [] as string[])
|
|
35
37
|
|
|
36
|
-
const dir =
|
|
38
|
+
const dir = host.cacheFolder
|
|
37
39
|
mkdirSync(dir, { recursive: true })
|
|
38
40
|
writeFileSync(join(dir, 'object_info.json'), readableStringify(spec, 4), 'utf8')
|
|
39
41
|
writeFileSync(join(dir, 'embeddings.json'), JSON.stringify(embeddings), 'utf8')
|
|
42
|
+
// the address, so code names this host by id alone: comfy.host({ id })
|
|
43
|
+
const hostFile = writeHostFile(comfy.storage, dir, { url: renderHttpBase(host.base) })
|
|
44
|
+
console.log(`[comfy-ts gen] 🟢 ${hostFile}: comfy.host({ id: '${id}' }) now finds this host`)
|
|
40
45
|
|
|
41
46
|
const parsed = new ComfySchema({ spec, embeddings })
|
|
42
47
|
const dts = parsed.codegenDTS({ hostId: id })
|
|
@@ -894,14 +894,14 @@ export class ServeApp {
|
|
|
894
894
|
|
|
895
895
|
// #region hosts (run a workflow somewhere else, the TUI's host override) ----
|
|
896
896
|
/** every host this process registered: the modules' own, plus anything they created */
|
|
897
|
-
private knownHosts(): { id: string; url: string; httpUrl: string; modules: string[] }[] {
|
|
898
|
-
const byId = new Map<string, { id: string; url: string; httpUrl: string; modules: string[] }>()
|
|
897
|
+
private knownHosts(): { id: string; url: string; httpUrl: string | null; modules: string[] }[] {
|
|
898
|
+
const byId = new Map<string, { id: string; url: string; httpUrl: string | null; modules: string[] }>()
|
|
899
899
|
for (const [id, host] of comfyts.hosts)
|
|
900
900
|
byId.set(id, {
|
|
901
901
|
id,
|
|
902
|
-
url:
|
|
902
|
+
url: host.addressLabel,
|
|
903
903
|
// the browser needs the REAL base to open the host's own pages (lora manager)
|
|
904
|
-
httpUrl: host.getServerHostHTTP(),
|
|
904
|
+
httpUrl: host.noAddress == null ? host.getServerHostHTTP() : null,
|
|
905
905
|
modules: [],
|
|
906
906
|
})
|
|
907
907
|
for (const mod of this.modules) {
|
package/src/cli/serve/web/api.ts
CHANGED
|
@@ -229,7 +229,7 @@ export function saveSettings(p: {
|
|
|
229
229
|
|
|
230
230
|
/** every host the serve process knows, and where each module currently runs */
|
|
231
231
|
export type HostsPayload = {
|
|
232
|
-
hosts: { id: string; url: string; httpUrl: string; modules: string[] }[]
|
|
232
|
+
hosts: { id: string; url: string; httpUrl: string | null; modules: string[] }[]
|
|
233
233
|
defaults: Record<string, string>
|
|
234
234
|
overrides: Record<string, string>
|
|
235
235
|
}
|
package/src/cli/skill.ts
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
// `comfy-ts skill install`: copy the Claude Code skills of claude-code/skills/ into a skills folder.
|
|
2
|
+
// the record file holds the hash of every file the install wrote: it is what tells an untouched
|
|
3
|
+
// file (safe to update) from one the user edited (never overwritten without --force)
|
|
4
|
+
import { createHash } from 'node:crypto'
|
|
5
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, rmdirSync, rmSync, statSync, writeFileSync } from 'node:fs'
|
|
6
|
+
import { homedir } from 'node:os'
|
|
7
|
+
import { dirname, join, relative, resolve } from 'pathe'
|
|
8
|
+
import { comfyTsPackageDir } from 'src/exampleAssets.ts'
|
|
9
|
+
|
|
10
|
+
export const SKILL_PREFIX = 'comfy-ts-'
|
|
11
|
+
export const SKILL_RECORD_FILE = '.comfy-ts-skills.json'
|
|
12
|
+
|
|
13
|
+
export const SKILL_USAGE = `comfy-ts skill install [--user | --dir <skills-dir>] [--force]
|
|
14
|
+
copy the comfy-ts Claude Code skills into .claude/skills/ of the cwd (--user: your personal
|
|
15
|
+
skills folder, --dir: that folder): /comfy-ts-guide, /comfy-ts-setup, /comfy-ts-workflow,
|
|
16
|
+
/comfy-ts-convert, /comfy-ts-run. A rerun updates what it wrote; a file you edited is never
|
|
17
|
+
overwritten without --force. The same skills ship as a Claude Code plugin:
|
|
18
|
+
/plugin marketplace add rvion/comfy-ts, then /plugin install comfy-ts@comfy-ts`
|
|
19
|
+
|
|
20
|
+
export type SkillAction = 'created' | 'unchanged' | 'updated' | 'overwritten' | 'removed' | 'kept' | 'conflict'
|
|
21
|
+
export type SkillLine = { action: SkillAction; file: string }
|
|
22
|
+
export type SkillReport = { ok: boolean; lines: SkillLine[]; commands: string[] }
|
|
23
|
+
type SkillRecord = { version: string; files: Record<string, string> }
|
|
24
|
+
|
|
25
|
+
/** claude-code/skills/ of the installed package, resolved from this module, never from the cwd */
|
|
26
|
+
export function skillSourceDir(): string {
|
|
27
|
+
const pkgDir = comfyTsPackageDir(import.meta.url)
|
|
28
|
+
if (pkgDir == null) throw new Error('cannot find the comfy-ts package this command runs from')
|
|
29
|
+
const dir = join(pkgDir, 'claude-code', 'skills')
|
|
30
|
+
if (!existsSync(dir)) throw new Error(`the comfy-ts package has no skills folder at ${dir}`)
|
|
31
|
+
return dir
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const sha256 = (bytes: Buffer): string => createHash('sha256').update(bytes).digest('hex')
|
|
35
|
+
|
|
36
|
+
/** every file under a skill folder, as paths relative to it */
|
|
37
|
+
function filesUnder(dir: string, prefix = ''): string[] {
|
|
38
|
+
const out: string[] = []
|
|
39
|
+
for (const name of readdirSync(dir).sort()) {
|
|
40
|
+
const abs = join(dir, name)
|
|
41
|
+
if (statSync(abs).isDirectory()) out.push(...filesUnder(abs, `${prefix}${name}/`))
|
|
42
|
+
else out.push(`${prefix}${name}`)
|
|
43
|
+
}
|
|
44
|
+
return out
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function readRecord(path: string): SkillRecord | null {
|
|
48
|
+
if (!existsSync(path)) return null
|
|
49
|
+
let parsed: unknown
|
|
50
|
+
try {
|
|
51
|
+
parsed = JSON.parse(readFileSync(path, 'utf8'))
|
|
52
|
+
} catch (e) {
|
|
53
|
+
throw new Error(`${path} is not valid json (${e instanceof Error ? e.message : String(e)}): fix or delete it`, {
|
|
54
|
+
cause: e,
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
if (typeof parsed !== 'object' || parsed == null || !('files' in parsed)) {
|
|
58
|
+
throw new Error(`${path} has no "files" map: fix or delete it`)
|
|
59
|
+
}
|
|
60
|
+
const files = parsed.files
|
|
61
|
+
if (typeof files !== 'object' || files == null) throw new Error(`${path} has no "files" map: fix or delete it`)
|
|
62
|
+
const out: Record<string, string> = {}
|
|
63
|
+
for (const [k, v] of Object.entries(files)) if (typeof v === 'string') out[k] = v
|
|
64
|
+
const version = 'version' in parsed && typeof parsed.version === 'string' ? parsed.version : ''
|
|
65
|
+
return { version, files: out }
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function packageVersion(pkgDir: string): string {
|
|
69
|
+
const parsed: unknown = JSON.parse(readFileSync(join(pkgDir, 'package.json'), 'utf8'))
|
|
70
|
+
if (typeof parsed === 'object' && parsed != null && 'version' in parsed && typeof parsed.version === 'string') {
|
|
71
|
+
return parsed.version
|
|
72
|
+
}
|
|
73
|
+
throw new Error(`${join(pkgDir, 'package.json')} has no version`)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* plan, then write only when nothing conflicts (or `force`): a conflict anywhere writes nothing,
|
|
78
|
+
* so a refused install never leaves half an update behind
|
|
79
|
+
*/
|
|
80
|
+
export function installSkills(p: { from: string; to: string; force: boolean; version: string }): SkillReport {
|
|
81
|
+
const recordPath = join(p.to, SKILL_RECORD_FILE)
|
|
82
|
+
const record = readRecord(recordPath)
|
|
83
|
+
const source = new Map<string, Buffer>()
|
|
84
|
+
const commands: string[] = []
|
|
85
|
+
for (const skill of readdirSync(p.from).sort()) {
|
|
86
|
+
if (!statSync(join(p.from, skill)).isDirectory()) continue
|
|
87
|
+
commands.push(`/${SKILL_PREFIX}${skill}`)
|
|
88
|
+
for (const f of filesUnder(join(p.from, skill))) {
|
|
89
|
+
source.set(`${SKILL_PREFIX}${skill}/${f}`, readFileSync(join(p.from, skill, f)))
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const lines: SkillLine[] = []
|
|
94
|
+
const writes: string[] = []
|
|
95
|
+
const removals: string[] = []
|
|
96
|
+
for (const [rel, bytes] of source) {
|
|
97
|
+
const abs = join(p.to, rel)
|
|
98
|
+
if (!existsSync(abs)) {
|
|
99
|
+
lines.push({ action: 'created', file: abs })
|
|
100
|
+
writes.push(rel)
|
|
101
|
+
continue
|
|
102
|
+
}
|
|
103
|
+
const onDisk = readFileSync(abs)
|
|
104
|
+
if (onDisk.equals(bytes)) lines.push({ action: 'unchanged', file: abs })
|
|
105
|
+
else if (record?.files[rel] === sha256(onDisk)) {
|
|
106
|
+
lines.push({ action: 'updated', file: abs })
|
|
107
|
+
writes.push(rel)
|
|
108
|
+
} else if (p.force) {
|
|
109
|
+
lines.push({ action: 'overwritten', file: abs })
|
|
110
|
+
writes.push(rel)
|
|
111
|
+
} else lines.push({ action: 'conflict', file: abs })
|
|
112
|
+
}
|
|
113
|
+
for (const [rel, hash] of Object.entries(record?.files ?? {})) {
|
|
114
|
+
const abs = join(p.to, rel)
|
|
115
|
+
if (source.has(rel) || !existsSync(abs)) continue
|
|
116
|
+
if (sha256(readFileSync(abs)) === hash) {
|
|
117
|
+
lines.push({ action: 'removed', file: abs })
|
|
118
|
+
removals.push(rel)
|
|
119
|
+
} else lines.push({ action: 'kept', file: abs })
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (lines.some((l) => l.action === 'conflict')) return { ok: false, lines, commands }
|
|
123
|
+
|
|
124
|
+
for (const rel of writes) {
|
|
125
|
+
const abs = join(p.to, rel)
|
|
126
|
+
mkdirSync(dirname(abs), { recursive: true })
|
|
127
|
+
writeFileSync(abs, source.get(rel) ?? Buffer.alloc(0))
|
|
128
|
+
}
|
|
129
|
+
for (const rel of removals) {
|
|
130
|
+
const abs = join(p.to, rel)
|
|
131
|
+
rmSync(abs)
|
|
132
|
+
// the skill folder goes too once it is empty, so no dead slash command stays listed
|
|
133
|
+
const dir = dirname(abs)
|
|
134
|
+
if (readdirSync(dir).length === 0) rmdirSync(dir)
|
|
135
|
+
}
|
|
136
|
+
const files: Record<string, string> = {}
|
|
137
|
+
for (const [rel, bytes] of source) files[rel] = sha256(bytes)
|
|
138
|
+
mkdirSync(p.to, { recursive: true })
|
|
139
|
+
writeFileSync(recordPath, `${JSON.stringify({ version: p.version, files }, null, 3)}\n`)
|
|
140
|
+
return { ok: true, lines, commands }
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const MARK: Record<SkillAction, string> = {
|
|
144
|
+
created: '+',
|
|
145
|
+
unchanged: '=',
|
|
146
|
+
updated: '~',
|
|
147
|
+
overwritten: '!',
|
|
148
|
+
removed: '-',
|
|
149
|
+
kept: '?',
|
|
150
|
+
conflict: '✗',
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export function runSkill(
|
|
154
|
+
args: string[],
|
|
155
|
+
p: { cwd?: string; env?: Record<string, string | undefined>; log?: (line: string) => void } = {},
|
|
156
|
+
): number {
|
|
157
|
+
const log = p.log ?? console.log
|
|
158
|
+
const cwd = p.cwd ?? process.cwd()
|
|
159
|
+
const env = p.env ?? process.env
|
|
160
|
+
const sub = args[0]
|
|
161
|
+
const rest = args.slice(1)
|
|
162
|
+
if (sub == null || sub === 'help' || sub === '--help' || rest.includes('--help')) {
|
|
163
|
+
log(SKILL_USAGE)
|
|
164
|
+
return 0
|
|
165
|
+
}
|
|
166
|
+
if (sub !== 'install') throw new Error(`unknown skill command "${sub}"\n${SKILL_USAGE}`)
|
|
167
|
+
|
|
168
|
+
let user = false
|
|
169
|
+
let force = false
|
|
170
|
+
let dir: string | null = null
|
|
171
|
+
for (let i = 0; i < rest.length; i++) {
|
|
172
|
+
const a = rest[i]
|
|
173
|
+
if (a === '--user') user = true
|
|
174
|
+
else if (a === '--force') force = true
|
|
175
|
+
else if (a === '--dir') {
|
|
176
|
+
const v = rest[++i]
|
|
177
|
+
if (v == null || v.startsWith('--')) throw new Error('--dir needs a value')
|
|
178
|
+
dir = v
|
|
179
|
+
} else throw new Error(`unknown argument "${a}"\n${SKILL_USAGE}`)
|
|
180
|
+
}
|
|
181
|
+
if (user && dir != null) throw new Error('--user and --dir name two targets: pass one')
|
|
182
|
+
|
|
183
|
+
const configDir = env.CLAUDE_CONFIG_DIR ?? join(env.HOME ?? homedir(), '.claude')
|
|
184
|
+
const to = dir != null ? resolve(cwd, dir) : user ? join(configDir, 'skills') : join(cwd, '.claude', 'skills')
|
|
185
|
+
const from = skillSourceDir()
|
|
186
|
+
const version = packageVersion(dirname(dirname(from)))
|
|
187
|
+
const show = (abs: string): string => {
|
|
188
|
+
const rel = relative(cwd, abs)
|
|
189
|
+
return rel.startsWith('..') ? abs : rel
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const report = installSkills({ from, to, force, version })
|
|
193
|
+
log(`[comfy-ts skill] comfy-ts ${version} skills → ${show(to)}`)
|
|
194
|
+
for (const l of report.lines) log(` ${MARK[l.action]} ${l.action.padEnd(11)} ${show(l.file)}`)
|
|
195
|
+
if (!report.ok) {
|
|
196
|
+
const n = report.lines.filter((l) => l.action === 'conflict').length
|
|
197
|
+
log(
|
|
198
|
+
`[comfy-ts skill] 🔴 ${n} file(s) changed since comfy-ts wrote them (✗ above): nothing was written. Keep your edits, or rerun with --force to overwrite them`,
|
|
199
|
+
)
|
|
200
|
+
return 1
|
|
201
|
+
}
|
|
202
|
+
const kept = report.lines.filter((l) => l.action === 'kept').length
|
|
203
|
+
if (kept > 0) log(`[comfy-ts skill] ${kept} file(s) no longer shipped were kept because you edited them (? above)`)
|
|
204
|
+
log(`[comfy-ts skill] 🟢 Claude Code commands: ${report.commands.join(' ')}`)
|
|
205
|
+
log(`[comfy-ts skill] a session started before this skills folder existed needs /reload-skills`)
|
|
206
|
+
return 0
|
|
207
|
+
}
|
|
@@ -42,10 +42,7 @@ export const Header = observer((p: { st: TuiSt }) => {
|
|
|
42
42
|
<Text bold color="green">
|
|
43
43
|
{runHost.data.id}
|
|
44
44
|
</Text>
|
|
45
|
-
<Text color="gray">
|
|
46
|
-
{' '}
|
|
47
|
-
({runHost.base.host}:{runHost.base.port})
|
|
48
|
-
</Text>
|
|
45
|
+
<Text color="gray"> ({runHost.addressLabel})</Text>
|
|
49
46
|
{/* the override must stay loud: every run bypasses the workflow's own host */}
|
|
50
47
|
{s.hostOverride != null && s.hostOverride !== s.wf.host && (
|
|
51
48
|
<Text color="yellow"> ⇄ overrides {s.wf.host.data.id}</Text>
|