@fungi.computer/oyster 0.50.3 → 0.50.5
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/dist/agent-avatars.d.ts +4 -3
- package/dist/agent-avatars.js +6 -4
- package/dist/embed-metafiles.js +1 -1
- package/dist/embed-scripts.js +1 -1
- package/docs/api/index.md +86 -83
- package/package.json +8 -8
package/dist/agent-avatars.d.ts
CHANGED
|
@@ -34,9 +34,10 @@ export declare const agentAvatarSchema: z.ZodObject<{
|
|
|
34
34
|
/**
|
|
35
35
|
* The avatar as a closed record, for contracts that refuse open maps (Hub
|
|
36
36
|
* projections): each character's appearance names only its own controls,
|
|
37
|
-
* then the catalog refines it exactly as `agentAvatarSchema` does.
|
|
37
|
+
* then the catalog refines it exactly as `agentAvatarSchema` does. Built on
|
|
38
|
+
* first use: constructing it is Worker startup cost no request there needs.
|
|
38
39
|
*/
|
|
39
|
-
export declare const agentAvatarProjectionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
40
|
+
export declare const agentAvatarProjectionSchema: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
40
41
|
v: z.ZodLiteral<1>;
|
|
41
42
|
character: z.ZodLiteral<"mushroom">;
|
|
42
43
|
appearance: z.ZodObject<{
|
|
@@ -87,7 +88,7 @@ export declare const agentAvatarProjectionSchema: z.ZodDiscriminatedUnion<[z.Zod
|
|
|
87
88
|
crt: "crt";
|
|
88
89
|
watercolor: "watercolor";
|
|
89
90
|
}>;
|
|
90
|
-
}, z.core.$strict>], "character"
|
|
91
|
+
}, z.core.$strict>], "character">>;
|
|
91
92
|
/** A projected avatar as the Avatar descriptor Sprite draws. */
|
|
92
93
|
export declare function avatarFromProjection(projected: z.infer<typeof agentAvatarProjectionSchema>): Avatar;
|
|
93
94
|
/** One owner-local store of chosen Agent avatars. */
|
package/dist/agent-avatars.js
CHANGED
|
@@ -23,22 +23,24 @@ function closedCharacterAvatar(character) {
|
|
|
23
23
|
/**
|
|
24
24
|
* The avatar as a closed record, for contracts that refuse open maps (Hub
|
|
25
25
|
* projections): each character's appearance names only its own controls,
|
|
26
|
-
* then the catalog refines it exactly as `agentAvatarSchema` does.
|
|
26
|
+
* then the catalog refines it exactly as `agentAvatarSchema` does. Built on
|
|
27
|
+
* first use: constructing it is Worker startup cost no request there needs.
|
|
27
28
|
*/
|
|
28
|
-
export const agentAvatarProjectionSchema = z
|
|
29
|
+
export const agentAvatarProjectionSchema = z.lazy(() => z
|
|
29
30
|
.discriminatedUnion("character", [
|
|
30
31
|
closedCharacterAvatar("mushroom"),
|
|
31
32
|
closedCharacterAvatar("cat"),
|
|
32
33
|
closedCharacterAvatar("burger"),
|
|
33
34
|
])
|
|
34
35
|
.superRefine((avatar, context) => {
|
|
35
|
-
for (const issue of agentAvatarSchema.safeParse(avatar).error?.issues ??
|
|
36
|
+
for (const issue of agentAvatarSchema.safeParse(avatar).error?.issues ??
|
|
37
|
+
[])
|
|
36
38
|
context.addIssue({
|
|
37
39
|
code: "custom",
|
|
38
40
|
path: issue.path,
|
|
39
41
|
message: issue.message,
|
|
40
42
|
});
|
|
41
|
-
});
|
|
43
|
+
}));
|
|
42
44
|
/** A projected avatar as the Avatar descriptor Sprite draws. */
|
|
43
45
|
export function avatarFromProjection(projected) {
|
|
44
46
|
return agentAvatarSchema.parse(projected);
|