comfy-ts 2.10.0 → 2.11.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 (45) hide show
  1. package/dist/{LogsSt-DFxzQfDc.js → LogsSt-qtFzOKpu.js} +2 -2
  2. package/dist/{LogsSt-DFxzQfDc.js.map → LogsSt-qtFzOKpu.js.map} +1 -1
  3. package/dist/cli.js +4 -4
  4. package/dist/index.cjs +93 -1
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.cts +19 -0
  7. package/dist/index.d.ts +19 -0
  8. package/dist/index.js +93 -1
  9. package/dist/index.js.map +1 -1
  10. package/dist/{run-serve-_nrvJYyt.js → run-serve-BK7BA2dn.js} +91 -3
  11. package/dist/run-serve-BK7BA2dn.js.map +1 -0
  12. package/dist/{run-tui-Atvf9vb3.js → run-tui-CQyvMf0N.js} +36 -4
  13. package/dist/run-tui-CQyvMf0N.js.map +1 -0
  14. package/dist/{DefinedWorkflow-BatWaZO1.js → schemaDrift-DjjEtwfx.js} +176 -2
  15. package/dist/schemaDrift-DjjEtwfx.js.map +1 -0
  16. package/dist/serve-web.js +32 -16
  17. package/dist/{state-6RFDIQwJ.js → state--wrz0BQc.js} +14 -3
  18. package/dist/{state-6RFDIQwJ.js.map → state--wrz0BQc.js.map} +1 -1
  19. package/dist/web.d.ts +19 -0
  20. package/dist/web.js +93 -1
  21. package/dist/web.js.map +1 -1
  22. package/examples/comfy-cloud/capybara-i2v.cflow.ts +2 -0
  23. package/examples/comfy-cloud/wan22-5b-t2v.cflow.ts +2 -0
  24. package/examples/comfy-cloud/wan22-i2v.cflow.ts +2 -0
  25. package/examples/comfy-cloud/wan22-t2v.cflow.ts +2 -0
  26. package/examples/rvion/07-local-llm-text-gen.cflow.ts +2 -2
  27. package/package.json +4 -2
  28. package/src/cli/serve/ServeApp.ts +94 -0
  29. package/src/cli/serve/describeVar.ts +7 -0
  30. package/src/cli/serve/favicon.ts +3 -0
  31. package/src/cli/serve/web/api.ts +12 -0
  32. package/src/cli/serve/web/components/VarsForm.tsx +18 -7
  33. package/src/cli/serve/web/components/controls/LorasControl.tsx +102 -6
  34. package/src/cli/serve/web/state/WebSt.ts +79 -0
  35. package/src/cli/serve/web/state/loraSort.ts +39 -0
  36. package/src/cli/serve/web/styles.ts +15 -0
  37. package/src/cli/tui/components/Header.tsx +2 -0
  38. package/src/cli/tui/state/HostSt.ts +34 -0
  39. package/src/host/ComfyHost.ts +15 -0
  40. package/src/host/loraInfoCache.ts +64 -0
  41. package/src/host/loraManagerApi.ts +27 -0
  42. package/src/host/schemaDrift.ts +87 -0
  43. package/dist/DefinedWorkflow-BatWaZO1.js.map +0 -1
  44. package/dist/run-serve-_nrvJYyt.js.map +0 -1
  45. package/dist/run-tui-Atvf9vb3.js.map +0 -1
@@ -1,6 +1,6 @@
1
- import { C as fetchLoraList, F as loraBasename, I as loraKey, L as loraPreviewMapFrom, V as extractErrorMessage, a as clearLoraKeywordOverride, c as loraKeywordFromMirror, d as getLoraDisplayName, h as loraMatchesFilter, i as PromptVar, l as setLoraKeyword, o as getLoraKeyword, p as getLoraPreviewUrl, q as logError, r as LorasVar, s as isLoraKeywordFromMirror, v as refreshLoraInfoCacheIfChanged, w as fetchLoraPreviewBytes } from "./DefinedWorkflow-BatWaZO1.js";
2
- import { i as importSharp, n as settingsPathFor } from "./state-6RFDIQwJ.js";
3
- import { c as buildFileRows, d as mergeWorkflowSources, f as scanCflowFiles, i as draftKeyForFile, l as familyOf, o as listDraftsForFile, r as DraftsSt, s as assignFamilyColors, t as LogsSt, u as findDefinedWorkflow } from "./LogsSt-DFxzQfDc.js";
1
+ import { G as loraPreviewMapFrom, M as fetchLoraPreviewBytes, T as refreshLoraInfoCacheIfChanged, U as loraBasename, W as loraKey, Y as extractErrorMessage, c as PromptVar, d as isLoraKeywordFromMirror, f as loraKeywordFromMirror, g as getLoraDisplayName, i as summarizeDrift, j as fetchLoraList, l as clearLoraKeywordOverride, p as setLoraKeyword, s as LorasVar, tt as logError, u as getLoraKeyword, v as getLoraPreviewUrl, x as loraMatchesFilter } from "./schemaDrift-DjjEtwfx.js";
2
+ import { i as importSharp, n as settingsPathFor } from "./state--wrz0BQc.js";
3
+ import { c as buildFileRows, d as mergeWorkflowSources, f as scanCflowFiles, i as draftKeyForFile, l as familyOf, o as listDraftsForFile, r as DraftsSt, s as assignFamilyColors, t as LogsSt, u as findDefinedWorkflow } from "./LogsSt-qtFzOKpu.js";
4
4
  import { spawn } from "node:child_process";
