@dahura/super-agent-kit 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.
@@ -0,0 +1,181 @@
1
+ /**
2
+ * Provider definition types and factory for @dahura/super-agent-kit.
3
+ *
4
+ * This module provides the `defineProvider()` factory function that follows
5
+ * the same DX pattern as `defineAgent()` — declarative definition objects
6
+ * with compile-time validation.
7
+ *
8
+ * Providers are the abstraction layer between agents and model backends:
9
+ * - Local LLM servers (llama-server, Ollama, LM Studio)
10
+ * - Local audio transcription (whisper-cpp)
11
+ * - Cloud providers (OpenAI, Anthropic)
12
+ * - Custom model backends
13
+ */
14
+ /**
15
+ * Supported provider transport mechanisms.
16
+ * - "ai-sdk": Uses Vercel AI SDK LanguageModel interface (HTTP-based)
17
+ * - "custom": Custom invoke function (e.g., subprocess for whisper-cpp)
18
+ */
19
+ export type ProviderKind = "ai-sdk" | "custom";
20
+ /**
21
+ * Capabilities a provider may support.
22
+ * Used for routing and validation.
23
+ */
24
+ export type ProviderCapability = "text" | "vision" | "audio" | "embedding";
25
+ /**
26
+ * Provider metadata. Similar to AgentMeta but without exportName
27
+ * since providers are typically referenced by id.
28
+ */
29
+ export type ProviderMeta = {
30
+ /** Stable kebab-case id, used as registry key and env prefix. */
31
+ id: string;
32
+ /** One-line human description shown in Playground. */
33
+ description: string;
34
+ /** Optional semver version. */
35
+ version?: string;
36
+ /** Capabilities this provider supports. */
37
+ capabilities: readonly ProviderCapability[];
38
+ };
39
+ /**
40
+ * Single environment variable specification.
41
+ */
42
+ export type ProviderEnvVar = {
43
+ /** Suffix for the env var (e.g., "BIN" → SUPERAGENT_<PROVIDER>_BIN). */
44
+ env: string;
45
+ /** Whether this env var is required for the provider to work. */
46
+ required?: boolean;
47
+ /** Default value if not set. */
48
+ default?: string;
49
+ /** Human description for documentation/UI. */
50
+ description?: string;
51
+ };
52
+ /**
53
+ * Environment schema for provider configuration.
54
+ * Each key maps to an env var specification.
55
+ */
56
+ export type ProviderEnvSchema = Record<string, ProviderEnvVar>;
57
+ /**
58
+ * Model discovery configuration for local providers.
59
+ * Allows automatic detection of available models from filesystem paths.
60
+ */
61
+ export type ProviderModelDiscovery = {
62
+ /** Paths to scan for models (supports ~ expansion). */
63
+ paths: readonly string[];
64
+ /** Glob pattern for model files (e.g., "**\/*.gguf"). */
65
+ pattern: string;
66
+ /** Extract a human-readable model id from a discovered file path. */
67
+ extractModelId: (filePath: string) => string;
68
+ /** Optional filter to exclude certain files (e.g., mmproj files). Return true to include. */
69
+ filter?: (filePath: string) => boolean;
70
+ };
71
+ /**
72
+ * Result of probing a provider for availability.
73
+ */
74
+ export type ProviderProbeResult = {
75
+ /** Whether the provider is available and configured. */
76
+ ok: boolean;
77
+ /** Latency of the probe request in milliseconds. */
78
+ latencyMs?: number;
79
+ /** List of available models (for HTTP-based providers). */
80
+ models?: readonly string[];
81
+ /** Error message if probe failed. */
82
+ error?: string;
83
+ /** Additional metadata from the probe. */
84
+ meta?: Record<string, unknown>;
85
+ };
86
+ /**
87
+ * Resolved configuration for a provider instance.
88
+ * Built from environment variables and defaults.
89
+ */
90
+ export type ProviderConfig = Record<string, string | number | boolean | undefined>;
91
+ /**
92
+ * The author-facing definition object passed to `defineProvider`.
93
+ *
94
+ * @template TConfig - Type of the resolved configuration object
95
+ */
96
+ export type ProviderDefinition<TConfig extends ProviderConfig = ProviderConfig> = {
97
+ /** Provider identification and metadata. */
98
+ meta: ProviderMeta;
99
+ /** Transport mechanism. */
100
+ kind: ProviderKind;
101
+ /** Environment variable schema for configuration. */
102
+ env: ProviderEnvSchema;
103
+ /** Optional model discovery for local providers. */
104
+ modelDiscovery?: ProviderModelDiscovery;
105
+ /**
106
+ * Optional probe function to check provider availability.
107
+ * Called by Playground /api/env/providers to show status.
108
+ */
109
+ probe?: (config: TConfig) => Promise<ProviderProbeResult>;
110
+ /**
111
+ * Build the resolved model from configuration.
112
+ * Returns a ResolvedModel (defined in @dahura/super-agent-runtime).
113
+ */
114
+ build: (config: TConfig) => Promise<unknown>;
115
+ };
116
+ /**
117
+ * What `defineProvider` returns. The actual provider registration
118
+ * happens in @dahura/super-agent-runtime via the ProviderRegistry.
119
+ */
120
+ export type ProviderModule<TConfig extends ProviderConfig = ProviderConfig> = {
121
+ __isProvider: true;
122
+ definition: ProviderDefinition<TConfig>;
123
+ };
124
+ /**
125
+ * Serialized provider manifest for tooling and UI.
126
+ */
127
+ export type ProviderManifest = {
128
+ kind: "provider";
129
+ id: string;
130
+ description: string;
131
+ version?: string;
132
+ capabilities: readonly ProviderCapability[];
133
+ providerKind: ProviderKind;
134
+ env: ProviderEnvSchema;
135
+ hasModelDiscovery: boolean;
136
+ hasProbe: boolean;
137
+ };
138
+ /**
139
+ * Validation errors thrown synchronously when `defineProvider` is given an
140
+ * inconsistent definition. These should never reach end users — they fail
141
+ * fast at module-load time so the registry refuses to accept a broken provider.
142
+ */
143
+ export declare class ProviderDefinitionError extends Error {
144
+ name: string;
145
+ }
146
+ /**
147
+ * The author-facing factory. Authors call this to define a provider.
148
+ * The returned `ProviderModule` is a thin wrapper — the actual provider
149
+ * registration happens in `@dahura/super-agent-runtime` via ProviderRegistry.
150
+ *
151
+ * @example
152
+ * export const llamaServerProvider = defineProvider({
153
+ * meta: {
154
+ * id: "llama-server",
155
+ * description: "Managed llama.cpp server for local LLM inference",
156
+ * capabilities: ["text", "vision"],
157
+ * },
158
+ * kind: "ai-sdk",
159
+ * env: {
160
+ * bin: { env: "BIN", required: true },
161
+ * modelPath: { env: "MODEL_PATH", required: true },
162
+ * },
163
+ * modelDiscovery: {
164
+ * paths: ["~/.cache/lm-studio/models"],
165
+ * pattern: "**\/*.gguf",
166
+ * extractModelId: (p) => basename(p, ".gguf"),
167
+ * },
168
+ * probe: probeLlamaServer,
169
+ * build: buildLlamaServerModel,
170
+ * });
171
+ */
172
+ export declare function defineProvider<TConfig extends ProviderConfig = ProviderConfig>(definition: ProviderDefinition<TConfig>): ProviderModule<TConfig>;
173
+ /**
174
+ * Type guard to check if a value is a ProviderModule.
175
+ */
176
+ export declare function isProviderModule(value: unknown): value is ProviderModule;
177
+ /**
178
+ * Convert a ProviderModule to a serializable manifest.
179
+ */
180
+ export declare function providerToManifest(provider: ProviderModule): ProviderManifest;
181
+ //# sourceMappingURL=provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE/C;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,WAAW,CAAC;AAE3E;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,iEAAiE;IACjE,EAAE,EAAE,MAAM,CAAC;IACX,sDAAsD;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,YAAY,EAAE,SAAS,kBAAkB,EAAE,CAAC;CAC7C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,wEAAwE;IACxE,GAAG,EAAE,MAAM,CAAC;IACZ,iEAAiE;IACjE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gCAAgC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAE/D;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,uDAAuD;IACvD,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,yDAAyD;IACzD,OAAO,EAAE,MAAM,CAAC;IAChB,qEAAqE;I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AE,kBAAkB,CAAC,OAAO,CAAC,CAAC;CACzC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAC5C,YAAY,EAAE,YAAY,CAAC;IAC3B,GAAG,EAAE,iBAAiB,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IACvC,IAAI,SAA6B;CAC3C;AA2GD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,cAAc,CAAC,OAAO,SAAS,cAAc,GAAG,cAAc,EAC5E,UAAU,EAAE,kBAAkB,CAAC,OAAO,CAAC,GACtC,cAAc,CAAC,OAAO,CAAC,CAkBzB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAOxE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,cAAc,GAAG,gBAAgB,CAa7E"}
@@ -0,0 +1,159 @@
1
+ /**
2
+ * Provider definition types and factory for @dahura/super-agent-kit.
3
+ *
4
+ * This module provides the `defineProvider()` factory function that follows
5
+ * the same DX pattern as `defineAgent()` — declarative definition objects
6
+ * with compile-time validation.
7
+ *
8
+ * Providers are the abstraction layer between agents and model backends:
9
+ * - Local LLM servers (llama-server, Ollama, LM Studio)
10
+ * - Local audio transcription (whisper-cpp)
11
+ * - Cloud providers (OpenAI, Anthropic)
12
+ * - Custom model backends
13
+ */
14
+ /**
15
+ * Validation errors thrown synchronously when `defineProvider` is given an
16
+ * inconsistent definition. These should never reach end users — they fail
17
+ * fast at module-load time so the registry refuses to accept a broken provider.
18
+ */
19
+ export class ProviderDefinitionError extends Error {
20
+ name = "ProviderDefinitionError";
21
+ }
22
+ /**
23
+ * Validate the meta section of a provider definition.
24
+ */
25
+ function validateProviderMeta(meta) {
26
+ if (!meta || typeof meta !== "object") {
27
+ throw new ProviderDefinitionError("meta is required");
28
+ }
29
+ if (!meta.id || !/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(meta.id)) {
30
+ throw new ProviderDefinitionError(`meta.id must be kebab-case (got: ${JSON.stringify(meta.id)})`);
31
+ }
32
+ if (!meta.description || meta.description.length === 0) {
33
+ throw new ProviderDefinitionError("meta.description is required");
34
+ }
35
+ if (!Array.isArray(meta.capabilities) || meta.capabilities.length === 0) {
36
+ throw new ProviderDefinitionError("meta.capabilities must be a non-empty array");
37
+ }
38
+ const validCapabilities = ["text", "vision", "audio", "embedding"];
39
+ for (const cap of meta.capabilities) {
40
+ if (!validCapabilities.includes(cap)) {
41
+ throw new ProviderDefinitionError(`meta.capabilities contains invalid capability "${cap}"`);
42
+ }
43
+ }
44
+ if (meta.version !== undefined && !/^\d+\.\d+\.\d+/.test(meta.version)) {
45
+ throw new ProviderDefinitionError(`meta.version must be semver if provided (got: ${JSON.stringify(meta.version)})`);
46
+ }
47
+ }
48
+ /**
49
+ * Validate the environment schema.
50
+ */
51
+ function validateProviderEnv(env) {
52
+ if (!env || typeof env !== "object") {
53
+ throw new ProviderDefinitionError("env schema is required");
54
+ }
55
+ for (const [key, spec] of Object.entries(env)) {
56
+ if (!spec || typeof spec !== "object") {
57
+ throw new ProviderDefinitionError(`env.${key} must be an object`);
58
+ }
59
+ if (!spec.env || typeof spec.env !== "string") {
60
+ throw new ProviderDefinitionError(`env.${key}.env must be a string`);
61
+ }
62
+ if (!/^[A-Z][A-Z0-9_]*$/.test(spec.env)) {
63
+ throw new ProviderDefinitionError(`env.${key}.env must be UPPER_SNAKE_CASE (got: ${JSON.stringify(spec.env)})`);
64
+ }
65
+ }
66
+ }
67
+ /**
68
+ * Validate the kind field.
69
+ */
70
+ function validateProviderKind(kind) {
71
+ if (kind !== "ai-sdk" && kind !== "custom") {
72
+ throw new ProviderDefinitionError(`kind must be "ai-sdk" or "custom" (got: ${JSON.stringify(kind)})`);
73
+ }
74
+ }
75
+ /**
76
+ * Validate model discovery configuration if provided.
77
+ */
78
+ function validateProviderModelDiscovery(discovery) {
79
+ if (!discovery)
80
+ return;
81
+ if (!Array.isArray(discovery.paths) || discovery.paths.length === 0) {
82
+ throw new ProviderDefinitionError("modelDiscovery.paths must be a non-empty array");
83
+ }
84
+ if (!discovery.pattern || typeof discovery.pattern !== "string") {
85
+ throw new ProviderDefinitionError("modelDiscovery.pattern must be a string");
86
+ }
87
+ if (typeof discovery.extractModelId !== "function") {
88
+ throw new ProviderDefinitionError("modelDiscovery.extractModelId must be a function");
89
+ }
90
+ }
91
+ /**
92
+ * The author-facing factory. Authors call this to define a provider.
93
+ * The returned `ProviderModule` is a thin wrapper — the actual provider
94
+ * registration happens in `@dahura/super-agent-runtime` via ProviderRegistry.
95
+ *
96
+ * @example
97
+ * export const llamaServerProvider = defineProvider({
98
+ * meta: {
99
+ * id: "llama-server",
100
+ * description: "Managed llama.cpp server for local LLM inference",
101
+ * capabilities: ["text", "vision"],
102
+ * },
103
+ * kind: "ai-sdk",
104
+ * env: {
105
+ * bin: { env: "BIN", required: true },
106
+ * modelPath: { env: "MODEL_PATH", required: true },
107
+ * },
108
+ * modelDiscovery: {
109
+ * paths: ["~/.cache/lm-studio/models"],
110
+ * pattern: "**\/*.gguf",
111
+ * extractModelId: (p) => basename(p, ".gguf"),
112
+ * },
113
+ * probe: probeLlamaServer,
114
+ * build: buildLlamaServerModel,
115
+ * });
116
+ */
117
+ export function defineProvider(definition) {
118
+ validateProviderMeta(definition.meta);
119
+ validateProviderKind(definition.kind);
120
+ validateProviderEnv(definition.env);
121
+ validateProviderModelDiscovery(definition.modelDiscovery);
122
+ if (typeof definition.build !== "function") {
123
+ throw new ProviderDefinitionError("build must be a function");
124
+ }
125
+ if (definition.probe !== undefined && typeof definition.probe !== "function") {
126
+ throw new ProviderDefinitionError("probe must be a function if provided");
127
+ }
128
+ return {
129
+ __isProvider: true,
130
+ definition,
131
+ };
132
+ }
133
+ /**
134
+ * Type guard to check if a value is a ProviderModule.
135
+ */
136
+ export function isProviderModule(value) {
137
+ return (typeof value === "object" &&
138
+ value !== null &&
139
+ "__isProvider" in value &&
140
+ value.__isProvider === true);
141
+ }
142
+ /**
143
+ * Convert a ProviderModule to a serializable manifest.
144
+ */
145
+ export function providerToManifest(provider) {
146
+ const { definition } = provider;
147
+ return {
148
+ kind: "provider",
149
+ id: definition.meta.id,
150
+ description: definition.meta.description,
151
+ version: definition.meta.version,
152
+ capabilities: definition.meta.capabilities,
153
+ providerKind: definition.kind,
154
+ env: definition.env,
155
+ hasModelDiscovery: !!definition.modelDiscovery,
156
+ hasProbe: !!definition.probe,
157
+ };
158
+ }
159
+ //# sourceMappingURL=provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAyIH;;;;GAIG;AACH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IACvC,IAAI,GAAG,yBAAyB,CAAC;CAC3C;AAED;;GAEG;AACH,SAAS,oBAAoB,CAAC,IAAkB;IAC9C,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACtC,MAAM,IAAI,uBAAuB,CAAC,kBAAkB,CAAC,CAAC;IACxD,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;QAC5D,MAAM,IAAI,uBAAuB,CAC/B,oCAAoC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAC/D,CAAC;IACJ,CAAC;IAED,IAAI,C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