@vibes.diy/prompts 14.3.250 → 14.3.252
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/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/llms/bluesky.js +2 -0
- package/llms/bluesky.js.map +1 -1
- package/llms/index.d.ts +5 -2
- package/llms/index.js +9 -0
- package/llms/index.js.map +1 -1
- package/llms/owner-secret.d.ts +2 -0
- package/llms/owner-secret.js +8 -0
- package/llms/owner-secret.js.map +1 -0
- package/llms/owner-secret.md +82 -0
- package/llms/reskin.md +8 -6
- package/llms/spotify.js +11 -1
- package/llms/spotify.js.map +1 -1
- package/llms/spotify.md +54 -50
- package/llms/third-party-embed.d.ts +2 -0
- package/llms/third-party-embed.js +8 -0
- package/llms/third-party-embed.js.map +1 -0
- package/llms/third-party-embed.md +110 -0
- package/llms/types.d.ts +9 -0
- package/llms/ui-weather.js +1 -1
- package/llms/ui-weather.js.map +1 -1
- package/llms/ui-weather.md +1 -2
- package/llms/weather.d.ts +2 -0
- package/llms/weather.js +12 -0
- package/llms/weather.js.map +1 -0
- package/llms/weather.md +248 -0
- package/llms/youtube.js +10 -1
- package/llms/youtube.js.map +1 -1
- package/llms/youtube.md +67 -53
- package/package.json +5 -5
package/index.d.ts
CHANGED
|
@@ -11,4 +11,4 @@ export * from "./themes/looks/index.js";
|
|
|
11
11
|
export { parseContent } from "./segment-parser.js";
|
|
12
12
|
export { normalizeComponentExports, transformImports, coreImportMap } from "./component-transforms.js";
|
|
13
13
|
export { buildSchemaSystemMessage, schemaSystemMessageText } from "./build-schema-prompt.js";
|
|
14
|
-
export { allConfigs, canonicalSkillName, cueMatches, cueMatchedSkills, expandSkills, onSkillMenu, skillGraphProblems, universalSkillNames, SKILL_ALIASES, SKILL_SPLITS, SKILL_CATALOG_EPOCH, storedSkillNames, type CueCatalogEntry, type NeedsCatalogEntry, } from "./llms/index.js";
|
|
14
|
+
export { allConfigs, canonicalSkillName, cueMatches, cueMatchedSkills, expandSkills, onSkillMenu, skillGraphProblems, universalSkillNames, SKILL_ALIASES, SKILL_SPLITS, SKILL_CATALOG_EPOCH, storedSkillNames, type CueCatalogEntry, type NeedsCatalogEntry, type SkillCredential, type SkillEgress, } from "./llms/index.js";
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../jsr/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAEvG,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAI7F,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../jsr/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAEvG,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAI7F,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,GAKjB,MAAM,iBAAiB,CAAC"}
|
package/llms/bluesky.js
CHANGED
|
@@ -11,5 +11,7 @@ export const blueskyConfig = {
|
|
|
11
11
|
"bluesky profile",
|
|
12
12
|
"bluesky feed",
|
|
13
13
|
],
|
|
14
|
+
credential: "none",
|
|
15
|
+
egress: [{ url: "https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=bsky.app", via: "cors", checked: "2026-11-02" }],
|
|
14
16
|
};
|
|
15
17
|
//# sourceMappingURL=bluesky.js.map
|
package/llms/bluesky.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bluesky.js","sourceRoot":"","sources":["../../jsr/llms/bluesky.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,aAAa,GAAc;IACtC,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EACT,6VAA6V;IAC/V,IAAI,EAAE;QACJ,SAAS;QACT,MAAM;QACN,aAAa;QACb,SAAS;QACT,sBAAsB;QACtB,iBAAiB;QACjB,cAAc;KACf;
|
|
1
|
+
{"version":3,"file":"bluesky.js","sourceRoot":"","sources":["../../jsr/llms/bluesky.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,aAAa,GAAc;IACtC,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EACT,6VAA6V;IAC/V,IAAI,EAAE;QACJ,SAAS;QACT,MAAM;QACN,aAAa;QACb,SAAS;QACT,sBAAsB;QACtB,iBAAiB;QACjB,cAAc;KACf;IACD,UAAU,EAAE,MAAM;IAClB,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,2EAA2E,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;CACnI,CAAC"}
|
package/llms/index.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ export { backendConfig } from "./backend.js";
|
|
|
3
3
|
export { calendarConfig } from "./calendar.js";
|
|
4
4
|
export { boardGamesConfig } from "./board-games.js";
|
|
5
5
|
export { surfaceBoardConfig } from "./surface-board.js";
|
|
6
|
+
export { ownerSecretConfig } from "./owner-secret.js";
|
|
7
|
+
export { thirdPartyEmbedConfig } from "./third-party-embed.js";
|
|
8
|
+
export { weatherConfig } from "./weather.js";
|
|
6
9
|
export { keepsakeConfig } from "./keepsake.js";
|
|
7
10
|
export { callaiConfig } from "./callai.js";
|
|
8
11
|
export { fireproofConfig } from "./fireproof.js";
|
|
@@ -72,10 +75,10 @@ export { uiQuizConfig } from "./ui-quiz.js";
|
|
|
72
75
|
export { uiLandingConfig } from "./ui-landing.js";
|
|
73
76
|
export { uiCalendarConfig } from "./ui-calendar.js";
|
|
74
77
|
export { uiTestimonialsConfig } from "./ui-testimonials.js";
|
|
75
|
-
export type { LlmConfig } from "./types.js";
|
|
78
|
+
export type { LlmConfig, SkillCredential, SkillEgress } from "./types.js";
|
|
76
79
|
export { cueMatches, cueMatchedSkills, type CueCatalogEntry } from "./cues.js";
|
|
77
80
|
export { expandSkills, onSkillMenu, skillGraphProblems, universalSkillNames, type NeedsCatalogEntry } from "./needs.js";
|
|
78
|
-
export declare const allConfigs: readonly [LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig];
|
|
81
|
+
export declare const allConfigs: readonly [LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig, LlmConfig];
|
|
79
82
|
export { mapsConfig } from "./maps.js";
|
|
80
83
|
export declare const SKILL_ALIASES: ReadonlyMap<string, string>;
|
|
81
84
|
export declare function canonicalSkillName(name: string): string;
|
package/llms/index.js
CHANGED
|
@@ -3,6 +3,9 @@ import { mapsConfig } from "./maps.js";
|
|
|
3
3
|
import { calendarConfig } from "./calendar.js";
|
|
4
4
|
import { boardGamesConfig } from "./board-games.js";
|
|
5
5
|
import { surfaceBoardConfig } from "./surface-board.js";
|
|
6
|
+
import { ownerSecretConfig } from "./owner-secret.js";
|
|
7
|
+
import { thirdPartyEmbedConfig } from "./third-party-embed.js";
|
|
8
|
+
import { weatherConfig } from "./weather.js";
|
|
6
9
|
import { keepsakeConfig } from "./keepsake.js";
|
|
7
10
|
import { callaiConfig } from "./callai.js";
|
|
8
11
|
import { fireproofConfig } from "./fireproof.js";
|
|
@@ -76,6 +79,9 @@ export { backendConfig } from "./backend.js";
|
|
|
76
79
|
export { calendarConfig } from "./calendar.js";
|
|
77
80
|
export { boardGamesConfig } from "./board-games.js";
|
|
78
81
|
export { surfaceBoardConfig } from "./surface-board.js";
|
|
82
|
+
export { ownerSecretConfig } from "./owner-secret.js";
|
|
83
|
+
export { thirdPartyEmbedConfig } from "./third-party-embed.js";
|
|
84
|
+
export { weatherConfig } from "./weather.js";
|
|
79
85
|
export { keepsakeConfig } from "./keepsake.js";
|
|
80
86
|
export { callaiConfig } from "./callai.js";
|
|
81
87
|
export { fireproofConfig } from "./fireproof.js";
|
|
@@ -180,9 +186,12 @@ export const allConfigs = [
|
|
|
180
186
|
connectionsConfig,
|
|
181
187
|
socialPostConfig,
|
|
182
188
|
githubConfig,
|
|
189
|
+
ownerSecretConfig,
|
|
190
|
+
thirdPartyEmbedConfig,
|
|
183
191
|
youtubeConfig,
|
|
184
192
|
blueskyConfig,
|
|
185
193
|
spotifyConfig,
|
|
194
|
+
weatherConfig,
|
|
186
195
|
stripeConfig,
|
|
187
196
|
stripeSubscriptionsConfig,
|
|
188
197
|
blocklyConfig,
|
package/llms/index.js.map
CHANGED
|
@@ -1 +1 @@
|
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,CAAC;QAChH,KAAK,MAAM,CAAC,IAAI,IAAI;YAAE,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,KAAK;gBAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const ownerSecretConfig = {
|
|
2
|
+
name: "owner-secret",
|
|
3
|
+
label: "The owner's own key",
|
|
4
|
+
description: "Hidden: the owner's own key for a third-party service as one Setup item (missing-key verdict, Settings → Secrets steps, no redeploy), kept to backend.js, the /_api second door that spends it only on the owner's calls, refusals that keep their reason, and rotation",
|
|
5
|
+
menu: false,
|
|
6
|
+
teaches: ["missing-key"],
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=owner-secret.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"owner-secret.js","sourceRoot":"","sources":["../../jsr/llms/owner-secret.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,MAAM,iBAAiB,GAAc;IAC1C,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EACT,yQAAyQ;IAC3Q,IAAI,EAAE,KAAK;IACX,OAAO,EAAE,CAAC,aAAa,CAAC;CACzB,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# The owner's own key — one secret the app runs on
|
|
2
|
+
|
|
3
|
+
Some services answer only with a key, and the key belongs to the app's owner:
|
|
4
|
+
they create it on the service's site once, paste it into the vibe's Secrets,
|
|
5
|
+
and backend.js reads it as `ctx.secrets.<NAME>`. The service skill that loaded
|
|
6
|
+
this page names the secret and the provider pages; this page is what every
|
|
7
|
+
owner-key feature does the same way.
|
|
8
|
+
|
|
9
|
+
## The owner's key, not each visitor's
|
|
10
|
+
|
|
11
|
+
The key is the owner's, its quota or bill is the owner's, and every visitor sees
|
|
12
|
+
what the owner's key can see. An app where each person sees **their own**
|
|
13
|
+
account is a **connection** instead: the platform runs the sign-in and holds the
|
|
14
|
+
credential, and the app's code never sees a token (the connections docs). So
|
|
15
|
+
never ask a visitor to paste a token or send one to a developer console: the
|
|
16
|
+
console trip in the service's steps is the owner's, once.
|
|
17
|
+
|
|
18
|
+
## The secret is a Setup item
|
|
19
|
+
|
|
20
|
+
The key is one item on the app's Setup surface (the use-vibe docs' *Some apps
|
|
21
|
+
need setup before they work*). The `/setup` route marks it done when
|
|
22
|
+
`ctx.secrets.<NAME>` is present, and every feature route answers
|
|
23
|
+
`{ ok: false, reason: "missing-key" }` while it is absent, so the page can say
|
|
24
|
+
*not open yet* to a visitor and show the owner the steps.
|
|
25
|
+
|
|
26
|
+
The item's steps are written for someone who has never opened the provider's
|
|
27
|
+
console: each one links the exact page and uses that page's own words, and the
|
|
28
|
+
last two are always the same:
|
|
29
|
+
|
|
30
|
+
- Open this vibe's **Settings** tab,
|
|
31
|
+
`https://vibes.diy/vibes/mine/<ownerHandle>/<appSlug>/settings`, and under
|
|
32
|
+
**Secrets** enter the name (`YOUTUBE_API_KEY`, in so many words), paste the
|
|
33
|
+
value, and save. From a terminal: `npx vibes-diy secrets set <NAME> --vibe <ownerHandle>/<appSlug>`.
|
|
34
|
+
- Come back to the app: it works the moment the key is saved, with no redeploy.
|
|
35
|
+
|
|
36
|
+
Wherever the owner types the value (this tab, the terminal, or a secure field
|
|
37
|
+
the vibes.diy assistant opens for them), it lands in the same store under the
|
|
38
|
+
same name, so the app's copy only has to name it. The app never asks for the key
|
|
39
|
+
itself: no input, no form, no "paste your key here" field on any page, because a
|
|
40
|
+
value typed into the app is a value the app's own data and every visitor's
|
|
41
|
+
browser can reach.
|
|
42
|
+
|
|
43
|
+
## The key never reaches the browser
|
|
44
|
+
|
|
45
|
+
Every call to the service is made in backend.js with `ctx.fetch`, and the key
|
|
46
|
+
rides only that request. App.jsx talks to the app's own `/_api/...` routes and
|
|
47
|
+
never names the service's API host. A key in a React component ships to every
|
|
48
|
+
visitor who views source.
|
|
49
|
+
|
|
50
|
+
## The `/_api` routes are a second door
|
|
51
|
+
|
|
52
|
+
A published vibe's `/_api/...` routes answer anyone, so a route that calls the
|
|
53
|
+
service on every request lets a stranger spend the owner's quota or bill. Spend
|
|
54
|
+
the key on the owner's own calls and on the backend's scheduled jobs; a
|
|
55
|
+
visitor's request is answered from what those calls stored, with the date it was
|
|
56
|
+
read, or with a stated reason when nothing is stored yet.
|
|
57
|
+
|
|
58
|
+
```js
|
|
59
|
+
// backend.js — who may spend the owner's key
|
|
60
|
+
const isOwnerCall = (ctx) => ctx.userInfo?.userHandle != null && ctx.userInfo.userHandle === ctx.appInfo.ownerHandle;
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
A service that charges per call (voice, images, video) needs this most: a
|
|
64
|
+
visitor-facing route that generates with the owner's key is a wallet with a
|
|
65
|
+
public URL. Let visitors use it only behind a limit the owner sets, kept in a
|
|
66
|
+
document the backend checks before each call.
|
|
67
|
+
|
|
68
|
+
## Errors keep their reason
|
|
69
|
+
|
|
70
|
+
Classify every refusal and pass the reason to the screen: the key is missing,
|
|
71
|
+
the key is wrong (the service's 401 or 403, which also means the Setup item
|
|
72
|
+
reads *Done* while one value is bad), the quota or rate limit is spent (keep the
|
|
73
|
+
service's own wait or reset time), or the item was not found. Wrap every route in
|
|
74
|
+
`try`/`catch` and answer with that reason, because an uncaught throw reaches the
|
|
75
|
+
page as a bare `500` that names nothing the owner can fix.
|
|
76
|
+
|
|
77
|
+
## Rotating the key
|
|
78
|
+
|
|
79
|
+
The owner rotates a key by saving a new value under the same name, and handlers
|
|
80
|
+
read the current value on every call, so there is nothing to restart. When a key
|
|
81
|
+
leaks (pasted into a chat, committed somewhere), the fix is a fresh key from the
|
|
82
|
+
provider and the old one revoked there.
|
package/llms/reskin.md
CHANGED
|
@@ -30,11 +30,13 @@ so the wrapper's values are the ones every component reads.
|
|
|
30
30
|
The tokens: `--bg --surface --ink --text-secondary --purple --on-accent
|
|
31
31
|
--orange --info --up --down --idle --warn` (colour), `--r-card --r-control
|
|
32
32
|
--r-pill` (corners), `--lip --lip-row` (the cushion's edge), `--font-family`,
|
|
33
|
-
`--s1` … `--s7` (spacing),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
skin
|
|
33
|
+
`--s1` … `--s7` (spacing), `--ui-paper` (the disc behind a status icon), and
|
|
34
|
+
the composite surfaces `--ui-card --ui-row --ui-row-hover --ui-control
|
|
35
|
+
--ui-control-active --ui-field --ui-field-focus --ui-blob` (a row's hover lift
|
|
36
|
+
is `--ui-row-hover`, an icon tile is `--ui-blob`). A composite is resolved where
|
|
37
|
+
it is declared, so a skin that changes the shadows or the edge re-declares every
|
|
38
|
+
one of those composites on the wrapper too (`none` for a flat skin):
|
|
39
|
+
a composite the skin leaves out keeps the look's own shadow or glow.
|
|
38
40
|
|
|
39
41
|
**2. The look's parts are styled through their hook classes, from the wrapper.**
|
|
40
42
|
Every component carries a stable class: `.ui-h1 .ui-h2 .ui-h3 .ui-card
|
|
@@ -102,7 +104,7 @@ const SKIN = `
|
|
|
102
104
|
--purple: #000000; --on-accent: #ffffff;
|
|
103
105
|
--r-card: 0px; --r-control: 0px; --r-pill: 0px; --lip: 0px; --lip-row: 0px;
|
|
104
106
|
--font-family: 'Space Grotesk', system-ui, sans-serif;
|
|
105
|
-
--ui-card: none; --ui-row: none; --ui-control: none; --ui-control-active: none;
|
|
107
|
+
--ui-card: none; --ui-row: none; --ui-row-hover: none; --ui-control: none; --ui-control-active: none; --ui-blob: none;
|
|
106
108
|
--ui-field: inset 0 0 0 1px #000000; --ui-field-focus: inset 0 0 0 2px #000000;
|
|
107
109
|
min-height: 100vh; background: var(--bg); color: var(--ink); font-family: var(--font-family);
|
|
108
110
|
}
|
package/llms/spotify.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const spotifyConfig = {
|
|
2
2
|
name: "spotify",
|
|
3
3
|
label: "Spotify catalog",
|
|
4
|
-
description: "
|
|
4
|
+
description: "Spotify on a page: playing tracks, albums, playlists and an artist's top tracks in Spotify's own player, which needs no credentials and no setup; and reading Spotify's public catalog (search, albums, tracks) with the owner's own Spotify app credentials: the setup steps the app shows when SPOTIFY_CLIENT_ID/SPOTIFY_CLIENT_SECRET are missing, the client-credentials token minted in backend.js and cached in memory rather than stored, searching artists/albums/tracks, the boundary that a listener's own top tracks and playlists need a connection instead, and keeping every refusal's reason",
|
|
5
5
|
cues: [
|
|
6
6
|
"spotify",
|
|
7
7
|
"spotify search",
|
|
@@ -10,6 +10,16 @@ export const spotifyConfig = {
|
|
|
10
10
|
"artist lookup",
|
|
11
11
|
"music catalog",
|
|
12
12
|
"audio features",
|
|
13
|
+
"spotify playlist",
|
|
14
|
+
"spotify embed",
|
|
15
|
+
],
|
|
16
|
+
needs: ["owner-secret", "third-party-embed"],
|
|
17
|
+
credential: "owner-secret",
|
|
18
|
+
egress: [
|
|
19
|
+
{ url: "https://accounts.spotify.com/api/token", method: "POST", via: "cors", checked: "2026-11-02" },
|
|
20
|
+
{ url: "https://api.spotify.com/v1/search?q=x&type=artist", via: "cors", checked: "2026-11-02" },
|
|
21
|
+
{ url: "https://open.spotify.com/embed/track/4uLU6hMCjMI75M1A2tKUQC", via: "frame" },
|
|
22
|
+
{ url: "https://open.spotify.com/oembed?url=https://open.spotify.com/track/4uLU6hMCjMI75M1A2tKUQC", via: "cors", checked: "2026-11-02" },
|
|
13
23
|
],
|
|
14
24
|
};
|
|
15
25
|
//# sourceMappingURL=spotify.js.map
|
package/llms/spotify.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spotify.js","sourceRoot":"","sources":["../../jsr/llms/spotify.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,aAAa,GAAc;IACtC,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,iBAAiB;IACxB,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"spotify.js","sourceRoot":"","sources":["../../jsr/llms/spotify.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,aAAa,GAAc;IACtC,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,iBAAiB;IACxB,WAAW,EACT,6kBAA6kB;IAC/kB,IAAI,EAAE;QACJ,SAAS;QACT,gBAAgB;QAChB,WAAW;QACX,cAAc;QACd,eAAe;QACf,eAAe;QACf,gBAAgB;QAChB,kBAAkB;QAClB,eAAe;KAChB;IAED,KAAK,EAAE,CAAC,cAAc,EAAE,mBAAmB,CAAC;IAC5C,UAAU,EAAE,cAAc;IAC1B,MAAM,EAAE;QACN,EAAE,GAAG,EAAE,wCAAwC,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE;QACrG,EAAE,GAAG,EAAE,mDAAmD,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE;QAChG,EAAE,GAAG,EAAE,6DAA6D,EAAE,GAAG,EAAE,OAAO,EAAE;QACpF,EAAE,GAAG,EAAE,2FAA2F,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE;KACzI;CACF,CAAC"}
|
package/llms/spotify.md
CHANGED
|
@@ -1,23 +1,48 @@
|
|
|
1
|
-
# Spotify
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
an
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
# Spotify — play tracks with no credentials, search the catalog with the owner's app
|
|
2
|
+
|
|
3
|
+
Two different asks share the name. **Playing** a track, an album, a playlist or
|
|
4
|
+
an artist's top tracks inside the page needs no credentials, no backend and no
|
|
5
|
+
setup: it is Spotify's own player in a frame, and section 0 is all of it.
|
|
6
|
+
**Searching** the catalog (look up an artist, list an album's tracks, chart a
|
|
7
|
+
playlist's tempo) is the **Spotify Web API** on app credentials the owner
|
|
8
|
+
supplies, a `backend.js` feature, and sections 1–6 are the recipe that keeps the
|
|
9
|
+
credentials safe and the token short-lived and unstored. Build the first for
|
|
10
|
+
"our band's songs", "a playlist on my page"; build the second only when the
|
|
11
|
+
page has to search or read catalog data.
|
|
12
|
+
|
|
13
|
+
## 0. Play a track: no credentials at all
|
|
14
|
+
|
|
15
|
+
A pasted Spotify link becomes a player on `open.spotify.com/embed/…`. Parse the
|
|
16
|
+
link into a type and an id and build the `src`; the frame itself is the shared
|
|
17
|
+
`EmbedFrame`, with the fixed height Spotify's player is drawn for.
|
|
18
|
+
|
|
19
|
+
```jsx
|
|
20
|
+
// A share link or spotify: URI → { src, height }, or null when it is not a playable Spotify item.
|
|
21
|
+
function spotifyEmbedSrc(link) {
|
|
22
|
+
const m = link.trim().match(/^(?:https:\/\/open\.spotify\.com\/(?:intl-[a-z-]+\/)?|spotify:)(track|album|playlist|artist|episode|show)[/:]([A-Za-z0-9]{22})/);
|
|
23
|
+
if (!m) return null;
|
|
24
|
+
const [, type, id] = m;
|
|
25
|
+
const compact = type === "track" || type === "episode";
|
|
26
|
+
return { src: `https://open.spotify.com/embed/${type}/${id}`, height: compact ? 152 : 352 };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// The player, once the link has parsed:
|
|
30
|
+
// const player = spotifyEmbedSrc(song.link);
|
|
31
|
+
// <EmbedFrame src={player.src} height={player.height} title={song.title} />
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
- The title and cover come from Spotify's keyless oEmbed endpoint,
|
|
35
|
+
`https://open.spotify.com/oembed`, read once when the link is added.
|
|
36
|
+
- A listener who is not signed in to Spotify in that browser may hear only a
|
|
37
|
+
preview of each track, so say "Previews play here; the full song is on
|
|
38
|
+
Spotify" beside the player, with "Listen on Spotify" linking the original.
|
|
39
|
+
- None of this touches the Web API, so none of the credential sections below
|
|
40
|
+
apply to a page that only plays music.
|
|
41
|
+
|
|
42
|
+
**The catalog half runs on the owner's app:** the credentials and rate limit are
|
|
43
|
+
the owner's, and every visitor sees the same public catalog. A visitor's own
|
|
44
|
+
top tracks and playlists are a connection, never a pasted token (the owner-key
|
|
45
|
+
rules below).
|
|
21
46
|
|
|
22
47
|
## 1. The setup item: the owner's Spotify app credentials
|
|
23
48
|
|
|
@@ -35,36 +60,21 @@ one is a link to the exact page and uses the words that page uses:
|
|
|
35
60
|
flow never uses one — and save.
|
|
36
61
|
2. Open the app you made and press **Settings**. Copy the **Client ID**, then
|
|
37
62
|
press **View client secret** and copy that too.
|
|
38
|
-
3.
|
|
39
|
-
`
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
`npx vibes-diy secrets set SPOTIFY_CLIENT_ID --vibe <ownerHandle>/<appSlug>`
|
|
44
|
-
and the same for `SPOTIFY_CLIENT_SECRET`.
|
|
45
|
-
4. Come back to the app. Search works the moment both are saved; no redeploy.
|
|
46
|
-
|
|
47
|
-
Those steps are the item's copy on the Setup surface, with the vibe's real
|
|
48
|
-
handle and slug filled in from the `ownerHandle` and `appSlug` the `/setup`
|
|
49
|
-
route hands over. Two secrets means two ways to be half-configured: one item,
|
|
63
|
+
3. Save both under **Secrets** on this vibe's Settings tab as
|
|
64
|
+
`SPOTIFY_CLIENT_ID` and `SPOTIFY_CLIENT_SECRET`, then come back: the
|
|
65
|
+
owner-key steps every item ends with.
|
|
66
|
+
|
|
67
|
+
Two secrets means two ways to be half-configured: one item,
|
|
50
68
|
done only when both are present, so one set and one unset reads as *To do*
|
|
51
69
|
rather than as a broken API. In the consumer flow, a search whose pair is not
|
|
52
|
-
set reads *Search is not open yet
|
|
53
|
-
steps are, and later it is where a rotated secret goes.
|
|
54
|
-
|
|
55
|
-
Only the owner can set or rotate a secret, and handlers see the current value on
|
|
56
|
-
every invocation — so the page starts working the moment the pair lands, with no
|
|
57
|
-
redeploy.
|
|
70
|
+
set reads *Search is not open yet*.
|
|
58
71
|
|
|
59
72
|
## 2. The credentials never reach the browser
|
|
60
73
|
|
|
61
74
|
Every Spotify request is made in backend.js with ctx.fetch and the two ctx.secrets values; App.jsx never calls api.spotify.com or accounts.spotify.com.
|
|
62
75
|
|
|
63
|
-
|
|
64
|
-
the
|
|
65
|
-
secret pasted into a React component ships to every visitor who views source, and
|
|
66
|
-
anyone who reads it can mint tokens against the owner's app until it is rotated.
|
|
67
|
-
The client id alone is no better: it is half of the pair and it names the owner's
|
|
76
|
+
Anyone who reads a client secret can mint tokens against the owner's app until it
|
|
77
|
+
is rotated, and the client id alone is no better: it is half of the pair and it names the owner's
|
|
68
78
|
app to anyone collecting them.
|
|
69
79
|
|
|
70
80
|
## 3. Mint a token, hold it in memory, never write it down
|
|
@@ -157,13 +167,7 @@ pass the reason through:
|
|
|
157
167
|
- `404` — no such artist, album or track. Keep the id on screen.
|
|
158
168
|
- anything else — show the API's own `error.message`.
|
|
159
169
|
|
|
160
|
-
|
|
161
|
-
nothing they can act on, and the five cases above each have a different fix.
|
|
162
|
-
|
|
163
|
-
Every `_api` route wraps its handler in `try`/`catch` and answers with a stated
|
|
164
|
-
reason, because an uncaught throw reaches the app as a bare `500 backend.js threw`
|
|
165
|
-
naming only the error class, and the app can show the person what to fix only
|
|
166
|
-
when the route names it.
|
|
170
|
+
The five cases above each have a different fix, so each keeps its own words.
|
|
167
171
|
|
|
168
172
|
## Complete backend.js
|
|
169
173
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const thirdPartyEmbedConfig = {
|
|
2
|
+
name: "third-party-embed",
|
|
3
|
+
label: "Third-party embeds",
|
|
4
|
+
description: "Hidden: another site's player inside the page — store the pasted link and build the iframe src from its parsed id, one EmbedFrame with title, lazy loading and the allow tokens the vibe's frame delegates, a link out under every player, a press-to-load card for long lists, and keyless oEmbed titles and thumbnails",
|
|
5
|
+
menu: false,
|
|
6
|
+
teaches: ["oEmbed"],
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=third-party-embed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"third-party-embed.js","sourceRoot":"","sources":["../../jsr/llms/third-party-embed.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,qBAAqB,GAAc;IAC9C,IAAI,EAAE,mBAAmB;IACzB,KAAK,EAAE,oBAAoB;IAC3B,WAAW,EACT,0TAA0T;IAC5T,IAAI,EAAE,KAAK;IACX,OAAO,EAAE,CAAC,QAAQ,CAAC;CACpB,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Third-party embeds — another site's player inside the page
|
|
2
|
+
|
|
3
|
+
A video, a track, a playlist from another site plays inside the app through that
|
|
4
|
+
site's own player: an `<iframe>` whose `src` is the service's embed page. No key,
|
|
5
|
+
no backend, and no fetch from your code. The service skill that loaded this page
|
|
6
|
+
says how its links turn into an embed `src`; this page is how every embed
|
|
7
|
+
behaves once you have one.
|
|
8
|
+
|
|
9
|
+
## Keep the link, build the frame
|
|
10
|
+
|
|
11
|
+
What a person pastes is a share link, and the link is what the app stores. The
|
|
12
|
+
service skill's parser turns it into an embed `src` at render time, and anything
|
|
13
|
+
that does not parse is refused with the input kept on screen ("That isn't a
|
|
14
|
+
YouTube link — paste the address from the Share button"), never saved.
|
|
15
|
+
|
|
16
|
+
Build the `src` from the parsed id only, and never render pasted embed HTML
|
|
17
|
+
(`dangerouslySetInnerHTML` with an `<iframe …>` someone copied): pasted markup
|
|
18
|
+
is someone else's HTML running in this page, and an id cannot carry a script.
|
|
19
|
+
|
|
20
|
+
## One frame component
|
|
21
|
+
|
|
22
|
+
Every embed renders through one component that owns the frame's attributes,
|
|
23
|
+
so a list of ten players carries the same rules ten times without ten copies.
|
|
24
|
+
|
|
25
|
+
```jsx
|
|
26
|
+
// A video keeps its shape as the column narrows; an audio player has the fixed
|
|
27
|
+
// height its service names, so pass `height` for those.
|
|
28
|
+
const ALLOW = "autoplay; encrypted-media; fullscreen; clipboard-write";
|
|
29
|
+
function EmbedFrame({ src, title, height }) {
|
|
30
|
+
if (height) {
|
|
31
|
+
return (
|
|
32
|
+
<iframe src={src} title={title} height={height} width="100%" loading="lazy" allow={ALLOW}
|
|
33
|
+
referrerPolicy="strict-origin-when-cross-origin" className="block border-0" />
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
return (
|
|
37
|
+
<iframe src={src} title={title} loading="lazy" allow={ALLOW}
|
|
38
|
+
referrerPolicy="strict-origin-when-cross-origin" className="block w-full aspect-video border-0" />
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
- **`title` is required.** It is what a screen reader announces for the frame:
|
|
44
|
+
the video's or track's name, never "embed" or "player".
|
|
45
|
+
- **`loading="lazy"`** keeps players below the fold from loading until they
|
|
46
|
+
scroll near.
|
|
47
|
+
- **`allow` asks only for what the app's own frame was given.** A vibe runs
|
|
48
|
+
inside a frame of its own, and a frame nested in it can be granted only what
|
|
49
|
+
that outer frame delegates: `autoplay`, `encrypted-media` (full-length
|
|
50
|
+
streams), `fullscreen` and `clipboard-write` are delegated. Picture-in-picture
|
|
51
|
+
is not, so asking for it does nothing.
|
|
52
|
+
- **The referrer stays on.** Players check where they are embedded, and some
|
|
53
|
+
refuse to play with no referrer at all, so never set
|
|
54
|
+
`referrerPolicy="no-referrer"` on a player.
|
|
55
|
+
- **Nothing autoplays with sound.** Browsers block it until the person presses
|
|
56
|
+
something, and a page that starts talking is a page people close. The
|
|
57
|
+
player's own play button is the gesture.
|
|
58
|
+
|
|
59
|
+
## A link out under every player
|
|
60
|
+
|
|
61
|
+
The player's insides are another origin: your code cannot read whether it
|
|
62
|
+
loaded, and a refusal (embedding turned off by the uploader, a region lock, an
|
|
63
|
+
age gate) shows only inside the frame. So every player has a plain link to the
|
|
64
|
+
same item on its own site beneath it ("Open on YouTube", "Listen on Spotify"),
|
|
65
|
+
which is also the way to the full experience.
|
|
66
|
+
|
|
67
|
+
## Many players: show a card, load the frame on press
|
|
68
|
+
|
|
69
|
+
A page of twenty embeds loads twenty players. Show each item as a card with its
|
|
70
|
+
thumbnail and title, and swap in the `EmbedFrame` when the person presses play,
|
|
71
|
+
so only the one they chose loads. The frame then needs the press to start, so
|
|
72
|
+
the service's embed parameter for "start on load" is fine there, and only there.
|
|
73
|
+
Pass the service's fixed player height through (Spotify's 152 or 352), so the
|
|
74
|
+
opened frame keeps the shape its service draws in.
|
|
75
|
+
|
|
76
|
+
```jsx
|
|
77
|
+
function PlayerFacade({ item, src, height }) {
|
|
78
|
+
const [open, setOpen] = useState(false);
|
|
79
|
+
if (open) return <EmbedFrame src={src} title={item.title} height={height} />;
|
|
80
|
+
return (
|
|
81
|
+
<div>
|
|
82
|
+
{item.thumbnail && <img src={item.thumbnail} alt="" className="block w-full" />}
|
|
83
|
+
<Button type="button" onClick={() => setOpen(true)}>Play {item.title}</Button>
|
|
84
|
+
</div>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## A title and thumbnail without a key: oEmbed
|
|
90
|
+
|
|
91
|
+
Most players publish an oEmbed endpoint: a keyless GET that answers a share
|
|
92
|
+
link with its `title`, `author_name` and `thumbnail_url`. The service skill
|
|
93
|
+
names its endpoint. Read it once, when the person adds the item (in the add
|
|
94
|
+
handler, never during render), and store the answer on the record with the link,
|
|
95
|
+
so the list renders from the app's own data. When the call fails in any way (an
|
|
96
|
+
error status, no network, an answer that is not JSON), save the link anyway with
|
|
97
|
+
the link itself as its title: the player still plays.
|
|
98
|
+
|
|
99
|
+
```jsx
|
|
100
|
+
async function fetchOEmbed(endpoint, link) {
|
|
101
|
+
try {
|
|
102
|
+
const r = await fetch(`${endpoint}?url=${encodeURIComponent(link)}&format=json`);
|
|
103
|
+
if (!r.ok) return { title: link };
|
|
104
|
+
const o = await r.json();
|
|
105
|
+
return { title: o.title ?? link, author: o.author_name ?? null, thumbnail: o.thumbnail_url ?? null };
|
|
106
|
+
} catch {
|
|
107
|
+
return { title: link };
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
```
|
package/llms/types.d.ts
CHANGED
|
@@ -11,7 +11,16 @@ export interface LlmConfig {
|
|
|
11
11
|
menu?: false;
|
|
12
12
|
rail?: "reskin" | "custom";
|
|
13
13
|
universal?: "always" | "edits";
|
|
14
|
+
credential?: SkillCredential;
|
|
15
|
+
egress?: readonly SkillEgress[];
|
|
14
16
|
importModule?: string;
|
|
15
17
|
importName?: string;
|
|
16
18
|
importType?: "named" | "namespace" | "default";
|
|
17
19
|
}
|
|
20
|
+
export type SkillCredential = "none" | "owner-secret" | "owner-connect" | "visitor-connection" | "platform";
|
|
21
|
+
export interface SkillEgress {
|
|
22
|
+
readonly url: string;
|
|
23
|
+
readonly method?: "GET" | "POST";
|
|
24
|
+
readonly via: "platform" | "cors" | "frame";
|
|
25
|
+
readonly checked?: string;
|
|
26
|
+
}
|
package/llms/ui-weather.js
CHANGED
|
@@ -2,6 +2,6 @@ export const uiWeatherConfig = {
|
|
|
2
2
|
name: "ui-weather",
|
|
3
3
|
aliases: ["pouf-weather"],
|
|
4
4
|
label: "Weather block",
|
|
5
|
-
description:
|
|
5
|
+
description: 'Weather card with city and unit pickers, hourly strip and forecast, drawn on sample figures; name "weather" beside it for live forecasts',
|
|
6
6
|
};
|
|
7
7
|
//# sourceMappingURL=ui-weather.js.map
|
package/llms/ui-weather.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-weather.js","sourceRoot":"","sources":["../../jsr/llms/ui-weather.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,eAAe,GAAc;IACxC,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,CAAC,cAAc,CAAC;IACzB,KAAK,EAAE,eAAe;
|
|
1
|
+
{"version":3,"file":"ui-weather.js","sourceRoot":"","sources":["../../jsr/llms/ui-weather.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,eAAe,GAAc;IACxC,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,CAAC,cAAc,CAAC;IACzB,KAAK,EAAE,eAAe;IAGtB,WAAW,EACT,0IAA0I;CAC7I,CAAC"}
|
package/llms/ui-weather.md
CHANGED
|
@@ -177,8 +177,7 @@ export default function App() {
|
|
|
177
177
|
|
|
178
178
|
## Adapting
|
|
179
179
|
|
|
180
|
-
- Real forecasts
|
|
181
|
-
- Never fetch a forecast from render or a React effect, and never put an API key in `App.jsx`. Prefer a keyless public forecast feed: a plain `GET` with no credentials reaches any https host. A keyed call (an `Authorization` header, a key read from the backend's secrets) is admitted only when the forecast host is CORS-open or on the platform's curated list, so check the host before choosing a keyed API.
|
|
180
|
+
- Real forecasts are the `weather` skill's: Open-Meteo answers with no key, and its days fill the `PLACES` shape here (`condition` from the code's words, `windKmh` from the default km/h), so the `Sample forecast` badge goes. Never put an API key in `App.jsx`.
|
|
182
181
|
- Change the places, not the shape: each one keeps a list of days with `hi` and `lo` in °C, `humidity` in percent, `windKmh`, `uv`, an `icon` from the built-in set (`sun`, `cloud`, `rain`, `wind`) and a `condition` in plain words. Store one unit and convert at render, as `deg` and `speed` do.
|
|
183
182
|
- To remember a person's places or units between visits, keep one small preference document per signed-in person and gate its write on `useVibe(dbName).can`, as the settings block does; a visitor who has not signed in keeps the page defaults.
|
|
184
183
|
- Keep the selected day as the view's one lead. A button added to the card (say, `Add a place`) becomes the lead instead, and the selected row then shows its choice with an `info` `Badge` rather than `selected`.
|
package/llms/weather.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const weatherConfig = {
|
|
2
|
+
name: "weather",
|
|
3
|
+
label: "Weather forecasts",
|
|
4
|
+
description: "Live weather for any app that shows weather (a dashboard, a trip planner, a garden or event page), with no key and no setup, from Open-Meteo: a place name to coordinates, current conditions, an hourly strip and a daily forecast for one or several places in one call, °C/°F and wind units, weather codes in plain words, refresh and errors that keep the last forecast, and the data credit",
|
|
5
|
+
cues: ["weather", "forecast", "weather dashboard", "weather app"],
|
|
6
|
+
credential: "none",
|
|
7
|
+
egress: [
|
|
8
|
+
{ url: "https://geocoding-api.open-meteo.com/v1/search?name=Oslo", via: "cors", checked: "2026-11-02" },
|
|
9
|
+
{ url: "https://api.open-meteo.com/v1/forecast?latitude=59.91&longitude=10.75", via: "cors", checked: "2026-11-02" },
|
|
10
|
+
],
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=weather.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"weather.js","sourceRoot":"","sources":["../../jsr/llms/weather.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,aAAa,GAAc;IACtC,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EACT,oYAAoY;IACtY,IAAI,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,mBAAmB,EAAE,aAAa,CAAC;IACjE,UAAU,EAAE,MAAM;IAClB,MAAM,EAAE;QACN,EAAE,GAAG,EAAE,0DAA0D,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE;QACvG,EAAE,GAAG,EAAE,uEAAuE,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE;KACrH;CACF,CAAC"}
|
package/llms/weather.md
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
# Weather — real forecasts from Open-Meteo, with no key
|
|
2
|
+
|
|
3
|
+
Current conditions, an hourly strip and a several-day forecast for any place on
|
|
4
|
+
Earth come from **Open-Meteo**: free, no account, no key, and open to any
|
|
5
|
+
origin, so the page calls it directly with a plain `fetch`. There is no setup
|
|
6
|
+
item, no secret and no backend in this recipe, and the app works the moment it
|
|
7
|
+
opens.
|
|
8
|
+
|
|
9
|
+
Open-Meteo's free tier is for non-commercial apps (no ads, no subscriptions)
|
|
10
|
+
and fewer than 10,000 calls a day. An app that sells something needs Open-Meteo's
|
|
11
|
+
commercial plan and a key; say that to the person in one sentence and build the
|
|
12
|
+
free version.
|
|
13
|
+
|
|
14
|
+
## 1. A place name becomes coordinates
|
|
15
|
+
|
|
16
|
+
The forecast takes a latitude and longitude, so a typed place goes through
|
|
17
|
+
Open-Meteo's geocoder first:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
GET https://geocoding-api.open-meteo.com/v1/search?name=<typed>&count=5&language=en&format=json
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Each entry of `results` carries `name`, `latitude`, `longitude`, `timezone`,
|
|
24
|
+
`country`, `country_code` and `admin1` (the region), with empty fields left
|
|
25
|
+
out. **When nothing matches, the answer has no `results` key at all**, so read
|
|
26
|
+
`data.results ?? []` and say "No place called Springfeld" with the typed name
|
|
27
|
+
kept on screen. Several towns share a name: list the matches as
|
|
28
|
+
`name, admin1, country` and let the person pick one, never silently take the
|
|
29
|
+
first. Keep the pick as `{ name, latitude, longitude, timezone }`, which is all
|
|
30
|
+
the forecast needs.
|
|
31
|
+
|
|
32
|
+
"Use my location" reads `navigator.geolocation.getCurrentPosition` from the
|
|
33
|
+
press handler (the app's frame is allowed to ask), names the place
|
|
34
|
+
"My location", and falls back to the search with the person's answer kept when
|
|
35
|
+
they decline.
|
|
36
|
+
|
|
37
|
+
## 2. One forecast call
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
GET https://api.open-meteo.com/v1/forecast?latitude=38.72&longitude=-9.15
|
|
41
|
+
¤t=temperature_2m,apparent_temperature,relative_humidity_2m,weather_code,wind_speed_10m,is_day
|
|
42
|
+
&hourly=temperature_2m,weather_code,precipitation_probability&forecast_hours=12
|
|
43
|
+
&daily=weather_code,temperature_2m_max,temperature_2m_min,precipitation_probability_max,uv_index_max,sunrise,sunset
|
|
44
|
+
&timezone=auto&forecast_days=5
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
- **`timezone=auto` is required for `daily`**, and it makes every `time` the
|
|
48
|
+
place's own local time, so "Tuesday" and "14:00" mean the place's Tuesday.
|
|
49
|
+
- `hourly` and `daily` are **parallel arrays**: `daily.time[i]` is the date of
|
|
50
|
+
`daily.temperature_2m_max[i]`. Zip them by index into one object per day.
|
|
51
|
+
- `forecast_hours=12` starts the hourly arrays at the current hour, so the strip
|
|
52
|
+
needs no slicing. `forecast_days` runs from 1 to 16.
|
|
53
|
+
- **Units go in the request, and change together**: `temperature_unit=fahrenheit`
|
|
54
|
+
with `wind_speed_unit=mph` (and `precipitation_unit=inch`), or the defaults
|
|
55
|
+
°C, km/h and mm. Label each figure from the response's `current_units`,
|
|
56
|
+
`hourly_units` and `daily_units`, which echo what was asked, and refetch when
|
|
57
|
+
the person switches units rather than converting by hand. Keep each response
|
|
58
|
+
beside the units it was asked in and label from those, so figures still on
|
|
59
|
+
screen while the new ones load (or after that refetch fails) keep their own
|
|
60
|
+
units, and let only the newest request land.
|
|
61
|
+
- **Several places, one call**: comma-separated `latitude=38.72,59.91` and
|
|
62
|
+
`longitude=-9.15,10.75` answer with an array, one forecast per place in the
|
|
63
|
+
order asked. A single place answers with one object, so wrap it.
|
|
64
|
+
|
|
65
|
+
## 3. Weather codes become words
|
|
66
|
+
|
|
67
|
+
`weather_code` is a WMO code. Map it to words in one table, pick any icon from
|
|
68
|
+
those words, and show the words: a code number means nothing to anyone.
|
|
69
|
+
|
|
70
|
+
```js
|
|
71
|
+
const WEATHER_CODES = {
|
|
72
|
+
0: "Clear", 1: "Mostly clear", 2: "Partly cloudy", 3: "Overcast", 45: "Fog", 48: "Freezing fog",
|
|
73
|
+
51: "Light drizzle", 53: "Drizzle", 55: "Heavy drizzle", 56: "Freezing drizzle", 57: "Freezing drizzle",
|
|
74
|
+
61: "Light rain", 63: "Rain", 65: "Heavy rain", 66: "Freezing rain", 67: "Freezing rain",
|
|
75
|
+
71: "Light snow", 73: "Snow", 75: "Heavy snow", 77: "Snow grains",
|
|
76
|
+
80: "Showers", 81: "Showers", 82: "Heavy showers", 85: "Snow showers", 86: "Heavy snow showers",
|
|
77
|
+
95: "Thunderstorm", 96: "Thunderstorm with hail", 99: "Thunderstorm with hail",
|
|
78
|
+
};
|
|
79
|
+
function weatherWords(code) {
|
|
80
|
+
return WEATHER_CODES[code] ?? "Unsettled";
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
`current.is_day` is `1` by day and `0` by night, so a clear night can show a
|
|
85
|
+
moon instead of a sun.
|
|
86
|
+
|
|
87
|
+
## 4. When to call
|
|
88
|
+
|
|
89
|
+
Fetch when the person picks a place or units, and when the app opens with
|
|
90
|
+
places already chosen: an effect keyed on the place and the units, never a call
|
|
91
|
+
from render. Refresh when the page becomes visible again after 15 minutes or
|
|
92
|
+
more, and keep the figures
|
|
93
|
+
on screen with "Updated 10:40" from the time they arrived. Three places on one
|
|
94
|
+
screen are one call (section 2), not three.
|
|
95
|
+
|
|
96
|
+
## 5. Errors keep their reason
|
|
97
|
+
|
|
98
|
+
A bad parameter answers HTTP 400 with `{ "error": true, "reason": "…" }`; show
|
|
99
|
+
that reason. A network failure (offline, the service down) keeps the last
|
|
100
|
+
forecast on screen with its time and a "Couldn't reach the forecast — Try again"
|
|
101
|
+
line, rather than blanking the page. "Try again" repeats the step that failed:
|
|
102
|
+
a failed place search searches again, a failed forecast fetches again. Never fill a failed day with zeros: a
|
|
103
|
+
forecast of 0° is a forecast, so a missing one says it is missing.
|
|
104
|
+
|
|
105
|
+
## 6. Credit the data
|
|
106
|
+
|
|
107
|
+
Open-Meteo's data is CC BY 4.0, so the screen carries a small visible line,
|
|
108
|
+
"Weather data by Open-Meteo.com", linking `https://open-meteo.com/`.
|
|
109
|
+
|
|
110
|
+
## 7. Alerts and digests
|
|
111
|
+
|
|
112
|
+
"Tell me when frost is coming" or "email me the weekend forecast" is a
|
|
113
|
+
scheduled job in backend.js (the `backend` skill), which can read the same
|
|
114
|
+
forecast URL with `ctx.fetch`. The page's own forecast never needs a backend.
|
|
115
|
+
|
|
116
|
+
## App.jsx
|
|
117
|
+
|
|
118
|
+
```jsx app=weather-forecast
|
|
119
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
120
|
+
import { Button, Field, Input, Row, Stack } from "@vibes.diy/ui";
|
|
121
|
+
|
|
122
|
+
const UNITS = {
|
|
123
|
+
metric: { query: "", temp: "°C", wind: "km/h" },
|
|
124
|
+
imperial: { query: "&temperature_unit=fahrenheit&wind_speed_unit=mph&precipitation_unit=inch", temp: "°F", wind: "mph" },
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
async function searchPlaces(typed) {
|
|
128
|
+
const r = await fetch(`https://geocoding-api.open-meteo.com/v1/search?name=${encodeURIComponent(typed)}&count=5&language=en&format=json`);
|
|
129
|
+
const data = await r.json();
|
|
130
|
+
if (!r.ok) throw new Error(data.reason ?? `The place search answered ${r.status}`);
|
|
131
|
+
return (data.results ?? []).map((p) => ({ name: p.name, region: [p.admin1, p.country].filter(Boolean).join(", "), latitude: p.latitude, longitude: p.longitude }));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Every place in one call; the answer is an array for several places and an object for one.
|
|
135
|
+
async function fetchForecast(places, units) {
|
|
136
|
+
const lat = places.map((p) => p.latitude).join(",");
|
|
137
|
+
const lon = places.map((p) => p.longitude).join(",");
|
|
138
|
+
const r = await fetch(
|
|
139
|
+
`https://api.open-meteo.com/v1/forecast?latitude=${lat}&longitude=${lon}` +
|
|
140
|
+
"¤t=temperature_2m,apparent_temperature,weather_code,wind_speed_10m,is_day" +
|
|
141
|
+
"&daily=weather_code,temperature_2m_max,temperature_2m_min,precipitation_probability_max" +
|
|
142
|
+
`&timezone=auto&forecast_days=5${UNITS[units].query}`
|
|
143
|
+
);
|
|
144
|
+
const data = await r.json();
|
|
145
|
+
if (!r.ok || data.error) throw new Error(data.reason ?? `The forecast answered ${r.status}`);
|
|
146
|
+
const all = Array.isArray(data) ? data : [data];
|
|
147
|
+
return all.map((f, i) => ({
|
|
148
|
+
place: places[i],
|
|
149
|
+
now: { temp: f.current.temperature_2m, feels: f.current.apparent_temperature, code: f.current.weather_code, wind: f.current.wind_speed_10m },
|
|
150
|
+
days: f.daily.time.map((date, d) => ({
|
|
151
|
+
date,
|
|
152
|
+
hi: f.daily.temperature_2m_max[d],
|
|
153
|
+
lo: f.daily.temperature_2m_min[d],
|
|
154
|
+
code: f.daily.weather_code[d],
|
|
155
|
+
rain: f.daily.precipitation_probability_max[d],
|
|
156
|
+
})),
|
|
157
|
+
}));
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const dayName = (date) => new Date(`${date}T12:00`).toLocaleDateString(undefined, { weekday: "short" });
|
|
161
|
+
|
|
162
|
+
export default function App() {
|
|
163
|
+
const [places, setPlaces] = useState([{ name: "Lisbon", region: "Portugal", latitude: 38.72, longitude: -9.15 }]);
|
|
164
|
+
const [units, setUnits] = useState("metric");
|
|
165
|
+
// The figures on screen and the units they were asked in, kept together: a toggle changes
|
|
166
|
+
// `units` at once, and the figures it labels arrive later or not at all.
|
|
167
|
+
const [shown, setShown] = useState({ forecasts: [], units: "metric" });
|
|
168
|
+
const latest = useRef(0);
|
|
169
|
+
const [updated, setUpdated] = useState(null);
|
|
170
|
+
// A failure and the step that retries it: search and forecast fail separately, so "Try again"
|
|
171
|
+
// repeats the one that failed. A search that found nothing has no retry, only a message.
|
|
172
|
+
const [problem, setProblem] = useState(null);
|
|
173
|
+
const [typed, setTyped] = useState("");
|
|
174
|
+
const [matches, setMatches] = useState([]);
|
|
175
|
+
|
|
176
|
+
const load = () => {
|
|
177
|
+
setProblem(null);
|
|
178
|
+
const n = ++latest.current; // only the newest request may land, or a slow old one restores old units
|
|
179
|
+
const asked = units;
|
|
180
|
+
fetchForecast(places, asked)
|
|
181
|
+
.then((f) => { if (n === latest.current) { setShown({ forecasts: f, units: asked }); setUpdated(new Date()); } })
|
|
182
|
+
.catch((e) => { if (n === latest.current) setProblem({ message: e.message, retry: load }); }); // the last forecast stays on screen, with its own units
|
|
183
|
+
};
|
|
184
|
+
useEffect(load, [places, units]);
|
|
185
|
+
useEffect(() => {
|
|
186
|
+
const onVisible = () => {
|
|
187
|
+
if (document.visibilityState === "visible" && updated && Date.now() - updated.getTime() > 15 * 60 * 1000) load();
|
|
188
|
+
};
|
|
189
|
+
document.addEventListener("visibilitychange", onVisible);
|
|
190
|
+
return () => document.removeEventListener("visibilitychange", onVisible);
|
|
191
|
+
}, [updated, places, units]);
|
|
192
|
+
|
|
193
|
+
const search = async () => {
|
|
194
|
+
setProblem(null);
|
|
195
|
+
try {
|
|
196
|
+
const found = await searchPlaces(typed);
|
|
197
|
+
setMatches(found);
|
|
198
|
+
if (found.length === 0) setProblem({ message: `No place called ${typed}.`, retry: null });
|
|
199
|
+
} catch (e) {
|
|
200
|
+
setProblem({ message: e.message, retry: search });
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
const u = UNITS[shown.units]; // label the figures in the units they came in
|
|
205
|
+
return (
|
|
206
|
+
<Stack gap={4}>
|
|
207
|
+
<Row gap={2} align="top">
|
|
208
|
+
<Field label="Add a place">{(id, describedBy) => <Input id={id} describedBy={describedBy} value={typed} onChange={setTyped} placeholder="Oslo" />}</Field>
|
|
209
|
+
<Button type="button" onClick={search}>Find</Button>
|
|
210
|
+
<Button type="button" variant="quiet" onClick={() => setUnits(units === "metric" ? "imperial" : "metric")}>
|
|
211
|
+
Show {units === "metric" ? "°F" : "°C"}
|
|
212
|
+
</Button>
|
|
213
|
+
</Row>
|
|
214
|
+
{matches.map((m) => (
|
|
215
|
+
<Button key={`${m.latitude},${m.longitude}`} type="button" variant="quiet" onClick={() => { setPlaces([...places, m]); setMatches([]); setTyped(""); }}>
|
|
216
|
+
{m.name}, {m.region}
|
|
217
|
+
</Button>
|
|
218
|
+
))}
|
|
219
|
+
{problem && (
|
|
220
|
+
<p role="alert">
|
|
221
|
+
{problem.message} {problem.retry && <Button type="button" variant="quiet" onClick={problem.retry}>Try again</Button>}
|
|
222
|
+
</p>
|
|
223
|
+
)}
|
|
224
|
+
|
|
225
|
+
{shown.forecasts.map((f) => {
|
|
226
|
+
const words = weatherWords(f.now.code);
|
|
227
|
+
return (
|
|
228
|
+
<section key={f.place.name + f.place.latitude}>
|
|
229
|
+
<h2>{f.place.name}</h2>
|
|
230
|
+
<p>{Math.round(f.now.temp)}{u.temp} · {words} · feels like {Math.round(f.now.feels)}{u.temp} · wind {Math.round(f.now.wind)} {u.wind}</p>
|
|
231
|
+
<ol>
|
|
232
|
+
{f.days.map((d) => (
|
|
233
|
+
<li key={d.date}>
|
|
234
|
+
{dayName(d.date)}: {weatherWords(d.code)}, {Math.round(d.hi)}{u.temp} / {Math.round(d.lo)}{u.temp}, {d.rain}% rain
|
|
235
|
+
</li>
|
|
236
|
+
))}
|
|
237
|
+
</ol>
|
|
238
|
+
</section>
|
|
239
|
+
);
|
|
240
|
+
})}
|
|
241
|
+
{updated && <small>Updated {updated.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })}</small>}
|
|
242
|
+
<small>Weather data by <a href="https://open-meteo.com/" target="_blank" rel="noreferrer">Open-Meteo.com</a></small>
|
|
243
|
+
</Stack>
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
`weatherWords` and its table are section 3's, in the same file.
|
package/llms/youtube.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const youtubeConfig = {
|
|
2
2
|
name: "youtube",
|
|
3
3
|
label: "YouTube channel stats",
|
|
4
|
-
description: "YouTube channel dashboards on the owner's own YouTube Data API v3 key: the setup steps the app shows when the key is missing, keeping the key in backend.js, resolving a channel from a handle or URL, reading videos through the uploads playlist instead of the 100-unit search endpoint, daily snapshots to chart change over time, and labeling the numbers an API key cannot see",
|
|
4
|
+
description: "YouTube on a page: playing videos, playlists and a channel's uploads in YouTube's own player, which needs no key and no setup; and channel stats dashboards on the owner's own YouTube Data API v3 key: the setup steps the app shows when the key is missing, keeping the key in backend.js, resolving a channel from a handle or URL, reading videos through the uploads playlist instead of the 100-unit search endpoint, daily snapshots to chart change over time, and labeling the numbers an API key cannot see",
|
|
5
5
|
cues: [
|
|
6
6
|
"youtube",
|
|
7
7
|
"my channel",
|
|
@@ -10,6 +10,15 @@ export const youtubeConfig = {
|
|
|
10
10
|
"video views",
|
|
11
11
|
"youtube stats",
|
|
12
12
|
"channel analytics",
|
|
13
|
+
"youtube video",
|
|
14
|
+
"youtube playlist",
|
|
15
|
+
],
|
|
16
|
+
needs: ["owner-secret", "third-party-embed"],
|
|
17
|
+
credential: "owner-secret",
|
|
18
|
+
egress: [
|
|
19
|
+
{ url: "https://www.googleapis.com/youtube/v3/channels?part=statistics", via: "platform" },
|
|
20
|
+
{ url: "https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ", via: "frame" },
|
|
21
|
+
{ url: "https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=dQw4w9WgXcQ", via: "cors", checked: "2026-11-02" },
|
|
13
22
|
],
|
|
14
23
|
};
|
|
15
24
|
//# sourceMappingURL=youtube.js.map
|
package/llms/youtube.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"youtube.js","sourceRoot":"","sources":["../../jsr/llms/youtube.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,aAAa,GAAc;IACtC,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"youtube.js","sourceRoot":"","sources":["../../jsr/llms/youtube.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,aAAa,GAAc;IACtC,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EACT,wfAAwf;IAC1f,IAAI,EAAE;QACJ,SAAS;QACT,YAAY;QACZ,kBAAkB;QAClB,aAAa;QACb,aAAa;QACb,eAAe;QACf,mBAAmB;QACnB,eAAe;QACf,kBAAkB;KACnB;IAED,KAAK,EAAE,CAAC,cAAc,EAAE,mBAAmB,CAAC;IAC5C,UAAU,EAAE,cAAc;IAC1B,MAAM,EAAE;QACN,EAAE,GAAG,EAAE,gEAAgE,EAAE,GAAG,EAAE,UAAU,EAAE;QAC1F,EAAE,GAAG,EAAE,oDAAoD,EAAE,GAAG,EAAE,OAAO,EAAE;QAC3E,EAAE,GAAG,EAAE,gFAAgF,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE;KAC9H;CACF,CAAC"}
|
package/llms/youtube.md
CHANGED
|
@@ -1,22 +1,60 @@
|
|
|
1
|
-
# YouTube
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
key
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
# YouTube — play videos with no key, chart a channel with the owner's own
|
|
2
|
+
|
|
3
|
+
Two different asks share the name. **Playing** a video, a playlist or a
|
|
4
|
+
channel's uploads inside the page needs no key, no backend and no setup: it is
|
|
5
|
+
YouTube's own player in a frame, and section 0 is all of it. **Counting** a
|
|
6
|
+
channel (subscribers, views, which videos are picking up) is the **YouTube Data
|
|
7
|
+
API v3** on a key the owner supplies, a `backend.js` feature, and sections 1–7
|
|
8
|
+
are the recipe that keeps the key safe, the quota survivable and the numbers
|
|
9
|
+
honest. Build the first for "show our videos", "my band's page", "a playlist of
|
|
10
|
+
clips"; build the second only when the ask is about the numbers.
|
|
11
|
+
|
|
12
|
+
## 0. Play a video: no key at all
|
|
13
|
+
|
|
14
|
+
A pasted YouTube link becomes a player through the privacy-enhanced host,
|
|
15
|
+
`www.youtube-nocookie.com`, which sets no cookie until the person presses play.
|
|
16
|
+
Parse the link into an id and build the `src`; the frame itself is the shared
|
|
17
|
+
`EmbedFrame`.
|
|
18
|
+
|
|
19
|
+
```jsx
|
|
20
|
+
// A share link → an embed src, or null when the link is not one YouTube can play here.
|
|
21
|
+
function youtubeEmbedSrc(link) {
|
|
22
|
+
let u;
|
|
23
|
+
try { u = new URL(link.trim()); } catch { return null; }
|
|
24
|
+
const host = u.hostname.replace(/^www\.|^m\./, "");
|
|
25
|
+
const list = u.searchParams.get("list");
|
|
26
|
+
const start = (u.searchParams.get("t") ?? u.searchParams.get("start") ?? "").match(/^(\d+)s?$/)?.[1];
|
|
27
|
+
const tail = start ? `?start=${start}` : "";
|
|
28
|
+
let id = null;
|
|
29
|
+
if (host === "youtu.be") id = u.pathname.slice(1);
|
|
30
|
+
else if (host === "youtube.com" || host === "music.youtube.com") {
|
|
31
|
+
const channel = u.pathname.match(/^\/channel\/UC([\w-]{22})(?:\/|$)/);
|
|
32
|
+
if (channel) return `https://www.youtube-nocookie.com/embed/videoseries?list=UU${channel[1]}`; // the channel's uploads
|
|
33
|
+
if (u.pathname === "/playlist" && /^[\w-]+$/.test(list ?? "")) return `https://www.youtube-nocookie.com/embed/videoseries?list=${list}`;
|
|
34
|
+
id = u.searchParams.get("v") ?? u.pathname.match(/^\/(?:shorts|embed|live)\/([\w-]{11})/)?.[1] ?? null;
|
|
35
|
+
}
|
|
36
|
+
if (!id || !/^[\w-]{11}$/.test(id)) return null;
|
|
37
|
+
return `https://www.youtube-nocookie.com/embed/${id}${tail}`;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// The player, once the link has parsed:
|
|
41
|
+
// <EmbedFrame src={youtubeEmbedSrc(video.link)} title={video.title} />
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
- A **channel's uploads** play as one playlist: its id is the channel id with
|
|
45
|
+
`UC` turned into `UU`. Only a `/channel/UC…` link carries that id; an
|
|
46
|
+
`@handle` link does not, and turning a handle into an id costs a key, so ask
|
|
47
|
+
for a video or playlist link, or the channel's `/channel/` address.
|
|
48
|
+
- The title and thumbnail come from YouTube's keyless oEmbed endpoint,
|
|
49
|
+
`https://www.youtube.com/oembed`, read once when the link is added.
|
|
50
|
+
- Under each player, "Watch on YouTube" links the original
|
|
51
|
+
`https://www.youtube.com/watch?v=<id>` (the shared link-out rule).
|
|
52
|
+
- None of this touches the Data API, so none of the key sections below apply
|
|
53
|
+
to a page that only plays videos.
|
|
54
|
+
|
|
55
|
+
**The stats half is the owner's dashboard:** the key and quota are the owner's,
|
|
56
|
+
and every visitor sees the *owner's* channel. A visitor's own channel is a
|
|
57
|
+
connection, never a pasted token (the owner-key rules below).
|
|
20
58
|
|
|
21
59
|
## 1. The setup item: the owner's YouTube Data API key
|
|
22
60
|
|
|
@@ -36,49 +74,26 @@ one is a link to the exact page and uses the words that page uses:
|
|
|
36
74
|
Press **Create credentials**, choose **API key**, and copy the key. Then
|
|
37
75
|
open the key, and under **API restrictions** choose **Restrict key**, tick
|
|
38
76
|
**YouTube Data API v3**, and save.
|
|
39
|
-
3.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
4. Come back to the app. The dashboard works the moment the key is saved; no
|
|
45
|
-
redeploy.
|
|
46
|
-
|
|
47
|
-
Those steps are the item's copy on the Setup surface, with the vibe's real
|
|
48
|
-
handle and slug filled in from the `ownerHandle` and `appSlug` the `/setup`
|
|
49
|
-
route hands over. In the consumer flow, a dashboard whose key is not set
|
|
50
|
-
reads *Channel stats are not open yet*; the owner's Setup entry is where the
|
|
51
|
-
steps are, and later it is where a rotated key goes.
|
|
52
|
-
|
|
53
|
-
Only the owner can set or rotate a secret, and handlers see the current value on
|
|
54
|
-
every invocation — so the dashboard starts working the moment the key lands, with
|
|
55
|
-
no redeploy.
|
|
77
|
+
3. Save it under **Secrets** on this vibe's Settings tab as `YOUTUBE_API_KEY`,
|
|
78
|
+
then come back: the owner-key steps every item ends with.
|
|
79
|
+
|
|
80
|
+
In the consumer flow, a dashboard whose key is not set reads *Channel stats are
|
|
81
|
+
not open yet*.
|
|
56
82
|
|
|
57
83
|
## 2. The key never reaches the browser
|
|
58
84
|
|
|
59
85
|
Every YouTube request is made in backend.js with ctx.fetch and ctx.secrets.YOUTUBE_API_KEY; App.jsx never calls googleapis.com.
|
|
60
86
|
|
|
61
|
-
|
|
62
|
-
backend is the only place that knows the key exists. A key pasted into a React
|
|
63
|
-
component ships to every visitor who views source, and a restricted key is still
|
|
64
|
-
the owner's quota to spend.
|
|
87
|
+
A restricted key is still the owner's quota to spend.
|
|
65
88
|
|
|
66
89
|
### The `/_api` routes are the second door
|
|
67
90
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
stranger the owner's 10,000 daily units and a refresh button.
|
|
91
|
+
A handler that calls Google on every request hands a stranger the owner's
|
|
92
|
+
10,000 daily units and a refresh button.
|
|
71
93
|
|
|
72
94
|
Live YouTube calls are made only for the vibe owner; every other visitor is served from the stored snapshot, so a stranger can never spend the owner's quota.
|
|
73
95
|
|
|
74
|
-
|
|
75
|
-
app's owner and `ctx.userInfo` is `{ userHandle }` or `null` when the caller is
|
|
76
|
-
anonymous. One comparison at the top of the handler is the whole gate:
|
|
77
|
-
|
|
78
|
-
```js
|
|
79
|
-
const isOwner = ctx.userInfo?.userHandle != null && ctx.userInfo.userHandle === ctx.appInfo.ownerHandle;
|
|
80
|
-
```
|
|
81
|
-
|
|
96
|
+
The owner gate is one comparison at the top of the handler (`isOwnerCall`).
|
|
82
97
|
Everyone else is answered from the daily snapshot docs section 5 already writes —
|
|
83
98
|
`{ ok: true, source: "snapshot", asOf: <day>, ... }`, so the client can say "as of
|
|
84
99
|
Tuesday" instead of implying the numbers are live — and
|
|
@@ -257,8 +272,7 @@ the reason through:
|
|
|
257
272
|
- `accessNotConfigured` — "Enable YouTube Data API v3 on this key's project."
|
|
258
273
|
- anything else — show the API's own `error.message`.
|
|
259
274
|
|
|
260
|
-
|
|
261
|
-
nothing they can act on, and the four cases above each have a different fix.
|
|
275
|
+
The four cases above each have a different fix, so each keeps its own words.
|
|
262
276
|
|
|
263
277
|
## Complete backend.js
|
|
264
278
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibes.diy/prompts",
|
|
3
|
-
"version": "14.3.
|
|
3
|
+
"version": "14.3.252",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"exports": {
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"license": "Apache-2.0",
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@adviser/cement": "~0.5.34",
|
|
42
|
-
"@vibes.diy/api-types": "14.3.
|
|
43
|
-
"@vibes.diy/call-ai-v2": "14.3.
|
|
44
|
-
"@vibes.diy/identity": "14.3.
|
|
45
|
-
"@vibes.diy/use-vibes-types": "14.3.
|
|
42
|
+
"@vibes.diy/api-types": "14.3.252",
|
|
43
|
+
"@vibes.diy/call-ai-v2": "14.3.252",
|
|
44
|
+
"@vibes.diy/identity": "14.3.252",
|
|
45
|
+
"@vibes.diy/use-vibes-types": "14.3.252",
|
|
46
46
|
"arktype": "~2.2.8",
|
|
47
47
|
"json-schema-faker": "~0.6.3"
|
|
48
48
|
},
|