@hypersocial/decks-cli 0.9.17 → 0.9.19
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 +9 -1
- package/package.json +1 -1
- package/skills/hyperdecks/SKILL.md +1 -1
- package/src/avatar-import.mjs +29 -2
- package/src/runtime.mjs +1 -1
package/README.md
CHANGED
|
@@ -117,7 +117,7 @@ avatar import <head.glb> --metadata <file.json> [--thumbnail <png>] [--pack <pac
|
|
|
117
117
|
|
|
118
118
|
### Importing a private avatar head (for tools)
|
|
119
119
|
|
|
120
|
-
`avatar import` puts a baked, owner-private Minimoji head (bake v17–
|
|
120
|
+
`avatar import` puts a baked, owner-private Minimoji head (bake v17–19; mouth anchors from 19,
|
|
121
121
|
`privateFormat: 1`) into the signed-in account, or into one of its own private
|
|
122
122
|
packs that has no grants. Tools such as Minimoji's character creator shell out
|
|
123
123
|
to it rather than reading Hyperdecks credentials.
|
|
@@ -139,6 +139,14 @@ to it rather than reading Hyperdecks credentials.
|
|
|
139
139
|
"reused": false, "visibility": "private", "defaultChanged": false }
|
|
140
140
|
```
|
|
141
141
|
|
|
142
|
+
With a pack, the upload also asks the server to re-check that the pack is
|
|
143
|
+
private and ungranted (`requirePrivate`): a pack shared or published after the
|
|
144
|
+
CLI's own check is refused by the server (`pack_not_private` / `pack_has_grants`,
|
|
145
|
+
exit 1 rather than the CLI's own exit 2 for the same codes before upload, nothing
|
|
146
|
+
stored). A server that cannot run the check, or stores the head without
|
|
147
|
+
confirming it, is `private_not_enforced` (exit 1); in the second case the
|
|
148
|
+
output carries the stored `avatarId`, to remove if the pack is shared.
|
|
149
|
+
|
|
142
150
|
Errors print `{ "ok": false, "error": "…", "code": "account_mismatch" }`. The
|
|
143
151
|
output never holds a token or an avatar URL, and the default presenter is
|
|
144
152
|
never changed.
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: hyperdecks
|
|
3
3
|
description: Use when asked to make, narrate, check or ship a deck ("make me a narrated deck", "turn this into a deck and send it"), or when working with Hypersocial Decks, Hyperdecks CLI, production deck analytics, recipient share links, deck activity, MCP deck tools, or real-world/customer-facing deck checks. Prefer production for real activity and analytics; use development only for local implementation/testing when explicitly requested.
|
|
4
4
|
metadata:
|
|
5
|
-
version: "0.9.
|
|
5
|
+
version: "0.9.19"
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Hyperdecks
|
package/src/avatar-import.mjs
CHANGED
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
// { ok: true, owner: { id, email }, avatarId, packId, sha256, bakeVersion,
|
|
17
17
|
// stockVoice, created, reused, visibility: "private", defaultChanged: false }
|
|
18
18
|
// { ok: false, error, code[, avatarId] } (avatarId: stored, but not confirmed)
|
|
19
|
+
// With a pack, the upload carries requirePrivate: the server refuses a pack
|
|
20
|
+
// that became shared or public (pack_not_private / pack_has_grants, exit 1) and
|
|
21
|
+
// acknowledges the check. An old server that refuses the key (nothing stored)
|
|
22
|
+
// or a stored upload without the acknowledgment (the output carries its
|
|
23
|
+
// avatarId: remove it if the pack is shared) is private_not_enforced (exit 1).
|
|
19
24
|
// The values come from the stored avatar read back after the upload, so a
|
|
20
25
|
// re-import of the same head reports what is stored, not what was sent. No
|
|
21
26
|
// token, avatar URL or view token is ever printed.
|
|
@@ -26,7 +31,11 @@ import { client as defaultClient, routeAuth as defaultRouteAuth } from "./runtim
|
|
|
26
31
|
|
|
27
32
|
export const MAX_BAKE_BYTES = 8 * 1024 * 1024;
|
|
28
33
|
export const MAX_THUMBNAIL_BYTES = 1024 * 1024;
|
|
29
|
-
|
|
34
|
+
// Mirrors convex/lib/avatars/privateBake.ts: bakes 17-19, and mouth anchors
|
|
35
|
+
// (checkMouthExtras there) only from bake 19.
|
|
36
|
+
export const MIN_BAKE_VERSION = 17, MAX_BAKE_VERSION = 19, MOUTH_ANCHOR_MIN_VERSION = 19;
|
|
37
|
+
const MOUTH_EXTRAS = new Set(["mouthAnchor", "mouthRigid", "mouthPivot"]);
|
|
38
|
+
const anchorNumbers = (x, length) => Array.isArray(x) && x.length === length && x.every((n) => typeof n === "number" && Number.isFinite(n) && Math.abs(n) <= 1000);
|
|
30
39
|
const ALLOWED_EXTENSIONS = new Set(["KHR_materials_sheen", "KHR_materials_clearcoat", "KHR_materials_unlit", "KHR_materials_ior", "KHR_materials_specular", "KHR_materials_emissive_strength"]);
|
|
31
40
|
const METADATA_KEYS = ["name", "sha256", "provenance", "limitations", "stockVoice", "packId"];
|
|
32
41
|
const UPLOAD_TIMEOUT_MS = 120_000;
|
|
@@ -106,6 +115,18 @@ export function checkBake(buffer) {
|
|
|
106
115
|
if (!Number.isInteger(meta.v) || meta.v < MIN_BAKE_VERSION || meta.v > MAX_BAKE_VERSION) bad(`unsupported Mini bake version ${meta.v} (expected ${MIN_BAKE_VERSION}-${MAX_BAKE_VERSION})`);
|
|
107
116
|
if (meta.privateFormat !== 1 || meta.character != null || meta.avatar != null) bad("not a private-format head (privateFormat must be 1, with no character or avatar)");
|
|
108
117
|
for (const key of ["u", "H", "W"]) if (typeof meta[key] !== "number" || !Number.isFinite(meta[key]) || meta[key] <= 0) bad(`invalid rig ${key}`);
|
|
118
|
+
// A mouth piece attached to the mouth (a fang, a tusk) carries
|
|
119
|
+
// mouthAnchor: [anchorX, anchorY, deltaRoll], mouthRigid: true and its offset.
|
|
120
|
+
for (const node of nodes) {
|
|
121
|
+
const extras = node?.extras;
|
|
122
|
+
if (!extras || typeof extras !== "object" || Array.isArray(extras)) continue;
|
|
123
|
+
for (const key of Object.keys(extras)) if (/^mouth/i.test(key) && !MOUTH_EXTRAS.has(key)) bad(`unsupported mouth metadata ${key}`);
|
|
124
|
+
if (extras.mouthRigid !== undefined && typeof extras.mouthRigid !== "boolean") bad("invalid mouthRigid");
|
|
125
|
+
if (extras.mouthAnchor === undefined) continue;
|
|
126
|
+
if (meta.v < MOUTH_ANCHOR_MIN_VERSION) bad(`mouth anchors need bake ${MOUTH_ANCHOR_MIN_VERSION}`);
|
|
127
|
+
if (!anchorNumbers(extras.mouthAnchor, 3)) bad("invalid mouth anchor");
|
|
128
|
+
if (extras.mouthRigid !== true || !anchorNumbers(extras.offset, 2)) bad("an anchored mouth piece needs mouthRigid and an offset");
|
|
129
|
+
}
|
|
109
130
|
return { bakeVersion: meta.v, sha256: createHash("sha256").update(buffer).digest("hex") };
|
|
110
131
|
}
|
|
111
132
|
|
|
@@ -135,7 +156,9 @@ export function buildMetadata(raw, { sha256, pack }) {
|
|
|
135
156
|
if (pack && m.packId !== undefined && m.packId !== pack) refuse("pack_conflict", `--pack ${pack} conflicts with metadata packId ${m.packId}`);
|
|
136
157
|
const packId = pack ?? m.packId;
|
|
137
158
|
if (packId !== undefined && !/^[a-z0-9]{16,64}$/.test(packId)) refuse("bad_usage", "invalid --pack id");
|
|
138
|
-
|
|
159
|
+
// Into a pack, the server re-checks private + ungranted in the same write
|
|
160
|
+
// (requirePrivate), so a pack shared after checkPack below is still refused.
|
|
161
|
+
const out = { name: m.name, sha256, provenance: m.provenance, limitations: m.limitations ?? [], ...(m.stockVoice ? { stockVoice: m.stockVoice } : {}), ...(packId ? { packId, requirePrivate: true } : {}) };
|
|
139
162
|
if (JSON.stringify(out).length > 8192) bad("metadata is too large");
|
|
140
163
|
return out;
|
|
141
164
|
}
|
|
@@ -215,9 +238,13 @@ export async function avatarImport(file, opts = {}, { client = defaultClient, ro
|
|
|
215
238
|
if (res.status === 401) failed("auth_failed", `the server did not accept the sign-in: ${message}`);
|
|
216
239
|
if (res.status === 403) failed("avatars_disabled", message);
|
|
217
240
|
if (res.status >= 500) failed("server_error", `the server failed (HTTP ${res.status}); ${RERUN}`);
|
|
241
|
+
if (body?.code === "pack_not_private" || body?.code === "pack_has_grants") failed(body.code, `the server refused the pack: ${message.replace(/^pack_\w+:\s*/, "")}; nothing was stored`);
|
|
242
|
+
// A server older than requirePrivate refuses the key: fail closed, and say why.
|
|
243
|
+
if (metadata.requirePrivate && /unsupported metadata field/.test(message)) failed("private_not_enforced", `this server cannot enforce a private pack (${message}); nothing was stored`);
|
|
218
244
|
failed("upload_rejected", `the server refused the head: ${message}`);
|
|
219
245
|
}
|
|
220
246
|
if (typeof body?.id !== "string" || typeof body.created !== "boolean") failed("stored_unverified", `the server accepted the upload (HTTP ${res.status}) but its reply could not be read; ${RERUN}`);
|
|
247
|
+
if (metadata.requirePrivate && body.requirePrivate !== true) failed("private_not_enforced", `stored as ${body.id}, but the server did not confirm pack ${metadata.packId} was private and ungranted; check the pack and remove the avatar if it is shared`, body.id);
|
|
221
248
|
|
|
222
249
|
// 5. Read back what is stored: on a dedup, the stored digest and voice win.
|
|
223
250
|
let after;
|
package/src/runtime.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import { ConvexHttpClient } from "convex/browser";
|
|
|
9
9
|
import { makeFunctionReference } from "convex/server";
|
|
10
10
|
import { recordSkillInstall } from "./skillFreshness.mjs";
|
|
11
11
|
|
|
12
|
-
export const VERSION = "0.9.
|
|
12
|
+
export const VERSION = "0.9.19";
|
|
13
13
|
|
|
14
14
|
// Sent on the CLI's calls to our routes and to Convex, so the server can see
|
|
15
15
|
// which CLI versions are still out there (not used to refuse anything).
|