@hypersocial/decks-cli 0.9.17 → 0.9.18

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 CHANGED
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hypersocial/decks-cli",
3
- "version": "0.9.17",
3
+ "version": "0.9.18",
4
4
  "description": "Command-line client for Hypersocial Decks live analytics and share management.",
5
5
  "type": "module",
6
6
  "main": "./src/commands.mjs",
@@ -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.17"
5
+ version: "0.9.18"
6
6
  ---
7
7
 
8
8
  # Hyperdecks
@@ -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.
@@ -135,7 +140,9 @@ export function buildMetadata(raw, { sha256, pack }) {
135
140
  if (pack && m.packId !== undefined && m.packId !== pack) refuse("pack_conflict", `--pack ${pack} conflicts with metadata packId ${m.packId}`);
136
141
  const packId = pack ?? m.packId;
137
142
  if (packId !== undefined && !/^[a-z0-9]{16,64}$/.test(packId)) refuse("bad_usage", "invalid --pack id");
138
- const out = { name: m.name, sha256, provenance: m.provenance, limitations: m.limitations ?? [], ...(m.stockVoice ? { stockVoice: m.stockVoice } : {}), ...(packId ? { packId } : {}) };
143
+ // Into a pack, the server re-checks private + ungranted in the same write
144
+ // (requirePrivate), so a pack shared after checkPack below is still refused.
145
+ const out = { name: m.name, sha256, provenance: m.provenance, limitations: m.limitations ?? [], ...(m.stockVoice ? { stockVoice: m.stockVoice } : {}), ...(packId ? { packId, requirePrivate: true } : {}) };
139
146
  if (JSON.stringify(out).length > 8192) bad("metadata is too large");
140
147
  return out;
141
148
  }
@@ -215,9 +222,13 @@ export async function avatarImport(file, opts = {}, { client = defaultClient, ro
215
222
  if (res.status === 401) failed("auth_failed", `the server did not accept the sign-in: ${message}`);
216
223
  if (res.status === 403) failed("avatars_disabled", message);
217
224
  if (res.status >= 500) failed("server_error", `the server failed (HTTP ${res.status}); ${RERUN}`);
225
+ 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`);
226
+ // A server older than requirePrivate refuses the key: fail closed, and say why.
227
+ if (metadata.requirePrivate && /unsupported metadata field/.test(message)) failed("private_not_enforced", `this server cannot enforce a private pack (${message}); nothing was stored`);
218
228
  failed("upload_rejected", `the server refused the head: ${message}`);
219
229
  }
220
230
  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}`);
231
+ 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
232
 
222
233
  // 5. Read back what is stored: on a dedup, the stored digest and voice win.
223
234
  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.17";
12
+ export const VERSION = "0.9.18";
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).