@ambasada/skills 0.6.0 → 0.7.1
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": "@ambasada/skills",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Skills for Claude Code, Cursor and Codex: ambasada-product (build a product that sells in the Hack A Ton Village) and ambasada-payments (TON Checkout, receipts, webhooks).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -88,7 +88,7 @@ export async function buy() {
|
|
|
88
88
|
## Deliver: the webhook
|
|
89
89
|
|
|
90
90
|
```ts
|
|
91
|
-
// app/api/webhook/route.ts (`ambasada webhook set https://<slug>.
|
|
91
|
+
// app/api/webhook/route.ts (`ambasada webhook set https://<slug>.ambasada.dev/api/webhook`)
|
|
92
92
|
import { ambasada } from "../../../lib/ambasada.ts";
|
|
93
93
|
|
|
94
94
|
export async function POST(req: Request) {
|
|
@@ -9,7 +9,7 @@ The Village is the Hack A Ton market. Everything is paid in **TON**: a play curr
|
|
|
9
9
|
bank, **not** the TON blockchain. Visitors spend TON from their Ambasada ID wallet; other teams' agents
|
|
10
10
|
buy from you through the Gateway.
|
|
11
11
|
|
|
12
|
-
A product is **one website** (one Cloudflare Worker) at `https://<your-slug>.
|
|
12
|
+
A product is **one website** (one Cloudflare Worker) at `https://<your-slug>.ambasada.dev`, plus
|
|
13
13
|
**your agent**, which runs the shop (prices, suppliers, deals) while you sleep.
|
|
14
14
|
|
|
15
15
|
For payment details (Checkout, receipts, webhooks, `buy`/`need`, LLM and images) use the
|
|
@@ -43,7 +43,7 @@ running, except the last section.
|
|
|
43
43
|
|
|
44
44
|
## Online (after `npx ambasada deploy`)
|
|
45
45
|
|
|
46
|
-
- [ ] `https://<slug>.
|
|
46
|
+
- [ ] `https://<slug>.ambasada.dev` loads on a phone.
|
|
47
47
|
- [ ] `npx ambasada offerings list`: every endpoint starts with your public URL, none with `localhost`.
|
|
48
48
|
- [ ] `npx ambasada webhook test` prints `delivered`.
|
|
49
49
|
- [ ] One real payment by someone outside your team (members can't buy from their own company) shows up
|
|
@@ -24,7 +24,7 @@ Try a sale:
|
|
|
24
24
|
`AMBASADA_API_URL=http://127.0.0.1:8788`, `AMBASADA_API_KEY=sk_test_dev` (already in the project's `.env`).
|
|
25
25
|
More on the mock: the ambasada-payments skill, `reference/test-mode.md`.
|
|
26
26
|
|
|
27
|
-
## `ambasada deploy`: online at `<slug>.
|
|
27
|
+
## `ambasada deploy`: online at `<slug>.ambasada.dev`
|
|
28
28
|
|
|
29
29
|
Once, per laptop:
|
|
30
30
|
|
|
@@ -45,7 +45,7 @@ It does, in order:
|
|
|
45
45
|
1. **build**: `opennextjs-cloudflare build` (Next), `vite build` (spa) or a bundle of the Worker (worker);
|
|
46
46
|
2. **smoke test**: runs the built Worker locally in workerd and requests `/` and `/api/receipt`;
|
|
47
47
|
a crash stops the deploy (skip with `--no-smoke` only if you know why it fails);
|
|
48
|
-
3. **upload** to the Village's hosting: the URL is `https://<your-company-slug>.
|
|
48
|
+
3. **upload** to the Village's hosting: the URL is `https://<your-company-slug>.ambasada.dev`,
|
|
49
49
|
with `AMBASADA_API_KEY`, `AMBASADA_API_URL` and `AMBASADA_COMPANY` set for you;
|
|
50
50
|
4. **agent and offerings**: pushes `agent/agent.md` + `agent/settings.json`, and lists your offerings at the new URL.
|
|
51
51
|
|
|
@@ -55,13 +55,29 @@ offerings list), `--dry-run` (print what it would push).
|
|
|
55
55
|
After the first deploy, point the webhook at it and deploy again so the Worker gets the secret:
|
|
56
56
|
|
|
57
57
|
```sh
|
|
58
|
-
npx ambasada webhook set https://<slug>.
|
|
58
|
+
npx ambasada webhook set https://<slug>.ambasada.dev/api/webhook
|
|
59
59
|
npx ambasada webhook test # should print "delivered"
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
Limits on Village hosting: 10 MB compressed bundle, 1000 static files, short CPU time per request
|
|
63
63
|
(waiting on `fetch` or the LLM does not count). Heavy work belongs in an API you call, not in the Worker.
|
|
64
64
|
|
|
65
|
+
## `ambasada dev --tunnel`: your laptop, live in the Village
|
|
66
|
+
|
|
67
|
+
When real buyers, Checkout, webhooks or other teams' agents need to reach the version on your laptop
|
|
68
|
+
(before deploying, or to debug a sale), log in once, then:
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
npx ambasada dev --tunnel # your dev server, against the real Village, at https://<slug>-dev.ambasada.dev
|
|
72
|
+
npx ambasada tunnel --port 5173 # or: only the tunnel, for a server you started yourself
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Until Ctrl+C, `https://<slug>-dev.ambasada.dev` is your product URL. Offerings and the webhook point
|
|
76
|
+
there, and the Shop tab shows "Live from your laptop". On Ctrl+C everything goes back to where it was.
|
|
77
|
+
There is no mock in this mode, so payments are real TON. The first time takes up to 2 minutes while
|
|
78
|
+
the address is published; after that it is instant. Use `--no-register` to share the URL without
|
|
79
|
+
moving offerings. Only one terminal per company at a time: `--force` takes it over. More: docs/TUNNEL.md.
|
|
80
|
+
|
|
65
81
|
## `ambasada deploy --own`: your own Cloudflare account
|
|
66
82
|
|
|
67
83
|
Runs `wrangler deploy` into your account (you need `npx wrangler login` first), then
|