@my-life-buddies/cli 0.9.0 → 0.11.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.
Files changed (34) hide show
  1. package/README.md +19 -14
  2. package/dist/bin/buddy.js +9 -0
  3. package/dist/bin/buddy.js.map +3 -3
  4. package/dist/bin/core.js +745 -801
  5. package/dist/bin/core.js.map +4 -4
  6. package/dist/bin/preview.js +12 -6
  7. package/dist/bin/preview.js.map +2 -2
  8. package/dist/web/app.css +3 -7
  9. package/dist/web/app.js +14 -1
  10. package/dist/web/index.html +1 -8
  11. package/dist/web/widgets.js +1 -1
  12. package/package.json +3 -3
  13. package/resources/dada-object-avatar/SKILL.md +37 -0
  14. package/resources/dada-object-avatar/agents/openai.yaml +4 -0
  15. package/resources/dada-object-avatar/assets/examples/cat.png +0 -0
  16. package/resources/dada-object-avatar/assets/examples/cooking.png +0 -0
  17. package/resources/dada-object-avatar/assets/examples/divination.png +0 -0
  18. package/resources/dada-object-avatar/assets/examples/doctor.png +0 -0
  19. package/resources/dada-object-avatar/assets/examples/relationship.png +0 -0
  20. package/resources/dada-object-avatar/assets/examples/work.png +0 -0
  21. package/resources/dada-object-avatar/assets/preview.png +0 -0
  22. package/resources/dada-object-avatar/references/evaluation-rubric.md +22 -0
  23. package/resources/dada-object-avatar/references/examples.json +8 -0
  24. package/resources/dada-object-avatar/references/prompt-template.md +27 -0
  25. package/resources/dada-object-avatar/references/style-system.md +54 -0
  26. package/resources/dada-object-avatar/references/subject-design.md +23 -0
  27. package/resources/dada-object-avatar/references/training-guide.md +14 -0
  28. package/resources/dada-object-avatar/references/training-log.jsonl +0 -0
  29. package/resources/dada-object-avatar/references/training-record.schema.json +20 -0
  30. package/resources/dada-object-avatar/scripts/choose_gaze.py +36 -0
  31. package/resources/dada-object-avatar/scripts/record_example.py +22 -0
  32. package/resources/dada-object-avatar/scripts/validate_png.py +52 -0
  33. package/resources/dada-object-avatar.manifest.json +85 -0
  34. package/dist/web/widget-delivery.js +0 -28
@@ -594,7 +594,6 @@ var PreviewController = class {
594
594
  };
595
595
 
596
596
  // apps/preview/src/server.ts
597
- import { checkWidgetDelivery } from "./core.js";
598
597
  import { randomBytes, timingSafeEqual } from "node:crypto";
599
598
  import { readFileSync } from "node:fs";
600
599
  import { createServer } from "node:http";
@@ -624,7 +623,6 @@ var WEB_ASSETS = Object.freeze(/* @__PURE__ */ new Map([
624
623
  contentType: "text/css; charset=utf-8",
625
624
  body: readFileSync(new URL("../web/brand.css", import.meta.url))
626
625
  }],
627
- ["/assets/widget-delivery.js", { contentType: "text/javascript; charset=utf-8", body: readFileSync(new URL("../web/widget-delivery.js", import.meta.url)) }],
628
626
  ["/assets/widgets.js", { contentType: "text/javascript; charset=utf-8", body: readFileSync(new URL("../web/widgets.js", import.meta.url)) }],
629
627
  ["/assets/widgets.css", { contentType: "text/css; charset=utf-8", body: readFileSync(new URL("../web/widgets.css", import.meta.url)) }],
630
628
  ["/assets/app.js", {
@@ -814,9 +812,6 @@ data: ${JSON.stringify(value)}
814
812
  const asset = WEB_ASSETS.get(url.pathname);
815
813
  if (asset) return staticAsset(response, asset);
816
814
  }
817
- if (request.method === "GET" && url.pathname === "/api/widgets/delivery") {
818
- return json(response, 200, await checkWidgetDelivery(options.controller.projectRoot));
819
- }
820
815
  if (request.method === "GET" && url.pathname === "/api/project") {
821
816
  try {
822
817
  return json(response, 200, { project: publicProject(await options.controller.project()) });
@@ -1376,7 +1371,18 @@ var MlbSimulatorClient = class {
1376
1371
  const signal = AbortSignal.any([AbortSignal.timeout(3e4), ...options.signal ? [options.signal] : []]);
1377
1372
  const details = parsePreviewBuddyDetails(await this.#request("GET", `/app/buddies/${encodeURIComponent(this.#buddyId)}`, { signal }), this.#buddyId);
1378
1373
  this.#privateId = details.privateId ?? void 0;
1379
- return details;
1374
+ if (!details.avatar) return details;
1375
+ let avatarPreview = null;
1376
+ try {
1377
+ const url = new URL(details.avatar, this.#baseUrl);
1378
+ if (url.origin !== this.#baseUrl.origin || url.username || url.password || !url.pathname.startsWith("/media/")) throw new Error("Unsupported avatar URL");
1379
+ const image = await this.#widgetResource(url.href, false);
1380
+ const contentType = image.contentType.split(";", 1)[0].trim().toLowerCase();
1381
+ if (!["image/png", "image/jpeg", "image/webp"].includes(contentType)) throw new Error("Unsupported avatar type");
1382
+ avatarPreview = `data:${contentType};base64,${Buffer.from(image.body).toString("base64")}`;
1383
+ } catch {
1384
+ }
1385
+ return Object.freeze({ ...details, avatarPreview });
1380
1386
  }
1381
1387
  async widgets() {
1382
1388
  this.#assertResetComplete();