@fungi.computer/inkcap 0.14.9 → 0.15.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/backend/index.ts CHANGED
@@ -1,18 +1,8 @@
1
1
  import { markDocumentsChanged } from "./documents-changed.js";
2
- import * as Redacted from "effect/Redacted";
3
2
  import { DurableObject } from "cloudflare:workers";
4
- import * as z from "zod";
5
- import {
6
- appBackendActorHeader,
7
- appBackendComputerHeader,
8
- } from "@fungi.computer/agar/backend";
9
3
  import { createDocumentActivityStore } from "./document-activity.js";
10
4
  import { appBackend, type InkcapBackendContext } from "./methods.js";
11
5
 
12
- const requestSchema = z.strictObject({
13
- method: z.enum(["documents.opened", "documents.edited", "documents.recent"]),
14
- input: z.json(),
15
- });
16
6
  class InkcapFacet extends DurableObject<InkcapBackendContext["env"]> {
17
7
  declare public readonly env: InkcapBackendContext["env"];
18
8
  readonly activity;
@@ -25,28 +15,5 @@ class InkcapFacet extends DurableObject<InkcapBackendContext["env"]> {
25
15
  sequence: number,
26
16
  ): Promise<void> =>
27
17
  markDocumentsChanged(this.env.APP_STORAGE, computerId, sequence);
28
- override async fetch(request: Request): Promise<Response> {
29
- if (request.method !== "PUT")
30
- return new Response(null, { status: 405, headers: { Allow: "PUT" } });
31
- const memberId = request.headers.get(appBackendActorHeader);
32
- if (!memberId)
33
- return Response.json({ error: "App actor unavailable" }, { status: 403 });
34
- try {
35
- const input = requestSchema.parse(await request.json());
36
- return Response.json(
37
- await appBackend.call(input.method, input.input, this, {
38
- actor: { kind: "member", memberId },
39
- computerId: request.headers.get(appBackendComputerHeader),
40
- }),
41
- );
42
- } catch (cause) {
43
- console.error("Inkcap action failed", Redacted.make(cause));
44
- // Never reflect provider errors, remote addresses or headers into the UI.
45
- return Response.json(
46
- { error: "Inkcap could not complete this action" },
47
- { status: 400 },
48
- );
49
- }
50
- }
51
18
  }
52
19
  export const Inkcap = appBackend.implement(InkcapFacet);
@@ -37,6 +37,7 @@ it("projects the saved Recent Files source with stable identities and its own cu
37
37
  },
38
38
  };
39
39
  const caller = {
40
+ scope: { kind: "standalone" as const, tenant: "default" },
40
41
  actor: { kind: "member" as const, memberId: "member-a" },
41
42
  computerId: "computer-a",
42
43
  };
@@ -59,6 +59,7 @@ const emptyMarker = () =>
59
59
  type ComputerBinding = InkcapBackendContext["env"]["COMPUTER"];
60
60
 
61
61
  const caller: Parameters<typeof appBackend.call>[3] = {
62
+ scope: { kind: "standalone" as const, tenant: "default" },
62
63
  actor: { kind: "agent", agentId: "agent-a" },
63
64
  computerId: "computer-a",
64
65
  };
@@ -395,23 +396,10 @@ it.each([
395
396
  }
396
397
  },
397
398
  );
398
- it("does not expose Computer methods through unauthenticated repository HTTP", async () => {
399
- expect(
400
- (await Inkcap.prototype.fetch(new Request("https://inkcap.test/"))).status,
401
- ).toBe(405);
402
- expect(
403
- (
404
- await Inkcap.prototype.fetch(
405
- new Request("https://inkcap.test/", {
406
- method: "PUT",
407
- body: JSON.stringify({
408
- method: "writeFile",
409
- input: { path: "/notes", content: "hi" },
410
- }),
411
- }),
412
- )
413
- ).status,
414
- ).toBe(403);
399
+ it("does not expose Computer methods through unauthenticated repository HTTP", () => {
400
+ // Only host-admitted method calls reach Inkcap; it serves no HTTP bridge
401
+ // whose headers could choose a caller.
402
+ expect(Object.hasOwn(Inkcap.prototype, "fetch")).toBe(false);
415
403
  });
416
404
 
417
405
  it("persists admitted document activity and pages saved rows without provider calls", async () => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fungi.computer/inkcap",
3
3
  "description": "Inkcap: edit the files on your Computer, an App for Oyster",
4
- "version": "0.14.9",
4
+ "version": "0.15.0",
5
5
  "author": "Levi <levi@technomancy.dev>",
6
6
  "type": "module",
7
7
  "exports": {
@@ -13,21 +13,21 @@
13
13
  "react-dom": "18.3.1",
14
14
  "@tanstack/react-form": "1.33.2",
15
15
  "@fungi.computer/caps": "0.12.0",
16
- "@fungi.computer/agar": "0.19.0",
16
+ "@fungi.computer/agar": "0.20.0",
17
17
  "lucide-react": "0.460.0",
18
18
  "@fungi.computer/stipe": "0.1.1",
19
19
  "@fungi.computer/whistle": "0.3.0",
20
- "@fungi.computer/nacre": "0.7.1",
20
+ "@fungi.computer/nacre": "0.7.2",
21
21
  "effect": "4.0.2",
22
22
  "@pierre/trees": "1.0.0-beta.6",
23
23
  "@pierre/diffs": "1.3.6",
24
24
  "@tanstack/react-query": "5.102.8",
25
25
  "zod": "4.4.3",
26
26
  "@fungi.computer/cairn": "0.1.0",
27
- "@fungi.computer/computer-contract": "0.5.1"
27
+ "@fungi.computer/computer-contract": "0.5.3"
28
28
  },
29
29
  "devDependencies": {
30
- "@fungi.computer/oyster": "0.35.0",
30
+ "@fungi.computer/oyster": "0.36.0",
31
31
  "@ladle/react": "5.1.1",
32
32
  "@fungi.computer/capnweb": "0.12.0-fungi.0",
33
33
  "@vitejs/plugin-react": "6.1.1",
@@ -43,7 +43,7 @@
43
43
  "@cloudflare/workers-types": "5.20260828.1",
44
44
  "esbuild": "0.28.2",
45
45
  "vitest": "4.1.11",
46
- "@fungi.computer/puffball": "0.9.1",
46
+ "@fungi.computer/puffball": "0.10.0",
47
47
  "eslint": "10.9.1",
48
48
  "@types/node": "24.13.3"
49
49
  },