@fungi.computer/oyster 0.16.0 → 0.17.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/agents.d.ts +7 -0
- package/dist/agents.js +4 -1
- package/dist/embed-metafiles.js +1 -1
- package/dist/embed-scripts.js +1 -1
- package/dist/page-script.js +1 -1
- package/dist/root-data.d.ts +3 -0
- package/dist/standalone/agents.d.ts +8 -0
- package/dist/standalone/agents.js +51 -12
- package/dist/standalone/owner-routes.js +2 -0
- package/dist/standalone/registry.d.ts +16 -0
- package/dist/standalone/registry.js +30 -0
- package/dist/standalone/trial-starters.d.ts +52 -0
- package/dist/standalone/trial-starters.js +67 -0
- package/dist/starter-agent.d.ts +10 -4
- package/dist/starter-agent.js +4 -4
- package/docs/api/agents.md +17 -0
- package/docs/api/host.md +1 -0
- package/docs/api/root-data.md +10 -9
- package/docs/api/workers-git.md +6 -6
- package/docs/api/workers.md +20 -17
- package/package.json +5 -5
package/dist/agents.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ import * as Schema from "effect/Schema";
|
|
|
7
7
|
import { type OysterCapability, type OysterEnv } from "./host.js";
|
|
8
8
|
import type { HostActor } from "@fungi.computer/puffball/app";
|
|
9
9
|
import type { Avatar } from "@fungi.computer/sprite/avatar";
|
|
10
|
+
import type { StarterOutcome } from "./starter-agent.js";
|
|
11
|
+
export type { StarterOutcome };
|
|
10
12
|
import type { AgentModelChoice, AgentModelRefusal } from "./standalone/agent-model-choice.js";
|
|
11
13
|
export type { AgentModelChoice, AgentModelRefusal, } from "./standalone/agent-model-choice.js";
|
|
12
14
|
import type { MemberInboxItem, MemberInboxSession } from "@fungi.computer/puffball/inbox";
|
|
@@ -104,6 +106,11 @@ export type OysterAgents = Readonly<{
|
|
|
104
106
|
list(options?: Readonly<{
|
|
105
107
|
archived?: boolean;
|
|
106
108
|
}>): Promise<readonly OysterAgent[]>;
|
|
109
|
+
/**
|
|
110
|
+
* Offer the owner their starter Agent on an empty Team's first owner read;
|
|
111
|
+
* it creates through this host's ordinary `create` and never fails the read.
|
|
112
|
+
*/
|
|
113
|
+
ensureStarter(principal: TenantPrincipal): Promise<StarterOutcome>;
|
|
107
114
|
/** Owner-only HTTP transition; creator Agents use their own control tool. */
|
|
108
115
|
setArchived(agentId: string, archived: boolean, principal: TenantPrincipal): Promise<Readonly<{
|
|
109
116
|
archived: boolean;
|
package/dist/agents.js
CHANGED
|
@@ -185,12 +185,15 @@ function createAgentRoutes(agents) {
|
|
|
185
185
|
.include(ownerAgentRoutes(agents, "direct-or-app"))
|
|
186
186
|
// Standalone Agents choose no Computer at creation; the owner attaches one.
|
|
187
187
|
.get("/agent-computers", owner("direct-or-app"), () => Response.json(null))
|
|
188
|
-
.get("/agents", agentCollection(), async (context, { reaches }) => {
|
|
188
|
+
.get("/agents", agentCollection(), async (context, { reaches, everyAgent, authority }) => {
|
|
189
189
|
const selected = context.req.query("archived");
|
|
190
190
|
if (selected !== undefined &&
|
|
191
191
|
selected !== "true" &&
|
|
192
192
|
selected !== "false")
|
|
193
193
|
return refusal(400, "Choose a valid archive view");
|
|
194
|
+
// The owner's own directory read is the starter Agent's one trigger.
|
|
195
|
+
if (everyAgent && authority.kind === "owner" && selected !== "true")
|
|
196
|
+
await agents.ensureStarter(authority.principal);
|
|
194
197
|
const listed = await agents.list({ archived: selected === "true" });
|
|
195
198
|
const reached = [];
|
|
196
199
|
for (const item of listed)
|