@womp/openai-plugin 0.8.1 → 0.9.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 +3 -3
- package/dist/index.d.ts +27 -14
- package/dist/index.js +24 -22
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -67,11 +67,11 @@ sign-in.
|
|
|
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
|
-
| `analyzePrint(subject, { designId, longestSideCm? })` | 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): size, whether it fits the largest size, separate pieces, and the price per piece in each material on offer |
|
|
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
72
|
| `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
73
|
| `getBuild(subject, { designId, buildId })` | a build's status, activity, title and picture; a build that isn't the caller's reads as empty |
|
|
74
|
-
| `checkoutDesign(subject, { designId,
|
|
74
|
+
| `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 the order to that address as a payment-sheet session; called only when every item passed the print checks |
|
|
75
75
|
| `completeCheckout?(subject, payment)` | optional: charges a payment made in ChatGPT's payment sheet and places the session's order; without it `checkout_design` takes no `shipTo` and there is no `complete_checkout` |
|
|
76
76
|
| `getOrderStatus(subject, { orderId? })` | the caller's paid orders, newest first, and the one to show, with no name, address, email or money |
|
|
77
77
|
|
|
@@ -82,7 +82,7 @@ changes an earlier one.
|
|
|
82
82
|
|
|
83
83
|
- **Identity.** Every tool acts as `subject`, the signed-in Womp account. Tool arguments and client `_meta` are never read for identity. Without a subject every tool call fails; with `wwwAuthenticate`, the failure carries that challenge in `_meta["mcp/www_authenticate"]`, so ChatGPT offers to link the account.
|
|
84
84
|
- **Brief and review.** `open_scene` requires a brief (a full one for a new design, an edit brief to reopen one) and `finish_scene` the critic's review. Both stay in the chat: the backend never receives them.
|
|
85
|
-
- **Print checks.** `finish_scene` and `checkout_design` take the material, finish, colour and pieces, analyse the design as it is now (`analyzePrint`) and check it (`printability.ts`): the material and finish are on offer, a material that prints in one colour has it as `#rrggbb`, the size fits, and it prints as the pieces given (1 by default). Only a design that passes is finished (`finishScene`)
|
|
85
|
+
- **Print checks.** `finish_scene` and `checkout_design` take the material, finish, colour and pieces, analyse the design as it is now (`analyzePrint`) and check it (`printability.ts`): the material and finish are on offer, a material that prints in one colour has it as `#rrggbb`, the size fits, and it prints as the pieces given (1 by default). `checkout_design` takes them for each of its items and checks each item on its own: the parts it names, or the whole design. Only a design that passes is finished (`finishScene`), and only when every item passes is it quoted (`checkoutDesign`).
|
|
86
86
|
- **Prompts** are five parts, each a template literal in its own tag, after one line on the workflow.
|
|
87
87
|
- `<brief>` (`brief.ts`): what to build: research, size, parts, proportions, silhouette, the material and the pieces.
|
|
88
88
|
- `<experience>` (`experience.ts`): the user, the conversation, the card, the product shot, the order of the tools, the print checks as they reach the user.
|
package/dist/index.d.ts
CHANGED
|
@@ -110,19 +110,25 @@ interface CheckoutLink {
|
|
|
110
110
|
url: string;
|
|
111
111
|
expiresAt: string;
|
|
112
112
|
}
|
|
113
|
-
/** A design quoted for ordering, as the user chose it. */
|
|
113
|
+
/** A design quoted for ordering, as the user chose it: its items, in one order. */
|
|
114
114
|
interface Checkout {
|
|
115
115
|
designId: string;
|
|
116
116
|
title: string;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
117
|
+
items: {
|
|
118
|
+
/** The names of the Areas it prints; empty for the whole design. */
|
|
119
|
+
parts: string[];
|
|
120
|
+
/** The item as an order lists it, such as "Tinted clear · #e11d48 · glossy · 4.0 × 3.0 × 1.0 cm". */
|
|
121
|
+
summary: string;
|
|
122
|
+
quantity: number;
|
|
123
|
+
/** How many separate pieces each one prints as. */
|
|
124
|
+
pieces: number;
|
|
125
|
+
/** The whole quantity's price, before shipping. */
|
|
126
|
+
price: number;
|
|
127
|
+
}[];
|
|
122
128
|
currency: string;
|
|
123
|
-
/**
|
|
129
|
+
/** Every item's price together, before shipping. */
|
|
124
130
|
price: number;
|
|
125
|
-
/** The day
|
|
131
|
+
/** The day the order leaves the factory, as YYYY-MM-DD. */
|
|
126
132
|
shipsBy: string;
|
|
127
133
|
minimumOrder: MinimumOrder;
|
|
128
134
|
link: CheckoutLink;
|
|
@@ -265,10 +271,11 @@ interface WompBackend {
|
|
|
265
271
|
materials: Material[];
|
|
266
272
|
maxSizeCm: [number, number, number];
|
|
267
273
|
}>;
|
|
268
|
-
/** The design as its scene is now, analysed and priced. Changes nothing. */
|
|
274
|
+
/** The design as its scene is now, or only the Areas `parts` names, analysed and priced. Changes nothing. */
|
|
269
275
|
analyzePrint(subject: string, input: {
|
|
270
276
|
designId: string;
|
|
271
277
|
longestSideCm?: number;
|
|
278
|
+
parts?: number[];
|
|
272
279
|
}): Promise<PrintAnalysis>;
|
|
273
280
|
finishScene(subject: string, input: {
|
|
274
281
|
designId: string;
|
|
@@ -280,13 +287,19 @@ interface WompBackend {
|
|
|
280
287
|
designId: string;
|
|
281
288
|
buildId: string;
|
|
282
289
|
}): Promise<Build>;
|
|
283
|
-
/**
|
|
290
|
+
/**
|
|
291
|
+
* Freezes the design as quoted, at `longestSideCm` when given, so its order prints it as it is now: every item in one
|
|
292
|
+
* checkout, each the Areas its `parts` names or the whole design. `shipTo` comes only to a host with `completeCheckout`.
|
|
293
|
+
*/
|
|
284
294
|
checkoutDesign(subject: string, input: {
|
|
285
295
|
designId: string;
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
296
|
+
items: {
|
|
297
|
+
parts?: number[];
|
|
298
|
+
material: string;
|
|
299
|
+
color?: string;
|
|
300
|
+
finish?: string;
|
|
301
|
+
quantity?: number;
|
|
302
|
+
}[];
|
|
290
303
|
longestSideCm?: number;
|
|
291
304
|
shipTo?: ShipTo;
|
|
292
305
|
}): Promise<Checkout>;
|