@w3kits/sdk 0.1.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.
Files changed (42) hide show
  1. package/README.md +29 -0
  2. package/dist/app-file.d.ts +39 -0
  3. package/dist/app-file.d.ts.map +1 -0
  4. package/dist/app-file.js +81 -0
  5. package/dist/app-file.js.map +1 -0
  6. package/dist/browser.d.ts +12 -0
  7. package/dist/browser.d.ts.map +1 -0
  8. package/dist/browser.js +12 -0
  9. package/dist/browser.js.map +1 -0
  10. package/dist/container.d.ts +36 -0
  11. package/dist/container.d.ts.map +1 -0
  12. package/dist/container.js +125 -0
  13. package/dist/container.js.map +1 -0
  14. package/dist/index.d.ts +12 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +12 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/local-cache.d.ts +207 -0
  19. package/dist/local-cache.d.ts.map +1 -0
  20. package/dist/local-cache.js +187 -0
  21. package/dist/local-cache.js.map +1 -0
  22. package/dist/path-mapping.d.ts +79 -0
  23. package/dist/path-mapping.d.ts.map +1 -0
  24. package/dist/path-mapping.js +156 -0
  25. package/dist/path-mapping.js.map +1 -0
  26. package/dist/plugin.d.ts +34 -0
  27. package/dist/plugin.d.ts.map +1 -0
  28. package/dist/plugin.js +124 -0
  29. package/dist/plugin.js.map +1 -0
  30. package/dist/profile-app-file.d.ts +202 -0
  31. package/dist/profile-app-file.d.ts.map +1 -0
  32. package/dist/profile-app-file.js +352 -0
  33. package/dist/profile-app-file.js.map +1 -0
  34. package/dist/r2-client.d.ts +76 -0
  35. package/dist/r2-client.d.ts.map +1 -0
  36. package/dist/r2-client.js +56 -0
  37. package/dist/r2-client.js.map +1 -0
  38. package/dist/storage/index.d.ts +67 -0
  39. package/dist/storage/index.d.ts.map +1 -0
  40. package/dist/storage/index.js +111 -0
  41. package/dist/storage/index.js.map +1 -0
  42. package/package.json +73 -0
