qarpeo 0.1.13 → 0.1.15

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 (33) hide show
  1. package/README.md +7 -13
  2. package/dist/chunks/auth-schema.mjs +119 -147
  3. package/dist/cli/index.mjs +1 -1
  4. package/dist/module.mjs +96 -21
  5. package/dist/runtime/ai.d.ts +4 -2
  6. package/dist/runtime/ai.mjs +8 -2
  7. package/dist/runtime/app/composables/ai.d.ts +74 -0
  8. package/dist/runtime/app/composables/ai.mjs +148 -0
  9. package/dist/runtime/app/composables/auth.d.ts +16 -1
  10. package/dist/runtime/app/composables/auth.mjs +23 -34
  11. package/dist/runtime/app/composables/void-client.d.ts +3 -0
  12. package/dist/runtime/app/composables/void-client.mjs +4 -0
  13. package/dist/runtime/blob.mjs +1 -1
  14. package/dist/runtime/db.mjs +1 -1
  15. package/dist/runtime/server/routes/agents/[agent]/history.get.d.ts +1 -1
  16. package/dist/runtime/server/routes/auth/handler.d.ts +2 -0
  17. package/dist/runtime/server/routes/auth/handler.mjs +11 -0
  18. package/dist/runtime/server/utils/auth.d.ts +66 -0
  19. package/dist/runtime/server/utils/auth.mjs +58 -0
  20. package/dist/runtime/server/utils/realtime.mjs +1 -1
  21. package/dist/runtime/server/utils/void-ai.d.ts +7 -0
  22. package/dist/runtime/server/utils/void-ai.mjs +47 -0
  23. package/dist/runtime/server/utils/void-auth.d.ts +2 -0
  24. package/dist/runtime/server/utils/void-auth.mjs +9 -0
  25. package/dist/runtime/server/utils/void-db.d.ts +8 -0
  26. package/dist/runtime/server/utils/void-db.mjs +38 -0
  27. package/dist/runtime/server/utils/void-seed.d.ts +11 -0
  28. package/dist/runtime/server/utils/void-seed.mjs +3 -0
  29. package/dist/runtime/types/ai.d.ts +2 -0
  30. package/dist/runtime/types/imports.d.ts +65 -6
  31. package/dist/types.d.ts +1 -1
  32. package/dist/utils/auth-schema.d.ts +3 -5
  33. package/package.json +3 -2
@@ -0,0 +1,38 @@
1
+ import { drizzle as drizzleD1 } from "drizzle-orm/d1";
2
+ import * as _schema from "#qarpeo/schema";
3
+ import { db, useDrizzle } from "./drizzle.mjs";
4
+ export { db, useDrizzle };
5
+ export function createDb(bindingOrName) {
6
+ if (typeof bindingOrName === "string") {
7
+ return useDrizzle(bindingOrName);
8
+ }
9
+ if (bindingOrName && typeof bindingOrName.prepare === "function") {
10
+ return drizzleD1(bindingOrName, { schema: _schema });
11
+ }
12
+ return db;
13
+ }
14
+ export {
15
+ eq,
16
+ ne,
17
+ gt,
18
+ gte,
19
+ lt,
20
+ lte,
21
+ and,
22
+ or,
23
+ not,
24
+ desc,
25
+ asc,
26
+ like,
27
+ ilike,
28
+ notLike,
29
+ inArray,
30
+ notInArray,
31
+ isNull,
32
+ isNotNull,
33
+ exists,
34
+ notExists,
35
+ between,
36
+ notBetween,
37
+ sql
38
+ } from "drizzle-orm";
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Void Cloud Seeding helper (`void/seed`).
3
+ * Identity helper for programmatic seed modules used by `void db seed` or `vpx qp db seed`.
4
+ */
5
+ export declare function defineSeed<TSchema = any>(fn: (ctx: {
6
+ db: any;
7
+ schema: TSchema;
8
+ }) => Promise<void> | void): (ctx: {
9
+ db: any;
10
+ schema: TSchema;
11
+ }) => Promise<void> | void;
@@ -0,0 +1,3 @@
1
+ export function defineSeed(fn) {
2
+ return fn;
3
+ }
@@ -65,4 +65,6 @@ export interface QarpeoAI {
65
65
  model?: string;
66
66
  binding?: string;
67
67
  }): Promise<number[][]>;
68
+ /** Performs vector similarity search using Cloudflare Vectorize. */
69
+ similaritySearch(indexName: string, query: string, options?: any): Promise<any[]>;
68
70
  }
@@ -17,6 +17,65 @@ declare global {
17
17
  const requireUserSession: (event: any, opts?: any) => Promise<any>
18
18
  }
19
19
 
