@hanzo/studio 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +29 -0
- package/NOTICE +68 -0
- package/lib/chat/store.d.ts +33 -0
- package/lib/chat/store.js +56 -0
- package/lib/chat/turn.d.ts +51 -0
- package/lib/chat/turn.js +274 -0
- package/lib/desk.d.ts +14 -0
- package/lib/desk.js +72 -0
- package/lib/gpu.d.ts +15 -0
- package/lib/gpu.js +41 -0
- package/lib/home.d.ts +6 -0
- package/lib/home.js +48 -0
- package/lib/host.d.ts +12 -0
- package/lib/host.js +18 -0
- package/lib/index.d.ts +12 -0
- package/lib/index.js +11 -0
- package/lib/kinds/ad.d.ts +51 -0
- package/lib/kinds/ad.js +124 -0
- package/lib/kinds/document.d.ts +6 -0
- package/lib/kinds/document.js +271 -0
- package/lib/kinds/image.d.ts +47 -0
- package/lib/kinds/image.js +179 -0
- package/lib/kinds/index.d.ts +9 -0
- package/lib/kinds/index.js +12 -0
- package/lib/kinds/kind.d.ts +113 -0
- package/lib/kinds/kind.js +13 -0
- package/lib/kinds/mesh/index.d.ts +2 -0
- package/lib/kinds/mesh/index.js +76 -0
- package/lib/kinds/mesh/viewer.d.ts +7 -0
- package/lib/kinds/mesh/viewer.js +79 -0
- package/lib/kinds/poster/compose.d.ts +40 -0
- package/lib/kinds/poster/compose.js +289 -0
- package/lib/kinds/poster/index.d.ts +21 -0
- package/lib/kinds/poster/index.js +210 -0
- package/lib/kinds/sound.d.ts +6 -0
- package/lib/kinds/sound.js +100 -0
- package/lib/kinds/type/fonts.d.ts +30 -0
- package/lib/kinds/type/fonts.js +111 -0
- package/lib/kinds/type/index.d.ts +5 -0
- package/lib/kinds/type/index.js +117 -0
- package/lib/kinds/type/system.d.ts +164 -0
- package/lib/kinds/type/system.js +302 -0
- package/lib/kinds/video.d.ts +2 -0
- package/lib/kinds/video.js +81 -0
- package/lib/live.d.ts +44 -0
- package/lib/live.js +128 -0
- package/lib/made.d.ts +75 -0
- package/lib/made.js +36 -0
- package/lib/nav.d.ts +17 -0
- package/lib/nav.js +29 -0
- package/lib/pdf.d.ts +16 -0
- package/lib/pdf.js +53 -0
- package/lib/places.d.ts +6 -0
- package/lib/places.js +121 -0
- package/lib/raster.d.ts +7 -0
- package/lib/raster.js +53 -0
- package/lib/route.d.ts +33 -0
- package/lib/route.js +52 -0
- package/lib/starters.d.ts +31 -0
- package/lib/starters.js +62 -0
- package/lib/studio.d.ts +26 -0
- package/lib/studio.js +58 -0
- package/lib/talk.d.ts +3 -0
- package/lib/talk.js +369 -0
- package/lib/ui.d.ts +50 -0
- package/lib/ui.js +57 -0
- package/lib/use.d.ts +11 -0
- package/lib/use.js +35 -0
- package/lib/wire.d.ts +237 -0
- package/lib/wire.js +455 -0
- package/lib/zip.d.ts +9 -0
- package/lib/zip.js +60 -0
- package/package.json +75 -3
- package/README.md +0 -3
package/lib/zip.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A ZIP of files, stored (no compression): what an ad set downloads as. PNGs
|
|
3
|
+
* are compressed already, so storing them costs nothing and keeps the writer
|
|
4
|
+
* to the format's two records and a CRC.
|
|
5
|
+
*/
|
|
6
|
+
export declare function zip(files: readonly {
|
|
7
|
+
name: string;
|
|
8
|
+
blob: Blob;
|
|
9
|
+
}[]): Promise<Blob>;
|
package/lib/zip.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A ZIP of files, stored (no compression): what an ad set downloads as. PNGs
|
|
3
|
+
* are compressed already, so storing them costs nothing and keeps the writer
|
|
4
|
+
* to the format's two records and a CRC.
|
|
5
|
+
*/
|
|
6
|
+
const TABLE = (() => {
|
|
7
|
+
const t = new Uint32Array(256);
|
|
8
|
+
for (let n = 0; n < 256; n++) {
|
|
9
|
+
let c = n;
|
|
10
|
+
for (let k = 0; k < 8; k++)
|
|
11
|
+
c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;
|
|
12
|
+
t[n] = c >>> 0;
|
|
13
|
+
}
|
|
14
|
+
return t;
|
|
15
|
+
})();
|
|
16
|
+
function crc32(b) {
|
|
17
|
+
let c = 0xffffffff;
|
|
18
|
+
for (let i = 0; i < b.length; i++)
|
|
19
|
+
c = TABLE[(c ^ b[i]) & 0xff] ^ (c >>> 8);
|
|
20
|
+
return (c ^ 0xffffffff) >>> 0;
|
|
21
|
+
}
|
|
22
|
+
export async function zip(files) {
|
|
23
|
+
const enc = new TextEncoder();
|
|
24
|
+
const out = [];
|
|
25
|
+
const central = [];
|
|
26
|
+
let offset = 0;
|
|
27
|
+
for (const f of files) {
|
|
28
|
+
const name = enc.encode(f.name);
|
|
29
|
+
const data = new Uint8Array(await f.blob.arrayBuffer());
|
|
30
|
+
const crc = crc32(data);
|
|
31
|
+
const local = new DataView(new ArrayBuffer(30));
|
|
32
|
+
local.setUint32(0, 0x04034b50, true);
|
|
33
|
+
local.setUint16(4, 20, true);
|
|
34
|
+
local.setUint16(8, 0, true);
|
|
35
|
+
local.setUint32(14, crc, true);
|
|
36
|
+
local.setUint32(18, data.length, true);
|
|
37
|
+
local.setUint32(22, data.length, true);
|
|
38
|
+
local.setUint16(26, name.length, true);
|
|
39
|
+
out.push(new Uint8Array(local.buffer), name, data);
|
|
40
|
+
const dir = new DataView(new ArrayBuffer(46));
|
|
41
|
+
dir.setUint32(0, 0x02014b50, true);
|
|
42
|
+
dir.setUint16(4, 20, true);
|
|
43
|
+
dir.setUint16(6, 20, true);
|
|
44
|
+
dir.setUint32(16, crc, true);
|
|
45
|
+
dir.setUint32(20, data.length, true);
|
|
46
|
+
dir.setUint32(24, data.length, true);
|
|
47
|
+
dir.setUint16(28, name.length, true);
|
|
48
|
+
dir.setUint32(42, offset, true);
|
|
49
|
+
central.push(new Uint8Array(dir.buffer), name);
|
|
50
|
+
offset += 30 + name.length + data.length;
|
|
51
|
+
}
|
|
52
|
+
const size = central.reduce((n, b) => n + b.length, 0);
|
|
53
|
+
const end = new DataView(new ArrayBuffer(22));
|
|
54
|
+
end.setUint32(0, 0x06054b50, true);
|
|
55
|
+
end.setUint16(8, files.length, true);
|
|
56
|
+
end.setUint16(10, files.length, true);
|
|
57
|
+
end.setUint32(12, size, true);
|
|
58
|
+
end.setUint32(16, offset, true);
|
|
59
|
+
return new Blob([...out, ...central, new Uint8Array(end.buffer)], { type: 'application/zip' });
|
|
60
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,78 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/studio",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "BSD-3-Clause",
|
|
6
|
+
"description": "Hanzo Studio: a chat that makes images, posters, documents, slides, type systems, 3D, video and sound, with every result open in a tab beside it. Mounted by the Hanzo app at hanzo.ai/studio and served whole at studio.hanzo.ai.",
|
|
7
|
+
"homepage": "https://studio.hanzo.ai",
|
|
8
|
+
"engines": {
|
|
9
|
+
"node": ">=22.18"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"three": "0.186.1"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@axe-core/playwright": "4.14.0",
|
|
16
|
+
"@hanzo/build": "0.2.56",
|
|
17
|
+
"@hanzo/composer": "0.2.0",
|
|
18
|
+
"@hanzo/font": "1.9.3",
|
|
19
|
+
"@hanzo/gui": "8.3.5",
|
|
20
|
+
"@hanzo/ui": "8.27.91",
|
|
21
|
+
"@hanzo/vite": "0.1.4",
|
|
22
|
+
"@hanzo/voice": "0.1.18",
|
|
23
|
+
"@hanzogui/lucide-icons-2": "8.3.5",
|
|
24
|
+
"@hanzogui/next-theme": "8.3.5",
|
|
25
|
+
"@playwright/test": "1.63.0",
|
|
26
|
+
"@types/node": "26.5.0",
|
|
27
|
+
"@types/react": "19.2.18",
|
|
28
|
+
"@types/react-dom": "19.2.7",
|
|
29
|
+
"@types/three": "0.186.0",
|
|
30
|
+
"@vitejs/plugin-react": "^6.1.1",
|
|
31
|
+
"next-themes": "^0.4.6",
|
|
32
|
+
"react": "19.2.8",
|
|
33
|
+
"react-dom": "19.2.8",
|
|
34
|
+
"react-native-web": "^0.21.2",
|
|
35
|
+
"typescript": "7.0.2",
|
|
36
|
+
"vite": "^8.2.2",
|
|
37
|
+
"vitest": "^4.1.11"
|
|
38
|
+
},
|
|
39
|
+
"exports": {
|
|
40
|
+
".": {
|
|
41
|
+
"types": "./lib/index.d.ts",
|
|
42
|
+
"import": "./lib/index.js",
|
|
43
|
+
"default": "./lib/index.js"
|
|
44
|
+
},
|
|
45
|
+
"./package.json": "./package.json"
|
|
46
|
+
},
|
|
47
|
+
"files": [
|
|
48
|
+
"lib",
|
|
49
|
+
"LICENSE",
|
|
50
|
+
"NOTICE"
|
|
51
|
+
],
|
|
52
|
+
"sideEffects": false,
|
|
53
|
+
"publishConfig": {
|
|
54
|
+
"access": "public"
|
|
55
|
+
},
|
|
56
|
+
"repository": {
|
|
57
|
+
"type": "git",
|
|
58
|
+
"url": "git+https://github.com/hanzoai/studio.git"
|
|
59
|
+
},
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"@hanzo/build": ">=0.2.56",
|
|
62
|
+
"@hanzo/composer": ">=0.2.0",
|
|
63
|
+
"@hanzo/gui": ">=8.3.5",
|
|
64
|
+
"@hanzo/ui": ">=8.27.77",
|
|
65
|
+
"@hanzo/voice": ">=0.1.16",
|
|
66
|
+
"@hanzogui/lucide-icons-2": ">=8.3.5",
|
|
67
|
+
"react": ">=19.2.8"
|
|
68
|
+
},
|
|
69
|
+
"scripts": {
|
|
70
|
+
"dev": "vite",
|
|
71
|
+
"build": "tsc --noEmit && vite build",
|
|
72
|
+
"build:lib": "rm -rf lib && tsc -p tsconfig.lib.json",
|
|
73
|
+
"typecheck": "tsc --noEmit",
|
|
74
|
+
"preview": "vite preview",
|
|
75
|
+
"test": "vitest run",
|
|
76
|
+
"e2e": "playwright test"
|
|
77
|
+
}
|
|
6
78
|
}
|
package/README.md
DELETED