@tangle-network/agent-app 1.0.4 → 1.0.6

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.
@@ -8,13 +8,11 @@
8
8
  * two partial unique indexes make the link one-per-user and
9
9
  * one-per-platform-user, which the write path relies on.
10
10
  *
11
- * Schema expectations are Better Auth's default SQLite model with camelCase
12
- * columns: `user(id, name, email, emailVerified, createdAt, updatedAt)`,
13
- * `session(id, userId, token, expiresAt, ipAddress, userAgent, createdAt,
14
- * updatedAt)` and `account(id, userId, accountId, providerId, createdAt,
15
- * updatedAt)`, with unix-second integer timestamps (Drizzle `mode:
16
- * 'timestamp'`). D1 is structural: Cloudflare `D1Database` satisfies
17
- * {@link TangleIdentityD1Like}.
11
+ * The default schema is Better Auth's singular SQLite model with camelCase
12
+ * columns. {@link D1TangleIdentityStoreOptions.hostSchema} maps an existing
13
+ * host's physical table and column names without changing those defaults.
14
+ * Timestamps are unix-second integers (Drizzle `mode: 'timestamp'`). D1 is
15
+ * structural: Cloudflare `D1Database` satisfies {@link TangleIdentityD1Like}.
18
16
  */
19
17
  import { type TangleIdentitySsoAccountStore } from './sso.js';
20
18
  /** Better Auth `account.providerId` for the Tangle platform link. */
@@ -53,8 +51,22 @@ export interface TangleIdentityLegacyLinkTable {
53
51
  /** Column holding the platform user id; must be unique. */
54
52
  platformUserIdColumn: string;
55
53
  }
54
+ export interface TangleIdentityHostTable<Column extends string> {
55
+ table: string;
56
+ columns: Record<Column, string>;
57
+ }
58
+ /** Better Auth table and physical column names used by the identity store. */
59
+ export interface TangleIdentityHostSchema {
60
+ user: TangleIdentityHostTable<'id' | 'name' | 'email' | 'emailVerified' | 'createdAt' | 'updatedAt'>;
61
+ session: TangleIdentityHostTable<'id' | 'userId' | 'token' | 'expiresAt' | 'ipAddress' | 'userAgent' | 'createdAt' | 'updatedAt'>;
62
+ account: TangleIdentityHostTable<'id' | 'userId' | 'accountId' | 'providerId' | 'createdAt' | 'updatedAt'>;
63
+ }
56
64
  export interface D1TangleIdentityStoreOptions {
57
65
  db: TangleIdentityD1Like;
66
+ /** Physical Better Auth names. Default: singular tables with camelCase columns.
67
+ * Custom account tables need the same two partial unique indexes, using their
68
+ * mapped column names; the default index SQL only targets the default schema. */
69
+ hostSchema?: TangleIdentityHostSchema;
58
70
  /**
59
71
  * The signed-in local user for an explicit "connect Tangle" flow. A live
60
72
  * local session plus a verified platform exchange jointly authorize linking
@@ -151,7 +151,7 @@ import {
151
151
  withoutRecordGridCreated,
152
152
  withoutRecordGridRemoved,
153
153
  withoutRecordGridUpdate
154
- } from "../chunk-DDYWECBU.js";
154
+ } from "../chunk-TGSVYWIF.js";
155
155
  import {
156
156
  useInfiniteScroll
157
157
  } from "../chunk-UHSUY6H6.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-app",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "packageManager": "pnpm@11.28.8",
5
5
  "description": "Build agent applications with typed chat, tools, sandboxes, integrations, billing, and evaluation.",
6
6
  "keywords": [