5
5
  import { fileURLToPath, pathToFileURL } from "node:url";
6
6
  import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, statSync, writeFileSync } from "node:fs";
@@ -656,6 +656,14 @@ const Header = observer((p) => {
656
656
  color: "yellow",
657
657
  children: [" ⇄ overrides ", s.wf.host.data.id]
658
658
  }),
659
+ s.host.drift !== "" && /* @__PURE__ */ jsxs(Text, {
660
+ color: "yellow",
661
+ children: [
662
+ " ⚠ changed: ",
663
+ s.host.drift,
664
+ " · a → re-codegen"
665
+ ]
666
+ }),
659
667
  s.host.status === "down" && /* @__PURE__ */ jsxs(Text, {
660
668
  color: "red",
661
669
  children: [" ", s.host.probing ? s.host.spinner : `↻ ${s.host.retryInS}s`]
@@ -2926,6 +2934,8 @@ var ExecSt = class {
2926
2934
  //#endregion
2927
2935
  //#region src/cli/tui/state/HostSt.ts
2928
2936
  const PROBE_EVERY_MS = 5e3;
2937
+ /** a light drift check (the loaders only) at most this often while the host is up */
2938
+ const DRIFT_EVERY_MS = 6e4;
2929
2939
  const PROBE_TIMEOUT_MS = 3e3;
2930
2940
  const SPIN_FRAMES = [
2931
2941
  "⠋",
@@ -2976,6 +2986,8 @@ var HostSt = class {
2976
2986
  this.loopTimer = null;
2977
2987
  this.spinTimer = null;
2978
2988
  this.countdownTimer = null;
2989
+ this.drift = "";
2990
+ this.driftAt = 0;
2979
2991
  this.ix = 0;
2980
2992
  this.running = null;
2981
2993
  this.actions = [
@@ -3010,6 +3022,7 @@ var HostSt = class {
3010
3022
  this.status = "unknown";
3011
3023
  this.statusVia = null;
3012
3024
  this.lastProbeError = null;
3025
+ this.drift = "";
3013
3026
  });
3014
3027
  this.probeGen++;
3015
3028
  if (this.loopTimer != null) clearTimeout(this.loopTimer);
@@ -3077,6 +3090,7 @@ var HostSt = class {
3077
3090
  }
3078
3091
  }
3079
3092
  if (this.host !== host) return;
3093
+ const before = this.status;
3080
3094
  const verdict = probeVerdict({
3081
3095
  httpOk: ok,
3082
3096
  wsOpen: host.isConnected,
@@ -3088,6 +3102,23 @@ var HostSt = class {
3088
3102
  this.statusVia = verdict.via;
3089
3103
  this.lastProbeError = probeError;
3090
3104
  });
3105
+ if (verdict.status === "up") {
3106
+ if (before !== "up") this.checkDrift(true);
3107
+ else if (Date.now() - this.driftAt > DRIFT_EVERY_MS) this.checkDrift(false);
3108
+ }
3109
+ }
3110
+ async checkDrift(full) {
3111
+ const host = this.host;
3112
+ if (host.data.sdkAutoWrite === false) return;
3113
+ this.driftAt = Date.now();
3114
+ try {
3115
+ const summary = summarizeDrift(await host.checkSchemaDrift({ full }));
3116
+ if (this.host !== host) return;
3117
+ runInAction(() => {
3118
+ if (summary !== "") this.drift = summary;
3119
+ else if (full) this.drift = "";
3120
+ });
3121
+ } catch {}
3091
3122
  }
3092
3123
  get host() {
3093
3124
  return this.st.runHost;
@@ -3189,6 +3220,7 @@ var HostSt = class {
3189
3220
  runInAction(() => {
3190
3221
  const schema = this.host.schema;
3191
3222
  this.st.exec.notice = `SDK regenerated: ${schema.nodes.length} node types, ${schema.getLoras().length} loras`;
3223
+ this.drift = "";
3192
3224
  });
3193
3225
  } catch (e) {
3194
3226
  runInAction(() => {
@@ -4540,4 +4572,4 @@ async function runTui(args) {
4540
4572
  //#endregion
4541
4573
  export { runTui };
4542
4574
 
4543
- //# sourceMappingURL=run-tui-Atvf9vb3.js.map
4575
+ //# sourceMappingURL=run-tui-CQyvMf0N.js.map