@womp/openai-plugin 0.11.1 → 0.13.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/README.md +7 -2
- package/dist/index.d.ts +16 -2
- package/dist/index.js +17 -17
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -45,7 +45,7 @@ src/
|
|
|
45
45
|
| `WompBackend` | the contract the host implements |
|
|
46
46
|
| `BackendRefusal` | an error whose message reaches the model as worded |
|
|
47
47
|
| `CheckoutSession`, `CompleteCheckoutArgs` | ChatGPT's payment sheet: the session it takes, and what it hands `complete_checkout` |
|
|
48
|
-
| `LiveView`, `ClaimLink` | what `
|
|
48
|
+
| `LiveView`, `ClaimLink` | what `liveView` and `claimLink` return for the design card's live view and account link |
|
|
49
49
|
|
|
50
50
|
`subject` is the caller as the host established it. `onError` receives every
|
|
51
51
|
error that is not a `BackendRefusal`. `instructions` is appended to the
|
|
@@ -62,16 +62,18 @@ sign-in.
|
|
|
62
62
|
|
|
63
63
|
| Method | Does |
|
|
64
64
|
|---|---|
|
|
65
|
-
| `openScene(subject, { designId?, title? })` | finds the caller's design, or makes one, and opens a **build** of it; returns `{ designId, buildId, title
|
|
65
|
+
| `openScene(subject, { designId?, title? })` | finds the caller's design, or makes one, and opens a **build** of it; returns `{ designId, buildId, title }` |
|
|
66
66
|
| `getSceneApi()` | the scene skill, script limits, view names, and `notes` about these designs |
|
|
67
67
|
| `runScript(subject, { designId, code, purpose })` | runs one script on the design; `purpose` becomes the current build's activity, its last screenshot or a fresh render its picture; a failed script returns `ok: false` |
|
|
68
68
|
| `renderScene(subject, { designId, view?, targetId? })` | renders the design; the image also becomes the current build's picture |
|
|
69
69
|
| `getMaterials(subject)` | the materials on offer to the caller, before any design exists: each with its label, whether it prints in one colour (`colorRequired`) and its finishes, the first the default; and the largest size checkout takes |
|
|
70
70
|
| `analyzePrint(subject, { designId, longestSideCm?, parts? })` | the design as its scene is now, analysed as it prints at its own size, or scaled so its longest side is `longestSideCm`, changing nothing, leaving out Areas named `REFERENCE` (bought parts modelled only to show a fit); with `parts` (node ids of Areas that print), only those Areas, at the scale of the whole design: size, whether it fits the largest size, separate pieces, and the price per piece in each material on offer |
|
|
71
71
|
| `finishScene(subject, { designId, title })` | marks the current build done, with this version's title; called only for a design that passed the print checks |
|
|
72
|
+
| `liveView?(subject, { designId })` | optional: the caller's design live in 3D on `liveViewOrigin`, with a new key, made each time the design card opens its live view; a design that isn't the caller's is a `BackendRefusal`; undefined when it can't now; without it, or without `liveViewOrigin`, the design card offers no live view |
|
|
72
73
|
| `claimLink?(subject)` | optional: a one-time link to a page that keeps the chat's designs in an account; without it the design card offers no button |
|
|
73
74
|
| `getBuild(subject, { designId, buildId })` | a build's status, activity, title and picture; a build that isn't the caller's reads as empty |
|
|
74
75
|
| `checkoutDesign(subject, { designId, items, longestSideCm?, shipTo? })` | freezes the design as quoted, at its own size or scaled to `longestSideCm`, and without its `REFERENCE` Areas, and returns the quote with one checkout link for all its `items`, each `{ parts?, material, color?, finish?, quantity? }`: the Areas `parts` names, or the whole design, priced on its own; with `shipTo`, also shipping to that address: from a host with `completeCheckout`, the order there as a payment-sheet `session`, else `shipping`, the cheapest shipping as the user's checkout on the web first offers it and the day it arrives; called only when every item passed the print checks |
|
|
76
|
+
| `checkoutLink?(subject, { url })` | optional: `url`, a checkout link `checkoutDesign` returned, as a one-time link that for a few minutes also signs a signed-out browser in to the caller's account; undefined when it can't now; without it, or then, the quote card's Checkout opens `url` as it is |
|
|
75
77
|
| `completeCheckout?(subject, payment)` | optional: charges a payment made in ChatGPT's payment sheet and places the session's order; without it there is no `complete_checkout`, and a quote to an address carries `shipping` instead of a session |
|
|
76
78
|
| `getOrderStatus(subject, { orderId? })` | the caller's paid orders, newest first, and the one to show, with no name, address, email or money |
|
|
77
79
|
|
|
@@ -93,6 +95,7 @@ changes an earlier one.
|
|
|
93
95
|
- **Tool metadata states facts.** Descriptions, input schemas and server instructions say what a tool does, never how the model should behave. Behaviour lives in `prompts/` and reaches the model in `load_scene_skill`'s result.
|
|
94
96
|
- **Every tool** declares `ui.visibility`, explicit annotation hints, and `securitySchemes: oauth2` with the `mcp:generate` scope. Tools only a card calls are `ui.visibility: ["app"]`.
|
|
95
97
|
- **Card data** is the tool result's `structuredContent`, typed by the card's `data.ts`. Tools map backend types to it; a card never receives backend types. What only the card may see is in the result's `_meta`, typed by the same `data.ts`: a link that is a credential, and a quote or an order, which the model would otherwise draw as a card of its own.
|
|
98
|
+
- **Live view.** `open_scene` sets `_meta.live` when the host has `liveView` and `liveViewOrigin`. The design card then offers the live view for as long as it is shown, and asks `get_live_view` for a new key each time it opens it. A result from before 0.13.0 carries a live view with its own key in `_meta.live`; the card reads it as the same offer, whether or not that key has expired.
|
|
96
99
|
- **Cards** are MCP Apps resources (`text/html;profile=mcp-app`): one self-contained HTML file each, loading no script, style or font from outside, at a fixed URI, `ui://womp/<card>.html`. A ChatGPT app added while card URIs were content hashes keeps the URI of its time, `ui://womp/<card>-<hash>.html`; every such URI reads as the current card. Only the design card frames a page: the live view, on `liveViewOrigin`.
|
|
97
100
|
|
|
98
101
|
### Tools
|
|
@@ -105,8 +108,10 @@ changes an earlier one.
|
|
|
105
108
|
| `render_scene` | model | |
|
|
106
109
|
| `finish_scene` | model | |
|
|
107
110
|
| `get_scene_progress` | `design` card | |
|
|
111
|
+
| `get_live_view` | `design` card | |
|
|
108
112
|
| `get_claim_link` | `design` card | |
|
|
109
113
|
| `checkout_design` | model | shows `quote` |
|
|
114
|
+
| `get_checkout_link` | `quote` card, only with `checkoutLink` | |
|
|
110
115
|
| `complete_checkout` | model and ChatGPT's payment sheet, only with `completeCheckout` | |
|
|
111
116
|
| `get_order_status` | model | shows `order` |
|
|
112
117
|
|
package/dist/index.d.ts
CHANGED
|
@@ -250,7 +250,6 @@ interface Order extends OrderSummary {
|
|
|
250
250
|
statusUrl: string | null;
|
|
251
251
|
}
|
|
252
252
|
interface WompBackend {
|
|
253
|
-
/** `live` is optional: a host that cannot offer a live view leaves it out and the card shows its picture. */
|
|
254
253
|
openScene(subject: string, input: {
|
|
255
254
|
designId?: string;
|
|
256
255
|
title?: string;
|
|
@@ -258,7 +257,6 @@ interface WompBackend {
|
|
|
258
257
|
designId: string;
|
|
259
258
|
buildId: string;
|
|
260
259
|
title: string;
|
|
261
|
-
live?: LiveView;
|
|
262
260
|
}>;
|
|
263
261
|
getSceneApi(): Promise<SceneApi>;
|
|
264
262
|
runScript(subject: string, input: {
|
|
@@ -286,6 +284,14 @@ interface WompBackend {
|
|
|
286
284
|
designId: string;
|
|
287
285
|
title: string;
|
|
288
286
|
}): Promise<void>;
|
|
287
|
+
/**
|
|
288
|
+
* Optional: the design live in 3D with a new key, which the card asks for each time it opens the live view. A design
|
|
289
|
+
* that isn't this user's is a `BackendRefusal`; undefined when there is no live view now. Without it the card offers
|
|
290
|
+
* no live view.
|
|
291
|
+
*/
|
|
292
|
+
liveView?(subject: string, input: {
|
|
293
|
+
designId: string;
|
|
294
|
+
}): Promise<LiveView | undefined>;
|
|
289
295
|
/** Optional: without it the card offers no account button. Undefined when no link is available now. */
|
|
290
296
|
claimLink?(subject: string): Promise<ClaimLink | undefined>;
|
|
291
297
|
getBuild(subject: string, input: {
|
|
@@ -309,6 +315,14 @@ interface WompBackend {
|
|
|
309
315
|
longestSideCm?: number;
|
|
310
316
|
shipTo?: ShipTo;
|
|
311
317
|
}): Promise<Checkout>;
|
|
318
|
+
/**
|
|
319
|
+
* Optional: `url`, a checkout link from `checkoutDesign`, as a one-time link that for a few minutes also signs a
|
|
320
|
+
* signed-out browser in to this user's account. Undefined when it can't now; without it, or then, the quote card opens
|
|
321
|
+
* `url` as it is.
|
|
322
|
+
*/
|
|
323
|
+
checkoutLink?(subject: string, input: {
|
|
324
|
+
url: string;
|
|
325
|
+
}): Promise<CheckoutLink | undefined>;
|
|
312
326
|
/** Optional: charges a payment from ChatGPT's payment sheet and places the order; without it, checkout is on the web alone. */
|
|
313
327
|
completeCheckout?(subject: string, payment: CompleteCheckoutArgs): Promise<CheckoutSession>;
|
|
314
328
|
/** The user's paid orders, newest first, and the one to show: `orderId` when it is one of theirs, else the newest. */
|