@gera2ld/pb-datacenter 0.1.0 → 0.1.1
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/index.js +10 -10
- package/dist/pocketbase.d.ts +1 -1
- package/dist/providers.d.ts +3 -2
- package/dist/souls.d.ts +3 -2
- package/dist/tokens.d.ts +2 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -52,13 +52,13 @@ var p = n(async function() {
|
|
|
52
52
|
}).partial().nullish(),
|
|
53
53
|
options: t.record(t.string(), t.any()).nullish()
|
|
54
54
|
});
|
|
55
|
-
async function h(e) {
|
|
56
|
-
let
|
|
55
|
+
async function h(e, t) {
|
|
56
|
+
let n = await e.collection("ai_providers").getFirstListItem(e.filter("name={:name}", { name: t }));
|
|
57
57
|
return m.parse(n);
|
|
58
58
|
}
|
|
59
59
|
var g = a(h, {
|
|
60
60
|
ttl: 6e4,
|
|
61
|
-
resolver: (e) =>
|
|
61
|
+
resolver: (e, t) => t
|
|
62
62
|
}), _ = t.object({
|
|
63
63
|
id: t.string(),
|
|
64
64
|
name: t.string(),
|
|
@@ -73,13 +73,13 @@ var g = a(h, {
|
|
|
73
73
|
capabilities: l.array().optional()
|
|
74
74
|
})
|
|
75
75
|
});
|
|
76
|
-
async function v(e) {
|
|
77
|
-
let
|
|
76
|
+
async function v(e, t) {
|
|
77
|
+
let n = await e.collection("ai_souls").getFirstListItem(e.filter("name={:name}", { name: t }), { expand: "providers,capabilities" });
|
|
78
78
|
return _.parse(n);
|
|
79
79
|
}
|
|
80
80
|
var y = a(v, {
|
|
81
81
|
ttl: 6e4,
|
|
82
|
-
resolver: (e) =>
|
|
82
|
+
resolver: (e, t) => t
|
|
83
83
|
}), b = e.object({
|
|
84
84
|
id: e.string(),
|
|
85
85
|
name: e.string(),
|
|
@@ -89,9 +89,9 @@ var y = a(v, {
|
|
|
89
89
|
created: e.string(),
|
|
90
90
|
updated: e.string()
|
|
91
91
|
});
|
|
92
|
-
async function x(e) {
|
|
93
|
-
let
|
|
94
|
-
return await
|
|
92
|
+
async function x(e, t) {
|
|
93
|
+
let n = e.filter(Object.keys(t).filter((e) => t[e]).map((e) => `${e} = {:${e}}`).join(" && "), t);
|
|
94
|
+
return await e.collection("tokens").getFirstListItem(n);
|
|
95
95
|
}
|
|
96
96
|
//#endregion
|
|
97
|
-
export { g as cachedFetchProvider, y as cachedFetchSoul, l as capabilitySchema, h as fetchProvider, v as fetchSoul, x as findToken, p as
|
|
97
|
+
export { g as cachedFetchProvider, y as cachedFetchSoul, l as capabilitySchema, h as fetchProvider, v as fetchSoul, x as findToken, p as getPbAdmin, o as jsonSchema, s as outputSchema, c as overrideOptionsSchema, m as providerSchema, f as setPocketBaseEnv, _ as soulSchema, b as tokenRecordSchema };
|
package/dist/pocketbase.d.ts
CHANGED
package/dist/providers.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type PocketBase from "pocketbase";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
export declare const providerSchema: z.ZodObject<{
|
|
3
4
|
name: z.ZodString;
|
|
@@ -13,7 +14,7 @@ export declare const providerSchema: z.ZodObject<{
|
|
|
13
14
|
options: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
14
15
|
}, z.core.$strip>;
|
|
15
16
|
export type ProviderSchema = z.infer<typeof providerSchema>;
|
|
16
|
-
export declare function fetchProvider(name: string): Promise<{
|
|
17
|
+
export declare function fetchProvider(pb: PocketBase, name: string): Promise<{
|
|
17
18
|
name: string;
|
|
18
19
|
enabled: boolean;
|
|
19
20
|
handler: string;
|
|
@@ -26,7 +27,7 @@ export declare function fetchProvider(name: string): Promise<{
|
|
|
26
27
|
} | null | undefined;
|
|
27
28
|
options?: Record<string, any> | null | undefined;
|
|
28
29
|
}>;
|
|
29
|
-
export declare const cachedFetchProvider: import("@gera2ld/async-memo").AsyncMemoContext<[name: string], {
|
|
30
|
+
export declare const cachedFetchProvider: import("@gera2ld/async-memo").AsyncMemoContext<[pb: PocketBase, name: string], {
|
|
30
31
|
name: string;
|
|
31
32
|
enabled: boolean;
|
|
32
33
|
handler: string;
|
package/dist/souls.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type PocketBase from "pocketbase";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
export declare const soulSchema: z.ZodObject<{
|
|
3
4
|
id: z.ZodString;
|
|
@@ -62,7 +63,7 @@ export declare const soulSchema: z.ZodObject<{
|
|
|
62
63
|
}, z.core.$strip>;
|
|
63
64
|
}, z.core.$strip>;
|
|
64
65
|
export type SoulSchema = z.infer<typeof soulSchema>;
|
|
65
|
-
export declare function fetchSoul(name: string): Promise<{
|
|
66
|
+
export declare function fetchSoul(pb: PocketBase, name: string): Promise<{
|
|
66
67
|
id: string;
|
|
67
68
|
name: string;
|
|
68
69
|
basePrompt: string;
|
|
@@ -117,7 +118,7 @@ export declare function fetchSoul(name: string): Promise<{
|
|
|
117
118
|
temperature?: number | undefined;
|
|
118
119
|
} | null | undefined;
|
|
119
120
|
}>;
|
|
120
|
-
export declare const cachedFetchSoul: import("@gera2ld/async-memo").AsyncMemoContext<[name: string], {
|
|
121
|
+
export declare const cachedFetchSoul: import("@gera2ld/async-memo").AsyncMemoContext<[pb: PocketBase, name: string], {
|
|
121
122
|
id: string;
|
|
122
123
|
name: string;
|
|
123
124
|
basePrompt: string;
|
package/dist/tokens.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type PocketBase from "pocketbase";
|
|
1
2
|
import z from "zod";
|
|
2
3
|
export declare const tokenRecordSchema: z.ZodObject<{
|
|
3
4
|
id: z.ZodString;
|
|
@@ -9,7 +10,7 @@ export declare const tokenRecordSchema: z.ZodObject<{
|
|
|
9
10
|
updated: z.ZodString;
|
|
10
11
|
}, z.core.$strip>;
|
|
11
12
|
export type TokenRecord = z.infer<typeof tokenRecordSchema>;
|
|
12
|
-
export declare function findToken(filters: {
|
|
13
|
+
export declare function findToken(pb: PocketBase, filters: {
|
|
13
14
|
token?: string;
|
|
14
15
|
user?: string;
|
|
15
16
|
}): Promise<{
|