@higgsfield/video-editor-mcp 1.0.7 → 1.1.1-dev.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/THIRD_PARTY_NOTICES.md +24 -24
- package/dist/cli.mjs +134 -125
- package/dist/index.html +136 -133
- package/dist/launcher.mjs +90 -90
- package/dist/server.mjs +1553 -1389
- package/node_modules/@higgsfield/higgsedit/README.md +181 -1
- package/node_modules/@higgsfield/higgsedit/dist/capture-page.js +902 -314
- package/node_modules/@higgsfield/higgsedit/dist/chunk-2JYLVSVV.mjs +1594 -0
- package/node_modules/@higgsfield/higgsedit/dist/chunk-2WKNH7OL.mjs +16 -0
- package/node_modules/@higgsfield/higgsedit/dist/{chunk-OMKZ5BXM.mjs → chunk-5LTTL3Q3.mjs} +1 -1
- package/node_modules/@higgsfield/higgsedit/dist/chunk-7PYXSJS7.mjs +717 -0
- package/node_modules/@higgsfield/higgsedit/dist/{chunk-MLJAIZGP.mjs → chunk-BH2QF635.mjs} +33 -326
- package/node_modules/@higgsfield/higgsedit/dist/{chunk-WZR5PZM7.mjs → chunk-BV5COOQZ.mjs} +250 -161
- package/node_modules/@higgsfield/higgsedit/dist/{chunk-HTCYVKFX.mjs → chunk-C3GSB3XZ.mjs} +8 -7
- package/node_modules/@higgsfield/higgsedit/dist/{chunk-CYH2EUQV.mjs → chunk-DVN4LUXV.mjs} +13 -4
- package/node_modules/@higgsfield/higgsedit/dist/chunk-F4CMIG5G.mjs +36 -0
- package/node_modules/@higgsfield/higgsedit/dist/chunk-IEPPEDEU.mjs +33 -0
- package/node_modules/@higgsfield/higgsedit/dist/{chunk-UVAZ6I6U.mjs → chunk-KIWGVAPJ.mjs} +16 -12
- package/node_modules/@higgsfield/higgsedit/dist/{chunk-L6QDNSL3.mjs → chunk-L5LWBA6A.mjs} +5 -5
- package/node_modules/@higgsfield/higgsedit/dist/chunk-LMQR3DHT.mjs +37 -0
- package/node_modules/@higgsfield/higgsedit/dist/chunk-LTKMGZ6T.mjs +58 -0
- package/node_modules/@higgsfield/higgsedit/dist/{chunk-VI6IV6JP.mjs → chunk-MV2JTTBQ.mjs} +65 -47
- package/node_modules/@higgsfield/higgsedit/dist/{chunk-4D6AXU4B.mjs → chunk-NARTAWRN.mjs} +50 -30
- package/node_modules/@higgsfield/higgsedit/dist/{chunk-27NBQ5FA.mjs → chunk-NUXTKQNM.mjs} +33 -21
- package/node_modules/@higgsfield/higgsedit/dist/chunk-OCIZ36XD.mjs +40 -0
- package/node_modules/@higgsfield/higgsedit/dist/{chunk-MK6PL7N4.mjs → chunk-OF6RMSM2.mjs} +19 -17
- package/node_modules/@higgsfield/higgsedit/dist/{chunk-6BETMESC.mjs → chunk-P2BGHTRR.mjs} +2 -2
- package/node_modules/@higgsfield/higgsedit/dist/{chunk-EKFC4S4M.mjs → chunk-PAHMD6SU.mjs} +5 -0
- package/node_modules/@higgsfield/higgsedit/dist/{chunk-QVLAEV3U.mjs → chunk-PFQYUJQL.mjs} +3 -4
- package/node_modules/@higgsfield/higgsedit/dist/chunk-QJTILFBS.mjs +335 -0
- package/node_modules/@higgsfield/higgsedit/dist/chunk-QQ3GGKDN.mjs +21 -0
- package/node_modules/@higgsfield/higgsedit/dist/chunk-TH7TK67K.mjs +23 -0
- package/node_modules/@higgsfield/higgsedit/dist/{chunk-SIMO6I3D.mjs → chunk-UDL5AHKO.mjs} +163 -158
- package/node_modules/@higgsfield/higgsedit/dist/chunk-UMWOUQN3.mjs +60 -0
- package/node_modules/@higgsfield/higgsedit/dist/{chunk-3AIM3THH.mjs → chunk-VLM5EOWJ.mjs} +4 -4
- package/node_modules/@higgsfield/higgsedit/dist/chunk-WENFTPXQ.mjs +403 -0
- package/node_modules/@higgsfield/higgsedit/dist/chunk-YLVXQIPX.mjs +464 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/.vite/manifest.json +559 -506
- package/node_modules/@higgsfield/higgsedit/dist/editor/assets/agent-corner-bottom-q4hZltI-.svg +431 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/assets/agent-corner-top-BJYI-I24.svg +431 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/assets/confirmation-BTnwl3LS.css +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/assets/drag-Bt_t4HZO.css +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/assets/local-B3OTAV_A.css +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/assets/menubar-2Y1Y2XJt.css +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/assets/model-DdE4hCgf.css +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/assets/{IconText1-CzbCrP7v.css → notifications-B08L1jSe.css} +1 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/assets/{panel-g852pZf_.css → panel-BRN_AbBM.css} +1 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/assets/panel-CYELNqrv.css +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/assets/panel-DYLpT6oA.css +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/assets/panel-v84HaGTZ.css +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconChainLink1-Bxb1Or0F.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/{IconCheckmark2Medium-daaES9uF.js → IconCheckmark2Medium-hegaz9mQ.js} +1 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/{IconChevronDownSmall-BhTBJk26.js → IconChevronDownSmall-DaruzJwU.js} +1 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconClosedCaptioning-BPqcqKsD.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/{IconCrossMedium-acfnCXOM.js → IconCrossMedium-BsPFJzc6.js} +1 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconOpenaiFilled-D1fzthmi.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/{IconPause-pTeVSvUe.js → IconPause-ClNg8pao.js} +1 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/{IconPlayFilled-CwdgIuDG.js → IconPlayFilled-CHb-7GSx.js} +1 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconSparklesSoftFilled-o7o33KRn.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/ai-composer-B9h-eaki.js +567 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/auto-layout-BO20Tg4B.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/{button-CjG6GcgF.js → button-Cg0U0zpV.js} +1 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/canvas-Bw4CVzfw.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/capabilities-BCd4-zPF.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/commands-QeSqAbCt.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/components-tXMtIZNL.js +51 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/confirmation-CO2PHR_z.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/dom-6aoQn29n.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/drag-Dw8b_vO2.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/{editing-CjWbiCxv.js → editing-Cy-SaOyB.js} +1 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/edits-CqLBqir0.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/export-dialog-BjBskOe3.js +2 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/factories-Bw_iQrUL.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/id3-CSR0NCRI.js +2 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/import-DP49i4ke.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/import-error-CMz9sLPe.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/ingest-DsmIc415.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/jsx-runtime-B5yqYJvp.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/{media-Bwjxu-0U.js → media-DQw6vU_T.js} +1 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/menubar-D31srALX.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/meters-D0nZVEJs.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/mode-DEG6doKF.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/model-Duf9fszJ.js +2 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/model-DyAkLA69.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/notifications-DqWZNIrK.js +9 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/palette-HT83gWgL.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-B5Mvm6dg.js +7 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-BC90wyvd.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-Bw_ZJ2JI.js +3 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-DNS060Nt.js +3 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-DSgxIrEq.js +2 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-DgBttE5O.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-assets-_T2bHsHW.js +771 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-inspector-DfHvAt5X.js +2 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-nBZvHlkA.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-timeline-DsCpJVSt.js +327 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-viewport-CEhZwZ67.js +280 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/projects-2_tW9Do7.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/react-dom-1uB7Vbbb.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/schemas-CddYAOcj.js +64 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/session-BpFeKAI2.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/src-BLG3tYBa.js +2 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/styles-e2n2A_JN.js +284 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/supercomputer-CuV0zYKd.js +24 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/tabs-XeAgs9cs.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/toggle-DbNEaSIl.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/transport-C8Ll3qFl.js +69 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/transport-bar-Dv1LPFbu.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/useOpenInteractionType-HWSfSsp2.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/useRenderElement-D4SOg3N_.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/value-EB7YmAdS.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/writeback-support-fj5rA9k3.js +1 -0
- package/node_modules/@higgsfield/higgsedit/dist/editor/editor-B-WAkLt7.js +372 -0
- package/node_modules/@higgsfield/higgsedit/dist/higgsedit.mjs +39 -24
- package/node_modules/@higgsfield/higgsedit/dist/jsx/hooks.d.ts +26 -0
- package/node_modules/@higgsfield/higgsedit/dist/jsx/index.d.ts +17 -0
- package/node_modules/@higgsfield/higgsedit/dist/jsx/inspect.d.ts +42 -0
- package/node_modules/@higgsfield/higgsedit/dist/jsx/jsx-runtime.d.ts +28 -0
- package/node_modules/@higgsfield/higgsedit/dist/jsx/svg.d.ts +9 -0
- package/node_modules/@higgsfield/higgsedit/dist/jsx/time.d.ts +6 -0
- package/node_modules/@higgsfield/higgsedit/dist/jsx/types.d.ts +420 -0
- package/node_modules/@higgsfield/higgsedit/package.json +28 -20
- package/package.json +4 -3
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/plugin.json +1 -1
- package/plugin/skills/video-editing/references/caption-titling.md +1 -1
- package/plugin/skills/video-editing/references/local-setup.md +3 -3
- package/node_modules/@higgsfield/higgsedit/dist/chunk-C6SASQHE.mjs +0 -424
- package/node_modules/@higgsfield/higgsedit/dist/chunk-FZ5U36SQ.mjs +0 -83
- package/node_modules/@higgsfield/higgsedit/dist/chunk-QLPCYN6K.mjs +0 -292
- package/node_modules/@higgsfield/higgsedit/dist/editor/assets/edit-drag-D2EV5ddd.css +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/assets/editor-CuRHT75g.css +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/assets/panel-DnuQD7ja.css +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/FieldControl-B0fenhBJ.js +0 -2
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconChainLink1-Cwv1X7hi.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconEyeOpen-BqTT9_VV.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconEyeSlash-Whv58c1m.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconPencil-Dr17k_7e.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconPlay-BroH3ziH.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconPlusSmall-43T9aE3d.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconText1-BaP_p9DW.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconTrashCan-DX2w2AIC.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/ai-composer-C-l0eIdP.js +0 -560
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/captions-Cd-bDG3G.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/clip-highlight-DpAvcA4x.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/components-e3ZbUVns.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/disposables-CwUPjcuA.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/drag-HLBkto5o.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/dropdown-BJ04G_X3.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/edit-drag-Bg6LggKC.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/edits-a2IixhrN.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/export-dialog-4I4gqI5V.js +0 -2
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/face-tracker-DzVfjVOO.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/fit-imported-media-CaCB0x0b.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/generation-queue-DuL2F4-_.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/import-error-CMARA0Hy.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/jsx-runtime-B-hcVAMW.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/menubar-Bs26OdwP.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/meters-YEr9OQjq.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/paints-DS2Msf91.js +0 -67
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/palette-CcS9IcAC.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-7M3uQokX.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-BBK1NyG-.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-CHZTs7By.js +0 -4
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-DaSOa3MP.js +0 -2
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-DlK3RYVo.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-Dst5OKWu.js +0 -2
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-H_ZoDiKK.js +0 -2
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-Rn9Z7Eek.js +0 -3
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-assets-FAghGFG3.js +0 -678
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-inspector-DEqULBNF.js +0 -260
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-timeline-0GYNz1uc.js +0 -333
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-viewport-DOWjJi5-.js +0 -317
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/projects-BBJc7h5_.js +0 -2
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/session-B9sZaFKC.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/supercomputer-CX-LCL6Y.js +0 -24
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/tabs-CvKQ-eas.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/toggle-CrzrwiDZ.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/transport-BgRfk-Qq.js +0 -69
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/transport-bar-C9nqAfE2.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/typography-C5-w9LOu-kD3uLKkf.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/useOpenInteractionType-DbrQ6Ehu.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/useRenderElement-bbxXdYq0.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/writeback-support-BZfNpkmB.js +0 -1
- package/node_modules/@higgsfield/higgsedit/dist/editor/editor-Csn2_T_e.js +0 -293
- package/node_modules/@higgsfield/higgsedit/dist/export-settings.mjs +0 -75
- package/node_modules/@higgsfield/higgsedit/dist/history.mjs +0 -295
- package/node_modules/@higgsfield/higgsedit/dist/media-upload.mjs +0 -381
- package/node_modules/@higgsfield/higgsedit/dist/proxy.mjs +0 -170
|
@@ -4,20 +4,22 @@ import { fileURLToPath as __higgseditPath } from "node:url";
|
|
|
4
4
|
const require = __higgseditRequire(import.meta.url);
|
|
5
5
|
const __filename = __higgseditPath(import.meta.url);
|
|
6
6
|
const __dirname = __filename.slice(0, __filename.lastIndexOf("/"));
|
|
7
|
-
import {
|
|
8
|
-
flag
|
|
9
|
-
} from "./chunk-MCVD2ZQV.mjs";
|
|
10
7
|
import {
|
|
11
8
|
GoogleFontsUnavailable,
|
|
12
9
|
cachedVariants,
|
|
13
10
|
catalogueError,
|
|
14
11
|
googleCatalogue,
|
|
12
|
+
googleFontsDir,
|
|
15
13
|
googleFontsOff,
|
|
16
14
|
stylesheetUrl
|
|
17
15
|
} from "./chunk-2VKQHJMM.mjs";
|
|
18
|
-
import
|
|
16
|
+
import {
|
|
17
|
+
fontFileFacts
|
|
18
|
+
} from "./chunk-BV5COOQZ.mjs";
|
|
19
19
|
|
|
20
20
|
// src/fonts/list.ts
|
|
21
|
+
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
22
|
+
import { join } from "node:path";
|
|
21
23
|
var FONT_CATEGORIES = ["sans-serif", "serif", "display", "handwriting", "monospace"];
|
|
22
24
|
var FONT_LIMIT = 50;
|
|
23
25
|
async function listFonts(query, options = {}) {
|
|
@@ -28,12 +30,33 @@ async function listFonts(query, options = {}) {
|
|
|
28
30
|
}
|
|
29
31
|
const needle = query.family?.trim().toLowerCase();
|
|
30
32
|
const matches = cat.families.filter((f) => (!needle || f.family.toLowerCase().includes(needle)) && (!query.category || f.category === query.category)).map((f) => ({ ...f, cached: cachedVariants(f.family, options), stylesheet: stylesheetUrl(f) })).filter((f) => !query.cached || f.cached.length > 0).toSorted((a, b) => Number(b.family.toLowerCase() === needle) - Number(a.family.toLowerCase() === needle) || a.popularity - b.popularity || a.family.localeCompare(b.family));
|
|
33
|
+
const offset = query.offset ?? 0;
|
|
31
34
|
return {
|
|
32
|
-
families: matches.slice(
|
|
35
|
+
families: matches.slice(offset, offset + (query.limit ?? FONT_LIMIT)),
|
|
33
36
|
total: matches.length,
|
|
34
37
|
catalogue: { fetchedAt: new Date(cat.fetchedAt).toISOString(), stale: cat.stale }
|
|
35
38
|
};
|
|
36
39
|
}
|
|
40
|
+
async function cachedFonts(query, options = {}) {
|
|
41
|
+
const root = googleFontsDir(options);
|
|
42
|
+
const dirs = existsSync(root) ? readdirSync(root, { withFileTypes: true }).filter((d) => d.isDirectory()) : [];
|
|
43
|
+
const found = await Promise.all(
|
|
44
|
+
dirs.map(async (d) => {
|
|
45
|
+
const files = readdirSync(join(root, d.name)).filter((f) => !f.endsWith(".tmp"));
|
|
46
|
+
if (!files.length) return null;
|
|
47
|
+
const bytes = readFileSync(join(root, d.name, files[0]));
|
|
48
|
+
const facts = await fontFileFacts(files[0], bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength)).catch(() => null);
|
|
49
|
+
if (!facts) return null;
|
|
50
|
+
const cached = cachedVariants(d.name, options);
|
|
51
|
+
const weights = (italic) => cached.filter((v) => v.endsWith("i") === italic).map((v) => Number.parseInt(v, 10));
|
|
52
|
+
return { family: facts.family, category: "", popularity: 0, weights: weights(false), italics: weights(true), cached };
|
|
53
|
+
})
|
|
54
|
+
);
|
|
55
|
+
const needle = query.family?.trim().toLowerCase();
|
|
56
|
+
const matches = found.filter((f) => f !== null).filter((f) => (!needle || f.family.toLowerCase().includes(needle)) && !query.category).toSorted((a, b) => a.family.localeCompare(b.family));
|
|
57
|
+
const offset = query.offset ?? 0;
|
|
58
|
+
return { families: matches.slice(offset, offset + (query.limit ?? FONT_LIMIT)), total: matches.length };
|
|
59
|
+
}
|
|
37
60
|
var variants = (f) => `${f.weights.join(",")}${f.italics.length ? ` +italic ${f.italics.join(",")}` : ""}`.trim();
|
|
38
61
|
function fontListText(list) {
|
|
39
62
|
const width = Math.max(0, ...list.families.map((f) => f.family.length));
|
|
@@ -42,21 +65,10 @@ function fontListText(list) {
|
|
|
42
65
|
return lines.join("\n");
|
|
43
66
|
}
|
|
44
67
|
|
|
45
|
-
// src/fonts/cli.ts
|
|
46
|
-
async function runFonts(args, print) {
|
|
47
|
-
const category = flag(args, "category");
|
|
48
|
-
if (category && !FONT_CATEGORIES.includes(category)) throw new Error(`unknown --category ${category}; use ${FONT_CATEGORIES.join(", ")}`);
|
|
49
|
-
const limit = flag(args, "limit");
|
|
50
|
-
const query = {
|
|
51
|
-
...args.positional[0] ? { family: args.positional[0] } : {},
|
|
52
|
-
...category ? { category } : {},
|
|
53
|
-
...args.flags.cached === true ? { cached: true } : {},
|
|
54
|
-
...limit ? { limit: Number(limit) } : {}
|
|
55
|
-
};
|
|
56
|
-
const list = await listFonts(query);
|
|
57
|
-
print(list, () => fontListText(list));
|
|
58
|
-
return 0;
|
|
59
|
-
}
|
|
60
68
|
export {
|
|
61
|
-
|
|
69
|
+
FONT_CATEGORIES,
|
|
70
|
+
FONT_LIMIT,
|
|
71
|
+
listFonts,
|
|
72
|
+
cachedFonts,
|
|
73
|
+
fontListText
|
|
62
74
|
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __higgseditRequire } from "node:module";
|
|
3
|
+
import { fileURLToPath as __higgseditPath } from "node:url";
|
|
4
|
+
const require = __higgseditRequire(import.meta.url);
|
|
5
|
+
const __filename = __higgseditPath(import.meta.url);
|
|
6
|
+
const __dirname = __filename.slice(0, __filename.lastIndexOf("/"));
|
|
7
|
+
import {
|
|
8
|
+
SELECT_USAGE,
|
|
9
|
+
SelectError,
|
|
10
|
+
grabFrame,
|
|
11
|
+
parsePrompt,
|
|
12
|
+
pickObject,
|
|
13
|
+
requireSelectBackend,
|
|
14
|
+
runSelect,
|
|
15
|
+
select,
|
|
16
|
+
selectBackend,
|
|
17
|
+
selectFrame,
|
|
18
|
+
selectStatus,
|
|
19
|
+
track
|
|
20
|
+
} from "./chunk-WENFTPXQ.mjs";
|
|
21
|
+
import "./chunk-QJTILFBS.mjs";
|
|
22
|
+
import "./chunk-PAHMD6SU.mjs";
|
|
23
|
+
import "./chunk-BV5COOQZ.mjs";
|
|
24
|
+
import "./chunk-F7YUKEI5.mjs";
|
|
25
|
+
import "./chunk-MCVD2ZQV.mjs";
|
|
26
|
+
import "./chunk-75WO2NOF.mjs";
|
|
27
|
+
export {
|
|
28
|
+
SELECT_USAGE,
|
|
29
|
+
SelectError,
|
|
30
|
+
grabFrame,
|
|
31
|
+
parsePrompt,
|
|
32
|
+
pickObject,
|
|
33
|
+
requireSelectBackend,
|
|
34
|
+
runSelect,
|
|
35
|
+
select,
|
|
36
|
+
selectBackend,
|
|
37
|
+
selectFrame,
|
|
38
|
+
selectStatus,
|
|
39
|
+
track
|
|
40
|
+
};
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
isComponentTag,
|
|
11
11
|
isIntrinsicTag,
|
|
12
12
|
tagName
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-MV2JTTBQ.mjs";
|
|
14
14
|
import {
|
|
15
15
|
CompileError,
|
|
16
16
|
EXTERNALS,
|
|
@@ -18,17 +18,29 @@ import {
|
|
|
18
18
|
compileFile,
|
|
19
19
|
evaluateProject,
|
|
20
20
|
findEntry,
|
|
21
|
-
fontFiles,
|
|
22
|
-
inside,
|
|
23
21
|
mountComponent,
|
|
24
22
|
packageModules,
|
|
25
|
-
readSources,
|
|
26
23
|
resolveSyncs
|
|
27
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-UDL5AHKO.mjs";
|
|
25
|
+
import {
|
|
26
|
+
fontFiles,
|
|
27
|
+
inside,
|
|
28
|
+
readSources
|
|
29
|
+
} from "./chunk-LTKMGZ6T.mjs";
|
|
28
30
|
import {
|
|
29
31
|
CHROME_ARGS,
|
|
30
32
|
installedChrome
|
|
31
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-P2BGHTRR.mjs";
|
|
34
|
+
import {
|
|
35
|
+
probe,
|
|
36
|
+
probeAudio
|
|
37
|
+
} from "./chunk-PAHMD6SU.mjs";
|
|
38
|
+
import {
|
|
39
|
+
GoogleFontsUnavailable,
|
|
40
|
+
googleFace,
|
|
41
|
+
googleFontsOff,
|
|
42
|
+
variantName
|
|
43
|
+
} from "./chunk-2VKQHJMM.mjs";
|
|
32
44
|
import {
|
|
33
45
|
Captions,
|
|
34
46
|
Extra,
|
|
@@ -63,20 +75,10 @@ import {
|
|
|
63
75
|
uniformDecls,
|
|
64
76
|
usedFonts,
|
|
65
77
|
wgslMessage
|
|
66
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-BV5COOQZ.mjs";
|
|
67
79
|
import {
|
|
68
80
|
TRANSITION_TYPES
|
|
69
81
|
} from "./chunk-F7YUKEI5.mjs";
|
|
70
|
-
import {
|
|
71
|
-
probe,
|
|
72
|
-
probeAudio
|
|
73
|
-
} from "./chunk-EKFC4S4M.mjs";
|
|
74
|
-
import {
|
|
75
|
-
GoogleFontsUnavailable,
|
|
76
|
-
googleFace,
|
|
77
|
-
googleFontsOff,
|
|
78
|
-
variantName
|
|
79
|
-
} from "./chunk-2VKQHJMM.mjs";
|
|
80
82
|
|
|
81
83
|
// src/check.ts
|
|
82
84
|
import { existsSync, readFileSync as readFileSync2 } from "node:fs";
|
|
@@ -22,7 +22,7 @@ function hostPlatform() {
|
|
|
22
22
|
}
|
|
23
23
|
function installedChrome(options = {}) {
|
|
24
24
|
const env = options.env ?? process.env;
|
|
25
|
-
const own = env.HIGGSEDIT_NEXT_CHROME
|
|
25
|
+
const own = env.HIGGSEDIT_NEXT_CHROME;
|
|
26
26
|
if (own) return existsSync(own) ? own : void 0;
|
|
27
27
|
const platform = options.platform ?? hostPlatform();
|
|
28
28
|
const binary = join(options.home ?? env.HIGGSEDIT_HOME ?? join(homedir(), ".higgsedit-next"), "chrome", CHROME_VERSION, `chrome-headless-shell-${platform}`, "chrome-headless-shell");
|
|
@@ -30,7 +30,7 @@ function installedChrome(options = {}) {
|
|
|
30
30
|
}
|
|
31
31
|
async function ensureChrome(options = {}) {
|
|
32
32
|
const env = options.env ?? process.env;
|
|
33
|
-
const own = env.HIGGSEDIT_NEXT_CHROME
|
|
33
|
+
const own = env.HIGGSEDIT_NEXT_CHROME;
|
|
34
34
|
if (own) {
|
|
35
35
|
if (!existsSync(own)) throw new Error(`headless Chrome not found at ${own} (from HIGGSEDIT_NEXT_CHROME)`);
|
|
36
36
|
return own;
|
|
@@ -57,9 +57,14 @@ function probe(file) {
|
|
|
57
57
|
const [fn, fd] = String(video.avg_frame_rate || video.r_frame_rate).split("/").map(Number);
|
|
58
58
|
const fps = fd ? fn / fd : fn;
|
|
59
59
|
const startTime = Number(video.start_time ?? info.format.start_time ?? 0) || 0;
|
|
60
|
+
const [sarW, sarH] = String(video.sample_aspect_ratio ?? "1:1").split(":").map(Number);
|
|
61
|
+
const wide = Math.round(Number(video.width) * (sarW > 0 && sarH > 0 ? sarW / sarH : 1));
|
|
62
|
+
const sides = video.side_data_list ?? [];
|
|
63
|
+
const turned = Math.abs(sides.find((s) => s.rotation !== void 0)?.rotation ?? 0) % 180 === 90;
|
|
60
64
|
return {
|
|
61
65
|
width: Number(video.width),
|
|
62
66
|
height: Number(video.height),
|
|
67
|
+
display: turned ? [Number(video.height), wide] : [wide, Number(video.height)],
|
|
63
68
|
fps,
|
|
64
69
|
duration: timestamps.length ? timestamps[timestamps.length - 1] - Math.max(0, timestamps[0]) + 1 / fps : Number(info.format.duration),
|
|
65
70
|
codec: String(video.codec_name),
|
|
@@ -6,7 +6,7 @@ const __filename = __higgseditPath(import.meta.url);
|
|
|
6
6
|
const __dirname = __filename.slice(0, __filename.lastIndexOf("/"));
|
|
7
7
|
import {
|
|
8
8
|
CLI_MANIFEST
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-2WKNH7OL.mjs";
|
|
10
10
|
import "./chunk-75WO2NOF.mjs";
|
|
11
11
|
|
|
12
12
|
// src/init.ts
|
|
@@ -47,8 +47,7 @@ function scaffold(dir, options = {}) {
|
|
|
47
47
|
private: true,
|
|
48
48
|
type: "module",
|
|
49
49
|
scripts: { dev: "higgsedit dev .", check: "higgsedit check .", typecheck: "tsc", render: "higgsedit render . -o renders/out.mp4" },
|
|
50
|
-
|
|
51
|
-
devDependencies: { "@higgsfield-ai/higgsedit": CLI_MANIFEST.version, typescript }
|
|
50
|
+
devDependencies: { [CLI_MANIFEST.name]: CLI_MANIFEST.version, typescript }
|
|
52
51
|
})
|
|
53
52
|
},
|
|
54
53
|
{
|
|
@@ -60,7 +59,7 @@ function scaffold(dir, options = {}) {
|
|
|
60
59
|
moduleResolution: "bundler",
|
|
61
60
|
lib: ["ES2022", "DOM", "DOM.Iterable"],
|
|
62
61
|
jsx: "preserve",
|
|
63
|
-
jsxImportSource:
|
|
62
|
+
jsxImportSource: `${CLI_MANIFEST.name}/jsx`,
|
|
64
63
|
strict: true,
|
|
65
64
|
noEmit: true,
|
|
66
65
|
isolatedModules: true,
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __higgseditRequire } from "node:module";
|
|
3
|
+
import { fileURLToPath as __higgseditPath } from "node:url";
|
|
4
|
+
const require = __higgseditRequire(import.meta.url);
|
|
5
|
+
const __filename = __higgseditPath(import.meta.url);
|
|
6
|
+
const __dirname = __filename.slice(0, __filename.lastIndexOf("/"));
|
|
7
|
+
import {
|
|
8
|
+
ffmpeg,
|
|
9
|
+
matrixOf,
|
|
10
|
+
probe,
|
|
11
|
+
requireTool
|
|
12
|
+
} from "./chunk-PAHMD6SU.mjs";
|
|
13
|
+
import {
|
|
14
|
+
frameIndexAt
|
|
15
|
+
} from "./chunk-BV5COOQZ.mjs";
|
|
16
|
+
|
|
17
|
+
// src/media/image.ts
|
|
18
|
+
import { crc32, deflateSync } from "node:zlib";
|
|
19
|
+
var GLYPHS = {
|
|
20
|
+
"0": [".###.", "#...#", "#..##", "#.#.#", "##..#", "#...#", ".###."],
|
|
21
|
+
"1": ["..#..", ".##..", "..#..", "..#..", "..#..", "..#..", ".###."],
|
|
22
|
+
"2": [".###.", "#...#", "....#", "...#.", "..#..", ".#...", "#####"],
|
|
23
|
+
"3": ["####.", "....#", "....#", ".###.", "....#", "....#", "####."],
|
|
24
|
+
"4": ["...#.", "..##.", ".#.#.", "#..#.", "#####", "...#.", "...#."],
|
|
25
|
+
"5": ["#####", "#....", "####.", "....#", "....#", "#...#", ".###."],
|
|
26
|
+
"6": ["..##.", ".#...", "#....", "####.", "#...#", "#...#", ".###."],
|
|
27
|
+
"7": ["#####", "....#", "...#.", "..#..", ".#...", ".#...", ".#..."],
|
|
28
|
+
"8": [".###.", "#...#", "#...#", ".###.", "#...#", "#...#", ".###."],
|
|
29
|
+
"9": [".###.", "#...#", "#...#", ".####", "....#", "...#.", ".##.."],
|
|
30
|
+
":": [".....", "..#..", "..#..", ".....", "..#..", "..#..", "....."],
|
|
31
|
+
"-": [".....", ".....", ".....", ".###.", ".....", ".....", "....."],
|
|
32
|
+
".": [".....", ".....", ".....", ".....", ".....", ".##..", ".##.."],
|
|
33
|
+
h: ["#....", "#....", "#.##.", "##..#", "#...#", "#...#", "#...#"],
|
|
34
|
+
m: [".....", ".....", "##.#.", "#.#.#", "#.#.#", "#.#.#", "#.#.#"],
|
|
35
|
+
s: [".....", ".....", ".####", "#....", ".###.", "....#", "####."],
|
|
36
|
+
f: ["..##.", ".#..#", ".#...", "###..", ".#...", ".#...", ".#..."],
|
|
37
|
+
" ": [".....", ".....", ".....", ".....", ".....", ".....", "....."]
|
|
38
|
+
};
|
|
39
|
+
var GLYPH_W = 5;
|
|
40
|
+
var GLYPH_H = 7;
|
|
41
|
+
var Bitmap = class {
|
|
42
|
+
constructor(width, height, background = [0, 0, 0, 255]) {
|
|
43
|
+
this.width = width;
|
|
44
|
+
this.height = height;
|
|
45
|
+
this.data = new Uint8Array(width * height * 4);
|
|
46
|
+
this.fill(0, 0, width, height, background);
|
|
47
|
+
}
|
|
48
|
+
width;
|
|
49
|
+
height;
|
|
50
|
+
data;
|
|
51
|
+
/** Fills a rectangle, alpha-blending over what is there. */
|
|
52
|
+
fill(x, y, w, h, [r, g, b, a]) {
|
|
53
|
+
const x0 = Math.max(0, Math.round(x));
|
|
54
|
+
const y0 = Math.max(0, Math.round(y));
|
|
55
|
+
const x1 = Math.min(this.width, Math.round(x + w));
|
|
56
|
+
const y1 = Math.min(this.height, Math.round(y + h));
|
|
57
|
+
const k = a / 255;
|
|
58
|
+
for (let yy = y0; yy < y1; yy++) {
|
|
59
|
+
for (let xx = x0; xx < x1; xx++) {
|
|
60
|
+
const i = (yy * this.width + xx) * 4;
|
|
61
|
+
const d = this.data;
|
|
62
|
+
d[i] = Math.round(r * k + d[i] * (1 - k));
|
|
63
|
+
d[i + 1] = Math.round(g * k + d[i + 1] * (1 - k));
|
|
64
|
+
d[i + 2] = Math.round(b * k + d[i + 2] * (1 - k));
|
|
65
|
+
d[i + 3] = 255;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/** Copies an opaque RGBA8 image of `w`x`h` to (`x`, `y`). */
|
|
70
|
+
blit(rgba, w, h, x, y) {
|
|
71
|
+
for (let row = 0; row < h; row++) {
|
|
72
|
+
const yy = y + row;
|
|
73
|
+
if (yy < 0 || yy >= this.height) continue;
|
|
74
|
+
const from = Math.max(0, -x);
|
|
75
|
+
const to = Math.min(w, this.width - x);
|
|
76
|
+
if (to <= from) continue;
|
|
77
|
+
this.data.set(rgba.subarray((row * w + from) * 4, (row * w + to) * 4), (yy * this.width + x + from) * 4);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/** Draws `text` with its top-left at (`x`, `y`), each font pixel `px` screen pixels square. */
|
|
81
|
+
text(text, x, y, px, color) {
|
|
82
|
+
let cx = x;
|
|
83
|
+
for (const ch of text) {
|
|
84
|
+
const glyph = GLYPHS[ch] ?? GLYPHS[" "];
|
|
85
|
+
for (let gy = 0; gy < GLYPH_H; gy++) for (let gx = 0; gx < GLYPH_W; gx++) if (glyph[gy][gx] === "#") this.fill(cx + gx * px, y + gy * px, px, px, color);
|
|
86
|
+
cx += (GLYPH_W + 1) * px;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
png() {
|
|
90
|
+
return encodePng(this.data, this.width, this.height);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
var textWidth = (text, px) => Math.max(0, [...text].length * (GLYPH_W + 1) * px - px);
|
|
94
|
+
var textHeight = (px) => GLYPH_H * px;
|
|
95
|
+
var chunk = (type, body) => {
|
|
96
|
+
const head = Buffer.alloc(8);
|
|
97
|
+
head.writeUInt32BE(body.length, 0);
|
|
98
|
+
head.write(type, 4, "latin1");
|
|
99
|
+
const crc = Buffer.alloc(4);
|
|
100
|
+
crc.writeUInt32BE(crc32(Buffer.concat([head.subarray(4), body])) >>> 0, 0);
|
|
101
|
+
return Buffer.concat([head, body, crc]);
|
|
102
|
+
};
|
|
103
|
+
var FILTER_TYPES = [0, 1, 2, 4];
|
|
104
|
+
var paeth = (a, b, c) => {
|
|
105
|
+
const p = a + b - c;
|
|
106
|
+
const pa = Math.abs(p - a);
|
|
107
|
+
const pb = Math.abs(p - b);
|
|
108
|
+
const pc = Math.abs(p - c);
|
|
109
|
+
return pa <= pb && pa <= pc ? a : pb <= pc ? b : c;
|
|
110
|
+
};
|
|
111
|
+
function encodePng(rgba, width, height) {
|
|
112
|
+
const stride = width * 4;
|
|
113
|
+
const raw = Buffer.alloc((stride + 1) * height);
|
|
114
|
+
const candidates = Array.from({ length: 4 }, () => new Uint8Array(stride));
|
|
115
|
+
for (let y = 0; y < height; y++) {
|
|
116
|
+
const row = rgba.subarray(y * stride, (y + 1) * stride);
|
|
117
|
+
const up = y > 0 ? rgba.subarray((y - 1) * stride, y * stride) : void 0;
|
|
118
|
+
const [none, sub, upF, pa] = candidates;
|
|
119
|
+
for (let i = 0; i < stride; i++) {
|
|
120
|
+
const x = row[i];
|
|
121
|
+
const a = i >= 4 ? row[i - 4] : 0;
|
|
122
|
+
const b = up ? up[i] : 0;
|
|
123
|
+
const c = up && i >= 4 ? up[i - 4] : 0;
|
|
124
|
+
none[i] = x;
|
|
125
|
+
sub[i] = x - a & 255;
|
|
126
|
+
upF[i] = x - b & 255;
|
|
127
|
+
pa[i] = x - paeth(a, b, c) & 255;
|
|
128
|
+
}
|
|
129
|
+
let best = 0;
|
|
130
|
+
let bestCost = Infinity;
|
|
131
|
+
candidates.forEach((cand, k) => {
|
|
132
|
+
let cost = 0;
|
|
133
|
+
for (let i = 0; i < stride; i++) cost += cand[i] < 128 ? cand[i] : 256 - cand[i];
|
|
134
|
+
if (cost < bestCost) {
|
|
135
|
+
bestCost = cost;
|
|
136
|
+
best = k;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
raw[y * (stride + 1)] = FILTER_TYPES[best];
|
|
140
|
+
raw.set(candidates[best], y * (stride + 1) + 1);
|
|
141
|
+
}
|
|
142
|
+
const ihdr = Buffer.alloc(13);
|
|
143
|
+
ihdr.writeUInt32BE(width, 0);
|
|
144
|
+
ihdr.writeUInt32BE(height, 4);
|
|
145
|
+
ihdr[8] = 8;
|
|
146
|
+
ihdr[9] = 6;
|
|
147
|
+
return Buffer.concat([Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]), chunk("IHDR", ihdr), chunk("IDAT", deflateSync(raw, { level: 6 })), chunk("IEND", new Uint8Array(0))]);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// src/media/source.ts
|
|
151
|
+
import { execFile } from "node:child_process";
|
|
152
|
+
import { randomUUID } from "node:crypto";
|
|
153
|
+
import { existsSync, mkdirSync, mkdtempSync, statSync, writeFileSync } from "node:fs";
|
|
154
|
+
import { homedir, tmpdir } from "node:os";
|
|
155
|
+
import { basename, dirname, isAbsolute, join, resolve } from "node:path";
|
|
156
|
+
import { promisify } from "node:util";
|
|
157
|
+
var run = promisify(execFile);
|
|
158
|
+
function resolveMediaPath(path, base) {
|
|
159
|
+
if (path === "~" || path.startsWith("~/")) return join(homedir(), path.slice(1));
|
|
160
|
+
if (isAbsolute(path)) return resolve(path);
|
|
161
|
+
if (!base) throw new Error(`"${path}" is a relative path: open a project first or pass an absolute path`);
|
|
162
|
+
return resolve(base, path);
|
|
163
|
+
}
|
|
164
|
+
function assertFile(file) {
|
|
165
|
+
if (!existsSync(file)) throw new Error(`No such file: ${file}`);
|
|
166
|
+
const st = statSync(file);
|
|
167
|
+
if (!st.isFile()) throw new Error(`Not a file: ${file}`);
|
|
168
|
+
return st.size;
|
|
169
|
+
}
|
|
170
|
+
var num = (v) => {
|
|
171
|
+
if (v === void 0 || v === null || v === "" || v === "N/A") return void 0;
|
|
172
|
+
const n = Number(v);
|
|
173
|
+
return Number.isFinite(n) ? n : void 0;
|
|
174
|
+
};
|
|
175
|
+
var str = (v) => typeof v === "string" && v !== "" && v !== "unknown" ? v : void 0;
|
|
176
|
+
var rate = (v) => {
|
|
177
|
+
const [n, d] = String(v ?? "").split("/").map(Number);
|
|
178
|
+
if (!n || !d) return void 0;
|
|
179
|
+
return Math.round(n / d * 1e3) / 1e3;
|
|
180
|
+
};
|
|
181
|
+
var defined = (o) => Object.fromEntries(Object.entries(o).filter(([, v]) => v !== void 0));
|
|
182
|
+
var IMAGE_FORMATS = /^(image2|.*_pipe|gif|webp|png|apng)$/;
|
|
183
|
+
async function probeMedia(file) {
|
|
184
|
+
const size = assertFile(file);
|
|
185
|
+
const ffprobe = requireTool("ffprobe");
|
|
186
|
+
let info;
|
|
187
|
+
try {
|
|
188
|
+
const { stdout } = await run(ffprobe, ["-v", "error", "-show_format", "-show_streams", "-of", "json", file], { maxBuffer: 1 << 24 });
|
|
189
|
+
info = JSON.parse(stdout);
|
|
190
|
+
} catch {
|
|
191
|
+
return { path: file, name: basename(file), type: "other", size, format: null, tracks: [] };
|
|
192
|
+
}
|
|
193
|
+
const format = info.format ?? {};
|
|
194
|
+
const tracks = (info.streams ?? []).map((s) => {
|
|
195
|
+
const tags = s.tags ?? {};
|
|
196
|
+
const side = s.side_data_list ?? [];
|
|
197
|
+
const video = s.codec_type === "video";
|
|
198
|
+
const audio = s.codec_type === "audio";
|
|
199
|
+
return defined({
|
|
200
|
+
id: Number(s.index),
|
|
201
|
+
type: String(s.codec_type ?? "unknown"),
|
|
202
|
+
codec: str(s.codec_name) ?? null,
|
|
203
|
+
codecLongName: str(s.codec_long_name),
|
|
204
|
+
profile: str(s.profile),
|
|
205
|
+
language: tags.language ?? "und",
|
|
206
|
+
firstTimestamp: num(s.start_time) ?? 0,
|
|
207
|
+
duration: num(s.duration) ?? num(format.duration) ?? 0,
|
|
208
|
+
bitRate: num(s.bit_rate),
|
|
209
|
+
frames: num(s.nb_frames),
|
|
210
|
+
...video ? {
|
|
211
|
+
width: num(s.width),
|
|
212
|
+
height: num(s.height),
|
|
213
|
+
fps: rate(s.avg_frame_rate) ?? rate(s.r_frame_rate),
|
|
214
|
+
pixFmt: str(s.pix_fmt),
|
|
215
|
+
colorSpace: str(s.color_space),
|
|
216
|
+
colorRange: str(s.color_range),
|
|
217
|
+
colorTransfer: str(s.color_transfer),
|
|
218
|
+
colorPrimaries: str(s.color_primaries),
|
|
219
|
+
rotation: num(side.find((d) => d.rotation !== void 0)?.rotation)
|
|
220
|
+
} : {},
|
|
221
|
+
...audio ? { sampleRate: num(s.sample_rate), channels: num(s.channels), channelLayout: str(s.channel_layout) } : {}
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
const formatName = str(format.format_name) ?? null;
|
|
225
|
+
const visual = tracks.find((t) => t.type === "video");
|
|
226
|
+
const still = formatName !== null && IMAGE_FORMATS.test(formatName);
|
|
227
|
+
const type = visual ? still ? "image" : "video" : tracks.some((t) => t.type === "audio") ? "audio" : "other";
|
|
228
|
+
return defined({
|
|
229
|
+
path: file,
|
|
230
|
+
name: basename(file),
|
|
231
|
+
type,
|
|
232
|
+
size,
|
|
233
|
+
format: formatName,
|
|
234
|
+
formatLongName: str(format.format_long_name),
|
|
235
|
+
duration: still ? void 0 : num(format.duration),
|
|
236
|
+
bitRate: num(format.bit_rate),
|
|
237
|
+
width: visual?.width,
|
|
238
|
+
height: visual?.height,
|
|
239
|
+
tags: format.tags && Object.keys(format.tags).length ? format.tags : void 0,
|
|
240
|
+
tracks
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
async function videoSource(file) {
|
|
244
|
+
assertFile(file);
|
|
245
|
+
const p = await probe(file).catch((error) => {
|
|
246
|
+
if (error instanceof Error && /no video stream/.test(error.message)) throw new Error(`${file} has no video track`);
|
|
247
|
+
throw error;
|
|
248
|
+
});
|
|
249
|
+
if (!p.timestamps.length) throw new Error(`${file} has no video frames`);
|
|
250
|
+
return {
|
|
251
|
+
file,
|
|
252
|
+
width: p.width,
|
|
253
|
+
height: p.height,
|
|
254
|
+
fps: p.fps,
|
|
255
|
+
duration: p.duration,
|
|
256
|
+
origin: Math.max(0, p.timestamps[0]),
|
|
257
|
+
timestamps: p.timestamps,
|
|
258
|
+
matrix: matrixOf(p),
|
|
259
|
+
range: p.colorRange === "pc" ? "full" : "limited"
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
var frameAt = (src, t) => frameIndexAt(src.timestamps, src.origin + t, src.fps);
|
|
263
|
+
var frameTime = (src, index) => src.timestamps[index] - src.origin;
|
|
264
|
+
var gridFrame = (src, index) => Math.round(frameTime(src, index) * src.fps);
|
|
265
|
+
var collect = (proc, what) => new Promise((done, failed) => {
|
|
266
|
+
const out = [];
|
|
267
|
+
const err = [];
|
|
268
|
+
proc.stdout.on("data", (b) => out.push(b));
|
|
269
|
+
proc.stderr.on("data", (b) => err.push(b));
|
|
270
|
+
proc.on("error", failed);
|
|
271
|
+
proc.on("close", (code) => code === 0 ? done(Buffer.concat(out)) : failed(new Error(`ffmpeg failed to decode ${what}: ${Buffer.concat(err).toString().trim() || `exit ${code}`}`)));
|
|
272
|
+
});
|
|
273
|
+
async function decodeFrame(src, index, width, height) {
|
|
274
|
+
const pts = src.timestamps[index];
|
|
275
|
+
const half = 0.25 / src.fps;
|
|
276
|
+
const seek = Math.max(0, pts - src.origin - 2);
|
|
277
|
+
const scale = `scale=w=${width}:h=${height}:flags=area:in_color_matrix=${src.matrix}:in_range=${src.range}:out_range=full,format=rgba`;
|
|
278
|
+
const proc = ffmpeg(["-copyts", "-ss", seek.toFixed(6), "-noaccurate_seek", "-i", src.file, "-map", "0:v:0", "-vf", `select=gte(t\\,${(pts - half).toFixed(6)}),${scale}`, "-frames:v", "1", "-f", "rawvideo", "-"]);
|
|
279
|
+
const bytes = await collect(proc, `frame ${index} of ${src.file}`);
|
|
280
|
+
if (bytes.length !== width * height * 4) throw new Error(`could not decode frame ${index} of ${src.file}`);
|
|
281
|
+
return new Uint8Array(bytes.buffer, bytes.byteOffset, bytes.length);
|
|
282
|
+
}
|
|
283
|
+
async function decodeAudio(file, start, end, rate2) {
|
|
284
|
+
const proc = ffmpeg(["-ss", start.toFixed(6), "-t", (end - start).toFixed(6), "-i", file, "-map", "0:a:0", "-ac", "1", "-ar", String(rate2), "-f", "f32le", "-"]);
|
|
285
|
+
const bytes = await collect(proc, `audio of ${file}`);
|
|
286
|
+
const copy = new Uint8Array(bytes.length - bytes.length % 4);
|
|
287
|
+
copy.set(bytes.subarray(0, copy.length));
|
|
288
|
+
return new Float32Array(copy.buffer);
|
|
289
|
+
}
|
|
290
|
+
async function pool(items, limit, job) {
|
|
291
|
+
const out = [];
|
|
292
|
+
let next = 0;
|
|
293
|
+
const worker = async () => {
|
|
294
|
+
while (next < items.length) {
|
|
295
|
+
const i = next++;
|
|
296
|
+
out[i] = await job(items[i]);
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
await Promise.all(Array.from({ length: Math.min(limit, items.length) }, worker));
|
|
300
|
+
return out;
|
|
301
|
+
}
|
|
302
|
+
function outputDir(dir, prefix) {
|
|
303
|
+
if (!dir) return mkdtempSync(join(tmpdir(), `${prefix}-`));
|
|
304
|
+
const abs = resolve(dir);
|
|
305
|
+
mkdirSync(abs, { recursive: true });
|
|
306
|
+
return abs;
|
|
307
|
+
}
|
|
308
|
+
function writeOutput(data, output, prefix, ext = "png") {
|
|
309
|
+
const fresh = `${prefix}-${randomUUID()}.${ext}`;
|
|
310
|
+
let file;
|
|
311
|
+
if (!output) file = join(tmpdir(), fresh);
|
|
312
|
+
else if (existsSync(output) && statSync(output).isDirectory()) file = join(resolve(output), fresh);
|
|
313
|
+
else file = resolve(output);
|
|
314
|
+
mkdirSync(dirname(file), { recursive: true });
|
|
315
|
+
writeFileSync(file, data);
|
|
316
|
+
return file;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export {
|
|
320
|
+
Bitmap,
|
|
321
|
+
textWidth,
|
|
322
|
+
textHeight,
|
|
323
|
+
encodePng,
|
|
324
|
+
resolveMediaPath,
|
|
325
|
+
probeMedia,
|
|
326
|
+
videoSource,
|
|
327
|
+
frameAt,
|
|
328
|
+
frameTime,
|
|
329
|
+
gridFrame,
|
|
330
|
+
decodeFrame,
|
|
331
|
+
decodeAudio,
|
|
332
|
+
pool,
|
|
333
|
+
outputDir,
|
|
334
|
+
writeOutput
|
|
335
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __higgseditRequire } from "node:module";
|
|
3
|
+
import { fileURLToPath as __higgseditPath } from "node:url";
|
|
4
|
+
const require = __higgseditRequire(import.meta.url);
|
|
5
|
+
const __filename = __higgseditPath(import.meta.url);
|
|
6
|
+
const __dirname = __filename.slice(0, __filename.lastIndexOf("/"));
|
|
7
|
+
import {
|
|
8
|
+
check
|
|
9
|
+
} from "./chunk-OF6RMSM2.mjs";
|
|
10
|
+
import "./chunk-MV2JTTBQ.mjs";
|
|
11
|
+
import "./chunk-UDL5AHKO.mjs";
|
|
12
|
+
import "./chunk-LTKMGZ6T.mjs";
|
|
13
|
+
import "./chunk-P2BGHTRR.mjs";
|
|
14
|
+
import "./chunk-PAHMD6SU.mjs";
|
|
15
|
+
import "./chunk-2VKQHJMM.mjs";
|
|
16
|
+
import "./chunk-BV5COOQZ.mjs";
|
|
17
|
+
import "./chunk-F7YUKEI5.mjs";
|
|
18
|
+
import "./chunk-75WO2NOF.mjs";
|
|
19
|
+
export {
|
|
20
|
+
check
|
|
21
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __higgseditRequire } from "node:module";
|
|
3
|
+
import { fileURLToPath as __higgseditPath } from "node:url";
|
|
4
|
+
const require = __higgseditRequire(import.meta.url);
|
|
5
|
+
const __filename = __higgseditPath(import.meta.url);
|
|
6
|
+
const __dirname = __filename.slice(0, __filename.lastIndexOf("/"));
|
|
7
|
+
import {
|
|
8
|
+
assertProject,
|
|
9
|
+
fontFiles,
|
|
10
|
+
inside,
|
|
11
|
+
readSources,
|
|
12
|
+
rel,
|
|
13
|
+
sourceFiles
|
|
14
|
+
} from "./chunk-LTKMGZ6T.mjs";
|
|
15
|
+
import "./chunk-75WO2NOF.mjs";
|
|
16
|
+
export {
|
|
17
|
+
assertProject,
|
|
18
|
+
fontFiles,
|
|
19
|
+
inside,
|
|
20
|
+
readSources,
|
|
21
|
+
rel,
|
|
22
|
+
sourceFiles
|
|
23
|
+
};
|