@vibes.diy/prompts 14.1.28 → 14.1.30

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 (2) hide show
  1. package/llms/connections.md +44 -12
  2. package/package.json +4 -4
@@ -2,7 +2,7 @@
2
2
 
3
3
  A **connection** lets a visitor link their own third-party account (GitHub,
4
4
  Threads, Instagram) to your app in one click, and lets your `backend.js` read
5
- from that account as them. The platform shows the consent screen, runs the
5
+ from that account — and, when they approve it, post to it — as them. The platform shows the consent screen, runs the
6
6
  sign-in, holds the credential, refreshes it, and warns the person before it
7
7
  expires. Your app contains **no** client id, secret, redirect route, token
8
8
  field, or refresh code.
@@ -48,16 +48,25 @@ refuses the push. `why` is **required** and is shown to the visitor verbatim on
48
48
  the consent card, quoted as the app's own words — write it for them ("Show your
49
49
  GitHub profile next to your entries."), never as a note to yourself.
50
50
 
51
- | provider | scope | what it buys (read-only) |
52
- | ----------- | -------------------------- | ----------------------------------------------------------- |
53
- | `github` | `read:user` | the account's profile (`github(ctx).me()`) |
54
- | `threads` | `threads_basic` | the account's profile and its own posts |
55
- | `instagram` | `instagram_business_basic` | the account's profile and its own media with like/comment counts |
56
-
57
- Every connection is **read-only today**: nothing posts, replies, or writes on
58
- the person's behalf, and there is no scope for that. Instagram views and plays
59
- (the `insights` edge) are not available yet either. Build the app around what
60
- the table gives you; do not add a token field for the rest.
51
+ | provider | scope | what it buys |
52
+ | ----------- | ------------------------------------- | ---------------------------------------------------------------- |
53
+ | `github` | `read:user` | read the account's profile (`github(ctx).me()`) |
54
+ | `threads` | `threads_basic` | read the account's profile and its own posts |
55
+ | `threads` | `threads_content_publish` | **post to their Threads feed** (`threads(ctx).publish()`) |
56
+ | `instagram` | `instagram_business_basic` | read the account's profile and its own media with like/comment counts |
57
+ | `instagram` | `instagram_business_content_publish` | **post a photo or video to their Instagram** (`instagram(ctx).publish()`) |
58
+
59
+ **A scope that posts is a separate scope, and asking for it is the whole
60
+ authorization.** Declare it only when the app really posts, and say so in `why`
61
+ — the visitor sees "Post to your Threads feed as you" beside your sentence and
62
+ decides. An app that declared only the read scopes cannot post: the platform
63
+ refuses the call, not because posting is forbidden but because nobody agreed to
64
+ it.
65
+
66
+ **GitHub is read-only on this lane** — there is no GitHub write scope to
67
+ declare. Instagram views and plays (the `insights` edge) are not available
68
+ either. Build the app around what the table gives you; do not add a token field
69
+ for the rest.
61
70
 
62
71
  ### 2. Ask for it — `App.jsx`
63
72
 
@@ -115,6 +124,24 @@ provider call as a typed request with a typed response, so there is no
115
124
  - `instagram(ctx).me()` → `{ id, username }`; `instagram(ctx).media({ limit, cursor })` →
116
125
  `{ items: [{ id, caption, mediaType, permalink, timestamp, likeCount, commentsCount }], cursor? }`
117
126
  (`likeCount` is `null` when the person hides likes, never `0`).
127
+ - `threads(ctx).publish({ text, imageUrl?, replyToId? })` → `{ id }`. Needs
128
+ `threads_content_publish`. A text post needs `text`; an image post needs a
129
+ publicly reachable `imageUrl` the provider fetches itself.
130
+ - `instagram(ctx).publish({ imageUrl, caption? })` → `{ id }`. Needs
131
+ `instagram_business_content_publish`. Instagram has no text-only post, so
132
+ `imageUrl` is required.
133
+
134
+ **Video posting is not available on either provider yet** — the provider hands
135
+ back a container while the video is still processing, and the platform cannot
136
+ yet read that container's status, so a video post would intermittently fail
137
+ rather than land. Build on text and images; do not work around it with a raw
138
+ `ctx.connections` call, which hits the same race.
139
+
140
+ Posting on someone's behalf is a real act, so **let the person press the
141
+ button** — post from a `fetch` route the app calls on an explicit action, and
142
+ never from a `scheduled` tick that posts for a visitor who is not there. A post
143
+ that fails is worth telling them about, so surface the thrown error rather than
144
+ swallowing it.
118
145
 
119
146
  Page with `cursor` until it is absent. A provider error surfaces as a thrown
120
147
  `ProviderResponseError` with `status`; a connection problem surfaces as a
@@ -148,4 +175,9 @@ tell the app is waiting.
148
175
  the platform owns all of it.
149
176
  - No `Authorization: Bearer …` header built in app code; `ctx.connections`
150
177
  attaches the credential.
151
- - No posting: `POST`/`PUT`/`DELETE` through `ctx.connections` is refused.
178
+ - No posting a person did not ask for: declare a publish scope only when the
179
+ app posts, and post on an action they took, never on a timer behind their
180
+ back.
181
+ - No pretending an app can post without declaring it — a `POST` under a
182
+ read-only declaration is refused, and the fix is the declaration plus a
183
+ re-approval, not a retry.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibes.diy/prompts",
3
- "version": "14.1.28",
3
+ "version": "14.1.30",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "exports": {
@@ -34,9 +34,9 @@
34
34
  "license": "Apache-2.0",
35
35
  "dependencies": {
36
36
  "@adviser/cement": "~0.5.34",
37
- "@vibes.diy/call-ai-v2": "14.1.28",
38
- "@vibes.diy/identity": "14.1.28",
39
- "@vibes.diy/use-vibes-types": "14.1.28",
37
+ "@vibes.diy/call-ai-v2": "14.1.30",
38
+ "@vibes.diy/identity": "14.1.30",
39
+ "@vibes.diy/use-vibes-types": "14.1.30",
40
40
  "arktype": "~2.2.3",
41
41
  "json-schema-faker": "~0.6.3"
42
42
  },