@fungi.computer/oyster 0.17.0 → 0.18.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/auth.js +6 -2
- package/dist/standalone/agents.d.ts +1 -1
- package/dist/standalone/tenancy.js +12 -1
- package/dist/standalone/try-cli.js +25 -5
- package/dist/standalone/workflow-host.d.ts +2 -2
- package/dist/standalone/workflows.d.ts +2 -2
- package/dist/tenancy/index.js +2 -1
- package/dist/tenancy/registry-record.d.ts +13 -0
- package/dist/tenancy/registry-record.js +33 -3
- package/docs/api/workers-git.md +1 -1
- package/package.json +1 -1
package/dist/auth.js
CHANGED
|
@@ -2,6 +2,7 @@ import * as Option from "effect/Option";
|
|
|
2
2
|
import * as Schema from "effect/Schema";
|
|
3
3
|
import { presentedGitKey } from "./git-auth.js";
|
|
4
4
|
import { sha256 } from "./release.js";
|
|
5
|
+
import { isLoopbackHttp } from "./tenancy/registry-record.js";
|
|
5
6
|
/** Cookie emitted by ownerKeyAuth, for composing credential-specific adapters. */
|
|
6
7
|
export const ownerKeyCookieName = "oyster_session";
|
|
7
8
|
/** Marks a browser that has signed in here before; it carries no authority. */
|
|
@@ -64,9 +65,12 @@ export function ownerKeyAuth(ownerKey, ownerId = "owner") {
|
|
|
64
65
|
if (Option.isNone(form) ||
|
|
65
66
|
!(await constantTimeEqual(form.value.key, ownerKey)))
|
|
66
67
|
return new Response("Wrong key", { status: 401 });
|
|
68
|
+
// Secure everywhere except loopback HTTP, where Safari would drop it and
|
|
69
|
+
// the traffic never leaves this machine.
|
|
70
|
+
const secure = isLoopbackHttp(new URL(request.url)) ? "" : " Secure;";
|
|
67
71
|
const headers = new Headers({ Location: "/" });
|
|
68
|
-
headers.append("Set-Cookie", `${ownerKeyCookieName}=${await sessionValue}; Path=/; HttpOnly
|
|
69
|
-
headers.append("Set-Cookie", `${returningCookieName}=1; Path=/; HttpOnly
|
|
72
|
+
headers.append("Set-Cookie", `${ownerKeyCookieName}=${await sessionValue}; Path=/; HttpOnly;${secure} SameSite=Strict; Max-Age=2592000`);
|
|
73
|
+
headers.append("Set-Cookie", `${returningCookieName}=1; Path=/; HttpOnly;${secure} SameSite=Strict; Max-Age=31536000`);
|
|
70
74
|
return new Response(null, { status: 303, headers });
|
|
71
75
|
},
|
|
72
76
|
};
|
|
@@ -532,7 +532,7 @@ export declare const agentFrameMethods: {
|
|
|
532
532
|
readonly state: "pending" | "delivered" | "answered" | "timed_out" | "closed";
|
|
533
533
|
readonly workflowTitle: string;
|
|
534
534
|
readonly reviewTitle: string;
|
|
535
|
-
readonly reviewers: "
|
|
535
|
+
readonly reviewers: "owners" | "runner";
|
|
536
536
|
readonly show: readonly Schema.Json[];
|
|
537
537
|
readonly openedAt: number;
|
|
538
538
|
readonly choices?: readonly string[] | undefined;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TenancyRegistryDO, admittedRegistry, durableObjectRegistry, } from "../tenancy/cloudflare.js";
|
|
2
2
|
import { createTenancy, } from "../tenancy/index.js";
|
|
3
3
|
import { ownerKey } from "../tenancy/owner-key.js";
|
|
4
|
+
import { loopbackAliasLocation } from "../tenancy/registry-record.js";
|
|
4
5
|
import { hosts } from "../tenancy/resolve.js";
|
|
5
6
|
import { ownerOrKeyAuth } from "../auth.js";
|
|
6
7
|
import { HTTPException } from "hono/http-exception";
|
|
@@ -89,7 +90,16 @@ export class StandaloneTenants extends TenancyRegistryDO {
|
|
|
89
90
|
export async function standaloneTenancyForRequest(env, request) {
|
|
90
91
|
const configuredOrigin = tenantScope(defaultTenant, env.OYSTER_ORIGIN).origin;
|
|
91
92
|
const requestOrigin = new URL(request.url).origin;
|
|
92
|
-
if (requestOrigin !== configuredOrigin)
|
|
93
|
+
if (requestOrigin !== configuredOrigin) {
|
|
94
|
+
// Another loopback name for this machine is the same Oyster.
|
|
95
|
+
const canonical = loopbackAliasLocation(new URL(request.url), configuredOrigin);
|
|
96
|
+
if (canonical !== null)
|
|
97
|
+
throw new HTTPException(307, {
|
|
98
|
+
res: new Response(null, {
|
|
99
|
+
status: 307,
|
|
100
|
+
headers: { Location: canonical, "Cache-Control": "no-store" },
|
|
101
|
+
}),
|
|
102
|
+
});
|
|
93
103
|
throw new HTTPException(404, {
|
|
94
104
|
res: Response.json({
|
|
95
105
|
kind: "refused",
|
|
@@ -99,6 +109,7 @@ export async function standaloneTenancyForRequest(env, request) {
|
|
|
99
109
|
message: `Request origin ${requestOrigin} does not match configured OYSTER_ORIGIN ${configuredOrigin}. Set OYSTER_ORIGIN to this Worker's URL.`,
|
|
100
110
|
}, { status: 404 }),
|
|
101
111
|
});
|
|
112
|
+
}
|
|
102
113
|
return standaloneTenancy(env);
|
|
103
114
|
}
|
|
104
115
|
const environments = new WeakMap();
|
|
@@ -330,6 +330,27 @@ async function runInstall(directory, manager, verbose, signal) {
|
|
|
330
330
|
await awaitCleanup(logClosed);
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
|
+
const originFile = join(".oyster", "origin");
|
|
334
|
+
/**
|
|
335
|
+
* Local data belongs to the origin it was seeded for. A project made for
|
|
336
|
+
* another origin (an older `try` used https://oyster.test; another --port is
|
|
337
|
+
* another origin) cannot be served, so its trial data is reset. The owner key,
|
|
338
|
+
* Hello source and Git history are not data of the Oyster. Returns the origin
|
|
339
|
+
* the data was reset from, or null.
|
|
340
|
+
*/
|
|
341
|
+
async function reconcileOrigin(directory, origin) {
|
|
342
|
+
const marker = join(directory, originFile);
|
|
343
|
+
const saved = (await exists(marker))
|
|
344
|
+
? (await readFile(marker, "utf8")).trim()
|
|
345
|
+
: "https://oyster.test";
|
|
346
|
+
const state = join(directory, ".wrangler", "state");
|
|
347
|
+
const reset = saved !== origin && (await exists(state));
|
|
348
|
+
if (reset)
|
|
349
|
+
await rm(state, { recursive: true, force: true });
|
|
350
|
+
await mkdir(join(directory, ".oyster"), { recursive: true });
|
|
351
|
+
await writeFile(marker, `${origin}\n`);
|
|
352
|
+
return reset ? saved : null;
|
|
353
|
+
}
|
|
333
354
|
function portFree(port) {
|
|
334
355
|
return new Promise((done) => {
|
|
335
356
|
const server = createServer();
|
|
@@ -381,14 +402,10 @@ function startWrangler(input) {
|
|
|
381
402
|
"127.0.0.1",
|
|
382
403
|
"--port",
|
|
383
404
|
String(input.port),
|
|
384
|
-
"--local-upstream",
|
|
385
|
-
"oyster.test",
|
|
386
|
-
"--upstream-protocol",
|
|
387
|
-
"https",
|
|
388
405
|
"--var",
|
|
389
406
|
`OYSTER_OWNER_KEY:${input.key}`,
|
|
390
407
|
"--var",
|
|
391
|
-
|
|
408
|
+
`OYSTER_ORIGIN:${url}`,
|
|
392
409
|
], {
|
|
393
410
|
cwd: input.directory,
|
|
394
411
|
detached: process.platform !== "win32",
|
|
@@ -612,6 +629,9 @@ export async function tryOyster(args, effects = realEffects, ui = createTryCli(a
|
|
|
612
629
|
await rm(join(directory, pendingInstall));
|
|
613
630
|
}
|
|
614
631
|
const url = `http://127.0.0.1:${String(port)}`;
|
|
632
|
+
const resetFrom = await reconcileOrigin(directory, url);
|
|
633
|
+
if (resetFrom !== null)
|
|
634
|
+
ui.info(`This project's local data was made for ${resetFrom}, so it was reset for ${url}. Your owner key and Hello source are unchanged; the Apps reinstall below.`);
|
|
615
635
|
const server = await task("Starting Oyster", () => (async () => {
|
|
616
636
|
const resource = await effects.startServer({
|
|
617
637
|
directory,
|
|
@@ -605,7 +605,7 @@ export declare function createStandaloneWorkflowHost(owner: WatchdogSqliteOwner,
|
|
|
605
605
|
readonly kind: "review";
|
|
606
606
|
readonly title: string;
|
|
607
607
|
readonly timeout: number;
|
|
608
|
-
readonly reviewers: "
|
|
608
|
+
readonly reviewers: "owners" | "runner";
|
|
609
609
|
readonly show: readonly {
|
|
610
610
|
readonly node: string;
|
|
611
611
|
readonly port: string;
|
|
@@ -702,7 +702,7 @@ export declare function createStandaloneWorkflowHost(owner: WatchdogSqliteOwner,
|
|
|
702
702
|
readonly kind: "review";
|
|
703
703
|
readonly title: string;
|
|
704
704
|
readonly timeout: number;
|
|
705
|
-
readonly reviewers: "
|
|
705
|
+
readonly reviewers: "owners" | "runner";
|
|
706
706
|
readonly show: readonly {
|
|
707
707
|
readonly node: string;
|
|
708
708
|
readonly port: string;
|
|
@@ -343,7 +343,7 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
|
|
|
343
343
|
readonly kind: "review";
|
|
344
344
|
readonly title: string;
|
|
345
345
|
readonly timeout: number;
|
|
346
|
-
readonly reviewers: "
|
|
346
|
+
readonly reviewers: "owners" | "runner";
|
|
347
347
|
readonly show: readonly {
|
|
348
348
|
readonly node: string;
|
|
349
349
|
readonly port: string;
|
|
@@ -440,7 +440,7 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
|
|
|
440
440
|
readonly kind: "review";
|
|
441
441
|
readonly title: string;
|
|
442
442
|
readonly timeout: number;
|
|
443
|
-
readonly reviewers: "
|
|
443
|
+
readonly reviewers: "owners" | "runner";
|
|
444
444
|
readonly show: readonly {
|
|
445
445
|
readonly node: string;
|
|
446
446
|
readonly port: string;
|
package/dist/tenancy/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isTenantOriginScheme } from "./registry-record.js";
|
|
1
2
|
import { createOysterTenancy } from "./oyster.js";
|
|
2
3
|
import { tenantScope } from "../tenant.js";
|
|
3
4
|
function managed(registry) {
|
|
@@ -21,7 +22,7 @@ export function createTenancy(config) {
|
|
|
21
22
|
if (tenant === null || tenant.status === "deleting")
|
|
22
23
|
return null;
|
|
23
24
|
if (config.resolve.kind === "origin" &&
|
|
24
|
-
(url
|
|
25
|
+
(!isTenantOriginScheme(url) || !tenant.domains.includes(url.host)))
|
|
25
26
|
return null;
|
|
26
27
|
return tenant;
|
|
27
28
|
};
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import * as Schema from "effect/Schema";
|
|
2
2
|
import type { Tenant } from "./contracts.js";
|
|
3
|
+
/** Plain HTTP on a loopback host: traffic that never leaves this machine. */
|
|
4
|
+
export declare function isLoopbackHttp(url: URL): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Where a loopback request at another loopback host (localhost, 127.0.0.1,
|
|
7
|
+
* [::1]) on the same port belongs: the same path at the canonical origin, or
|
|
8
|
+
* null when either origin is not loopback HTTP or the host is already canonical.
|
|
9
|
+
*/
|
|
10
|
+
export declare function loopbackAliasLocation(request: URL, canonicalOrigin: string): string | null;
|
|
11
|
+
/**
|
|
12
|
+
* A tenant origin is HTTPS. Plain HTTP is admitted only for a loopback host,
|
|
13
|
+
* which browsers treat as a secure context; no other HTTP origin is.
|
|
14
|
+
*/
|
|
15
|
+
export declare function isTenantOriginScheme(url: URL): boolean;
|
|
3
16
|
export declare function checkedOrigin(origin: string, domains: readonly string[]): string;
|
|
4
17
|
export declare function immutable(tenant: Tenant): Tenant;
|
|
5
18
|
export declare function createMemberId(): string;
|
|
@@ -5,18 +5,48 @@ const identityIds = defineIdFamily({
|
|
|
5
5
|
version: 1,
|
|
6
6
|
kinds: { member: { prefix: "tenant_member" } },
|
|
7
7
|
});
|
|
8
|
+
const loopbackHosts = new Set([
|
|
9
|
+
"localhost",
|
|
10
|
+
"127.0.0.1",
|
|
11
|
+
"[::1]",
|
|
12
|
+
]);
|
|
13
|
+
/** Plain HTTP on a loopback host: traffic that never leaves this machine. */
|
|
14
|
+
export function isLoopbackHttp(url) {
|
|
15
|
+
return url.protocol === "http:" && loopbackHosts.has(url.hostname);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Where a loopback request at another loopback host (localhost, 127.0.0.1,
|
|
19
|
+
* [::1]) on the same port belongs: the same path at the canonical origin, or
|
|
20
|
+
* null when either origin is not loopback HTTP or the host is already canonical.
|
|
21
|
+
*/
|
|
22
|
+
export function loopbackAliasLocation(request, canonicalOrigin) {
|
|
23
|
+
const canonical = new URL(canonicalOrigin);
|
|
24
|
+
if (!isLoopbackHttp(request) ||
|
|
25
|
+
!isLoopbackHttp(canonical) ||
|
|
26
|
+
request.port !== canonical.port ||
|
|
27
|
+
request.host === canonical.host)
|
|
28
|
+
return null;
|
|
29
|
+
return `${canonical.origin}${request.pathname}${request.search}`;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A tenant origin is HTTPS. Plain HTTP is admitted only for a loopback host,
|
|
33
|
+
* which browsers treat as a secure context; no other HTTP origin is.
|
|
34
|
+
*/
|
|
35
|
+
export function isTenantOriginScheme(url) {
|
|
36
|
+
return url.protocol === "https:" || isLoopbackHttp(url);
|
|
37
|
+
}
|
|
8
38
|
export function checkedOrigin(origin, domains) {
|
|
9
39
|
const url = new URL(origin);
|
|
10
|
-
if (url
|
|
40
|
+
if (!isTenantOriginScheme(url) ||
|
|
11
41
|
url.username ||
|
|
12
42
|
url.password ||
|
|
13
43
|
url.pathname !== "/" ||
|
|
14
44
|
url.search ||
|
|
15
45
|
url.hash ||
|
|
16
46
|
!domains.includes(url.host))
|
|
17
|
-
throw new TypeError("Tenant origin must be HTTPS and match a declared domain, without credentials or a path");
|
|
47
|
+
throw new TypeError("Tenant origin must be HTTPS (or HTTP on a loopback host) and match a declared domain, without credentials or a path");
|
|
18
48
|
for (const domain of domains) {
|
|
19
|
-
const parsed = new URL(
|
|
49
|
+
const parsed = new URL(`${url.protocol}//${domain}`);
|
|
20
50
|
if (parsed.host !== domain ||
|
|
21
51
|
parsed.pathname !== "/" ||
|
|
22
52
|
parsed.search ||
|
package/docs/api/workers-git.md
CHANGED
|
@@ -1732,7 +1732,7 @@ both compose it here.
|
|
|
1732
1732
|
| `env` | [`OysterGitEnv`](#oystergitenv) |
|
|
1733
1733
|
| `scope` | [`TenantScope`](tenant.md#tenantscope) |
|
|
1734
1734
|
| `hostOwnerRoutes` | \| [`Routes`](authorization.md#routes)\<[`OysterEnv`](host.md#oysterenv)\> \| `undefined` |
|
|
1735
|
-
| `agents` | \| `Readonly`\<\{ `list`: `Promise`\<readonly `Readonly`\<\{ `agentId`: `string`; `name`: `string`; `avatar`: \{ `v`: `1`; `character`: `"mushroom"` \| `"cat"` \| `"burger"`; `appearance`: `z.ZodRecord`\<`z.ZodString`, `z.ZodUnion`\<readonly ...\>\>; `expression`: `string`; `renderStyle`: \| `"plain"` \| `"pencil"` \| `"manga"` \| `"riso"` \| `"halftone"` \| `"blueprint"` \| `"crt"` \| `"watercolor"`; \}; `sessionOperations`: readonly (`"agent.manage"` \| `"agent.read"` \| `"agent.send"`)[]; \}\>[]\>; `ensureStarter`: `Promise`\<[`StarterOutcome`](agents.md#starteroutcome)\>; `setArchived`: `Promise`\< \| `Readonly`\<\{ `archived`: `boolean`; `revision`: `number`; \}\> \| `Readonly`\<\{ `error`: \| `"archived"` \| `"pending"` \| `"not_found"` \| `"running"` \| `"not_granted"` \| `"self"` \| `"not_creator"` \| `"unreadable"`; `message?`: `string`; `archived?`: `boolean`; `revision?`: `number`; \}\>\>; `create`: `Promise`\<`Readonly`\<\{ `agentId`: `string`; `name`: `string`; `avatar`: \{ `v`: `1`; `character`: `"mushroom"` \| `"cat"` \| `"burger"`; `appearance`: `z.ZodRecord`\<`z.ZodString`, `z.ZodUnion`\<readonly \[..., ..., ...\]\>\>; `expression`: `string`; `renderStyle`: \| `"plain"` \| `"pencil"` \| `"manga"` \| `"riso"` \| `"halftone"` \| `"blueprint"` \| `"crt"` \| `"watercolor"`; \}; `sessionOperations`: readonly (`"agent.manage"` \| `"agent.read"` \| `"agent.send"`)[]; \}\>\>; `rename`: `Promise`\< \| `Readonly`\<\{ `agentId`: `string`; `name`: `string`; `avatar`: \{ `v`: `1`; `character`: `"mushroom"` \| `"cat"` \| `"burger"`; `appearance`: `z.ZodRecord`\<`z.ZodString`, `z.ZodUnion`\<readonly ...\>\>; `expression`: `string`; `renderStyle`: \| `"plain"` \| `"pencil"` \| `"manga"` \| `"riso"` \| `"halftone"` \| `"blueprint"` \| `"crt"` \| `"watercolor"`; \}; `sessionOperations`: readonly (`"agent.manage"` \| `"agent.read"` \| `"agent.send"`)[]; \}\> \| `Readonly`\<\{ `error`: `"not_found"` \| `"not_granted"` \| `"name_taken"`; \}\>\>; `setAvatar`: `Promise`\< \| `Readonly`\<\{ `agentId`: `string`; `name`: `string`; `avatar`: \{ `v`: `1`; `character`: `"mushroom"` \| `"cat"` \| `"burger"`; `appearance`: `z.ZodRecord`\<`z.ZodString`, `z.ZodUnion`\<readonly ...\>\>; `expression`: `string`; `renderStyle`: \| `"plain"` \| `"pencil"` \| `"manga"` \| `"riso"` \| `"halftone"` \| `"blueprint"` \| `"crt"` \| `"watercolor"`; \}; `sessionOperations`: readonly (`"agent.manage"` \| `"agent.read"` \| `"agent.send"`)[]; \}\> \| `Readonly`\<\{ `error`: `"not_found"` \| `"not_granted"`; \}\>\>; `readModelChoice`: `Promise`\< \| \{ `keySource`: `"workers-ai"` \| `"ai-gateway"` \| `"byok"`; `model`: \{ `providerId`: `string`; `modelId`: `string`; `reasoning?`: `"max"` \| `"low"` \| `"medium"` \| `"high"` \| `"minimal"` \| `"xhigh"`; \}; `keyId?`: `string`; \} \| `null`\>; `decodeModelChoice`: \| \{ `keySource`: `"workers-ai"` \| `"ai-gateway"` \| `"byok"`; `model`: \{ `providerId`: `string`; `modelId`: `string`; `reasoning?`: `"max"` \| `"low"` \| `"medium"` \| `"high"` \| `"minimal"` \| `"xhigh"`; \}; `keyId?`: `string`; \} \| `null`; `setModelChoice`: `Promise`\< \| \{ `keySource`: `"workers-ai"` \| `"ai-gateway"` \| `"byok"`; `model`: \{ `providerId`: `string`; `modelId`: `string`; `reasoning?`: `"max"` \| `"low"` \| `"medium"` \| `"high"` \| `"minimal"` \| `"xhigh"`; \}; `keyId?`: `string`; \} \| `Readonly`\<\{ `error`: \| `"not_found"` \| `"not_granted"` \| [`AgentModelRefusal`](agents.md#agentmodelrefusal); \}\>\>; `policyStatus`: `Promise`\< \| `Readonly`\<\{ `status`: `"pending"` \| `"approved"`; `revision`: `string`; \}\> \| `null`\>; `appToolPolicy`: `Promise`\< \| \{ `level`: `"read"` \| `"write"`; `revision`: `string`; `grantedBy`: `string`; \} \| `null`\>; `policyRevision`: `Promise`\<`string` \| `null`\>; `approveAppToolPolicy`: `Promise`\< \| \{ `level`: `"read"` \| `"write"`; `revision`: `string`; `grantedBy`: `string`; \} \| `Readonly`\<\{ `status`: `"pending"`; `revision`: `string`; \}\> \| `Readonly`\<\{ `error`: `"not_found"` \| `"not_granted"` \| `"revision_conflict"`; \}\>\>; `setup`: `Promise`\<`Readonly`\<\{ `models`: `"ready"` \| `"missing"`; `media`: `"ready"` \| `"missing"`; \}\>\>; `modelKeys`: `Promise`\<readonly `Readonly`\<\{ `keyId`: `string`; `provider`: `"anthropic"` \| `"openai"` \| `"openrouter"` \| `"openai-compatible"`; `label`: `string`; `createdAt`: `number`; `validatedAt`: `number`; \}\>[]\>; `sealModelKey`: `Promise`\< \| `Readonly`\<\{ `keyId`: `string`; `provider`: `"anthropic"` \| `"openai"` \| `"openrouter"` \| `"openai-compatible"`; `label`: `string`; `createdAt`: `number`; `validatedAt`: `number`; \}\> \| `Readonly`\<\{ `error`: [`ModelKeyRefusal`](agents.md#modelkeyrefusal); \}\>\>; `removeModelKey`: `Promise`\<`"deleted"` \| `"absent"`\>; `connections`: `Promise`\<readonly `Readonly`\<\{ `connectionId`: `string`; `name`: `string`; `label`: `string`; `kind`: `"mcp"` \| `"openapi"`; `url`: `string`; `auth`: `"none"` \| `"token"` \| `"oauth"`; `state`: `"pending"` \| `"connected"` \| `"reconnect_required"`; `grants`: readonly `Readonly`\<\{ `agentId`: `string`; `access`: [`ConnectionAccess`](agents.md#connectionaccess); \}\>[]; \}\>[]\>; `addConnection`: `Promise`\< \| `Readonly`\<\{ `connectionId`: `string`; `authorizeUrl`: `string` \| `null`; \}\> \| `Readonly`\<\{ `error`: `"limit"` \| `"not_found"` \| `"duplicate_name"` \| `"invalid_endpoint"`; \}\>\>; `grantConnection`: `Promise`\< \| `Readonly`\<\{ `error`: `"limit"` \| `"not_found"` \| `"duplicate_name"` \| `"invalid_endpoint"`; \}\> \| `Readonly`\<\{ `ok`: `true`; \}\>\>; `ungrantConnection`: `Promise`\<`boolean`\>; `removeConnection`: `Promise`\<`boolean`\>; `connectionTools`: `Promise`\< \| readonly `string`[] \| `Readonly`\<\{ `error`: `"limit"` \| `"not_found"` \| `"duplicate_name"` \| `"invalid_endpoint"`; \}\>\>; `completeMcpConnection`: `Promise`\< \| `Readonly`\<\{ `ok`: `true`; \}\> \| `Readonly`\<\{ `error`: `string`; \}\>\>; `mcpCallbackUrl`: `string`; `fetch`: `Promise`\<`Response` \| `null`\>; `inbox`: `Promise`\<`Readonly`\<\{ `items`: readonly ( \| \{ `agentId`: `string`; `sessionId`: `string`; `title`: `string`; `triggerId?`: `string`; `createdAt`: `number`; `lastActivityAt`: `number`; `settledAt?`: `number`; `visitedAt?`: `number`; `state`: `"running"` \| `"done"` \| `"errored"` \| `"needs_you"`; \} \| \{ `agentId`: `string`; `sessionId`: `string`; `state`: `"unavailable"`; \} \| \{ `kind`: `"workflow-review"`; `key`: \{ `runId`: `string`; `nodeId`: `string`; `iteration`: `string`; \}; `installationId`: `string`; `workflowId`: `string` \| `null`; `workflowTitle`: `string`; `reviewTitle`: `string`; `reviewers`: `"
|
|
1735
|
+
| `agents` | \| `Readonly`\<\{ `list`: `Promise`\<readonly `Readonly`\<\{ `agentId`: `string`; `name`: `string`; `avatar`: \{ `v`: `1`; `character`: `"mushroom"` \| `"cat"` \| `"burger"`; `appearance`: `z.ZodRecord`\<`z.ZodString`, `z.ZodUnion`\<readonly ...\>\>; `expression`: `string`; `renderStyle`: \| `"plain"` \| `"pencil"` \| `"manga"` \| `"riso"` \| `"halftone"` \| `"blueprint"` \| `"crt"` \| `"watercolor"`; \}; `sessionOperations`: readonly (`"agent.manage"` \| `"agent.read"` \| `"agent.send"`)[]; \}\>[]\>; `ensureStarter`: `Promise`\<[`StarterOutcome`](agents.md#starteroutcome)\>; `setArchived`: `Promise`\< \| `Readonly`\<\{ `archived`: `boolean`; `revision`: `number`; \}\> \| `Readonly`\<\{ `error`: \| `"archived"` \| `"pending"` \| `"not_found"` \| `"running"` \| `"not_granted"` \| `"self"` \| `"not_creator"` \| `"unreadable"`; `message?`: `string`; `archived?`: `boolean`; `revision?`: `number`; \}\>\>; `create`: `Promise`\<`Readonly`\<\{ `agentId`: `string`; `name`: `string`; `avatar`: \{ `v`: `1`; `character`: `"mushroom"` \| `"cat"` \| `"burger"`; `appearance`: `z.ZodRecord`\<`z.ZodString`, `z.ZodUnion`\<readonly \[..., ..., ...\]\>\>; `expression`: `string`; `renderStyle`: \| `"plain"` \| `"pencil"` \| `"manga"` \| `"riso"` \| `"halftone"` \| `"blueprint"` \| `"crt"` \| `"watercolor"`; \}; `sessionOperations`: readonly (`"agent.manage"` \| `"agent.read"` \| `"agent.send"`)[]; \}\>\>; `rename`: `Promise`\< \| `Readonly`\<\{ `agentId`: `string`; `name`: `string`; `avatar`: \{ `v`: `1`; `character`: `"mushroom"` \| `"cat"` \| `"burger"`; `appearance`: `z.ZodRecord`\<`z.ZodString`, `z.ZodUnion`\<readonly ...\>\>; `expression`: `string`; `renderStyle`: \| `"plain"` \| `"pencil"` \| `"manga"` \| `"riso"` \| `"halftone"` \| `"blueprint"` \| `"crt"` \| `"watercolor"`; \}; `sessionOperations`: readonly (`"agent.manage"` \| `"agent.read"` \| `"agent.send"`)[]; \}\> \| `Readonly`\<\{ `error`: `"not_found"` \| `"not_granted"` \| `"name_taken"`; \}\>\>; `setAvatar`: `Promise`\< \| `Readonly`\<\{ `agentId`: `string`; `name`: `string`; `avatar`: \{ `v`: `1`; `character`: `"mushroom"` \| `"cat"` \| `"burger"`; `appearance`: `z.ZodRecord`\<`z.ZodString`, `z.ZodUnion`\<readonly ...\>\>; `expression`: `string`; `renderStyle`: \| `"plain"` \| `"pencil"` \| `"manga"` \| `"riso"` \| `"halftone"` \| `"blueprint"` \| `"crt"` \| `"watercolor"`; \}; `sessionOperations`: readonly (`"agent.manage"` \| `"agent.read"` \| `"agent.send"`)[]; \}\> \| `Readonly`\<\{ `error`: `"not_found"` \| `"not_granted"`; \}\>\>; `readModelChoice`: `Promise`\< \| \{ `keySource`: `"workers-ai"` \| `"ai-gateway"` \| `"byok"`; `model`: \{ `providerId`: `string`; `modelId`: `string`; `reasoning?`: `"max"` \| `"low"` \| `"medium"` \| `"high"` \| `"minimal"` \| `"xhigh"`; \}; `keyId?`: `string`; \} \| `null`\>; `decodeModelChoice`: \| \{ `keySource`: `"workers-ai"` \| `"ai-gateway"` \| `"byok"`; `model`: \{ `providerId`: `string`; `modelId`: `string`; `reasoning?`: `"max"` \| `"low"` \| `"medium"` \| `"high"` \| `"minimal"` \| `"xhigh"`; \}; `keyId?`: `string`; \} \| `null`; `setModelChoice`: `Promise`\< \| \{ `keySource`: `"workers-ai"` \| `"ai-gateway"` \| `"byok"`; `model`: \{ `providerId`: `string`; `modelId`: `string`; `reasoning?`: `"max"` \| `"low"` \| `"medium"` \| `"high"` \| `"minimal"` \| `"xhigh"`; \}; `keyId?`: `string`; \} \| `Readonly`\<\{ `error`: \| `"not_found"` \| `"not_granted"` \| [`AgentModelRefusal`](agents.md#agentmodelrefusal); \}\>\>; `policyStatus`: `Promise`\< \| `Readonly`\<\{ `status`: `"pending"` \| `"approved"`; `revision`: `string`; \}\> \| `null`\>; `appToolPolicy`: `Promise`\< \| \{ `level`: `"read"` \| `"write"`; `revision`: `string`; `grantedBy`: `string`; \} \| `null`\>; `policyRevision`: `Promise`\<`string` \| `null`\>; `approveAppToolPolicy`: `Promise`\< \| \{ `level`: `"read"` \| `"write"`; `revision`: `string`; `grantedBy`: `string`; \} \| `Readonly`\<\{ `status`: `"pending"`; `revision`: `string`; \}\> \| `Readonly`\<\{ `error`: `"not_found"` \| `"not_granted"` \| `"revision_conflict"`; \}\>\>; `setup`: `Promise`\<`Readonly`\<\{ `models`: `"ready"` \| `"missing"`; `media`: `"ready"` \| `"missing"`; \}\>\>; `modelKeys`: `Promise`\<readonly `Readonly`\<\{ `keyId`: `string`; `provider`: `"anthropic"` \| `"openai"` \| `"openrouter"` \| `"openai-compatible"`; `label`: `string`; `createdAt`: `number`; `validatedAt`: `number`; \}\>[]\>; `sealModelKey`: `Promise`\< \| `Readonly`\<\{ `keyId`: `string`; `provider`: `"anthropic"` \| `"openai"` \| `"openrouter"` \| `"openai-compatible"`; `label`: `string`; `createdAt`: `number`; `validatedAt`: `number`; \}\> \| `Readonly`\<\{ `error`: [`ModelKeyRefusal`](agents.md#modelkeyrefusal); \}\>\>; `removeModelKey`: `Promise`\<`"deleted"` \| `"absent"`\>; `connections`: `Promise`\<readonly `Readonly`\<\{ `connectionId`: `string`; `name`: `string`; `label`: `string`; `kind`: `"mcp"` \| `"openapi"`; `url`: `string`; `auth`: `"none"` \| `"token"` \| `"oauth"`; `state`: `"pending"` \| `"connected"` \| `"reconnect_required"`; `grants`: readonly `Readonly`\<\{ `agentId`: `string`; `access`: [`ConnectionAccess`](agents.md#connectionaccess); \}\>[]; \}\>[]\>; `addConnection`: `Promise`\< \| `Readonly`\<\{ `connectionId`: `string`; `authorizeUrl`: `string` \| `null`; \}\> \| `Readonly`\<\{ `error`: `"limit"` \| `"not_found"` \| `"duplicate_name"` \| `"invalid_endpoint"`; \}\>\>; `grantConnection`: `Promise`\< \| `Readonly`\<\{ `error`: `"limit"` \| `"not_found"` \| `"duplicate_name"` \| `"invalid_endpoint"`; \}\> \| `Readonly`\<\{ `ok`: `true`; \}\>\>; `ungrantConnection`: `Promise`\<`boolean`\>; `removeConnection`: `Promise`\<`boolean`\>; `connectionTools`: `Promise`\< \| readonly `string`[] \| `Readonly`\<\{ `error`: `"limit"` \| `"not_found"` \| `"duplicate_name"` \| `"invalid_endpoint"`; \}\>\>; `completeMcpConnection`: `Promise`\< \| `Readonly`\<\{ `ok`: `true`; \}\> \| `Readonly`\<\{ `error`: `string`; \}\>\>; `mcpCallbackUrl`: `string`; `fetch`: `Promise`\<`Response` \| `null`\>; `inbox`: `Promise`\<`Readonly`\<\{ `items`: readonly ( \| \{ `agentId`: `string`; `sessionId`: `string`; `title`: `string`; `triggerId?`: `string`; `createdAt`: `number`; `lastActivityAt`: `number`; `settledAt?`: `number`; `visitedAt?`: `number`; `state`: `"running"` \| `"done"` \| `"errored"` \| `"needs_you"`; \} \| \{ `agentId`: `string`; `sessionId`: `string`; `state`: `"unavailable"`; \} \| \{ `kind`: `"workflow-review"`; `key`: \{ `runId`: `string`; `nodeId`: `string`; `iteration`: `string`; \}; `installationId`: `string`; `workflowId`: `string` \| `null`; `workflowTitle`: `string`; `reviewTitle`: `string`; `reviewers`: `"owners"` \| `"runner"`; `show`: readonly `Json`[]; `choices?`: readonly ...[]; `openedAt`: `number`; `expiresAt`: `number`; `state`: `"pending"` \| `"delivered"` \| `"answered"` \| `"timed_out"` \| `"closed"`; \})[]; `revision`: `number`; \}\>\>; `revision`: `Promise`\<`number`\>; `visit`: `Promise`\<`boolean`\>; \}\> \| `undefined` |
|
|
1736
1736
|
|
|
1737
1737
|
#### Returns
|
|
1738
1738
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fungi.computer/oyster",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"author": "Levi <levi@technomancy.dev>",
|
|
5
5
|
"description": "Run your own Apps on Cloudflare Workers or celld: installable App Releases, each with its own Durable Object, SQLite database and declared bindings",
|
|
6
6
|
"type": "module",
|