@dbx-tools/appkit-mastra 0.6.9 → 0.6.11

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.
@@ -1,19 +1,24 @@
1
1
  /**
2
2
  * Startup provisioning of remote Agent-Skill sources for a Mastra workspace.
3
3
  *
4
- * A {@link RemoteSkillSource} names WHERE a `SKILL.md` tree comes from - a
5
- * GitHub `owner/repo`, any git / GitLab URL, or a direct download URL - and
6
- * optional per-source policy. {@link provisionRemoteSkills} materializes every
7
- * source into a local `SKILL.md` tree at app boot and returns the directories
8
- * to hand Mastra as extra skill scan paths.
4
+ * A {@link RemoteSkillSource} names WHERE a `SKILL.md` tree comes from - the
5
+ * {@link AITOOLS_SOURCE} constant, a GitHub `owner/repo`, any git / GitLab URL,
6
+ * or a direct download URL - and optional per-source policy.
7
+ * {@link provisionRemoteSkills} materializes every source into a local
8
+ * `SKILL.md` tree at app boot and returns the directories to hand Mastra as
9
+ * extra skill scan paths.
9
10
  *
10
11
  * Resolution per source, in order:
11
12
  *
12
- * 1. the OPTIONAL `skills` npm CLI (peer dep): if installed, each source is
13
+ * 1. the {@link AITOOLS_SOURCE} constant (`"aitools"`): Databricks' own skill
14
+ * set, read straight from the public repo the `databricks aitools` CLI
15
+ * sources from. No CLI, no Databricks auth - which is what makes it usable
16
+ * inside a Databricks App container, where the CLI is not installed;
17
+ * 2. the OPTIONAL `skills` npm CLI (peer dep): if installed, each source is
13
18
  * copied into a staging dir with `skills add <source> --agent <dir> --copy`,
14
19
  * which understands every source format the ecosystem does (GitHub
15
20
  * shorthand, git URLs, archive/download URLs);
16
- * 2. otherwise a plain {@link fetch} of the source URL (built with
21
+ * 3. otherwise a plain {@link fetch} of the source URL (built with
17
22
  * {@link net.urlBuilder}), writing the downloaded `SKILL.md` to a staging
18
23
  * dir.
19
24
  *
@@ -27,24 +32,39 @@
27
32
  * discovered by the built-in Assistant-skills mount. Pass `userEmail` (or an
28
33
  * explicit `databricksBasePath`) to target `/Users/<email>/.assistant/skills`
29
34
  * instead. When no Databricks client is resolvable at startup, the tree is
30
- * written to a local temp dir and returned as an extra local skill path for
31
- * the current process.
35
+ * written under {@link localFS.tmpFS} and returned as an extra local skill path
36
+ * for the current process.
32
37
  *
33
38
  * @module
34
39
  */
35
40
  import type { WorkspaceClientLike } from "@dbx-tools/appkit";
41
+ import { net } from "@dbx-tools/shared-core";
42
+ import type { OneOrMany } from "@dbx-tools/shared-core";
43
+ /**
44
+ * Source constant selecting Databricks' own AI Tools skill set.
45
+ *
46
+ * @example
47
+ * mastra({ remoteSkills: "aitools" });
48
+ */
49
+ export declare const AITOOLS_SOURCE = "aitools";
50
+ /** The {@link AITOOLS_SOURCE} literal, for callers spelling the union out. */
51
+ export type AiToolsSource = typeof AITOOLS_SOURCE;
36
52
  /**
37
53
  * One remote skill source and its per-source policy.
38
54
  *
39
- * `source` is anything the `skills` ecosystem understands: a GitHub
40
- * `owner/repo` shorthand, a full GitHub / GitLab / git URL, or a direct
41
- * download URL to a `SKILL.md` or archive.
55
+ * `source` is {@link AITOOLS_SOURCE} or anything the `skills` ecosystem
56
+ * understands: a GitHub `owner/repo` shorthand, a full GitHub / GitLab / git
57
+ * URL, or a direct download URL to a `SKILL.md` or archive.
42
58
  */
43
59
  export interface RemoteSkillSourceOptions {
44
- /** GitHub shorthand, git / GitLab URL, or a direct download URL. */
45
- source: string;
46
- /** Install only these skill names from the source (CLI path only). */
60
+ /** `"aitools"`, a GitHub shorthand, a git / GitLab URL, or a download URL. */
61
+ source: net.UrlLike | AiToolsSource;
62
+ /** Install only these skill names from the source. */
47
63
  skills?: string | string[];
64
+ /** Include experimental skills. `"aitools"` only. */
65
+ experimental?: boolean;
66
+ /** Pin the repo ref (tag / branch / sha). `"aitools"` only; defaults to `main`. */
67
+ ref?: string;
48
68
  /** Override the byte ceiling on a direct-fetch download for this source. */
49
69
  maxDownloadBytes?: number;
50
70
  /**
@@ -54,19 +74,20 @@ export interface RemoteSkillSourceOptions {
54
74
  failOnError?: boolean;
55
75
  }
56
76
  /**
57
- * A remote skill source: a bare source string (GitHub shorthand / URL) or a
58
- * {@link RemoteSkillSourceOptions} with per-source policy.
77
+ * A remote skill source: the {@link AITOOLS_SOURCE} constant, a URL-like
78
+ * (string / `URL` / `{ url }`), or a {@link RemoteSkillSourceOptions} bag with
79
+ * per-source policy.
59
80
  */
60
- export type RemoteSkillSource = string | RemoteSkillSourceOptions;
81
+ export type RemoteSkillSource = net.UrlLike | AiToolsSource | RemoteSkillSourceOptions;
61
82
  /**
62
- * The workspace `remoteSkills` option. A single source, a list, or a
63
- * {@link ProvisionRemoteSkillsOptions} bag when top-level policy is needed.
83
+ * The workspace `remoteSkills` option: one source, a non-empty list of them, or
84
+ * a {@link ProvisionRemoteSkillsOptions} bag when top-level policy is needed.
64
85
  */
65
- export type RemoteSkillsOption = RemoteSkillSource | RemoteSkillSource[] | ProvisionRemoteSkillsOptions;
86
+ export type RemoteSkillsOption = RemoteSkillSource | OneOrMany<RemoteSkillSource> | ProvisionRemoteSkillsOptions;
66
87
  /** Top-level remote-skills provisioning options. */
67
88
  export interface ProvisionRemoteSkillsOptions {
68
89
  /** Sources to materialize at startup. */
69
- sources: RemoteSkillSource | RemoteSkillSource[];
90
+ sources: RemoteSkillSource | OneOrMany<RemoteSkillSource>;
70
91
  /**
71
92
  * Fail app startup when a source can't be resolved. Defaults to `true`. A
72
93
  * per-source `failOnError` wins over this.
@@ -103,7 +124,7 @@ export declare function normalizeRemoteSkillsOption(option: RemoteSkillsOption |
103
124
  * Materialize every configured remote skill source at app startup.
104
125
  *
105
126
  * Writes each resolved `SKILL.md` tree to the Databricks user Assistant skills
106
- * folder when a writable workspace is available, else to a local temp dir
107
- * returned in {@link ProvisionedRemoteSkills.localSkillPaths}.
127
+ * folder when a writable workspace is available, else under
128
+ * {@link localFS.tmpFS} returned in {@link ProvisionedRemoteSkills.localSkillPaths}.
108
129
  */
109
130
  export declare function provisionRemoteSkills(option: RemoteSkillsOption | undefined): Promise<ProvisionedRemoteSkills>;