@fungi.computer/oyster 0.1.0 → 0.2.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/dist/agent-avatars.d.ts +103 -0
- package/dist/agent-avatars.js +66 -0
- package/dist/agents.d.ts +12 -2
- package/dist/agents.js +39 -2
- package/dist/apps/gate.d.ts +7 -7
- package/dist/apps/gate.js +6 -6
- package/dist/apps/installation.d.ts +35 -35
- package/dist/apps/installation.js +20 -19
- package/dist/build/candidate-cli.mjs +55 -5
- package/dist/build-egress.js +4 -4
- package/dist/cloudflare.js +4 -4
- package/dist/frame-binding-wire-script.js +1 -1
- package/dist/frame-binding-wire.d.ts +1 -1
- package/dist/frame-binding-wire.js +1 -1
- package/dist/git-journal.js +4 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/installation-consent.d.ts +3 -1
- package/dist/installation-consent.js +2 -0
- package/dist/page/mount.d.ts +4 -8
- package/dist/page-script.js +4 -4
- package/dist/shell/app-directory.d.ts +37 -37
- package/dist/shell/app-directory.js +15 -18
- package/dist/shell/window-manager.d.ts +5 -1
- package/dist/shell/window-manager.js +21 -2
- package/dist/shell/workbench-directory.d.ts +9 -9
- package/dist/shell/workbench-host-types.d.ts +1 -1
- package/dist/shell/workbench-host.js +5 -0
- package/dist/shell/workbench-model.d.ts +3 -1
- package/dist/standalone/agents.d.ts +11 -4
- package/dist/standalone/agents.js +44 -5
- package/dist/standalone/app-builds-binding.js +6 -6
- package/dist/standalone/computer.js +3 -3
- package/dist/standalone/preview.js +2 -2
- package/dist/standalone/worker.js +2 -2
- package/dist/standalone/workflow-binding.d.ts +10 -10
- package/dist/standalone/workflow-binding.js +2 -2
- package/dist/standalone/workflow-host.d.ts +37 -13
- package/dist/standalone/workflow-host.js +36 -9
- package/dist/standalone/workflow-trigger-host.d.ts +24 -2
- package/dist/standalone/workflows.d.ts +67 -11
- package/dist/workers-git.js +1 -4
- package/package.json +19 -17
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An Agent's avatar is host data on the Agent, beside its directory record:
|
|
3
|
+
* the one the owner chose, else Sprite's `seededAvatar(agentId)`. The seeded
|
|
4
|
+
* default is a pure function of identity, so it is computed, never stored,
|
|
5
|
+
* and an Agent created before any choice needs no stored row. Conversations
|
|
6
|
+
* carry no avatar of their own. Both hosts (the Hub's Team store and a
|
|
7
|
+
* standalone Oyster's Agent directory) keep the row in the same owner-local
|
|
8
|
+
* SQLite as the directory, so a choice commits and erases with its Agent.
|
|
9
|
+
*/
|
|
10
|
+
import type { WatchdogSqliteOwner } from "@fungi.computer/watchdog";
|
|
11
|
+
import { type Avatar } from "@fungi.computer/sprite/avatar";
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
/** The catalog-valid avatar an owner may choose for an Agent. */
|
|
14
|
+
export declare const agentAvatarSchema: z.ZodObject<{
|
|
15
|
+
v: z.ZodLiteral<1>;
|
|
16
|
+
character: z.ZodEnum<{
|
|
17
|
+
mushroom: "mushroom";
|
|
18
|
+
cat: "cat";
|
|
19
|
+
burger: "burger";
|
|
20
|
+
}>;
|
|
21
|
+
appearance: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
22
|
+
expression: z.ZodString;
|
|
23
|
+
renderStyle: z.ZodEnum<{
|
|
24
|
+
plain: "plain";
|
|
25
|
+
pencil: "pencil";
|
|
26
|
+
manga: "manga";
|
|
27
|
+
riso: "riso";
|
|
28
|
+
halftone: "halftone";
|
|
29
|
+
blueprint: "blueprint";
|
|
30
|
+
crt: "crt";
|
|
31
|
+
watercolor: "watercolor";
|
|
32
|
+
}>;
|
|
33
|
+
}, z.core.$strict>;
|
|
34
|
+
/**
|
|
35
|
+
* The avatar as a closed record, for contracts that refuse open maps (Hub
|
|
36
|
+
* projections): each character's appearance names only its own controls,
|
|
37
|
+
* then the catalog refines it exactly as `agentAvatarSchema` does.
|
|
38
|
+
*/
|
|
39
|
+
export declare const agentAvatarProjectionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
40
|
+
v: z.ZodLiteral<1>;
|
|
41
|
+
character: z.ZodLiteral<"mushroom">;
|
|
42
|
+
appearance: z.ZodObject<{
|
|
43
|
+
[x: string]: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
44
|
+
}, z.core.$strict>;
|
|
45
|
+
expression: z.ZodString;
|
|
46
|
+
renderStyle: z.ZodEnum<{
|
|
47
|
+
plain: "plain";
|
|
48
|
+
pencil: "pencil";
|
|
49
|
+
manga: "manga";
|
|
50
|
+
riso: "riso";
|
|
51
|
+
halftone: "halftone";
|
|
52
|
+
blueprint: "blueprint";
|
|
53
|
+
crt: "crt";
|
|
54
|
+
watercolor: "watercolor";
|
|
55
|
+
}>;
|
|
56
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
57
|
+
v: z.ZodLiteral<1>;
|
|
58
|
+
character: z.ZodLiteral<"cat">;
|
|
59
|
+
appearance: z.ZodObject<{
|
|
60
|
+
[x: string]: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
61
|
+
}, z.core.$strict>;
|
|
62
|
+
expression: z.ZodString;
|
|
63
|
+
renderStyle: z.ZodEnum<{
|
|
64
|
+
plain: "plain";
|
|
65
|
+
pencil: "pencil";
|
|
66
|
+
manga: "manga";
|
|
67
|
+
riso: "riso";
|
|
68
|
+
halftone: "halftone";
|
|
69
|
+
blueprint: "blueprint";
|
|
70
|
+
crt: "crt";
|
|
71
|
+
watercolor: "watercolor";
|
|
72
|
+
}>;
|
|
73
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
74
|
+
v: z.ZodLiteral<1>;
|
|
75
|
+
character: z.ZodLiteral<"burger">;
|
|
76
|
+
appearance: z.ZodObject<{
|
|
77
|
+
[x: string]: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
78
|
+
}, z.core.$strict>;
|
|
79
|
+
expression: z.ZodString;
|
|
80
|
+
renderStyle: z.ZodEnum<{
|
|
81
|
+
plain: "plain";
|
|
82
|
+
pencil: "pencil";
|
|
83
|
+
manga: "manga";
|
|
84
|
+
riso: "riso";
|
|
85
|
+
halftone: "halftone";
|
|
86
|
+
blueprint: "blueprint";
|
|
87
|
+
crt: "crt";
|
|
88
|
+
watercolor: "watercolor";
|
|
89
|
+
}>;
|
|
90
|
+
}, z.core.$strict>], "character">;
|
|
91
|
+
/** A projected avatar as the Avatar descriptor Sprite draws. */
|
|
92
|
+
export declare function avatarFromProjection(projected: z.infer<typeof agentAvatarProjectionSchema>): Avatar;
|
|
93
|
+
/** One owner-local store of chosen Agent avatars. */
|
|
94
|
+
export type AgentAvatarStore = Readonly<{
|
|
95
|
+
/** The Agent's avatar: its chosen one, else its seeded default. */
|
|
96
|
+
read(agentId: string): Avatar;
|
|
97
|
+
/** Record the owner's choice; the caller owns the Agent's existence. */
|
|
98
|
+
write(agentId: string, avatar: Avatar): void;
|
|
99
|
+
/** Forget a removed Agent's choice in the caller's removal transaction. */
|
|
100
|
+
remove(agentId: string): void;
|
|
101
|
+
}>;
|
|
102
|
+
/** Open the chosen-avatar table in the Agent directory's own SQLite. */
|
|
103
|
+
export declare function createAgentAvatarStore(sql: WatchdogSqliteOwner["sql"]): AgentAvatarStore;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { seededAvatar } from "@fungi.computer/sprite/avatar";
|
|
2
|
+
import { avatarSchema } from "@fungi.computer/sprite-zdog/avatar";
|
|
3
|
+
import { avatarCatalog } from "@fungi.computer/sprite-zdog/catalog";
|
|
4
|
+
import { renderStyleSchema } from "@fungi.computer/sprite";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
const storedAvatarRowSchema = z.strictObject({ avatar: z.string() });
|
|
7
|
+
/** The catalog-valid avatar an owner may choose for an Agent. */
|
|
8
|
+
export const agentAvatarSchema = avatarSchema;
|
|
9
|
+
const appearanceValue = z.union([z.string(), z.number(), z.boolean()]);
|
|
10
|
+
/** One character's avatar with its appearance closed to that character's controls. */
|
|
11
|
+
function closedCharacterAvatar(character) {
|
|
12
|
+
return z.strictObject({
|
|
13
|
+
v: z.literal(1),
|
|
14
|
+
character: z.literal(character),
|
|
15
|
+
appearance: z.strictObject(Object.fromEntries(Object.keys(avatarCatalog[character].controls).map((control) => [
|
|
16
|
+
control,
|
|
17
|
+
appearanceValue.optional(),
|
|
18
|
+
]))),
|
|
19
|
+
expression: z.string().min(1),
|
|
20
|
+
renderStyle: renderStyleSchema,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The avatar as a closed record, for contracts that refuse open maps (Hub
|
|
25
|
+
* projections): each character's appearance names only its own controls,
|
|
26
|
+
* then the catalog refines it exactly as `agentAvatarSchema` does.
|
|
27
|
+
*/
|
|
28
|
+
export const agentAvatarProjectionSchema = z
|
|
29
|
+
.discriminatedUnion("character", [
|
|
30
|
+
closedCharacterAvatar("mushroom"),
|
|
31
|
+
closedCharacterAvatar("cat"),
|
|
32
|
+
closedCharacterAvatar("burger"),
|
|
33
|
+
])
|
|
34
|
+
.superRefine((avatar, context) => {
|
|
35
|
+
for (const issue of agentAvatarSchema.safeParse(avatar).error?.issues ?? [])
|
|
36
|
+
context.addIssue({
|
|
37
|
+
code: "custom",
|
|
38
|
+
path: issue.path,
|
|
39
|
+
message: issue.message,
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
/** A projected avatar as the Avatar descriptor Sprite draws. */
|
|
43
|
+
export function avatarFromProjection(projected) {
|
|
44
|
+
return agentAvatarSchema.parse(projected);
|
|
45
|
+
}
|
|
46
|
+
/** Open the chosen-avatar table in the Agent directory's own SQLite. */
|
|
47
|
+
export function createAgentAvatarStore(sql) {
|
|
48
|
+
sql.exec("CREATE TABLE IF NOT EXISTS agent_avatars (agent_id TEXT PRIMARY KEY, avatar TEXT NOT NULL) STRICT");
|
|
49
|
+
return {
|
|
50
|
+
read(agentId) {
|
|
51
|
+
const row = sql
|
|
52
|
+
.exec("SELECT avatar FROM agent_avatars WHERE agent_id = ?", agentId)
|
|
53
|
+
.toArray()[0];
|
|
54
|
+
if (row === undefined)
|
|
55
|
+
return seededAvatar(agentId);
|
|
56
|
+
const stored = storedAvatarRowSchema.parse(row);
|
|
57
|
+
return agentAvatarSchema.parse(JSON.parse(stored.avatar));
|
|
58
|
+
},
|
|
59
|
+
write(agentId, avatar) {
|
|
60
|
+
sql.exec("INSERT INTO agent_avatars(agent_id, avatar) VALUES(?, ?) ON CONFLICT(agent_id) DO UPDATE SET avatar = excluded.avatar", agentId, JSON.stringify(agentAvatarSchema.parse(avatar)));
|
|
61
|
+
},
|
|
62
|
+
remove(agentId) {
|
|
63
|
+
sql.exec("DELETE FROM agent_avatars WHERE agent_id = ?", agentId);
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
}
|
package/dist/agents.d.ts
CHANGED
|
@@ -10,11 +10,14 @@ import type { AppToolPolicy } from "./apps/tools.js";
|
|
|
10
10
|
import * as Schema from "effect/Schema";
|
|
11
11
|
import { type OysterCapability, type OysterEnv, type OysterPrincipal } from "./host.js";
|
|
12
12
|
import type { HostActor } from "@fungi.computer/puffball/app";
|
|
13
|
+
import type { Avatar } from "@fungi.computer/sprite/avatar";
|
|
13
14
|
import type { MemberInboxItem, MemberInboxSession } from "@fungi.computer/puffball/inbox";
|
|
14
15
|
/** One agent as Apps see it, in Agar's `appAgentSchema` shape. */
|
|
15
16
|
export type OysterAgent = Readonly<{
|
|
16
17
|
agentId: string;
|
|
17
18
|
name: string;
|
|
19
|
+
/** The Agent's own avatar: the owner's choice, else its seeded default. */
|
|
20
|
+
avatar: Avatar;
|
|
18
21
|
sessionOperations: readonly ("agent.read" | "agent.send" | "agent.manage")[];
|
|
19
22
|
}>;
|
|
20
23
|
/** An Agent owner's Session facts before the member identity and visit are added. */
|
|
@@ -70,12 +73,19 @@ export type AgentToolPolicyStatus = Readonly<{
|
|
|
70
73
|
export type OysterAgents = Readonly<{
|
|
71
74
|
/** Every agent, oldest first. */
|
|
72
75
|
list(): Promise<readonly OysterAgent[]>;
|
|
73
|
-
/**
|
|
74
|
-
|
|
76
|
+
/**
|
|
77
|
+
* Create an agent; retrying with the same `requestId` returns the same one.
|
|
78
|
+
* With no `avatar` it wears its seeded default until the owner picks one.
|
|
79
|
+
*/
|
|
80
|
+
create(name: string, requestId: string, principal: OysterPrincipal, actor: AgentPolicyActor, avatar?: Avatar): Promise<OysterAgent>;
|
|
75
81
|
/** Owner-only rename; refuses a name already held by another Agent. */
|
|
76
82
|
rename(agentId: string, name: string, principal: OysterPrincipal): Promise<OysterAgent | Readonly<{
|
|
77
83
|
error: "not_found" | "name_taken" | "not_granted";
|
|
78
84
|
}>>;
|
|
85
|
+
/** Owner-only avatar change for an existing Agent. */
|
|
86
|
+
setAvatar(agentId: string, avatar: Avatar, principal: OysterPrincipal): Promise<OysterAgent | Readonly<{
|
|
87
|
+
error: "not_found" | "not_granted";
|
|
88
|
+
}>>;
|
|
79
89
|
/** This Agent's App-tool policy status, or `null` for no such Agent. */
|
|
80
90
|
policyStatus(agentId: string): Promise<AgentToolPolicyStatus | null>;
|
|
81
91
|
/** Read this Agent's stored App-tool approval; absence requires re-approval. A key's App access is its own grants (Ear Tag), not this policy. */
|
package/dist/agents.js
CHANGED
|
@@ -7,8 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { Hono } from "hono";
|
|
9
9
|
import * as Schema from "effect/Schema";
|
|
10
|
+
import { z } from "zod";
|
|
10
11
|
import { oysterPrincipalIsOwner, } from "./host.js";
|
|
11
|
-
import {
|
|
12
|
+
import { agentAvatarSchema } from "./agent-avatars.js";
|
|
13
|
+
import { agentAvatar, agentList, agentManage, agentRename, agentSessionRead, agentSessionWrite, agentToolPolicy, } from "@fungi.computer/agar/agents";
|
|
12
14
|
/** At most this many MCP servers per Agent. */
|
|
13
15
|
export const maxAgentMcpServers = 16;
|
|
14
16
|
/** Owner input for one MCP server: a guest identifier, an `https:` endpoint and an optional bearer. */
|
|
@@ -30,10 +32,12 @@ export const agentMcpServerInputSchema = Schema.Struct({
|
|
|
30
32
|
const createSchema = Schema.Struct({
|
|
31
33
|
name: Schema.String.check(Schema.isMinLength(1), Schema.isMaxLength(256)),
|
|
32
34
|
requestId: Schema.String.check(Schema.isPattern(/^[A-Za-z0-9_.:-]{1,256}$/u)),
|
|
35
|
+
avatar: Schema.optionalKey(Schema.Unknown),
|
|
33
36
|
});
|
|
34
37
|
const renameSchema = Schema.Struct({
|
|
35
38
|
name: Schema.String.check(Schema.isMinLength(1), Schema.isMaxLength(256)),
|
|
36
39
|
});
|
|
40
|
+
const avatarInputSchema = z.object({ avatar: agentAvatarSchema });
|
|
37
41
|
const visitSchema = Schema.Struct({
|
|
38
42
|
agentId: Schema.String,
|
|
39
43
|
sessionId: Schema.String,
|
|
@@ -76,6 +80,19 @@ export function agentCapabilities(agents) {
|
|
|
76
80
|
rename: { kind: "json", method: "PUT", path: "agent-names/:agentId" },
|
|
77
81
|
},
|
|
78
82
|
},
|
|
83
|
+
{
|
|
84
|
+
...shared,
|
|
85
|
+
id: "agent.avatar",
|
|
86
|
+
permission: "agent.avatar",
|
|
87
|
+
version: agentAvatar.version,
|
|
88
|
+
methods: {
|
|
89
|
+
setAvatar: {
|
|
90
|
+
kind: "json",
|
|
91
|
+
method: "PUT",
|
|
92
|
+
path: "agent-avatars/:agentId",
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
},
|
|
79
96
|
{
|
|
80
97
|
...shared,
|
|
81
98
|
id: "agent.toolPolicy",
|
|
@@ -126,9 +143,14 @@ function createAgentRoutes(agents) {
|
|
|
126
143
|
const body = Schema.decodeUnknownOption(createSchema)(await context.req.json());
|
|
127
144
|
if (body._tag === "None")
|
|
128
145
|
return refusal(400, "Name the agent");
|
|
146
|
+
const avatar = body.value.avatar === undefined
|
|
147
|
+
? undefined
|
|
148
|
+
: agentAvatarSchema.safeParse(body.value.avatar);
|
|
149
|
+
if (avatar?.success === false)
|
|
150
|
+
return refusal(400, "Choose a valid avatar");
|
|
129
151
|
// The owner's own authenticated request creates this Agent; its App tools
|
|
130
152
|
// are approved the same way direct owner approval is, with no second path.
|
|
131
|
-
return Response.json(await agents.create(body.value.name, body.value.requestId, principal, "owner-direct"));
|
|
153
|
+
return Response.json(await agents.create(body.value.name, body.value.requestId, principal, "owner-direct", avatar?.data));
|
|
132
154
|
});
|
|
133
155
|
routes.put("/agent-names/:agentId", async (context) => {
|
|
134
156
|
const { principal } = context.env;
|
|
@@ -149,6 +171,21 @@ function createAgentRoutes(agents) {
|
|
|
149
171
|
: 403, result.error);
|
|
150
172
|
return Response.json(result);
|
|
151
173
|
});
|
|
174
|
+
routes.put("/agent-avatars/:agentId", async (context) => {
|
|
175
|
+
const { principal } = context.env;
|
|
176
|
+
if (!oysterPrincipalIsOwner(principal))
|
|
177
|
+
return refusal(403, "Only the owner changes avatars");
|
|
178
|
+
const agentId = context.req.param("agentId");
|
|
179
|
+
if (!agentIdPattern.test(agentId))
|
|
180
|
+
return refusal(404, "No such agent");
|
|
181
|
+
const body = avatarInputSchema.safeParse(await context.req.json());
|
|
182
|
+
if (!body.success)
|
|
183
|
+
return refusal(400, "Choose a valid avatar");
|
|
184
|
+
const result = await agents.setAvatar(agentId, body.data.avatar, principal);
|
|
185
|
+
if ("error" in result)
|
|
186
|
+
return refusal(result.error === "not_found" ? 404 : 403, result.error);
|
|
187
|
+
return Response.json(result);
|
|
188
|
+
});
|
|
152
189
|
routes.get("/agent-policies/:agentId", async (context) => {
|
|
153
190
|
const agentId = context.req.param("agentId");
|
|
154
191
|
if (!agentIdPattern.test(agentId))
|
package/dist/apps/gate.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export type HostPrincipal = Readonly<{
|
|
|
10
10
|
role: "owner" | "member" | null;
|
|
11
11
|
}>;
|
|
12
12
|
/** Requests select existing SDK methods, opaque backend calls and derived operation identities. */
|
|
13
|
-
export declare const gateRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
13
|
+
export declare const gateRequestSchema: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
14
14
|
kind: z.ZodLiteral<"method">;
|
|
15
15
|
name: z.ZodString;
|
|
16
16
|
input: z.ZodUnknown;
|
|
@@ -22,7 +22,7 @@ export declare const gateRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
22
22
|
}>;
|
|
23
23
|
}, z.core.$strict>, z.ZodObject<{
|
|
24
24
|
kind: z.ZodLiteral<"capability-route">;
|
|
25
|
-
capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"agent.list" | "agent.manage" | "agent.rename" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage", unknown>>;
|
|
25
|
+
capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage", unknown>>;
|
|
26
26
|
operation: z.ZodString;
|
|
27
27
|
}, z.core.$strict>, z.ZodObject<{
|
|
28
28
|
kind: z.ZodLiteral<"binding">;
|
|
@@ -32,7 +32,7 @@ export declare const gateRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
32
32
|
kind: z.ZodLiteral<"list-tools">;
|
|
33
33
|
}, z.core.$strict>, z.ZodObject<{
|
|
34
34
|
kind: z.ZodLiteral<"backend">;
|
|
35
|
-
}, z.core.$strict>], "kind"
|
|
35
|
+
}, z.core.$strict>], "kind">>;
|
|
36
36
|
/** One decoded method, route, binding or catalog admission request. */
|
|
37
37
|
export type GateRequest = z.output<typeof gateRequestSchema>;
|
|
38
38
|
/** Immutable values the host already read; resource/grantor freshness remains host-owned. */
|
|
@@ -49,16 +49,16 @@ export type GateFacts = Readonly<{
|
|
|
49
49
|
}>;
|
|
50
50
|
}>;
|
|
51
51
|
/** Binding grants have the exact S2 InvocationFacts shape and its maintained registry grammar. */
|
|
52
|
-
export declare const invocationGrantsSchema: z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
52
|
+
export declare const invocationGrantsSchema: z.ZodLazy<z.ZodReadonly<z.ZodArray<z.ZodObject<{
|
|
53
53
|
binding: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"BACKGROUND" | "GIT" | "EVENTS" | "APPS" | "WORKFLOWS" | "APP_STORAGE" | "MEDIA" | "COMPUTER" | "INBOX" | "AGENTS", unknown>>;
|
|
54
54
|
operations: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
55
|
-
}, z.core.$strict
|
|
55
|
+
}, z.core.$strict>>>>;
|
|
56
56
|
/** The explicit binding ceiling passed to an invocation frame. */
|
|
57
57
|
export type InvocationGrants = z.output<typeof invocationGrantsSchema>;
|
|
58
58
|
/** A declared method from the canonical Puffball API grammar. */
|
|
59
59
|
export type AppMethodDeclaration = AppApi["methods"][string];
|
|
60
60
|
/** Ordered, closed refusal vocabulary; external methods always require approval. */
|
|
61
|
-
export declare const gateRefusalSchema: z.ZodObject<{
|
|
61
|
+
export declare const gateRefusalSchema: z.ZodLazy<z.ZodObject<{
|
|
62
62
|
kind: z.ZodLiteral<"refused">;
|
|
63
63
|
code: z.ZodEnum<{
|
|
64
64
|
unavailable: "unavailable";
|
|
@@ -71,7 +71,7 @@ export declare const gateRefusalSchema: z.ZodObject<{
|
|
|
71
71
|
invalid_input: "invalid_input";
|
|
72
72
|
visitor_read_only: "visitor_read_only";
|
|
73
73
|
}>;
|
|
74
|
-
}, z.core.$strict
|
|
74
|
+
}, z.core.$strict>>;
|
|
75
75
|
/** Either an admitted scoped ceiling or one closed refusal code. */
|
|
76
76
|
export type GateDecision = Readonly<{
|
|
77
77
|
kind: "admitted";
|
package/dist/apps/gate.js
CHANGED
|
@@ -8,7 +8,7 @@ import { appToolAccessSchema } from "./tools.js";
|
|
|
8
8
|
import { ownerCodec, } from "./installation.js";
|
|
9
9
|
const bindingNameSchema = ownerCodec(Schema.Literals(Object.values(appBackendBindingKinds).map((kind) => kind.name)));
|
|
10
10
|
/** Requests select existing SDK methods, opaque backend calls and derived operation identities. */
|
|
11
|
-
export const gateRequestSchema = z.discriminatedUnion("kind", [
|
|
11
|
+
export const gateRequestSchema = z.lazy(() => z.discriminatedUnion("kind", [
|
|
12
12
|
z.strictObject({
|
|
13
13
|
kind: z.literal("method"),
|
|
14
14
|
name: z.string(),
|
|
@@ -27,9 +27,9 @@ export const gateRequestSchema = z.discriminatedUnion("kind", [
|
|
|
27
27
|
}),
|
|
28
28
|
z.strictObject({ kind: z.literal("list-tools") }),
|
|
29
29
|
z.strictObject({ kind: z.literal("backend") }),
|
|
30
|
-
]);
|
|
30
|
+
]));
|
|
31
31
|
/** Binding grants have the exact S2 InvocationFacts shape and its maintained registry grammar. */
|
|
32
|
-
export const invocationGrantsSchema = z
|
|
32
|
+
export const invocationGrantsSchema = z.lazy(() => z
|
|
33
33
|
.array(z.strictObject({
|
|
34
34
|
binding: bindingNameSchema,
|
|
35
35
|
operations: z.array(z.string().min(1)).readonly(),
|
|
@@ -38,9 +38,9 @@ export const invocationGrantsSchema = z
|
|
|
38
38
|
name: grant.binding,
|
|
39
39
|
operations: grant.operations,
|
|
40
40
|
}))), "Invalid declared binding operations")
|
|
41
|
-
.readonly();
|
|
41
|
+
.readonly());
|
|
42
42
|
/** Ordered, closed refusal vocabulary; external methods always require approval. */
|
|
43
|
-
export const gateRefusalSchema = z.strictObject({
|
|
43
|
+
export const gateRefusalSchema = z.lazy(() => z.strictObject({
|
|
44
44
|
kind: z.literal("refused"),
|
|
45
45
|
code: z.enum([
|
|
46
46
|
"unavailable",
|
|
@@ -53,7 +53,7 @@ export const gateRefusalSchema = z.strictObject({
|
|
|
53
53
|
"invalid_input",
|
|
54
54
|
"visitor_read_only",
|
|
55
55
|
]),
|
|
56
|
-
});
|
|
56
|
+
}));
|
|
57
57
|
/** Intersect stored approvals with the current verified Release without widening resource selectors. */
|
|
58
58
|
export function grantsFor(installation, declaration, snapshot, capability) {
|
|
59
59
|
if (installation.status !== "enabled" ||
|
|
@@ -6,7 +6,7 @@ import type { CapabilityDescriptor } from "../capability-descriptor.js";
|
|
|
6
6
|
/** Reuse the owning Effect codec at a JSON/storage boundary. */
|
|
7
7
|
export declare function ownerCodec<A, I>(schema: Schema.Codec<A, I>): z.ZodPipe<z.ZodUnknown, z.ZodTransform<Awaited<A>, unknown>>;
|
|
8
8
|
/** Installation names cannot contain the tenant separator. */
|
|
9
|
-
export declare const installationIdSchema: z.ZodString
|
|
9
|
+
export declare const installationIdSchema: z.ZodLazy<z.ZodString>;
|
|
10
10
|
export type ResourceRef = Exclude<ApprovedGrant["resources"], "tenant-scope">[number];
|
|
11
11
|
/**
|
|
12
12
|
* Consent approves capabilities, with explicit operation and resource ceilings.
|
|
@@ -21,13 +21,13 @@ export type ResourceRef = Exclude<ApprovedGrant["resources"], "tenant-scope">[nu
|
|
|
21
21
|
* Exact operation rows are enforced for capability routes and backend bindings.
|
|
22
22
|
*/
|
|
23
23
|
export declare const approvedGrantSchema: z.ZodReadonly<z.ZodObject<{
|
|
24
|
-
capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"agent.list" | "agent.manage" | "agent.rename" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage", unknown>>;
|
|
24
|
+
capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage", unknown>>;
|
|
25
25
|
capabilityApproved: z.ZodLiteral<true>;
|
|
26
|
-
operations: z.ZodReadonly<z.ZodArray<z.ZodString
|
|
27
|
-
resources: z.ZodUnion<readonly [z.ZodLiteral<"tenant-scope">, z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
26
|
+
operations: z.ZodLazy<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
27
|
+
resources: z.ZodUnion<readonly [z.ZodLiteral<"tenant-scope">, z.ZodReadonly<z.ZodArray<z.ZodLazy<z.ZodReadonly<z.ZodObject<{
|
|
28
28
|
kind: z.ZodString;
|
|
29
29
|
id: z.ZodString;
|
|
30
|
-
}, z.core.$strict
|
|
30
|
+
}, z.core.$strict>>>>>]>;
|
|
31
31
|
}, z.core.$strict>>;
|
|
32
32
|
export type ApprovedGrant = Readonly<z.output<typeof approvedGrantSchema>>;
|
|
33
33
|
export type GrantRequest = Extract<InstallationCommand, {
|
|
@@ -35,7 +35,7 @@ export type GrantRequest = Extract<InstallationCommand, {
|
|
|
35
35
|
}>["grants"];
|
|
36
36
|
export type Approval = NonNullable<Installation["approval"]>;
|
|
37
37
|
/** Immutable operation facts derived from descriptor methods and the binding registry. */
|
|
38
|
-
export declare const declaredOperationsSchema: z.ZodObject<{
|
|
38
|
+
export declare const declaredOperationsSchema: z.ZodLazy<z.ZodObject<{
|
|
39
39
|
artifactDigest: z.ZodPipe<z.ZodUnknown, z.ZodTransform<import("@fungi.computer/puffball").Sha256Digest, unknown>>;
|
|
40
40
|
digest: z.ZodPipe<z.ZodUnknown, z.ZodTransform<import("@fungi.computer/puffball").Sha256Digest, unknown>>;
|
|
41
41
|
anonymousMethods: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
@@ -43,10 +43,10 @@ export declare const declaredOperationsSchema: z.ZodObject<{
|
|
|
43
43
|
digest: z.ZodPipe<z.ZodUnknown, z.ZodTransform<import("@fungi.computer/puffball").Sha256Digest, unknown>>;
|
|
44
44
|
}, z.core.$strict>>>>;
|
|
45
45
|
capabilities: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
46
|
-
capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"agent.list" | "agent.manage" | "agent.rename" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage", unknown>>;
|
|
47
|
-
operations: z.ZodReadonly<z.ZodArray<z.ZodString
|
|
46
|
+
capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage", unknown>>;
|
|
47
|
+
operations: z.ZodLazy<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
48
48
|
}, z.core.$strict>>>>;
|
|
49
|
-
}, z.core.$strict
|
|
49
|
+
}, z.core.$strict>>;
|
|
50
50
|
export type DeclaredOperations = Readonly<z.output<typeof declaredOperationsSchema>>;
|
|
51
51
|
/** Use the existing adapter's permission and methods; hosts author no operation lists. */
|
|
52
52
|
export type CapabilityOperationDescriptor = Pick<CapabilityDescriptor, "id" | "methods"> & Readonly<{
|
|
@@ -54,7 +54,7 @@ export type CapabilityOperationDescriptor = Pick<CapabilityDescriptor, "id" | "m
|
|
|
54
54
|
}>;
|
|
55
55
|
/** Resolved immutable Release plus host-owned installation and approval state. */
|
|
56
56
|
export declare const installationSchema: z.ZodObject<{
|
|
57
|
-
installationId: z.ZodString
|
|
57
|
+
installationId: z.ZodLazy<z.ZodString>;
|
|
58
58
|
instanceId: z.ZodNullable<z.ZodPipe<z.ZodUnknown, z.ZodTransform<import("../index.js").InstanceId, unknown>>>;
|
|
59
59
|
appId: z.ZodPipe<z.ZodUnknown, z.ZodTransform<import("@fungi.computer/puffball").AppId, unknown>>;
|
|
60
60
|
release: z.ZodPipe<z.ZodUnknown, z.ZodTransform<{
|
|
@@ -74,7 +74,7 @@ export declare const installationSchema: z.ZodObject<{
|
|
|
74
74
|
pinned: "pinned";
|
|
75
75
|
floating: "floating";
|
|
76
76
|
}>;
|
|
77
|
-
authorityVersion: z.ZodNumber
|
|
77
|
+
authorityVersion: z.ZodLazy<z.ZodNumber>;
|
|
78
78
|
status: z.ZodEnum<{
|
|
79
79
|
enabled: "enabled";
|
|
80
80
|
disabled: "disabled";
|
|
@@ -85,16 +85,16 @@ export declare const installationSchema: z.ZodObject<{
|
|
|
85
85
|
public: "public";
|
|
86
86
|
}>;
|
|
87
87
|
declaredOperationsDigest: z.ZodPipe<z.ZodUnknown, z.ZodTransform<import("@fungi.computer/puffball").Sha256Digest, unknown>>;
|
|
88
|
-
approvedGrants: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
89
|
-
capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"agent.list" | "agent.manage" | "agent.rename" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage", unknown>>;
|
|
88
|
+
approvedGrants: z.ZodLazy<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
89
|
+
capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage", unknown>>;
|
|
90
90
|
capabilityApproved: z.ZodLiteral<true>;
|
|
91
|
-
operations: z.ZodReadonly<z.ZodArray<z.ZodString
|
|
92
|
-
resources: z.ZodUnion<readonly [z.ZodLiteral<"tenant-scope">, z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
91
|
+
operations: z.ZodLazy<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
92
|
+
resources: z.ZodUnion<readonly [z.ZodLiteral<"tenant-scope">, z.ZodReadonly<z.ZodArray<z.ZodLazy<z.ZodReadonly<z.ZodObject<{
|
|
93
93
|
kind: z.ZodString;
|
|
94
94
|
id: z.ZodString;
|
|
95
|
-
}, z.core.$strict
|
|
96
|
-
}, z.core.$strict
|
|
97
|
-
approval: z.ZodNullable<z.ZodReadonly<z.ZodObject<{
|
|
95
|
+
}, z.core.$strict>>>>>]>;
|
|
96
|
+
}, z.core.$strict>>>>>;
|
|
97
|
+
approval: z.ZodNullable<z.ZodLazy<z.ZodReadonly<z.ZodObject<{
|
|
98
98
|
by: import("zod/mini").ZodMiniDiscriminatedUnion<[import("zod/mini").ZodMiniObject<{
|
|
99
99
|
kind: import("zod/mini").ZodMiniLiteral<"member">;
|
|
100
100
|
memberId: import("zod/mini").ZodMiniString<string>;
|
|
@@ -106,13 +106,13 @@ export declare const installationSchema: z.ZodObject<{
|
|
|
106
106
|
keyId: import("zod/mini").ZodMiniString<string>;
|
|
107
107
|
}, z.core.$strip>], "kind">;
|
|
108
108
|
at: z.ZodNumber;
|
|
109
|
-
authorityVersion: z.ZodNumber
|
|
110
|
-
}, z.core.$strict
|
|
109
|
+
authorityVersion: z.ZodLazy<z.ZodNumber>;
|
|
110
|
+
}, z.core.$strict>>>>;
|
|
111
111
|
approvedAnonymousMethods: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
112
112
|
name: z.ZodPipe<z.ZodUnknown, z.ZodTransform<string, unknown>>;
|
|
113
113
|
digest: z.ZodPipe<z.ZodUnknown, z.ZodTransform<import("@fungi.computer/puffball").Sha256Digest, unknown>>;
|
|
114
114
|
}, z.core.$strict>>>>;
|
|
115
|
-
anonymousApproval: z.ZodNullable<z.ZodReadonly<z.ZodObject<{
|
|
115
|
+
anonymousApproval: z.ZodNullable<z.ZodLazy<z.ZodReadonly<z.ZodObject<{
|
|
116
116
|
by: import("zod/mini").ZodMiniDiscriminatedUnion<[import("zod/mini").ZodMiniObject<{
|
|
117
117
|
kind: import("zod/mini").ZodMiniLiteral<"member">;
|
|
118
118
|
memberId: import("zod/mini").ZodMiniString<string>;
|
|
@@ -124,19 +124,19 @@ export declare const installationSchema: z.ZodObject<{
|
|
|
124
124
|
keyId: import("zod/mini").ZodMiniString<string>;
|
|
125
125
|
}, z.core.$strip>], "kind">;
|
|
126
126
|
at: z.ZodNumber;
|
|
127
|
-
authorityVersion: z.ZodNumber
|
|
128
|
-
}, z.core.$strict
|
|
127
|
+
authorityVersion: z.ZodLazy<z.ZodNumber>;
|
|
128
|
+
}, z.core.$strict>>>>;
|
|
129
129
|
}, z.core.$strict>;
|
|
130
130
|
export type Installation = Readonly<z.output<typeof installationSchema>>;
|
|
131
131
|
/** Host commands; floating targets have already been resolved to immutable Releases. */
|
|
132
|
-
export declare const installationCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
132
|
+
export declare const installationCommandSchema: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
133
133
|
grants: z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"declared">, z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
134
|
-
capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"agent.list" | "agent.manage" | "agent.rename" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage", unknown>>;
|
|
135
|
-
operations: z.ZodReadonly<z.ZodArray<z.ZodString
|
|
136
|
-
resources: z.ZodUnion<readonly [z.ZodLiteral<"tenant-scope">, z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
134
|
+
capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage", unknown>>;
|
|
135
|
+
operations: z.ZodLazy<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
136
|
+
resources: z.ZodUnion<readonly [z.ZodLiteral<"tenant-scope">, z.ZodReadonly<z.ZodArray<z.ZodLazy<z.ZodReadonly<z.ZodObject<{
|
|
137
137
|
kind: z.ZodString;
|
|
138
138
|
id: z.ZodString;
|
|
139
|
-
}, z.core.$strict
|
|
139
|
+
}, z.core.$strict>>>>>]>;
|
|
140
140
|
}, z.core.$strict>>>>]>;
|
|
141
141
|
release: z.ZodPipe<z.ZodUnknown, z.ZodTransform<{
|
|
142
142
|
readonly releaseId: import("@fungi.computer/puffball").ReleaseId;
|
|
@@ -191,12 +191,12 @@ export declare const installationCommandSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
191
191
|
}, z.core.$strict>, z.ZodObject<{
|
|
192
192
|
kind: z.ZodLiteral<"set-grants">;
|
|
193
193
|
grants: z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"declared">, z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
194
|
-
capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"agent.list" | "agent.manage" | "agent.rename" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage", unknown>>;
|
|
195
|
-
operations: z.ZodReadonly<z.ZodArray<z.ZodString
|
|
196
|
-
resources: z.ZodUnion<readonly [z.ZodLiteral<"tenant-scope">, z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
194
|
+
capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage", unknown>>;
|
|
195
|
+
operations: z.ZodLazy<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
|
|
196
|
+
resources: z.ZodUnion<readonly [z.ZodLiteral<"tenant-scope">, z.ZodReadonly<z.ZodArray<z.ZodLazy<z.ZodReadonly<z.ZodObject<{
|
|
197
197
|
kind: z.ZodString;
|
|
198
198
|
id: z.ZodString;
|
|
199
|
-
}, z.core.$strict
|
|
199
|
+
}, z.core.$strict>>>>>]>;
|
|
200
200
|
}, z.core.$strict>>>>]>;
|
|
201
201
|
}, z.core.$strict>, z.ZodObject<{
|
|
202
202
|
kind: z.ZodLiteral<"approve-anonymous">;
|
|
@@ -204,7 +204,7 @@ export declare const installationCommandSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
204
204
|
name: z.ZodPipe<z.ZodUnknown, z.ZodTransform<string, unknown>>;
|
|
205
205
|
digest: z.ZodPipe<z.ZodUnknown, z.ZodTransform<import("@fungi.computer/puffball").Sha256Digest, unknown>>;
|
|
206
206
|
}, z.core.$strict>>>>;
|
|
207
|
-
}, z.core.$strict>], "kind"
|
|
207
|
+
}, z.core.$strict>], "kind">>;
|
|
208
208
|
export type InstallationCommand = z.output<typeof installationCommandSchema>;
|
|
209
209
|
/** Values captured by the host; identities and time are never generated by the reducer. */
|
|
210
210
|
export type InstallationContext = Readonly<{
|
|
@@ -221,7 +221,7 @@ export type InstallationContext = Readonly<{
|
|
|
221
221
|
}>;
|
|
222
222
|
}>;
|
|
223
223
|
/** Closed refusals: failed commands produce no installation update. */
|
|
224
|
-
export declare const installationRefusalSchema: z.ZodObject<{
|
|
224
|
+
export declare const installationRefusalSchema: z.ZodLazy<z.ZodObject<{
|
|
225
225
|
kind: z.ZodLiteral<"refused">;
|
|
226
226
|
code: z.ZodEnum<{
|
|
227
227
|
unavailable: "unavailable";
|
|
@@ -231,7 +231,7 @@ export declare const installationRefusalSchema: z.ZodObject<{
|
|
|
231
231
|
not_owner: "not_owner";
|
|
232
232
|
invalid_command: "invalid_command";
|
|
233
233
|
}>;
|
|
234
|
-
}, z.core.$strict
|
|
234
|
+
}, z.core.$strict>>;
|
|
235
235
|
export type InstallationRefusal = z.output<typeof installationRefusalSchema>;
|
|
236
236
|
export type InstallationUpdate = Readonly<{
|
|
237
237
|
next: Installation;
|