@fungi.computer/oyster 0.26.0 → 0.27.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/dist/agents.d.ts +24 -8
- package/dist/agents.js +12 -5
- package/dist/apps/catalog.js +1 -1
- package/dist/boot-host-script.js +1 -1
- package/dist/build/candidate-cli.mjs +6 -0
- package/dist/embed-metafiles.js +2 -2
- package/dist/embed-scripts.js +1 -1
- package/dist/hello-app-script.js +1 -1
- package/dist/media.d.ts +5 -0
- package/dist/media.js +1 -0
- package/dist/page-script.js +2 -2
- package/dist/standalone/agent-computers.js +17 -1
- package/dist/standalone/agents.d.ts +16 -8
- package/dist/standalone/agents.js +77 -24
- package/dist/standalone/app-set.d.ts +7 -0
- package/dist/standalone/app-set.js +17 -3
- package/dist/standalone/computer-fleet.d.ts +1 -0
- package/dist/standalone/computer-fleet.js +9 -1
- package/dist/standalone/computer.d.ts +26 -3
- package/dist/standalone/computer.js +32 -1
- package/dist/standalone/install-apps-cli.js +8 -2
- package/dist/standalone/media.d.ts +8 -3
- package/dist/standalone/media.js +76 -7
- package/dist/standalone/registry.d.ts +5 -1
- package/dist/standalone/registry.js +9 -0
- package/docs/api/agents.md +204 -214
- package/docs/api/apps.md +33 -33
- package/docs/api/media.md +4 -0
- package/docs/api/workers-git.md +7 -7
- package/examples/standalone/wrangler.jsonc +3 -0
- package/package.json +19 -23
- package/dist/agent-instructions.d.ts +0 -35
- package/dist/agent-instructions.js +0 -42
package/dist/agents.d.ts
CHANGED
|
@@ -14,6 +14,17 @@ export type { StarterOutcome };
|
|
|
14
14
|
import type { AgentModelChoice, AgentModelRefusal } from "./standalone/agent-model-choice.js";
|
|
15
15
|
export type { AgentModelChoice, AgentModelRefusal, } from "./standalone/agent-model-choice.js";
|
|
16
16
|
import type { MemberInboxItem, MemberInboxSession } from "@fungi.computer/puffball/inbox";
|
|
17
|
+
/** An Agent's AGENTS.md on its Home Computer, with the byte limit the host enforces. */
|
|
18
|
+
export type OysterAgentInstructions = Readonly<{
|
|
19
|
+
/** The Home Computer holding the file; null when the Agent has none. */
|
|
20
|
+
home: Readonly<{
|
|
21
|
+
name: string;
|
|
22
|
+
}> | null;
|
|
23
|
+
/** The file's text; null when there is no Home or the file does not exist yet. */
|
|
24
|
+
content: string | null;
|
|
25
|
+
bytes: number;
|
|
26
|
+
limit: number;
|
|
27
|
+
}>;
|
|
17
28
|
/** One agent as Apps see it, in Agar's `appAgentSchema` shape. */
|
|
18
29
|
export type OysterAgent = Readonly<{
|
|
19
30
|
agentId: string;
|
|
@@ -140,19 +151,24 @@ export type OysterAgents = Readonly<{
|
|
|
140
151
|
}>>;
|
|
141
152
|
/** Owner-only, secret-free Agent default; an unknown Agent cannot be configured. */
|
|
142
153
|
readModelChoice(agentId: string): Promise<AgentModelChoice | null>;
|
|
143
|
-
/** Owner-only read of the
|
|
154
|
+
/** Owner-only read of the AGENTS.md on this Agent's Home Computer. */
|
|
144
155
|
readInstructions(agentId: string, principal: TenantPrincipal): Promise<Readonly<{
|
|
145
156
|
agentId: string;
|
|
146
|
-
|
|
147
|
-
}> | Readonly<{
|
|
157
|
+
} & OysterAgentInstructions> | Readonly<{
|
|
148
158
|
error: "not_found" | "not_granted";
|
|
149
159
|
}>>;
|
|
150
|
-
/**
|
|
151
|
-
|
|
160
|
+
/**
|
|
161
|
+
* Owner-only replacement of it. `expectedContent` is what the owner last read;
|
|
162
|
+
* null creates the file only while absent. A file the Agent changed since is a
|
|
163
|
+
* `conflict`, never overwritten.
|
|
164
|
+
*/
|
|
165
|
+
setInstructions(agentId: string, edit: Readonly<{
|
|
166
|
+
expectedContent: string | null;
|
|
167
|
+
content: string;
|
|
168
|
+
}>, principal: TenantPrincipal): Promise<Readonly<{
|
|
152
169
|
agentId: string;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
error: "not_found" | "not_granted";
|
|
170
|
+
} & OysterAgentInstructions> | Readonly<{
|
|
171
|
+
error: "not_found" | "not_granted" | "conflict" | "too_large" | "no_home";
|
|
156
172
|
}>>;
|
|
157
173
|
/** Parse the owner's JSON through the deployable Agent's model preference schema. */
|
|
158
174
|
decodeModelChoice(json: string): AgentModelChoice | null;
|
package/dist/agents.js
CHANGED
|
@@ -6,7 +6,7 @@ import { agentAvatarSchema } from "./agent-avatars.js";
|
|
|
6
6
|
import { computerTargetParam } from "./computer-target.js";
|
|
7
7
|
import { modelKeyProviderChoices } from "./standalone/model-key-providers.js";
|
|
8
8
|
import { supportedAgentModels } from "./standalone/agent-model-choice.js";
|
|
9
|
-
import { agentAvatar, agentInstructions,
|
|
9
|
+
import { agentAvatar, agentInstructions, agentList, agentManage, agentRename, agentSessionRead, agentSessionWrite, agentToolPolicy, } from "@fungi.computer/agar/agents";
|
|
10
10
|
/** At most this many connections per Agent. */
|
|
11
11
|
export const maxAgentConnections = 16;
|
|
12
12
|
/** Owner input for one MCP connection: a guest identifier, an `https:` endpoint and an optional bearer. */
|
|
@@ -44,7 +44,8 @@ const renameSchema = Schema.Struct({
|
|
|
44
44
|
});
|
|
45
45
|
const avatarInputSchema = z.object({ avatar: agentAvatarSchema });
|
|
46
46
|
const instructionsInputSchema = z.object({
|
|
47
|
-
|
|
47
|
+
expectedContent: z.string().nullable(),
|
|
48
|
+
content: z.string(),
|
|
48
49
|
});
|
|
49
50
|
const visitSchema = Schema.Struct({
|
|
50
51
|
agentId: Schema.String,
|
|
@@ -267,10 +268,16 @@ function createAgentRoutes(agents) {
|
|
|
267
268
|
return refusal(404, "No such agent");
|
|
268
269
|
const body = instructionsInputSchema.safeParse(await context.req.json());
|
|
269
270
|
if (!body.success)
|
|
270
|
-
return refusal(400, "
|
|
271
|
-
const result = await agents.setInstructions(agentId, body.data
|
|
271
|
+
return refusal(400, "Invalid instructions edit");
|
|
272
|
+
const result = await agents.setInstructions(agentId, body.data, principal);
|
|
272
273
|
if ("error" in result)
|
|
273
|
-
return refusal(result.error === "not_found"
|
|
274
|
+
return refusal(result.error === "not_found"
|
|
275
|
+
? 404
|
|
276
|
+
: result.error === "not_granted"
|
|
277
|
+
? 403
|
|
278
|
+
: result.error === "too_large"
|
|
279
|
+
? 413
|
|
280
|
+
: 409, result.error);
|
|
274
281
|
return Response.json(result);
|
|
275
282
|
})
|
|
276
283
|
.get("/agent-policies/:agentId", agent(), async (_context, { agentId }) => {
|
package/dist/apps/catalog.js
CHANGED
|
@@ -19,7 +19,7 @@ export const permissionCatalog = {
|
|
|
19
19
|
"agent.manage": entry("agents", "Create and manage Agents", "create Agents and manage their sessions.", "createAgents", "install", "agent"),
|
|
20
20
|
"agent.rename": entry("agents", "Rename Agents", "rename Agents you created.", "createAgents", "install"),
|
|
21
21
|
"agent.avatar": entry("agents", "Change Agent avatars", "change the avatars of Agents you created.", "createAgents", "install"),
|
|
22
|
-
"agent.instructions": entry("agents", "Change Agent instructions", "change the
|
|
22
|
+
"agent.instructions": entry("agents", "Change Agent instructions", "change the AGENTS.md instructions on your Agents' Home Computers.", "createAgents", "install"),
|
|
23
23
|
"agent.toolPolicy": entry("agents", "Allow Agents to use Apps", "approve Agents to use your installed Apps.", "createAgents", "install"),
|
|
24
24
|
"agent.read": entry("agents", "Read Agent conversations", "read Agent conversations.", "readConversations", "install", "agent"),
|
|
25
25
|
"agent.send": entry("agents", "Send messages to Agents", "send messages to Agents.", "sendPrompts", "install", "agent"),
|