agentic-drive 0.3.0 → 0.5.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/worker.d.ts CHANGED
@@ -1,9 +1,16 @@
1
1
  import { Hono } from 'hono';
2
2
  import { D1Like, R2Like } from 'agentic-identity/cloudflare';
3
3
  import { Store } from 'agentic-identity';
4
- import { C as Ctx, D as Drive } from './drive-Dlzwukjq.js';
4
+ import { C as Ctx, D as Drive } from './drive-Cn3mpuDW.js';
5
5
  export { B as BackfillOptions, a as BackfillResult, b as backfillAuthorIds, c as backfillResources } from './migrate-B79gRPMu.js';
6
6
 
7
+ /**
8
+ * The caller behind a bearer token, resolved by the store-backed Auth of agentic-identity: the credential
9
+ * names a principal, and the whole delegation chain must be live. Only a bearer token counts. A session
10
+ * cookie is refused, because no check of the request origin stands behind it here. Any problem gives null.
11
+ */
12
+ declare function authenticate(request: Request, store: Store, now?: () => number): Promise<Ctx | null>;
13
+
7
14
  interface WorkerEnv {
8
15
  DB: D1Like;
9
16
  FILES: R2Like;
@@ -22,12 +29,6 @@ type App = {
22
29
  ctx: Ctx;
23
30
  };
24
31
  };
25
- /**
26
- * The caller behind a bearer token, resolved by the store-backed Auth of agentic-identity: the credential
27
- * names a principal, and the whole delegation chain must be live. Only a bearer token counts. A session
28
- * cookie is refused, because no check of the request origin stands behind it here. Any problem gives null.
29
- */
30
- declare function authenticate(request: Request, store: Store, now?: () => number): Promise<Ctx | null>;
31
32
  declare function createApp(): Hono<App>;
32
33
  declare const _default: {
33
34
  fetch: (request: Request, env: WorkerEnv, ctx: unknown) => Response | Promise<Response>;
package/dist/worker.js CHANGED
@@ -1,22 +1,23 @@
1
1
  import {
2
2
  backfillAuthorIds,
3
3
  backfillResources
4
- } from "./chunk-5KEISBS4.js";
4
+ } from "./chunk-B7E2Q3RB.js";
5
5
  import {
6
6
  DEFAULT_MAX_BYTES,
7
7
  DEFAULT_URL_SECONDS,
8
8
  DriveError,
9
+ authenticate,
9
10
  buildExport,
10
11
  createDrive,
11
12
  publicNode,
12
13
  safeMime,
13
14
  upload
14
- } from "./chunk-VSVIJBMJ.js";
15
+ } from "./chunk-T6C5Y2WA.js";
15
16
 
16
17
  // src/worker.ts
17
18
  import { Hono } from "hono";
18
19
  import { D1_SCHEMA, createD1Store, createR2Blobs, verifySignedBlobUrl } from "agentic-identity/cloudflare";
19
- import { createSharing, createStoreAuth, parseRegion } from "agentic-identity";
20
+ import { createSharing, parseRegion } from "agentic-identity";
20
21
  var STATUS = {
21
22
  CROSS_DRIVE: 409,
22
23
  INVALID_SHARE: 400,
@@ -42,11 +43,6 @@ var STATUS = {
42
43
  TOO_LARGE: 413
43
44
  };
44
45
  var fail = (code, message, status) => new Response(JSON.stringify({ error: { code, message } }), { status, headers: { "content-type": "application/json" } });
45
- async function authenticate(request, store, now) {
46
- if (!/^Bearer [A-Za-z0-9_-]{1,512}$/.test(request.headers.get("authorization") ?? "")) return null;
47
- const principal = await createStoreAuth(store, now ? { now } : {}).authenticate(request);
48
- return principal ? { owner: principal.chain[0].id, actor: { id: principal.principalId, kind: principal.kind }, principal } : null;
49
- }
50
46
  var schemas = /* @__PURE__ */ new WeakMap();
51
47
  function settings(env) {
52
48
  let publicUrl;
package/llms.txt CHANGED
@@ -6,7 +6,7 @@ Keywords: drive,files,folders,storage,upload,sharing,agents,mcp,cli,r2.
6
6
 
7
7
  - SDK: import { createDrive } from "agentic-drive".
8
8
  - Remote SDK: import { createClient } from "agentic-drive/client". createClient({ baseUrl, token, fetch?, retries? }) has one method for each bearer route and each shared route (list, stat, mkdir, upload, download, move, trash, restore, purge, search, share, createLink, and more). A failed call throws DriveApiError with code and status. It runs in browsers, Workers, and Node 22.
9
- - CLI: agentic-drive ls /.
9
+ - CLI: agentic-drive ls /. Needs a principal: set AGENTIC_DRIVE_TOKEN (or --token) to an API key. Make one with `principal add <id> [--of <person>]` and `key issue <id>`. No key, or a revoked key, exits 3.
10
10
  - MCP: run agentic-drive mcp, then call drive_ls.
11
11
 
12
12
  ## Docs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-drive",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "Store, sort, and share files and folders.",
5
5
  "keywords": [
6
6
  "drive",
@@ -27,6 +27,7 @@
27
27
  },
28
28
  "files": [
29
29
  "dist",
30
+ "ui-dist",
30
31
  "README.md",
31
32
  "CHANGELOG.md",
32
33
  "LICENSE",
@@ -58,8 +59,11 @@
58
59
  "typecheck": "tsc --noEmit",
59
60
  "test": "vitest run",
60
61
  "clean": "rm -rf dist",
61
- "prepack": "npm run build --silent >&2",
62
- "ci:local": "npm run build && npm run typecheck && npm test"
62
+ "prepack": "npm run build --silent >&2 && npm run build:ui --silent >&2",
63
+ "ci:local": "npm run build && npm run build:ui && npm run typecheck && npm test && npm run test:e2e",
64
+ "build:ui": "vite build",
65
+ "deploy:demo": "npm run build:ui && wrangler deploy -c wrangler.demo.jsonc",
66
+ "test:e2e": "playwright test"
63
67
  },
64
68
  "dependencies": {
65
69
  "@modelcontextprotocol/sdk": "^1.12.0",
@@ -68,10 +72,19 @@
68
72
  "zod": "^3.25.0"
69
73
  },
70
74
  "devDependencies": {
75
+ "@axe-core/playwright": "^4.14.0",
76
+ "@playwright/test": "^1.64.1",
71
77
  "@types/node": "^22.0.0",
78
+ "@types/react": "^19.3.0",
79
+ "@types/react-dom": "^19.3.0",
80
+ "@vitejs/plugin-react": "^5.2.0",
81
+ "agentic-design": "^0.1.0",
72
82
  "miniflare": "^4.20260730.0",
83
+ "react": "^19.3.1",
84
+ "react-dom": "^19.3.1",
73
85
  "tsup": "^8.0.0",
74
86
  "typescript": "^5.6.0",
87
+ "vite": "^7.3.7",
75
88
  "vitest": "^3.0.0",
76
89
  "wrangler": "^4.155.0"
77
90
  },
@@ -0,0 +1,4 @@
1
+ /*
2
+ Content-Security-Policy: default-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; frame-ancestors 'none'
3
+ X-Content-Type-Options: nosniff
4
+ Referrer-Policy: no-referrer