@dbx-tools/appkit-mastra 0.9.74 → 0.9.79
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/README.md +53 -42
- package/index.ts +8 -3
- package/lib/index.d.ts +8 -3
- package/lib/index.js +6 -3
- package/lib/src/agents.js +38 -5
- package/lib/src/config.d.ts +7 -7
- package/lib/src/config.js +4 -4
- package/lib/src/genie.js +9 -15
- package/lib/src/mlflow.js +5 -5
- package/lib/src/monty-native.d.ts +40 -0
- package/lib/src/monty-native.js +100 -0
- package/lib/src/monty-sandbox.js +7 -3
- package/lib/src/remote-skills.js +26 -2
- package/lib/src/skill-cache.d.ts +80 -56
- package/lib/src/skill-cache.js +215 -158
- package/lib/src/skill-search.d.ts +30 -0
- package/lib/src/skill-search.js +171 -0
- package/lib/src/workspaces.d.ts +10 -5
- package/lib/src/workspaces.js +132 -117
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +34 -15
- package/src/agents.ts +39 -6
- package/src/config.ts +10 -10
- package/src/genie.ts +8 -13
- package/src/mlflow.ts +4 -4
- package/src/monty-native.ts +149 -0
- package/src/monty-sandbox.ts +7 -2
- package/src/remote-skills.ts +32 -1
- package/src/skill-cache.ts +278 -243
- package/src/skill-search.ts +203 -0
- package/src/workspaces.ts +177 -139
package/lib/src/skill-cache.d.ts
CHANGED
|
@@ -1,70 +1,94 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* User-scoped workspace skill catalogues cached as one semantic record.
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import type {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
import type { RequestContext } from "@mastra/core/request-context";
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
declare const SkillCatalogueEntrySchema: z.ZodObject<{
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
description: z.ZodString;
|
|
11
|
+
instructions: z.ZodString;
|
|
12
|
+
sourceId: z.ZodString;
|
|
13
|
+
sourcePath: z.ZodString;
|
|
14
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
declare const SkillCatalogueSchema: z.ZodObject<{
|
|
17
|
+
version: z.ZodLiteral<1>;
|
|
18
|
+
generatedAt: z.ZodString;
|
|
19
|
+
roots: z.ZodArray<z.ZodString>;
|
|
20
|
+
skills: z.ZodArray<z.ZodObject<{
|
|
21
|
+
name: z.ZodString;
|
|
22
|
+
description: z.ZodString;
|
|
23
|
+
instructions: z.ZodString;
|
|
24
|
+
sourceId: z.ZodString;
|
|
25
|
+
sourcePath: z.ZodString;
|
|
26
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
/** Parsed skill retained in a materialized workspace catalogue. */
|
|
30
|
+
export type SkillCatalogueEntry = z.infer<typeof SkillCatalogueEntrySchema>;
|
|
31
|
+
/** Versioned persisted skill catalogue. */
|
|
32
|
+
export type SkillCatalogue = z.infer<typeof SkillCatalogueSchema>;
|
|
33
|
+
/** One ordered filesystem root contributing skills to a catalogue. */
|
|
34
|
+
export interface SkillCatalogueSource {
|
|
35
|
+
/** Stable source identity including its mount precedence. */
|
|
36
|
+
id: string;
|
|
37
|
+
/** List one source-relative directory with provider metadata when available. */
|
|
38
|
+
list(path: string): Promise<SkillCatalogueFileEntry[]>;
|
|
39
|
+
/** Read one source-relative file fresh from its owning filesystem. */
|
|
40
|
+
read(path: string): Promise<string>;
|
|
41
|
+
}
|
|
42
|
+
/** Minimal directory metadata used to compare one catalogue refresh. */
|
|
43
|
+
export interface SkillCatalogueFileEntry {
|
|
44
|
+
metadata?: Readonly<Record<string, unknown>>;
|
|
45
|
+
name: string;
|
|
46
|
+
size?: number;
|
|
47
|
+
type: "directory" | "file";
|
|
48
|
+
}
|
|
49
|
+
/** Options for one user-scoped workspace skill catalogue. */
|
|
50
|
+
export interface WorkspaceSkillCatalogueOptions {
|
|
12
51
|
host: string;
|
|
13
|
-
|
|
52
|
+
sources: readonly SkillCatalogueSource[];
|
|
14
53
|
ttlMs?: number;
|
|
15
54
|
userKey: string;
|
|
16
55
|
}
|
|
17
|
-
/**
|
|
18
|
-
export interface
|
|
19
|
-
|
|
20
|
-
|
|
56
|
+
/** Request state used to resolve one user-scoped catalogue owner. */
|
|
57
|
+
export interface SkillCatalogueResolveContext {
|
|
58
|
+
abortSignal?: AbortSignal;
|
|
59
|
+
requestContext?: RequestContext;
|
|
21
60
|
}
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
readonly
|
|
29
|
-
readonly
|
|
30
|
-
readonly
|
|
31
|
-
|
|
32
|
-
private
|
|
33
|
-
private readonly
|
|
34
|
-
private
|
|
35
|
-
constructor(options:
|
|
36
|
-
/** Rebind
|
|
37
|
-
bind(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
resolvePath(inputPath: string): string;
|
|
42
|
-
readFile(inputPath: string): Promise<Uint8Array>;
|
|
43
|
-
readFile(inputPath: string, options: ReadFileOptions & {
|
|
44
|
-
encoding: string;
|
|
45
|
-
}): Promise<string>;
|
|
46
|
-
writeFile(inputPath: string, content: FileContent, options?: WriteFileOptions): Promise<void>;
|
|
47
|
-
appendFile(inputPath: string, content: FileContent): Promise<void>;
|
|
48
|
-
deleteFile(inputPath: string, options?: RemoveOptions): Promise<void>;
|
|
49
|
-
copyFile(sourcePath: string, destinationPath: string, options?: CopyOptions): Promise<void>;
|
|
50
|
-
moveFile(sourcePath: string, destinationPath: string, options?: CopyOptions): Promise<void>;
|
|
51
|
-
mkdir(inputPath: string, options?: MakeDirectoryOptions): Promise<void>;
|
|
52
|
-
rmdir(inputPath: string, options?: RemoveOptions): Promise<void>;
|
|
53
|
-
readdir(inputPath: string, options?: ListOptions): Promise<FileEntry[]>;
|
|
54
|
-
exists(inputPath: string): Promise<boolean>;
|
|
55
|
-
stat(inputPath: string): Promise<FileStat>;
|
|
56
|
-
/** Rotate this scope's cache generation so the next read reloads it. */
|
|
61
|
+
/** Resolve one request's complete skill catalogue. */
|
|
62
|
+
export type SkillCatalogueResolver = (context: SkillCatalogueResolveContext) => Promise<WorkspaceSkillCatalogue>;
|
|
63
|
+
/** Default lifetime for one complete workspace skill catalogue. */
|
|
64
|
+
export declare const DEFAULT_WORKSPACE_SKILL_CACHE_TTL_MS: number;
|
|
65
|
+
/** Materialized catalogue with one AppKit cache record and fresh auxiliary reads. */
|
|
66
|
+
export declare class WorkspaceSkillCatalogue {
|
|
67
|
+
private readonly options;
|
|
68
|
+
readonly cacheKey: string;
|
|
69
|
+
readonly host: string;
|
|
70
|
+
readonly userKey: string;
|
|
71
|
+
private lastValid?;
|
|
72
|
+
private readonly ttlMs;
|
|
73
|
+
private sources;
|
|
74
|
+
constructor(options: WorkspaceSkillCatalogueOptions);
|
|
75
|
+
/** Rebind refreshes and lazy reads to the current request's filesystem clients. */
|
|
76
|
+
bind(sources: readonly SkillCatalogueSource[]): void;
|
|
77
|
+
/** Return the cached catalogue, refreshing all roots once on cache miss. */
|
|
78
|
+
get(signal?: AbortSignal): Promise<SkillCatalogue>;
|
|
79
|
+
/** Expire this complete catalogue without touching unrelated cache entries. */
|
|
57
80
|
invalidate(): Promise<void>;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
private
|
|
61
|
-
private
|
|
81
|
+
/** Read one selected skill's auxiliary file directly from its current source. */
|
|
82
|
+
readSkillFile(skillName: string, inputPath: string, signal?: AbortSignal): Promise<string>;
|
|
83
|
+
private refresh;
|
|
84
|
+
private rootKey;
|
|
85
|
+
private persistentKey;
|
|
62
86
|
}
|
|
63
|
-
/** Return one stable
|
|
64
|
-
export declare function
|
|
65
|
-
/** Invalidate
|
|
87
|
+
/** Return one stable catalogue owner for a user, host, and ordered root set. */
|
|
88
|
+
export declare function workspaceSkillCatalogue(options: WorkspaceSkillCatalogueOptions): WorkspaceSkillCatalogue;
|
|
89
|
+
/** Invalidate matching complete catalogues and retain their stable owners. */
|
|
66
90
|
export declare function clearWorkspaceSkillCache(options: {
|
|
67
91
|
host: string;
|
|
68
|
-
|
|
69
|
-
userKey: string;
|
|
92
|
+
userKey?: string;
|
|
70
93
|
}): Promise<void>;
|
|
94
|
+
export {};
|