@wix/himalaya-cli 0.1066.0 → 0.1067.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/dist/cli.mjs CHANGED
@@ -1437,8 +1437,12 @@ function sentinelizeArchive(raw, fallbackName) {
1437
1437
  } catch {
1438
1438
  }
1439
1439
  const name = contentName ?? config.match(/\bname\s*:\s*["']([^"'\n]+)["']/)?.[1] ?? fallbackName;
1440
+ const packageSlug = new RegExp(`\\b(const PACKAGE_SLUG = )"${escapeRe(name)}"`, "g");
1440
1441
  return Object.fromEntries(
1441
- entries.map(([rel, body]) => [rel, sentinelizeIdentity(body, { name: IDENTITY_FILES.has(rel) ? name : void 0, ids })])
1442
+ entries.map(([rel, body]) => [
1443
+ rel,
1444
+ sentinelizeIdentity(body, { name: IDENTITY_FILES.has(rel) ? name : void 0, ids }).replace(packageSlug, '$1"__HIMI_APP_SLUG__"')
1445
+ ])
1442
1446
  );
1443
1447
  }
1444
1448
  function materializeSource(files, name, destDir, slug = name) {
@@ -12446,7 +12450,6 @@ function resolveIdiom(tokens, ctx = {}) {
12446
12450
  var IDIOM_CONTEXTS, UNSAFE_KEYS;
12447
12451
  var init_idiom = __esm({
12448
12452
  "../../core/ts/src/idiom.ts"() {
12449
- "use strict";
12450
12453
  IDIOM_CONTEXTS = {
12451
12454
  ios: { native: ["ios"] },
12452
12455
  android: { native: ["material"] },
@@ -22874,7 +22877,6 @@ function shouldRevealError(args) {
22874
22877
  var EMAIL_RE, URL_HOST_RE, INTEGER_RE, NUMBER_RE;
22875
22878
  var init_validation = __esm({
22876
22879
  "../../core/ts/src/validation.ts"() {
22877
- "use strict";
22878
22880
  EMAIL_RE = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
22879
22881
  URL_HOST_RE = /^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(:[0-9]+)?$/;
22880
22882
  INTEGER_RE = /^[+-]?[0-9]+$/;
@@ -26475,7 +26477,6 @@ function validateWorkerSubtree(raw, slotId, policy, actionCatalog) {
26475
26477
  var WORKER_SUBTREE_CEILINGS, ID_PART, ACTION_ID;
26476
26478
  var init_worker_subtree = __esm({
26477
26479
  "../../core/ts/src/worker-subtree.ts"() {
26478
- "use strict";
26479
26480
  init_worker_subtree_safe_types_generated();
26480
26481
  WORKER_SUBTREE_CEILINGS = Object.freeze({
26481
26482
  maxEncodedBytes: 65536,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1066.0",
3
+ "version": "0.1067.0",
4
4
  "type": "module",
5
5
  "description": "himi — the Himalaya authoring CLI. Build a Tier-5 content package on your own machine, push it to the production serve as a draft, preview it on web + Himi Player, and read worker logs back — the remote dev loop. Wraps @himalaya/serve-cli for transport.",
6
6
  "keywords": [
@@ -65,5 +65,5 @@
65
65
  "artifactId": "himalaya-cli"
66
66
  }
67
67
  },
68
- "falconPackageHash": "20e0465f099842099a9eb46bc0b20993df3071ca402d303dc0e7d66d"
68
+ "falconPackageHash": "0c8d3503f5ca13101d4857f4aea03d5974e1c26ac88f40e350b6d4de"
69
69
  }
@@ -3,8 +3,19 @@
3
3
  // fill __HIMI_ID__ sentinels per request.
4
4
  import config from "../config.js";
5
5
 
6
+ // The chat screen names your app by its display name: config.ts `name`. `himi init` fills
7
+ // that field AND this constant with the package slug, and "Message my-app" is not copy — so
8
+ // while the two are equal the screen uses neutral copy. Give the app a name and it is used.
9
+ const PACKAGE_SLUG = "__HIMI_APP_SLUG__";
10
+ const displayName = ((): string => {
11
+ const name = String(config.name ?? "").trim();
12
+ return name && name !== PACKAGE_SLUG ? name : "";
13
+ })();
14
+
6
15
  const runtimeSetting = (value: unknown): unknown => {
7
16
  if (value === "__HIMI_PODCAST_FEED_URL__") return process.env.PODCAST_FEED_URL?.trim() || "";
17
+ if (value === "__HIMI_MESSAGE_CTA__") return displayName ? `Message ${displayName}` : "Send a message";
18
+ if (value === "__HIMI_CHAT_TITLE__") return displayName || "Chat";
8
19
  if (Array.isArray(value)) return value.map(runtimeSetting);
9
20
  if (!value || typeof value !== "object") return value;
10
21
  return Object.fromEntries(Object.entries(value).map(([key, child]) => [key, runtimeSetting(child)]));
@@ -1129,7 +1140,7 @@ const SCREENS = runtimeSetting({
1129
1140
  "package": "himalaya",
1130
1141
  "type": "Text",
1131
1142
  "props": {
1132
- "text": "__HIMI_APP_NAME__",
1143
+ "text": "__HIMI_CHAT_TITLE__",
1133
1144
  "style": "body",
1134
1145
  "color": "textPrimary",
1135
1146
  "maxLines": 1
@@ -1263,7 +1274,7 @@ const SCREENS = runtimeSetting({
1263
1274
  "kind": "text",
1264
1275
  "text": {
1265
1276
  "value": "$service:chat.input",
1266
- "placeholder": "Message __HIMI_APP_NAME__",
1277
+ "placeholder": "__HIMI_MESSAGE_CTA__",
1267
1278
  "onChange": {
1268
1279
  "actionId": "tier5.chat.setInput"
1269
1280
  },
@@ -118,8 +118,12 @@ interface ChatState {
118
118
 
119
119
  // ── Content ─────────────────────────────────────────────────────────────────
120
120
 
121
+ // Neither string names the app. `himi init` knows only the package slug, not your app's
122
+ // display name, so a named greeting opened every new app on "Hi — I'm my-app." and a
123
+ // named system prompt had the model introduce itself that way. To have the assistant use
124
+ // your app's name, write it into both strings.
121
125
  const GREETING =
122
- "Hi — I'm __HIMI_APP_NAME__. Ask anything, send a photo, or tap the mic for a voice message. " +
126
+ "Hi! Ask anything, send a photo, or tap the mic for a voice message. " +
123
127
  "Cloud LLM by default; flip Private mode in Settings to stay on-device.";
124
128
 
125
129
  const SUGGESTIONS: Chip[] = [
@@ -136,7 +140,7 @@ const SAMPLES: Sample[] = [
136
140
  ];
137
141
 
138
142
  const SYSTEM_PROMPT =
139
- "You are __HIMI_APP_NAME__, a helpful personal assistant. Reply clearly and concisely. " +
143
+ "You are a helpful personal assistant. Reply clearly and concisely. " +
140
144
  "Respond ONLY with JSON matching the schema { reply: string }.";
141
145
 
142
146
  const REPLY_SCHEMA = {