@vibes.diy/prompts 13.0.6 → 13.0.8
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/llms/backend.md +26 -0
- package/package.json +4 -4
package/llms/backend.md
CHANGED
|
@@ -136,8 +136,34 @@ const json = JSON.parse(
|
|
|
136
136
|
const res = await ctx.fetch("https://api.example.com/x", { headers }); // outbound HTTP — use this, not bare fetch()
|
|
137
137
|
await ctx.notify({ toHandle: "alice", body: "Your turn", dedupeKey: "game-7-turn-3" }); // one participant; throws on failure
|
|
138
138
|
ctx.log("info", "tick finished", { written: 3 }); // diagnostics — read back with: vibes-diy app logs owner/slug
|
|
139
|
+
const gh = await ctx.github.fetch("/repos/acme/site/issues", { method: "POST", body: { title: "Filed from the vibe" } }); // connected GitHub repo
|
|
139
140
|
```
|
|
140
141
|
|
|
142
|
+
- `ctx.github.fetch(path, init)` calls the GitHub REST API **as the GitHub App
|
|
143
|
+
installation the owner connected to this vibe**. It is the only GitHub surface
|
|
144
|
+
a backend has: `path` is a GitHub API path rooted at `/` (`/repos/…`, plus
|
|
145
|
+
`/installation/repositories`), `init` takes `method`, `headers` and `body`
|
|
146
|
+
(an object is JSON-encoded for you), and it resolves a normal `Response` — so
|
|
147
|
+
`res.status`, `await res.json()` and `res.headers.get("link")` all work, and
|
|
148
|
+
an upstream 404 or 422 comes back as a `Response`, not an error. **There is no
|
|
149
|
+
token to read.** The installation credential is attached by the platform and
|
|
150
|
+
never enters your code, so you cannot pass it to another library, log it, or
|
|
151
|
+
store it — and every call the App makes on the owner's behalf is one the
|
|
152
|
+
platform made. The proxy also enforces the binding: a `/repos/{owner}/{repo}/…`
|
|
153
|
+
path must name a repository the owner actually connected to THIS vibe, so a
|
|
154
|
+
path built from user-supplied text simply gets refused rather than reaching
|
|
155
|
+
some other repo the installation happens to cover. Do not treat that refusal
|
|
156
|
+
as your validation — check the repo name yourself before you build the path,
|
|
157
|
+
and tell the user which repos this vibe is bound to (`/installation/repositories`).
|
|
158
|
+
Calls
|
|
159
|
+
outside the proxied surface reject with an `Error` carrying a short `reason`
|
|
160
|
+
(`not_connected` — the owner has not connected a repo, `unmodeled_endpoint` —
|
|
161
|
+
a path outside `/repos/…` + `/installation/repositories`, or one naming a repo
|
|
162
|
+
this vibe is not bound to,
|
|
163
|
+
`unsupported_method`, `streaming_unsupported`, `body_too_large`,
|
|
164
|
+
`permission_not_granted` — the installation lacks that permission, or
|
|
165
|
+
`upstream_error`); branch on `err.reason`, and tell the user which one it was.
|
|
166
|
+
|
|
141
167
|
- `{ db }` names the Fireproof database (same names `App.jsx` uses with
|
|
142
168
|
`useFireproof`). It is **required** — except inside `onChange`, where the
|
|
143
169
|
database that triggered the event is the default.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibes.diy/prompts",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.8",
|
|
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": "^13.0.
|
|
28
|
-
"@vibes.diy/identity": "^13.0.
|
|
29
|
-
"@vibes.diy/use-vibes-types": "^13.0.
|
|
27
|
+
"@vibes.diy/call-ai-v2": "^13.0.8",
|
|
28
|
+
"@vibes.diy/identity": "^13.0.8",
|
|
29
|
+
"@vibes.diy/use-vibes-types": "^13.0.8",
|
|
30
30
|
"arktype": "~2.2.3",
|
|
31
31
|
"json-schema-faker": "~0.6.3"
|
|
32
32
|
},
|