20
+ declare module "#qarpeo/auth/schema" {
21
+ export const user: any
22
+ export const users: any
23
+ export const session: any
24
+ export const sessions: any
25
+ export const account: any
26
+ export const accounts: any
27
+ export const verification: any
28
+ export const verifications: any
29
+ export const twoFactor: any
30
+ export const passkey: any
31
+ export const authenticators: any
32
+ export const organization: any
33
+ export const organizations: any
34
+ export const member: any
35
+ export const members: any
36
+ export const invitation: any
37
+ export const invitations: any
38
+ }
39
+
40
+ declare module "@schema" {
41
+ export * from "#qarpeo/schema"
42
+ }
43
+
44
+ declare module "void/db" {
45
+ export const db: any
46
+ export const useDrizzle: any
47
+ export const createDb: (bindingOrName?: any) => any
48
+ export const sql: any
49
+ export const eq: any
50
+ export const ne: any
51
+ export const gt: any
52
+ export const gte: any
53
+ export const lt: any
54
+ export const lte: any
55
+ export const and: any
56
+ export const or: any
57
+ export const not: any
58
+ export const desc: any
59
+ export const asc: any
60
+ export const like: any
61
+ export const ilike: any
62
+ export const notLike: any
63
+ export const inArray: any
64
+ export const notInArray: any
65
+ export const isNull: any
66
+ export const isNotNull: any
67
+ export const exists: any
68
+ export const notExists: any
69
+ export const between: any
70
+ export const notBetween: any
71
+ }
72
+
73
+ declare module "void/seed" {
74
+ export function defineSeed<TSchema = any>(
75
+ fn: (ctx: { db: any; schema: TSchema }) => Promise<void> | void,
76
+ ): (ctx: { db: any; schema: TSchema }) => Promise<void> | void
77
+ }
78
+
20
79
  declare module "#qarpeo/agents-registry" {
21
80
  const def: any
22
81
  export default def
@@ -38,6 +97,8 @@ declare module "#app" {
38
97
 
39
98
  declare module "#imports" {
40
99
  export const useAuth: any
100
+ export const useSession: any
101
+ export const authClient: any
41
102
  export const useUserSession: any
42
103
  export const getAuthSession: any
43
104
  export const setAuthSession: any
@@ -49,10 +110,8 @@ declare module "#imports" {
49
110
  export const replaceUserSession: any
50
111
  export const clearUserSession: any
51
112
  export const requireUserSession: any
52
- export const useRuntimeConfig: any
53
- export const useNitroApp: any
54
- export const navigateTo: any
55
- export const defineNuxtRouteMiddleware: any
56
- export const createError: any
57
- export const $fetch: any
113
+ export const useChat: any
114
+ export const useAgentChat: any
115
+ export const useAIStream: any
116
+ export const useVectorSearch: any
58
117
  }
package/dist/types.d.ts CHANGED
@@ -2537,7 +2537,7 @@ export interface QarpeoOptions {
2537
2537
  */
2538
2538
  cache?: boolean | CacheOptions;
2539
2539
  /**
2540
- * Enable Cloudflare Edge Authentication powered by nuxt-auth-utils + D1 + KV (Tier 2).
2540
+ * Enable Cloudflare Edge Authentication powered by Better Auth & void/auth + D1 (Tier 2).
2541
2541
  *
2542
2542
  * @default false
2543
2543
  */
@@ -1,11 +1,9 @@
1
1
  import type { AuthOptions } from "../types";
2
- export declare const ALL_AUTH_TABLE_NAMES: readonly ["_qarpeo_users", "_qarpeo_accounts", "_qarpeo_sessions", "_qarpeo_two_factor", "_qarpeo_authenticators", "_qarpeo_organizations", "_qarpeo_members", "_qarpeo_invitations", "_qarpeo_api_tokens"];
2
+ export declare const ALL_AUTH_TABLE_NAMES: readonly ["user", "account", "session", "verification", "twoFactor", "passkey", "organization", "member", "invitation", "_qarpeo_users", "_qarpeo_accounts", "_qarpeo_sessions"];
3
3
  /** Returns the list of active auth table names based on enabled feature flags in `auth`. */
4
4
  export declare function getActiveAuthTableNames(auth?: boolean | AuthOptions): string[];
5
5
  /**
6
- * Dynamically composes Drizzle SQLite schema code based on active auth feature flags. Uses
7
- * `snakeCase.table` from drizzle-orm/sqlite-core so camelCase property names are automatically
8
- * mapped to snake_case column names — no manual column strings needed. Assembled at build time into
9
- * `#qarpeo/auth/schema` and merged into `#qarpeo/schema`.
6
+ * Composes Drizzle SQLite schema conforming to the official Better Auth / void/auth specifications.
7
+ * Merged at build time into `#qarpeo/auth/schema` and virtual `@schema`.
10
8
  */
11
9
  export declare function generateAuthSchema(auth?: boolean | AuthOptions): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qarpeo",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "Zero-config Cloudflare Edge Platform for Nuxt",
5
5
  "keywords": [
6
6
  "analytics-engine",
@@ -52,6 +52,7 @@
52
52
  "access": "public"
53
53
  },
54
54
  "dependencies": {
55
+ "@better-auth/drizzle-adapter": "^1.7.18",
55
56
  "@cloudflare/puppeteer": "1.4.0",
56
57
  "@comark/nuxt": "^0.8.1",
57
58
  "@comark/vue": "^0.8.1",
@@ -59,6 +60,7 @@
59
60
  "@nuxt/kit": "npm:@nuxt/kit-nightly@^5.0.0-2611070044-e3875e8",
60
61
  "@simplewebauthn/browser": "14.0.0",
61
62
  "@simplewebauthn/server": "14.0.3",
63
+ "better-auth": "^1.7.18",
62
64
  "citty": "^0.2.2",
63
65
  "comark": "^0.8.1",
64
66
  "defu": "^6.1.7",
@@ -66,7 +68,6 @@
66
68
  "drizzle-orm": "1.0.0-rc.5",
67
69
  "drizzle-seed": "1.0.0-rc.5",
68
70
  "giget": "^3.3.1",
69
- "nuxt-auth-utils": "0.6.0",
70
71
  "nypm": "^0.6.12",
71
72
  "pathe": "^2.0.3",
72
73
  "shiki": "^4.6.0",