@@ -0,0 +1,56 @@
1
+ export const W3KITS_STORAGE_CAPABILITY_DESCRIPTOR_VERSION = "w3kits.storage.capability.v1";
2
+ /**
3
+ * Creates the SDK-owned descriptor shape consumed by plugin/runtime bridges.
4
+ */
5
+ export function createW3KitsStorageCapabilityDescriptor(input) {
6
+ return {
7
+ version: W3KITS_STORAGE_CAPABILITY_DESCRIPTOR_VERSION,
8
+ visibleRoot: input.capability.root,
9
+ capability: input.capability,
10
+ r2: input.r2,
11
+ auth: {
12
+ mode: "runtime-session",
13
+ header: "x-w3kits-runtime-session",
14
+ },
15
+ localFirst: {
16
+ enabled: input.localFirstEnabled !== false,
17
+ store: "indexeddb-opfs",
18
+ commit: {
19
+ interactiveSuccess: "local",
20
+ remoteSync: "background",
21
+ },
22
+ flushPolicy: {
23
+ onChange: true,
24
+ debounceMs: 2000,
25
+ lifecycleEvents: [
26
+ "visibilitychange",
27
+ "pagehide",
28
+ "run-complete",
29
+ "daemon-stop",
30
+ "daemon-crash",
31
+ ],
32
+ highFrequencyPolling: false,
33
+ },
34
+ },
35
+ sync: {
36
+ commitSemantics: "local-durable-first",
37
+ largeBodyThresholdBytes: input.largeBodyThresholdBytes ?? 4 * 1024 * 1024,
38
+ },
39
+ };
40
+ }
41
+ /**
42
+ * Builds a path-style R2 object URL from a scoped descriptor.
43
+ */
44
+ export function r2ObjectUrl(descriptor, key) {
45
+ const endpoint = descriptor.endpoint.replace(/\/+$/u, "");
46
+ const cleanPrefix = descriptor.prefix.replace(/^\/+|\/+$/gu, "");
47
+ const cleanKey = key.replace(/^\/+/u, "");
48
+ const objectKey = [cleanPrefix, cleanKey]
49
+ .filter((segment) => segment.length > 0)
50
+ .join("/");
51
+ return `${endpoint}/${encodeURIComponent(descriptor.bucket)}/${objectKey
52
+ .split("/")
53
+ .map(encodeURIComponent)
54
+ .join("/")}`;
55
+ }
56
+ //# sourceMappingURL=r2-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"r2-client.js","sourceRoot":"","sources":["../src/r2-client.ts"],"names":[],"mappings":"AA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CAAC;SACtC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;SACvC,IAAI,CAAC,GAAG,CAAC,CAAC;IACb,OAAO,GAAG,QAAQ,IAAI,kBAAkB,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,SAAS;SACrE,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,kBAAkB,CAAC;SACvB,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AACjB,CAAC"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Defines SDK storage capability contracts and a small local-first flush adapter.
3
+ * @owner w3kits-sdk
4
+ * @module sdk
5
+ * @boundary storage
6
+ */
7
+ import { InMemoryOperationLog, type LocalFirstVfsClientOptions, type LocalFirstVfsOperation } from "../local-cache.js";
8
+ import { type StorageScope } from "../path-mapping.js";
9
+ export type StorageCapabilityAction = "list" | "get" | "put" | "delete" | "multipart";
10
+ export type StorageCapability = {
11
+ id: string;
12
+ userId: string;
13
+ profileId: string;
14
+ root: "/home/agent" | `/home/agent/${string}`;
15
+ actions: StorageCapabilityAction[];
16
+ expiresAt: string;
17
+ credentialMode: "temporary-r2-credentials" | "presigned-url";
18
+ };
19
+ export type StorageRemote = {
20
+ put(input: {
21
+ key: string;
22
+ body: Uint8Array;
23
+ operationId: string;
24
+ }): Promise<{
25
+ revision?: string;
26
+ }>;
27
+ delete(input: {
28
+ key: string;
29
+ operationId: string;
30
+ }): Promise<{
31
+ revision?: string;
32
+ }>;
33
+ };
34
+ /**
35
+ * Represents auth/capability failures during queued storage flush.
36
+ */
37
+ export declare class StorageAuthError extends Error {
38
+ /**
39
+ * Creates a storage auth error.
40
+ */
41
+ constructor(message?: string);
42
+ }
43
+ /**
44
+ * Minimal local-first storage client for SDK contract tests and future browser adapters.
45
+ */
46
+ export declare class LocalFirstStorageClient {
47
+ private readonly options;
48
+ private readonly remote?;
49
+ readonly operations: InMemoryOperationLog;
50
+ /**
51
+ * Initializes the storage client.
52
+ */
53
+ constructor(options: LocalFirstVfsClientOptions & StorageScope, remote?: StorageRemote | undefined);
54
+ /**
55
+ * Enqueues a visible-path put operation.
56
+ */
57
+ put(visiblePath: string, body: Uint8Array): LocalFirstVfsOperation;
58
+ /**
59
+ * Enqueues a visible-path delete operation.
60
+ */
61
+ delete(visiblePath: string): LocalFirstVfsOperation;
62
+ /**
63
+ * Flushes queued operations through the remote adapter.
64
+ */
65
+ flush(): Promise<LocalFirstVfsOperation[]>;
66
+ }
67
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,oBAAoB,EAEpB,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAC5B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE3E,MAAM,MAAM,uBAAuB,GAC/B,MAAM,GACN,KAAK,GACL,KAAK,GACL,QAAQ,GACR,WAAW,CAAC;AAEhB,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,aAAa,GAAG,eAAe,MAAM,EAAE,CAAC;IAC9C,OAAO,EAAE,uBAAuB,EAAE,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,0BAA0B,GAAG,eAAe,CAAC;CAC9D,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,CAAC,KAAK,EAAE;QACT,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,UAAU,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;KACrB,GAAG,OAAO,CAAC;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnC,MAAM,CAAC,KAAK,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACrF,CAAC;AAEF;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IACzC;;OAEG;gBACS,OAAO,SAAiD;CAIrE;AAED;;GAEG;AACH,qBAAa,uBAAuB;IAOhC,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;IAP1B,QAAQ,CAAC,UAAU,uBAA8B;IAEjD;;OAEG;gBAEgB,OAAO,EAAE,0BAA0B,GAAG,YAAY,EAClD,MAAM,CAAC,EAAE,aAAa,YAAA;IAGzC;;OAEG;IACH,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,sBAAsB;IAWlE;;OAEG;IACH,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,sBAAsB;IAUnD;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,sBAAsB,EAAE,CAAC;CAmDjD"}
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Defines SDK storage capability contracts and a small local-first flush adapter.
3
+ * @owner w3kits-sdk
4
+ * @module sdk
5
+ * @boundary storage
6
+ */
7
+ import { InMemoryOperationLog, markQueuedAuthFailure, } from "../local-cache.js";
8
+ import { mapVisiblePathToR2 } from "../path-mapping.js";
9
+ /**
10
+ * Represents auth/capability failures during queued storage flush.
11
+ */
12
+ export class StorageAuthError extends Error {
13
+ /**
14
+ * Creates a storage auth error.
15
+ */
16
+ constructor(message = "Storage capability is unavailable or expired") {
17
+ super(message);
18
+ this.name = "StorageAuthError";
19
+ }
20
+ }
21
+ /**
22
+ * Minimal local-first storage client for SDK contract tests and future browser adapters.
23
+ */
24
+ export class LocalFirstStorageClient {
25
+ options;
26
+ remote;
27
+ operations = new InMemoryOperationLog();
28
+ /**
29
+ * Initializes the storage client.
30
+ */
31
+ constructor(options, remote) {
32
+ this.options = options;
33
+ this.remote = remote;
34
+ }
35
+ /**
36
+ * Enqueues a visible-path put operation.
37
+ */
38
+ put(visiblePath, body) {
39
+ const mapping = mapVisiblePathToR2(visiblePath, this.options);
40
+ return this.operations.enqueue({
41
+ scopeId: `${mapping.userId}:${mapping.profileId}`,
42
+ type: "put",
43
+ bucket: "home",
44
+ key: mapping.relativeHomePath,
45
+ bodyRef: `memory:${body.byteLength}:${mapping.r2Key}`,
46
+ });
47
+ }
48
+ /**
49
+ * Enqueues a visible-path delete operation.
50
+ */
51
+ delete(visiblePath) {
52
+ const mapping = mapVisiblePathToR2(visiblePath, this.options);
53
+ return this.operations.enqueue({
54
+ scopeId: `${mapping.userId}:${mapping.profileId}`,
55
+ type: "delete",
56
+ bucket: "home",
57
+ key: mapping.relativeHomePath,
58
+ });
59
+ }
60
+ /**
61
+ * Flushes queued operations through the remote adapter.
62
+ */
63
+ async flush() {
64
+ if (!this.remote)
65
+ return this.operations.pending();
66
+ const flushed = [];
67
+ for (const operation of this.operations.pending()) {
68
+ try {
69
+ const syncing = this.operations.update({
70
+ ...operation,
71
+ status: "syncing",
72
+ attempts: operation.attempts + 1,
73
+ updatedAt: new Date().toISOString(),
74
+ });
75
+ if (syncing.type === "put") {
76
+ await this.remote.put({
77
+ key: syncing.key,
78
+ body: new Uint8Array(),
79
+ operationId: syncing.operationId,
80
+ });
81
+ }
82
+ else if (syncing.type === "delete") {
83
+ await this.remote.delete({
84
+ key: syncing.key,
85
+ operationId: syncing.operationId,
86
+ });
87
+ }
88
+ flushed.push(this.operations.update({
89
+ ...syncing,
90
+ status: "synced",
91
+ updatedAt: new Date().toISOString(),
92
+ }));
93
+ }
94
+ catch (error) {
95
+ if (error instanceof StorageAuthError) {
96
+ flushed.push(this.operations.update(markQueuedAuthFailure(operation, this.options)));
97
+ continue;
98
+ }
99
+ flushed.push(this.operations.update({
100
+ ...operation,
101
+ status: "failed",
102
+ attempts: operation.attempts + 1,
103
+ lastError: error instanceof Error ? error.message : "flush_failed",
104
+ updatedAt: new Date().toISOString(),
105
+ }));
106
+ }
107
+ }
108
+ return flushed;
109
+ }
110
+ }
111
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,oBAAoB,EACpB,qBAAqB,GAGtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAqB,MAAM,oBAAoB,CAAC;AA4B3E;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACzC;;OAEG;IACH,YAAY,OAAO,GAAG,8CAA8C;QAClE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACjC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,uBAAuB;IAOf;IACA;IAPV,UAAU,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAEjD;;OAEG;IACH,YACmB,OAAkD,EAClD,MAAsB;QADtB,YAAO,GAAP,OAAO,CAA2C;QAClD,WAAM,GAAN,MAAM,CAAgB;IACtC,CAAC;IAEJ;;OAEG;IACH,GAAG,CAAC,WAAmB,EAAE,IAAgB;QACvC,MAAM,OAAO,GAAG,kBAAkB,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9D,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;YAC7B,OAAO,EAAE,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,SAAS,EAAE;YACjD,IAAI,EAAE,KAAK;YACX,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,OAAO,CAAC,gBAAgB;YAC7B,OAAO,EAAE,UAAU,IAAI,CAAC,UAAU,IAAI,OAAO,CAAC,KAAK,EAAE;SACtD,CAAC,CAA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OAAO,CAAC,GAAG;wBAChB,WAAW,EAAE,OAAO,CAAC,WAAW;qBACjC,CAAC,CAAC;gBACL,CAAC;gBACD,OAAO,CAAC,IAAI,CACV,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;oBACrB,GAAG,OAAO;oBACV,MAAM,EAAE,QAAQ;oBAChB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;iBACpC,CAAC,CACH,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,KAAK,YAAY,gBAAgB,EAAE,CAAC;oBACtC,OAAO,CAAC,IAAI,CACV,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,qBAAqB,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CACvE,CAAC;oBACF,SAAS;gBACX,CAAC;gBACD,OAAO,CAAC,IAAI,CACV,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;oBACrB,GAAG,SAAS;oBACZ,MAAM,EAAE,QAAQ;oBAChB,QAAQ,EAAE,SAAS,CAAC,QAAQ,GAAG,CAAC;oBAChC,SAAS,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc;oBAClE,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;iBACpC,CAAC,CACH,CAAC;YACJ,CAAC;QACH,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
package/package.json ADDED
@@ -0,0 +1,73 @@
1
+ {
2
+ "name": "@w3kits/sdk",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "private": false,
6
+ "description": "Client-first W3Kits SDK for browser, plugin, container, storage, visible path, local cache, R2 capability, and .app file semantics.",
7
+ "main": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "files": [
10
+ "dist",
11
+ "README.md"
12
+ ],
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.js"
20
+ },
21
+ "./browser": {
22
+ "types": "./dist/browser.d.ts",
23
+ "import": "./dist/browser.js"
24
+ },
25
+ "./plugin": {
26
+ "types": "./dist/plugin.d.ts",
27
+ "import": "./dist/plugin.js"
28
+ },
29
+ "./container": {
30
+ "types": "./dist/container.d.ts",
31
+ "import": "./dist/container.js"
32
+ },
33
+ "./storage": {
34
+ "types": "./dist/storage/index.d.ts",
35
+ "import": "./dist/storage/index.js"
36
+ },
37
+ "./path-mapping": {
38
+ "types": "./dist/path-mapping.d.ts",
39
+ "import": "./dist/path-mapping.js"
40
+ },
41
+ "./local-cache": {
42
+ "types": "./dist/local-cache.d.ts",
43
+ "import": "./dist/local-cache.js"
44
+ },
45
+ "./r2-client": {
46
+ "types": "./dist/r2-client.d.ts",
47
+ "import": "./dist/r2-client.js"
48
+ },
49
+ "./app-file": {
50
+ "types": "./dist/app-file.d.ts",
51
+ "import": "./dist/app-file.js"
52
+ },
53
+ "./profile-app-file": {
54
+ "types": "./dist/profile-app-file.d.ts",
55
+ "import": "./dist/profile-app-file.js"
56
+ },
57
+ "./package.json": "./package.json"
58
+ },
59
+ "scripts": {
60
+ "build": "rm -rf dist && tsc -p tsconfig.build.json",
61
+ "pack:check": "npm pack --dry-run",
62
+ "prepack": "npm run build",
63
+ "prepare": "npm run build",
64
+ "test": "vitest run",
65
+ "typecheck": "tsc --noEmit"
66
+ },
67
+ "devDependencies": {
68
+ "@types/node": "catalog:",
69
+ "@workspace/typescript-config": "workspace:*",
70
+ "typescript": "catalog:",
71
+ "vitest": "catalog:"
72
+ }
73
+ }