hypeframe 0.9.0 → 0.9.2
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 +1 -1
- package/dist/index.js +107 -63
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -97,7 +97,7 @@ npm i -g hypeframe # keep it installed
|
|
|
97
97
|
| | |
|
|
98
98
|
|---|---|
|
|
99
99
|
| System | Windows 10/11 (x64; ARM64 through emulation), macOS (Apple Silicon or Intel), Linux x64 or arm64 (glibc or musl/Alpine) |
|
|
100
|
-
| Android | Through Termux: the installer adds Node.js, ffmpeg and Chromium with `pkg`. Whether renders work depends on that Chromium build (`hypeframe doctor` tells
|
|
100
|
+
| Android | Through Termux: the installer adds Node.js, ffmpeg and Chromium with `pkg`. Whether renders work depends on that Chromium build (`hypeframe doctor` tells; when it cannot render, HypeFrame Web shows why on the device's card, with the command that helps). Agents that ship only glibc programs cannot run there. |
|
|
101
101
|
| iPhone / iPad | Cannot run the engine. Use HypeFrame Web with "In this browser" rendering. |
|
|
102
102
|
| Chrome | Uses the installed Chrome or Edge. Without one, Chrome for Testing is downloaded once (about 150 MB). |
|
|
103
103
|
| ffmpeg | Comes with the npm package. The standalone program downloads the same build once (about 28 MB) and checks its sha256. |
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/cli/args.ts
|
|
1
|
+
// packages/hypeframe/src/cli/args.ts
|
|
2
2
|
var VALUE = new Map([
|
|
3
3
|
["--gateway", "gateway"],
|
|
4
4
|
["--web", "web"],
|
|
@@ -49,10 +49,10 @@ function parseArgs(argv) {
|
|
|
49
49
|
return out;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
// src/config/account.ts
|
|
52
|
+
// packages/hypeframe/src/config/account.ts
|
|
53
53
|
import fs2 from "node:fs";
|
|
54
54
|
|
|
55
|
-
// src/config/paths.ts
|
|
55
|
+
// packages/hypeframe/src/config/paths.ts
|
|
56
56
|
import fs from "node:fs";
|
|
57
57
|
import os from "node:os";
|
|
58
58
|
import path from "node:path";
|
|
@@ -79,7 +79,7 @@ function projectDir(projectId) {
|
|
|
79
79
|
return sub("proyek", projectId);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
// src/config/account.ts
|
|
82
|
+
// packages/hypeframe/src/config/account.ts
|
|
83
83
|
function readAccount() {
|
|
84
84
|
try {
|
|
85
85
|
const a = JSON.parse(fs2.readFileSync(accountFile(), "utf8"));
|
|
@@ -101,11 +101,11 @@ function maskEmail(email) {
|
|
|
101
101
|
return m ? `${m[1]}***${m[2]}`.replace(/[\u0000-\u001f\u007f]/g, "") : "-";
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
// src/config/settings.ts
|
|
104
|
+
// packages/hypeframe/src/config/settings.ts
|
|
105
105
|
import fs4 from "node:fs";
|
|
106
106
|
import os2 from "node:os";
|
|
107
107
|
|
|
108
|
-
// src/util/which.ts
|
|
108
|
+
// packages/hypeframe/src/util/which.ts
|
|
109
109
|
import fs3 from "node:fs";
|
|
110
110
|
import path2 from "node:path";
|
|
111
111
|
function isAndroid() {
|
|
@@ -126,7 +126,7 @@ function onPath(name) {
|
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
// src/config/settings.ts
|
|
129
|
+
// packages/hypeframe/src/config/settings.ts
|
|
130
130
|
var DEFAULT_GATEWAY = "https://api.sairipedia.com";
|
|
131
131
|
var DEFAULT_WEB = "https://hype-frame.com";
|
|
132
132
|
function readSettings() {
|
|
@@ -155,7 +155,7 @@ function osName() {
|
|
|
155
155
|
return { win32: "windows", darwin: "macos", linux: "linux", android: "android" }[process.platform] || process.platform;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
// src/ui/locale.ts
|
|
158
|
+
// packages/hypeframe/src/ui/locale.ts
|
|
159
159
|
function systemLang() {
|
|
160
160
|
const env = process.env.LC_ALL || process.env.LC_MESSAGES || process.env.LANG || Intl.DateTimeFormat().resolvedOptions().locale || "";
|
|
161
161
|
return /^id\b|^id[-_]|^in[-_]/i.test(env) ? "id" : "en";
|
|
@@ -383,6 +383,7 @@ Tekan Esc untuk melewati satu langkah. Panduan ini bisa dibuka lagi dari Bantuan
|
|
|
383
383
|
"doctor.alpha": "Klip transparan",
|
|
384
384
|
"doctor.alphaNo": "tidak didukung Chrome ini; dibuat di server atau HP",
|
|
385
385
|
"doctor.tryChromiumMini": "Chromium Termux belum bisa render di HP ini. Coba Chromium di Linux mini: hypeframe chromium",
|
|
386
|
+
"render.tryChromiumMini": "Perbaikannya: buka sesi Termux baru lalu jalankan hypeframe chromium. Mesin ini mencoba render lagi begitu Chromium itu siap.",
|
|
386
387
|
"doctor.yes": "bisa",
|
|
387
388
|
"doctor.no": "tidak bisa",
|
|
388
389
|
"doctor.unreachable": "tidak terjangkau",
|
|
@@ -654,6 +655,7 @@ Press Esc to skip a step. You can open this guide again from Help & maintenance.
|
|
|
654
655
|
"doctor.alpha": "Transparent clips",
|
|
655
656
|
"doctor.alphaNo": "not supported by this Chrome; made on the server or phone",
|
|
656
657
|
"doctor.tryChromiumMini": "Termux's Chromium cannot render on this phone yet. Try Chromium in the Linux mini: hypeframe chromium",
|
|
658
|
+
"render.tryChromiumMini": "The fix: open a new Termux session and run hypeframe chromium. This engine tries rendering again as soon as that Chromium is ready.",
|
|
657
659
|
"doctor.yes": "yes",
|
|
658
660
|
"doctor.no": "no",
|
|
659
661
|
"doctor.unreachable": "unreachable",
|
|
@@ -717,11 +719,11 @@ function t(key, vars = {}) {
|
|
|
717
719
|
return s.replace(/\{(\w+)\}/g, (_, k) => String(vars[k] ?? `{${k}}`));
|
|
718
720
|
}
|
|
719
721
|
|
|
720
|
-
// src/ui/log.ts
|
|
722
|
+
// packages/hypeframe/src/ui/log.ts
|
|
721
723
|
import fs5 from "node:fs";
|
|
722
724
|
import path3 from "node:path";
|
|
723
725
|
|
|
724
|
-
// src/ui/theme.ts
|
|
726
|
+
// packages/hypeframe/src/ui/theme.ts
|
|
725
727
|
import picocolors from "picocolors";
|
|
726
728
|
var env = process.env;
|
|
727
729
|
var enabled = !("NO_COLOR" in env) && env.TERM !== "dumb" && ("FORCE_COLOR" in env ? env.FORCE_COLOR !== "0" : !!process.stdout.isTTY);
|
|
@@ -755,7 +757,7 @@ var icon = {
|
|
|
755
757
|
};
|
|
756
758
|
var plain = (s) => s.replace(/\x1b\[[0-9;]*m/g, "");
|
|
757
759
|
|
|
758
|
-
// src/ui/log.ts
|
|
760
|
+
// packages/hypeframe/src/ui/log.ts
|
|
759
761
|
var SECRET = /\b(hfm_[A-Za-z0-9_-]{20,}|hms_[A-Za-z0-9_-]{20,}|npm_[A-Za-z0-9]{20,}|gh[pousr]_[A-Za-z0-9]{20,}|v1\.[A-Za-z0-9_-]{20,}\.[A-Za-z0-9_-]{20,})\b/g;
|
|
760
762
|
var mask = (s) => s.replace(SECRET, (m) => `${m.slice(0, 4)}…`);
|
|
761
763
|
var MAX_FILE = 1024 * 1024;
|
|
@@ -793,11 +795,11 @@ var log = {
|
|
|
793
795
|
detail: (m) => write("detail", m)
|
|
794
796
|
};
|
|
795
797
|
|
|
796
|
-
// src/cli/commands/start.ts
|
|
798
|
+
// packages/hypeframe/src/cli/commands/start.ts
|
|
797
799
|
import crypto9 from "node:crypto";
|
|
798
800
|
import readline3 from "node:readline";
|
|
799
801
|
|
|
800
|
-
//
|
|
802
|
+
// packages/protocol/src/index.ts
|
|
801
803
|
var PROTOCOL_VERSION = 1;
|
|
802
804
|
var ALLOWED_KINDS = ["status", "kunci", "agen.mulai", "agen.kirim", "agen.izin", "agen.batal", "agen.opsi", "agen.riwayat", "agen.akun", "render.relai"];
|
|
803
805
|
var CloseCode = {
|
|
@@ -820,14 +822,14 @@ var EngineError = {
|
|
|
820
822
|
BadPackage: "Paket berisi berkas yang tidak diizinkan."
|
|
821
823
|
};
|
|
822
824
|
|
|
823
|
-
// src/agent/service.ts
|
|
825
|
+
// packages/hypeframe/src/agent/service.ts
|
|
824
826
|
import crypto3 from "node:crypto";
|
|
825
827
|
import fs11 from "node:fs";
|
|
826
828
|
import path8 from "node:path";
|
|
827
|
-
// package.json
|
|
829
|
+
// packages/hypeframe/package.json
|
|
828
830
|
var package_default = {
|
|
829
831
|
name: "hypeframe",
|
|
830
|
-
version: "0.9.
|
|
832
|
+
version: "0.9.2",
|
|
831
833
|
description: "Local engine for HypeFrame Web: code clips, video renders and AI agents run on your own machine; the web is just the view.",
|
|
832
834
|
keywords: [
|
|
833
835
|
"hypeframe",
|
|
@@ -877,10 +879,10 @@ var package_default = {
|
|
|
877
879
|
}
|
|
878
880
|
};
|
|
879
881
|
|
|
880
|
-
// src/config/version.ts
|
|
882
|
+
// packages/hypeframe/src/config/version.ts
|
|
881
883
|
var VERSION = process.env.HF_MESIN_VERSI || package_default.version;
|
|
882
884
|
|
|
883
|
-
// src/agent/instructions.ts
|
|
885
|
+
// packages/hypeframe/src/agent/instructions.ts
|
|
884
886
|
var MCP_INSTRUCTIONS = "Tools to make videos from code in HypeFrame Web, open in the user's browser. Tools run in that browser tab, so HypeFrame Web must stay open. " + "A project is a sequence of scenes written in code (create_motion with engine halaman, html, gsap or remotion) plus sound written in code (create_audio, Web Audio). " + "CODE FIRST (the main feature of HypeFrame): build every scene of a new video by writing code and passing it in the code argument of preview_motion and then create_motion (engine halaman, html, gsap or remotion), and make sound with create_audio. Writing that code through these tools is your main job here; never say you cannot write code. Do not build scenes from add_text, add_shape or add_image layers: use those (and set_keyframe) only when the user asks for a small manual change to a video that already exists. " + "Try code with preview_motion first. Depending on the permission setting of the user, create_motion / create_audio runs at once (the code is still shown in HypeFrame Web) or waits until the user approves it, so wait for the job result with get_job_status. " + "At the start of every conversation call get_memory first: it shows unfinished work saved by earlier conversations. If there is unfinished work, say in one or two sentences what it was and ask whether to continue it. " + "Keep the memory current: call save_memory after every finished step. " + "Before creating a project, call list_skills, pick the best skill (say which) and read it with use_skill. A skill can be a package with files: read examples with read_skill_file and put assets into the project with import_skill_files. " + "All times are in frames (seconds x project fps). " + "render_video may ask the user to approve (their setting) and returns immediately: poll get_render_status until it finishes. Most users write in Indonesian: write every message, including progress notes, in their language.";
|
|
885
887
|
var AGENTS_MD = `# HypeFrame
|
|
886
888
|
|
|
@@ -893,7 +895,7 @@ You are running on the user's computer through the HypeFrame engine. The user ty
|
|
|
893
895
|
- A file you made or downloaded in this folder (image, audio, video, font, Lottie/JSON, up to 4 MB) reaches the video only through add_file_from_computer, which returns its asset id (use it as asset://<id>).
|
|
894
896
|
`;
|
|
895
897
|
|
|
896
|
-
// src/agent/registry.ts
|
|
898
|
+
// packages/hypeframe/src/agent/registry.ts
|
|
897
899
|
import { spawnSync } from "node:child_process";
|
|
898
900
|
import fs6 from "node:fs";
|
|
899
901
|
var SUPPORTED_AGENTS = ["antigravity-acp", "codex-acp", "opencode"];
|
|
@@ -925,7 +927,7 @@ async function fetchRegistry() {
|
|
|
925
927
|
return (Array.isArray(j.agents) ? j.agents : []).filter(valid).map((a) => local ? a : { ...a, distribution: { ...a.distribution, local: undefined } });
|
|
926
928
|
}
|
|
927
929
|
|
|
928
|
-
// src/agent/linux.ts
|
|
930
|
+
// packages/hypeframe/src/agent/linux.ts
|
|
929
931
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
930
932
|
import crypto from "node:crypto";
|
|
931
933
|
import fs7 from "node:fs";
|
|
@@ -1112,10 +1114,10 @@ function watchOpenRequests(open, everyMs = 1000) {
|
|
|
1112
1114
|
return () => clearInterval(timer);
|
|
1113
1115
|
}
|
|
1114
1116
|
|
|
1115
|
-
// src/agent/login.ts
|
|
1117
|
+
// packages/hypeframe/src/agent/login.ts
|
|
1116
1118
|
import { spawn as spawn2 } from "node:child_process";
|
|
1117
1119
|
|
|
1118
|
-
// src/agent/acp.ts
|
|
1120
|
+
// packages/hypeframe/src/agent/acp.ts
|
|
1119
1121
|
import { spawn } from "node:child_process";
|
|
1120
1122
|
import { EventEmitter } from "node:events";
|
|
1121
1123
|
import readline from "node:readline";
|
|
@@ -1256,7 +1258,7 @@ class AcpProcess extends EventEmitter {
|
|
|
1256
1258
|
}
|
|
1257
1259
|
}
|
|
1258
1260
|
|
|
1259
|
-
// src/agent/store.ts
|
|
1261
|
+
// packages/hypeframe/src/agent/store.ts
|
|
1260
1262
|
import fs8 from "node:fs";
|
|
1261
1263
|
import path5 from "node:path";
|
|
1262
1264
|
function setReady(id, ready) {
|
|
@@ -1322,7 +1324,7 @@ function saveAgentEnv(id, env) {
|
|
|
1322
1324
|
fs8.renameSync(`${f}.tmp`, f);
|
|
1323
1325
|
}
|
|
1324
1326
|
|
|
1325
|
-
// src/agent/login.ts
|
|
1327
|
+
// packages/hypeframe/src/agent/login.ts
|
|
1326
1328
|
var SIGN_IN = /https?:\/\/[^\s"'<>]{8,2000}/g;
|
|
1327
1329
|
var looksLikeSignIn = (u) => /oauth|auth|login|signin|sign-in|device|accounts\./i.test(u);
|
|
1328
1330
|
function linkScanner(found) {
|
|
@@ -1555,7 +1557,7 @@ function cancelRemoteLogin(id) {
|
|
|
1555
1557
|
r.cancel();
|
|
1556
1558
|
}
|
|
1557
1559
|
|
|
1558
|
-
// src/agent/opencode.ts
|
|
1560
|
+
// packages/hypeframe/src/agent/opencode.ts
|
|
1559
1561
|
import fs9 from "node:fs";
|
|
1560
1562
|
import path6 from "node:path";
|
|
1561
1563
|
var OPENCODE = "opencode";
|
|
@@ -1621,7 +1623,7 @@ async function fetchApiModels(url, key, timeoutMs = 1e4) {
|
|
|
1621
1623
|
}
|
|
1622
1624
|
}
|
|
1623
1625
|
|
|
1624
|
-
// src/agent/session.ts
|
|
1626
|
+
// packages/hypeframe/src/agent/session.ts
|
|
1625
1627
|
import crypto2 from "node:crypto";
|
|
1626
1628
|
import fs10 from "node:fs";
|
|
1627
1629
|
import path7 from "node:path";
|
|
@@ -1940,7 +1942,7 @@ class AgentSessions {
|
|
|
1940
1942
|
}
|
|
1941
1943
|
}
|
|
1942
1944
|
|
|
1943
|
-
// src/agent/service.ts
|
|
1945
|
+
// packages/hypeframe/src/agent/service.ts
|
|
1944
1946
|
var hostOf = (u) => {
|
|
1945
1947
|
try {
|
|
1946
1948
|
return new URL(u).host;
|
|
@@ -2428,12 +2430,12 @@ function createAgentService(o) {
|
|
|
2428
2430
|
return { work, route, capabilities, checkAccounts, activity, key, stop: () => (stopping = true, clearInterval(ticker), sessions.stopAll()) };
|
|
2429
2431
|
}
|
|
2430
2432
|
|
|
2431
|
-
// src/agent/mcp-bridge.ts
|
|
2433
|
+
// packages/hypeframe/src/agent/mcp-bridge.ts
|
|
2432
2434
|
import fs13 from "node:fs";
|
|
2433
2435
|
import path10 from "node:path";
|
|
2434
2436
|
import readline2 from "node:readline";
|
|
2435
2437
|
|
|
2436
|
-
// src/util/runtime.ts
|
|
2438
|
+
// packages/hypeframe/src/util/runtime.ts
|
|
2437
2439
|
import fs12 from "node:fs";
|
|
2438
2440
|
import path9 from "node:path";
|
|
2439
2441
|
function isStandalone() {
|
|
@@ -2455,7 +2457,7 @@ function launchCommand() {
|
|
|
2455
2457
|
}
|
|
2456
2458
|
var INSTALL_URL = "https://hype-frame.com/install";
|
|
2457
2459
|
|
|
2458
|
-
// src/agent/mcp-bridge.ts
|
|
2460
|
+
// packages/hypeframe/src/agent/mcp-bridge.ts
|
|
2459
2461
|
var BRIDGE_SOURCE = `// HypeFrame MCP bridge (written by hypeframe; do not edit). stdin JSON-RPC lines -> engine -> stdout.
|
|
2460
2462
|
import readline from 'node:readline';
|
|
2461
2463
|
const url = process.env.HF_MCP_URL, key = process.env.HF_MCP_KUNCI;
|
|
@@ -2534,7 +2536,7 @@ async function runMcpBridge() {
|
|
|
2534
2536
|
await Promise.all(busy);
|
|
2535
2537
|
}
|
|
2536
2538
|
|
|
2537
|
-
// src/config/lock.ts
|
|
2539
|
+
// packages/hypeframe/src/config/lock.ts
|
|
2538
2540
|
import fs14 from "node:fs";
|
|
2539
2541
|
class AlreadyRunning extends Error {
|
|
2540
2542
|
code = "SUDAH_JALAN";
|
|
@@ -2583,7 +2585,7 @@ function singleInstance() {
|
|
|
2583
2585
|
throw new AlreadyRunning("engine already running");
|
|
2584
2586
|
}
|
|
2585
2587
|
|
|
2586
|
-
// src/engine/connection.ts
|
|
2588
|
+
// packages/hypeframe/src/engine/connection.ts
|
|
2587
2589
|
import crypto4 from "node:crypto";
|
|
2588
2590
|
import { EventEmitter as EventEmitter2 } from "node:events";
|
|
2589
2591
|
import WebSocket from "ws";
|
|
@@ -2721,7 +2723,7 @@ class Connection extends EventEmitter2 {
|
|
|
2721
2723
|
}
|
|
2722
2724
|
}
|
|
2723
2725
|
|
|
2724
|
-
// src/engine/handler.ts
|
|
2726
|
+
// packages/hypeframe/src/engine/handler.ts
|
|
2725
2727
|
function createHandler(work) {
|
|
2726
2728
|
return async function handle(c) {
|
|
2727
2729
|
const kind = String(c?.jenis || "");
|
|
@@ -2736,7 +2738,7 @@ function createHandler(work) {
|
|
|
2736
2738
|
};
|
|
2737
2739
|
}
|
|
2738
2740
|
|
|
2739
|
-
// src/engine/pairing.ts
|
|
2741
|
+
// packages/hypeframe/src/engine/pairing.ts
|
|
2740
2742
|
var sleep = (ms, signal) => new Promise((ok, fail) => {
|
|
2741
2743
|
const timer = setTimeout(ok, ms);
|
|
2742
2744
|
signal?.addEventListener("abort", () => (clearTimeout(timer), fail(new Error("Dibatalkan."))), { once: true });
|
|
@@ -2812,7 +2814,7 @@ async function pair(o) {
|
|
|
2812
2814
|
}
|
|
2813
2815
|
}
|
|
2814
2816
|
|
|
2815
|
-
// src/render/chrome.ts
|
|
2817
|
+
// packages/hypeframe/src/render/chrome.ts
|
|
2816
2818
|
import fs15 from "node:fs";
|
|
2817
2819
|
import http from "node:http";
|
|
2818
2820
|
import path11 from "node:path";
|
|
@@ -2822,7 +2824,9 @@ var ANDROID_ARGS = ["--no-sandbox", "--disable-dev-shm-usage"];
|
|
|
2822
2824
|
var ANDROID_FALLBACKS = [
|
|
2823
2825
|
{ args: [], pipe: false },
|
|
2824
2826
|
{ args: [], pipe: true },
|
|
2827
|
+
{ args: ["--disable-gpu"], pipe: true },
|
|
2825
2828
|
{ args: ["--enable-features=NetworkServiceInProcess2"], pipe: true },
|
|
2829
|
+
{ args: ["--disable-gpu", "--single-process", "--no-zygote"], pipe: true },
|
|
2826
2830
|
{ args: ["--single-process", "--no-zygote"], pipe: true },
|
|
2827
2831
|
{ args: ["--enable-features=NetworkServiceInProcess2"], pipe: false },
|
|
2828
2832
|
{ args: ["--single-process", "--no-zygote"], pipe: false }
|
|
@@ -2856,7 +2860,7 @@ async function probeChrome(attempt, android = isAndroid()) {
|
|
|
2856
2860
|
if (!android)
|
|
2857
2861
|
return attempt({ args: [], pipe: false });
|
|
2858
2862
|
const saved = savedCara();
|
|
2859
|
-
|
|
2863
|
+
const errors = [];
|
|
2860
2864
|
for (const cara of [saved, ...ANDROID_FALLBACKS.filter((f) => !sameCara(f, saved))]) {
|
|
2861
2865
|
try {
|
|
2862
2866
|
const r = await attempt({ args: [...cara.args], pipe: cara.pipe });
|
|
@@ -2864,10 +2868,19 @@ async function probeChrome(attempt, android = isAndroid()) {
|
|
|
2864
2868
|
saveCara(cara);
|
|
2865
2869
|
return r;
|
|
2866
2870
|
} catch (e) {
|
|
2867
|
-
|
|
2871
|
+
errors.push(e);
|
|
2868
2872
|
}
|
|
2869
2873
|
}
|
|
2870
|
-
|
|
2874
|
+
const reasons = [...new Set(errors.map((e) => e instanceof Error ? e.message : String(e)))];
|
|
2875
|
+
if (reasons.length === 1)
|
|
2876
|
+
throw errors[0];
|
|
2877
|
+
throw new Error(reasons.slice(0, 4).join(" / "));
|
|
2878
|
+
}
|
|
2879
|
+
function renderHelp(message, { android, miniReady }) {
|
|
2880
|
+
return {
|
|
2881
|
+
renderGalat: message.replace(/\s+/g, " ").trim().slice(0, 240),
|
|
2882
|
+
renderSaran: android && !miniReady ? "hypeframe chromium" : "hypeframe doctor"
|
|
2883
|
+
};
|
|
2871
2884
|
}
|
|
2872
2885
|
function chromeLogHint(log) {
|
|
2873
2886
|
return log.split(`
|
|
@@ -2976,7 +2989,7 @@ async function checkOnce(chrome, gpu, platformArgs, pipe = false) {
|
|
|
2976
2989
|
}
|
|
2977
2990
|
}
|
|
2978
2991
|
|
|
2979
|
-
// src/render/ffmpeg.ts
|
|
2992
|
+
// packages/hypeframe/src/render/ffmpeg.ts
|
|
2980
2993
|
import crypto5 from "node:crypto";
|
|
2981
2994
|
import fs16 from "node:fs";
|
|
2982
2995
|
import fsp from "node:fs/promises";
|
|
@@ -3058,7 +3071,7 @@ async function prepareFfmpeg(cacheDir, progress = () => {
|
|
|
3058
3071
|
return cached2(cacheDir);
|
|
3059
3072
|
}
|
|
3060
3073
|
|
|
3061
|
-
// src/render/job.ts
|
|
3074
|
+
// packages/hypeframe/src/render/job.ts
|
|
3062
3075
|
import { spawn as spawn3 } from "node:child_process";
|
|
3063
3076
|
import crypto6 from "node:crypto";
|
|
3064
3077
|
import fs17 from "node:fs";
|
|
@@ -3215,7 +3228,7 @@ function createJobRunner(o) {
|
|
|
3215
3228
|
return { renderer, route, setPort: (p) => void (port = p) };
|
|
3216
3229
|
}
|
|
3217
3230
|
|
|
3218
|
-
// src/render/page.ts
|
|
3231
|
+
// packages/hypeframe/src/render/page.ts
|
|
3219
3232
|
import fs18 from "node:fs";
|
|
3220
3233
|
import fsp3 from "node:fs/promises";
|
|
3221
3234
|
import path14 from "node:path";
|
|
@@ -3314,7 +3327,7 @@ function createPage({ web, cacheDir }) {
|
|
|
3314
3327
|
};
|
|
3315
3328
|
}
|
|
3316
3329
|
|
|
3317
|
-
// src/render/relay.ts
|
|
3330
|
+
// packages/hypeframe/src/render/relay.ts
|
|
3318
3331
|
import crypto7 from "node:crypto";
|
|
3319
3332
|
var sha = (b) => crypto7.createHash("sha256").update(b).digest("hex");
|
|
3320
3333
|
var sleep2 = (ms) => new Promise((ok) => setTimeout(ok, ms));
|
|
@@ -3431,7 +3444,7 @@ async function runRelayJob(j, o) {
|
|
|
3431
3444
|
}
|
|
3432
3445
|
}
|
|
3433
3446
|
|
|
3434
|
-
// src/render/service.ts
|
|
3447
|
+
// packages/hypeframe/src/render/service.ts
|
|
3435
3448
|
import crypto8 from "node:crypto";
|
|
3436
3449
|
import fs19 from "node:fs";
|
|
3437
3450
|
import fsp4 from "node:fs/promises";
|
|
@@ -3857,7 +3870,7 @@ async function createRenderService(o) {
|
|
|
3857
3870
|
};
|
|
3858
3871
|
}
|
|
3859
3872
|
|
|
3860
|
-
// src/ui/banner.ts
|
|
3873
|
+
// packages/hypeframe/src/ui/banner.ts
|
|
3861
3874
|
function banner() {
|
|
3862
3875
|
const mark = color.brand("◆");
|
|
3863
3876
|
return `
|
|
@@ -3866,7 +3879,7 @@ function banner() {
|
|
|
3866
3879
|
`;
|
|
3867
3880
|
}
|
|
3868
3881
|
|
|
3869
|
-
// src/util/format.ts
|
|
3882
|
+
// packages/hypeframe/src/util/format.ts
|
|
3870
3883
|
function bytes2(n) {
|
|
3871
3884
|
if (!(n > 0))
|
|
3872
3885
|
return "0 B";
|
|
@@ -3903,7 +3916,7 @@ function table(rows, indent = " ") {
|
|
|
3903
3916
|
`);
|
|
3904
3917
|
}
|
|
3905
3918
|
|
|
3906
|
-
// src/util/open.ts
|
|
3919
|
+
// packages/hypeframe/src/util/open.ts
|
|
3907
3920
|
import { spawn as spawn4 } from "node:child_process";
|
|
3908
3921
|
var PAIRING_LINK = new RegExp(`^https?://[A-Za-z0-9.-]+(:\\d+)?/sambung\\?kode=${PAIRING_CODE.source.slice(1, -1)}$`);
|
|
3909
3922
|
var WEB_ORIGIN = /^https?:\/\/[A-Za-z0-9.-]+(:\d+)?\/?$/;
|
|
@@ -3940,7 +3953,7 @@ function openOnPhone(url) {
|
|
|
3940
3953
|
return true;
|
|
3941
3954
|
}
|
|
3942
3955
|
|
|
3943
|
-
// src/cli/commands/start.ts
|
|
3956
|
+
// packages/hypeframe/src/cli/commands/start.ts
|
|
3944
3957
|
var preview = (s) => {
|
|
3945
3958
|
const one = s.replace(/\s+/g, " ").trim();
|
|
3946
3959
|
return one.length > 80 ? `${one.slice(0, 79)}…` : one;
|
|
@@ -4178,13 +4191,33 @@ async function start(args, { fromMenu = false } = {}) {
|
|
|
4178
4191
|
runner = createJobRunner({ chrome, ffmpeg, page, gpu: s.gpu, transparent: info.transparent, note: (m) => log.detail(m) });
|
|
4179
4192
|
runner.setPort(service.port);
|
|
4180
4193
|
Object.assign(capabilities, { render: true, chrome: info.version, transparan: info.transparent });
|
|
4194
|
+
delete capabilities.renderGalat;
|
|
4195
|
+
delete capabilities.renderSaran;
|
|
4181
4196
|
engineConn.setInfo({ kemampuan: capabilities });
|
|
4182
4197
|
engineConn.news("status", { kemampuan: capabilities });
|
|
4183
4198
|
log.ok(t("render.ready", { chrome: info.version, extra: info.transparent ? "" : t("render.noAlpha") }));
|
|
4184
4199
|
} catch (e) {
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4200
|
+
const message = e.message;
|
|
4201
|
+
renderNote = message.slice(0, 120);
|
|
4202
|
+
log.warn(t("render.notYet", { reason: message }));
|
|
4203
|
+
const help = renderHelp(message, { android: isAndroid(), miniReady: linuxChromiumReady() });
|
|
4204
|
+
Object.assign(capabilities, help);
|
|
4205
|
+
engineConn.setInfo({ kemampuan: capabilities });
|
|
4206
|
+
engineConn.news("status", { kemampuan: capabilities });
|
|
4207
|
+
if (help.renderSaran === "hypeframe chromium") {
|
|
4208
|
+
log.info(t("render.tryChromiumMini"));
|
|
4209
|
+
const watch = setInterval(() => {
|
|
4210
|
+
if (!linuxChromiumReady())
|
|
4211
|
+
return;
|
|
4212
|
+
clearInterval(watch);
|
|
4213
|
+
clearTimeout(later);
|
|
4214
|
+
prepareRender();
|
|
4215
|
+
}, 15000);
|
|
4216
|
+
watch.unref();
|
|
4217
|
+
const later = setTimeout(() => (clearInterval(watch), void prepareRender()), 10 * 60000);
|
|
4218
|
+
later.unref();
|
|
4219
|
+
} else
|
|
4220
|
+
setTimeout(prepareRender, 10 * 60000).unref();
|
|
4188
4221
|
}
|
|
4189
4222
|
}
|
|
4190
4223
|
prepareRender();
|
|
@@ -4205,7 +4238,7 @@ async function start(args, { fromMenu = false } = {}) {
|
|
|
4205
4238
|
});
|
|
4206
4239
|
}
|
|
4207
4240
|
|
|
4208
|
-
// src/cli/commands/account.ts
|
|
4241
|
+
// packages/hypeframe/src/cli/commands/account.ts
|
|
4209
4242
|
async function login(args) {
|
|
4210
4243
|
const s = resolveSettings(args.flags);
|
|
4211
4244
|
const a = readAccount();
|
|
@@ -4221,7 +4254,7 @@ function logout() {
|
|
|
4221
4254
|
log.ok(t("logout.done"));
|
|
4222
4255
|
}
|
|
4223
4256
|
|
|
4224
|
-
// src/cli/commands/autostart.ts
|
|
4257
|
+
// packages/hypeframe/src/cli/commands/autostart.ts
|
|
4225
4258
|
import { spawnSync as spawnSync3 } from "node:child_process";
|
|
4226
4259
|
import fs20 from "node:fs";
|
|
4227
4260
|
import os3 from "node:os";
|
|
@@ -4311,7 +4344,7 @@ X-GNOME-Autostart-enabled=true
|
|
|
4311
4344
|
log.detail(file);
|
|
4312
4345
|
}
|
|
4313
4346
|
|
|
4314
|
-
// src/cli/commands/bench.ts
|
|
4347
|
+
// packages/hypeframe/src/cli/commands/bench.ts
|
|
4315
4348
|
import http3 from "node:http";
|
|
4316
4349
|
import puppeteer3 from "puppeteer-core";
|
|
4317
4350
|
var FRAMES = 150;
|
|
@@ -4359,6 +4392,17 @@ async function bench(args) {
|
|
|
4359
4392
|
${color.bold(t("bench.title"))} ${color.muted(`(${s.gpu ? t("bench.gpu") : t("bench.cpu")})`)}
|
|
4360
4393
|
`);
|
|
4361
4394
|
const chrome = await prepareChrome(cacheDir(), (percent, what) => void (percent === 0 ? log.info(`${t("render.downloading")} ${color.muted(what)}`) : percent % 20 === 0 && log.detail(`${what} ${percent}%`)));
|
|
4395
|
+
if (isAndroid()) {
|
|
4396
|
+
try {
|
|
4397
|
+
await checkChrome(chrome, { gpu: s.gpu });
|
|
4398
|
+
} catch (e) {
|
|
4399
|
+
log.error(String(e.message).split(`
|
|
4400
|
+
`)[0].slice(0, 280));
|
|
4401
|
+
if (!linuxChromiumReady())
|
|
4402
|
+
log.detail(t("doctor.tryChromiumMini"));
|
|
4403
|
+
return;
|
|
4404
|
+
}
|
|
4405
|
+
}
|
|
4362
4406
|
const srv = http3.createServer((_q, r) => (r.writeHead(200, { "content-type": "text/html" }), r.end("<!doctype html><title>bench</title>")));
|
|
4363
4407
|
await new Promise((ok) => srv.listen(0, "127.0.0.1", ok));
|
|
4364
4408
|
const b = await puppeteer3.launch({
|
|
@@ -4398,10 +4442,10 @@ async function bench(args) {
|
|
|
4398
4442
|
`);
|
|
4399
4443
|
}
|
|
4400
4444
|
|
|
4401
|
-
// src/cli/commands/agent.ts
|
|
4445
|
+
// packages/hypeframe/src/cli/commands/agent.ts
|
|
4402
4446
|
import * as p from "@clack/prompts";
|
|
4403
4447
|
|
|
4404
|
-
// src/agent/install.ts
|
|
4448
|
+
// packages/hypeframe/src/agent/install.ts
|
|
4405
4449
|
import fs21 from "node:fs";
|
|
4406
4450
|
import fsp5 from "node:fs/promises";
|
|
4407
4451
|
import path17 from "node:path";
|
|
@@ -4638,7 +4682,7 @@ async function installAgent(id, progress = () => {
|
|
|
4638
4682
|
return installed;
|
|
4639
4683
|
}
|
|
4640
4684
|
|
|
4641
|
-
// src/cli/commands/agent.ts
|
|
4685
|
+
// packages/hypeframe/src/cli/commands/agent.ts
|
|
4642
4686
|
var NAMES = { "antigravity-acp": "Antigravity", "codex-acp": "Codex", opencode: "OpenCode" };
|
|
4643
4687
|
var agentName = (id) => NAMES[id] ?? readInstalled().find((a) => a.id === id)?.name ?? id;
|
|
4644
4688
|
var ALIASES = { codex: "codex-acp", antigravity: "antigravity-acp", agy: "antigravity-acp", gemini: "antigravity-acp", opencode: "opencode" };
|
|
@@ -4844,7 +4888,7 @@ async function agentMenu() {
|
|
|
4844
4888
|
}
|
|
4845
4889
|
}
|
|
4846
4890
|
|
|
4847
|
-
// src/cli/commands/config.ts
|
|
4891
|
+
// packages/hypeframe/src/cli/commands/config.ts
|
|
4848
4892
|
import * as p2 from "@clack/prompts";
|
|
4849
4893
|
function print() {
|
|
4850
4894
|
const s = resolveSettings();
|
|
@@ -4910,7 +4954,7 @@ async function config(args) {
|
|
|
4910
4954
|
log.detail(t("config.restart"));
|
|
4911
4955
|
}
|
|
4912
4956
|
|
|
4913
|
-
// src/cli/commands/doctor.ts
|
|
4957
|
+
// packages/hypeframe/src/cli/commands/doctor.ts
|
|
4914
4958
|
import { spawnSync as spawnSync4 } from "node:child_process";
|
|
4915
4959
|
import fs22 from "node:fs";
|
|
4916
4960
|
import path18 from "node:path";
|
|
@@ -4991,7 +5035,7 @@ async function doctor(args) {
|
|
|
4991
5035
|
return checks;
|
|
4992
5036
|
}
|
|
4993
5037
|
|
|
4994
|
-
// src/cli/commands/history.ts
|
|
5038
|
+
// packages/hypeframe/src/cli/commands/history.ts
|
|
4995
5039
|
import fs23 from "node:fs";
|
|
4996
5040
|
import path19 from "node:path";
|
|
4997
5041
|
function readHistory2(hours = 24) {
|
|
@@ -5031,7 +5075,7 @@ function history() {
|
|
|
5031
5075
|
return items;
|
|
5032
5076
|
}
|
|
5033
5077
|
|
|
5034
|
-
// src/cli/commands/maintenance.ts
|
|
5078
|
+
// packages/hypeframe/src/cli/commands/maintenance.ts
|
|
5035
5079
|
import { spawnSync as spawnSync5 } from "node:child_process";
|
|
5036
5080
|
import fs24 from "node:fs";
|
|
5037
5081
|
import os4 from "node:os";
|
|
@@ -5122,7 +5166,7 @@ function openWeb(args) {
|
|
|
5122
5166
|
log.warn(t("pair.badWeb"));
|
|
5123
5167
|
}
|
|
5124
5168
|
|
|
5125
|
-
// src/cli/commands/status.ts
|
|
5169
|
+
// packages/hypeframe/src/cli/commands/status.ts
|
|
5126
5170
|
import fs25 from "node:fs";
|
|
5127
5171
|
import path21 from "node:path";
|
|
5128
5172
|
function statusRows(args) {
|
|
@@ -5147,7 +5191,7 @@ function status(args) {
|
|
|
5147
5191
|
console.log("");
|
|
5148
5192
|
}
|
|
5149
5193
|
|
|
5150
|
-
// src/cli/menu.ts
|
|
5194
|
+
// packages/hypeframe/src/cli/menu.ts
|
|
5151
5195
|
import * as p3 from "@clack/prompts";
|
|
5152
5196
|
function mainChoices(s) {
|
|
5153
5197
|
return [
|
|
@@ -5341,7 +5385,7 @@ async function menu(args) {
|
|
|
5341
5385
|
}
|
|
5342
5386
|
}
|
|
5343
5387
|
|
|
5344
|
-
// src/index.ts
|
|
5388
|
+
// packages/hypeframe/src/index.ts
|
|
5345
5389
|
function help() {
|
|
5346
5390
|
const rows = [
|
|
5347
5391
|
["start", t("help.start")],
|
package/package.json
CHANGED