@dbx-tools/appkit-mastra 0.9.118 → 0.9.119
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 +83 -76
- package/index.ts +3 -6
- package/lib/index.d.ts +3 -6
- package/lib/index.js +3 -5
- package/lib/src/agents.js +2 -2
- package/lib/src/config.d.ts +18 -15
- package/lib/src/config.js +4 -4
- package/lib/src/defaults.js +4 -4
- package/lib/src/genie.js +8 -8
- package/lib/src/plugin.js +2 -2
- package/lib/src/remote-skills.d.ts +32 -28
- package/lib/src/remote-skills.js +103 -29
- package/lib/src/workspaces.d.ts +4 -7
- package/lib/src/workspaces.js +55 -52
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +16 -24
- package/src/agents.ts +1 -1
- package/src/config.ts +25 -18
- package/src/defaults.ts +3 -3
- package/src/genie.ts +9 -9
- package/src/plugin.ts +1 -1
- package/src/remote-skills.ts +158 -38
- package/src/workspaces.ts +58 -74
- package/lib/src/sandbox.d.ts +0 -107
- package/lib/src/sandbox.js +0 -461
- package/src/sandbox.ts +0 -556
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* {@link AITOOLS_SOURCE} constant, a GitHub `owner/repo`, any git / GitLab URL,
|
|
6
6
|
* or a direct download URL - and optional per-source policy.
|
|
7
7
|
* {@link provisionRemoteSkills} materializes every source into a local
|
|
8
|
-
* `SKILL.md` tree at app boot and returns read-only
|
|
8
|
+
* `SKILL.md` tree at app boot and returns read-only filesystem backings plus
|
|
9
9
|
* their stable virtual workspace mounts.
|
|
10
10
|
*
|
|
11
11
|
* Resolution per source, in order:
|
|
@@ -26,35 +26,29 @@
|
|
|
26
26
|
* source (or the top-level call) sets `failOnError: false`, in which case it is
|
|
27
27
|
* logged and skipped so one bad source never takes the app down.
|
|
28
28
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* record travels WITH the tree rather than in process memory, so the reuse
|
|
35
|
-
* survives a restart - which is the only way it helps a Databricks App at all.
|
|
36
|
-
* Pass `refreshTtlMs: 0` to download on every boot.
|
|
29
|
+
* AI Tools uses the shared `@dbx-tools/cache` project cache with a one-day TTL,
|
|
30
|
+
* then hydrates one process-memory filesystem mounted at
|
|
31
|
+
* {@link AITOOLS_SKILLS_MOUNT} for every default workspace. Other sources keep
|
|
32
|
+
* a {@link METADATA_FILE} beside their provisioned tree and default to a
|
|
33
|
+
* seven-day refresh window. Pass `refreshTtlMs: 0` to download on every boot.
|
|
37
34
|
*
|
|
38
|
-
*
|
|
39
|
-
* (`/Workspace/.assistant/skills`)
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* instead. When no Databricks client is resolvable at startup - or the resolved
|
|
43
|
-
* identity cannot WRITE the destination, which is the normal case for a
|
|
44
|
-
* Databricks App service principal against the admin-owned shared tree (see
|
|
45
|
-
* {@link openWritableWorkspace}) - the tree is written under
|
|
46
|
-
* {@link localFS.tmpFS} and exposed through a stable read-only virtual mount
|
|
47
|
-
* for the current process. Storage location degrades; the skills themselves do not.
|
|
35
|
+
* For non-AI-Tools sources, the default destination is the Databricks workspace
|
|
36
|
+
* Assistant skills tree (`/Workspace/.assistant/skills`). Pass `userEmail` or
|
|
37
|
+
* `databricksBasePath` to select another destination. When it is unavailable,
|
|
38
|
+
* the tree is exposed through a stable read-only local mount instead.
|
|
48
39
|
*
|
|
49
40
|
* @module
|
|
50
41
|
*/
|
|
51
42
|
import type { WorkspaceClientLike } from "@dbx-tools/appkit";
|
|
52
43
|
import { net } from "@dbx-tools/shared-core";
|
|
53
44
|
import type { OneOrMany } from "@dbx-tools/shared-core";
|
|
45
|
+
import { type FileSystem } from "@dbx-tools/shared-fs";
|
|
54
46
|
/** Virtual workspace path reserved for locally provisioned Databricks AI Tools. */
|
|
55
47
|
export declare const AITOOLS_SKILLS_MOUNT = "/.databricks/skills";
|
|
56
48
|
/** Virtual workspace root for every other locally provisioned remote source. */
|
|
57
49
|
export declare const REMOTE_SKILLS_MOUNT = "/.skills";
|
|
50
|
+
/** How long the shared Databricks AI Tools snapshot is reused. */
|
|
51
|
+
export declare const AITOOLS_REFRESH_TTL_MS: number;
|
|
58
52
|
/**
|
|
59
53
|
* Source constant selecting Databricks' own AI Tools skill set.
|
|
60
54
|
*
|
|
@@ -108,13 +102,22 @@ export type RemoteSkillSource = net.UrlLike | AiToolsSource | RemoteSkillSourceO
|
|
|
108
102
|
* a {@link ProvisionRemoteSkillsOptions} bag when top-level policy is needed.
|
|
109
103
|
*/
|
|
110
104
|
export type RemoteSkillsOption = RemoteSkillSource | OneOrMany<RemoteSkillSource> | ProvisionRemoteSkillsOptions;
|
|
111
|
-
/** Read-only local
|
|
112
|
-
export interface
|
|
105
|
+
/** Read-only local directory exposed at a stable virtual workspace path. */
|
|
106
|
+
export interface LocalSkillDirectoryMount {
|
|
113
107
|
/** Physical local directory containing the provisioned `SKILL.md` tree. */
|
|
114
108
|
root: string;
|
|
115
109
|
/** Virtual path agents see inside the composed Mastra workspace. */
|
|
116
110
|
mountPath: string;
|
|
117
111
|
}
|
|
112
|
+
/** Read-only process-local filesystem exposed at a stable virtual workspace path. */
|
|
113
|
+
export interface MemorySkillMount {
|
|
114
|
+
/** Process-shared filesystem containing the provisioned `SKILL.md` tree. */
|
|
115
|
+
filesystem: FileSystem;
|
|
116
|
+
/** Virtual path agents see inside the composed Mastra workspace. */
|
|
117
|
+
mountPath: string;
|
|
118
|
+
}
|
|
119
|
+
/** Local skill backing accepted by every auto-created workspace. */
|
|
120
|
+
export type LocalSkillMount = LocalSkillDirectoryMount | MemorySkillMount;
|
|
118
121
|
/** Top-level remote-skills provisioning options. */
|
|
119
122
|
export interface ProvisionRemoteSkillsOptions {
|
|
120
123
|
/** Sources to materialize at startup. */
|
|
@@ -137,17 +140,18 @@ export interface ProvisionRemoteSkillsOptions {
|
|
|
137
140
|
maxDownloadBytes?: number;
|
|
138
141
|
/**
|
|
139
142
|
* How long a provisioned tree is reused before its source is downloaded
|
|
140
|
-
* again, in milliseconds.
|
|
141
|
-
* boot. A per-source `refreshTtlMs` wins
|
|
143
|
+
* again, in milliseconds. AI Tools defaults to one day and other sources to
|
|
144
|
+
* seven days; `0` re-downloads on every boot. A per-source `refreshTtlMs` wins.
|
|
142
145
|
*/
|
|
143
146
|
refreshTtlMs?: number;
|
|
144
147
|
}
|
|
145
148
|
/** What {@link provisionRemoteSkills} resolved. */
|
|
146
149
|
export interface ProvisionedRemoteSkills {
|
|
147
150
|
/**
|
|
148
|
-
* Extra read-only
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
+
* Extra read-only local or process-memory skill mounts to hand Mastra. AI
|
|
152
|
+
* Tools always uses process memory; other sources use this fallback when
|
|
153
|
+
* they could not be written to Databricks. Physical paths remain hidden
|
|
154
|
+
* behind stable virtual workspace paths.
|
|
151
155
|
*/
|
|
152
156
|
localSkillMounts: LocalSkillMount[];
|
|
153
157
|
/** Absolute Databricks destination each source was written to, if any. */
|
|
@@ -159,8 +163,8 @@ export interface ProvisionedRemoteSkills {
|
|
|
159
163
|
skillNames: string[];
|
|
160
164
|
}
|
|
161
165
|
/**
|
|
162
|
-
*
|
|
163
|
-
* {@link METADATA_FILE}.
|
|
166
|
+
* Metadata for one resolved source snapshot. General remote sources store it
|
|
167
|
+
* in {@link METADATA_FILE}; AI Tools stores it with the cache-package value.
|
|
164
168
|
*/
|
|
165
169
|
export interface RemoteSkillCacheEntry {
|
|
166
170
|
/** The source string this entry was downloaded from, for readability. */
|