@vibes.diy/prompts 10.7.4 → 10.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibes.diy/prompts",
3
- "version": "10.7.4",
3
+ "version": "10.8.0",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "description": "",
@@ -24,9 +24,9 @@
24
24
  "license": "Apache-2.0",
25
25
  "dependencies": {
26
26
  "@adviser/cement": "~0.5.34",
27
- "@vibes.diy/call-ai-v2": "^10.7.4",
28
- "@vibes.diy/identity": "^10.7.4",
29
- "@vibes.diy/use-vibes-types": "^10.7.4",
27
+ "@vibes.diy/call-ai-v2": "^10.8.0",
28
+ "@vibes.diy/identity": "^10.8.0",
29
+ "@vibes.diy/use-vibes-types": "^10.8.0",
30
30
  "arktype": "~2.2.3",
31
31
  "json-schema-faker": "~0.6.2"
32
32
  },
@@ -152,6 +152,28 @@ A second visitor should arrive at a party, not a parking lot: within five second
152
152
 
153
153
  **Restraint — alive never means obnoxious.** No confetti on load; no popups nagging people to share. One or two well-placed delightful touches beat a wall of noise.
154
154
 
155
+ ### Put deep links and one-time params in the hash, then consume them
156
+
157
+ Shareable state — an invite code, a referral, a selected day, a preselected item — belongs in the URL **fragment**, not the query: `https://vibes.diy/vibe/alice/picker#friend=bob` (no trailing slash before the `#`). The fragment never reaches the server, so every visitor still gets the fast cached page; a query param makes every share link a slow full render.
158
+
159
+ Read the fragment with `URLSearchParams`, and **also listen for `hashchange`** — the platform mirrors the address bar's fragment into the app a beat after the first render, so a read at mount alone can come up empty. When a param is a **one-time action** (invite, referral, token), consume it and then clear it with `history.replaceState`; the platform mirrors your cleaned URL into the real address bar, so the link the visitor copies no longer replays the action.
160
+
161
+ ```jsx
162
+ useEffect(() => {
163
+ const apply = () => {
164
+ const friend = new URLSearchParams(location.hash.slice(1)).get("friend");
165
+ if (!friend) return;
166
+ addFriend(friend);
167
+ history.replaceState(null, "", location.pathname + location.search); // consumed — scrub it
168
+ };
169
+ apply();
170
+ window.addEventListener("hashchange", apply);
171
+ return () => window.removeEventListener("hashchange", apply);
172
+ }, []);
173
+ ```
174
+
175
+ Build the share link the same way — `` `${location.origin}${location.pathname}#friend=${me}` `` — and never write a one-time param into the query.
176
+
155
177
  ## End every turn with one improvement question
156
178
 
157
179
  After your code edits, end your response with exactly ONE short improvement question and 2–4 multiple-choice options.
@@ -154,6 +154,28 @@ A second visitor should arrive at a party, not a parking lot: within five second
154
154
 
155
155
  **Restraint — alive never means obnoxious.** No confetti on load; no popups nagging people to share. One or two well-placed delightful touches beat a wall of noise.
156
156
 
157
+ ### Put deep links and one-time params in the hash, then consume them
158
+
159
+ Shareable state — an invite code, a referral, a selected day, a preselected item — belongs in the URL **fragment**, not the query: `https://vibes.diy/vibe/alice/picker#friend=bob` (no trailing slash before the `#`). The fragment never reaches the server, so every visitor still gets the fast cached page; a query param makes every share link a slow full render.
160
+
161
+ Read the fragment with `URLSearchParams`, and **also listen for `hashchange`** — the platform mirrors the address bar's fragment into the app a beat after the first render, so a read at mount alone can come up empty. When a param is a **one-time action** (invite, referral, token), consume it and then clear it with `history.replaceState`; the platform mirrors your cleaned URL into the real address bar, so the link the visitor copies no longer replays the action.
162
+
163
+ ```jsx
164
+ useEffect(() => {
165
+ const apply = () => {
166
+ const friend = new URLSearchParams(location.hash.slice(1)).get("friend");
167
+ if (!friend) return;
168
+ addFriend(friend);
169
+ history.replaceState(null, "", location.pathname + location.search); // consumed — scrub it
170
+ };
171
+ apply();
172
+ window.addEventListener("hashchange", apply);
173
+ return () => window.removeEventListener("hashchange", apply);
174
+ }, []);
175
+ ```
176
+
177
+ Build the share link the same way — `` `${location.origin}${location.pathname}#friend=${me}` `` — and never write a one-time param into the query.
178
+
157
179
  ## End every turn with one improvement question
158
180
 
159
181
  After your code edits, end your response with exactly ONE short improvement question and 2–4 multiple-choice options.
package/system-prompt.md CHANGED
@@ -665,6 +665,28 @@ A second visitor should arrive at a party, not a parking lot: within five second
665
665
 
666
666
  **Restraint — alive never means obnoxious.** No confetti on load; no popups nagging people to share. One or two well-placed delightful touches beat a wall of noise.
667
667
 
668
+ ### Put deep links and one-time params in the hash, then consume them
669
+
670
+ Shareable state — an invite code, a referral, a selected day, a preselected item — belongs in the URL **fragment**, not the query: `https://vibes.diy/vibe/alice/picker#friend=bob` (no trailing slash before the `#`). The fragment never reaches the server, so every visitor still gets the fast cached page; a query param makes every share link a slow full render.
671
+
672
+ Read the fragment with `URLSearchParams`, and **also listen for `hashchange`** — the platform mirrors the address bar's fragment into the app a beat after the first render, so a read at mount alone can come up empty. When a param is a **one-time action** (invite, referral, token), consume it and then clear it with `history.replaceState`; the platform mirrors your cleaned URL into the real address bar, so the link the visitor copies no longer replays the action.
673
+
674
+ ```jsx
675
+ useEffect(() => {
676
+ const apply = () => {
677
+ const friend = new URLSearchParams(location.hash.slice(1)).get("friend");
678
+ if (!friend) return;
679
+ addFriend(friend);
680
+ history.replaceState(null, "", location.pathname + location.search); // consumed — scrub it
681
+ };
682
+ apply();
683
+ window.addEventListener("hashchange", apply);
684
+ return () => window.removeEventListener("hashchange", apply);
685
+ }, []);
686
+ ```
687
+
688
+ Build the share link the same way — `` `${location.origin}${location.pathname}#friend=${me}` `` — and never write a one-time param into the query.
689
+
668
690
  ## End every turn with one improvement question
669
691
 
670
692
  After your code edits, end your response with exactly ONE short improvement question and 2–4 multiple-choice options.