@babyclaw/gateway 0.0.0 → 0.2.0
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.d.ts +91 -1
- package/dist/index.js +308 -79
- package/dist/index.js.map +1 -1
- package/dist/main.js +255 -71
- package/dist/main.js.map +1 -1
- package/package.json +8 -2
package/dist/index.d.ts
CHANGED
|
@@ -134,6 +134,9 @@ declare class AdminClient {
|
|
|
134
134
|
shutdown(): Promise<{
|
|
135
135
|
ok: boolean;
|
|
136
136
|
}>;
|
|
137
|
+
reloadSkills(): Promise<{
|
|
138
|
+
ok: boolean;
|
|
139
|
+
}>;
|
|
137
140
|
private get;
|
|
138
141
|
}
|
|
139
142
|
|
|
@@ -148,6 +151,16 @@ declare function writeConfig({ config }: {
|
|
|
148
151
|
declare const CONFIG_PATH_ENV_VAR = "BABYCLAW_CONFIG_PATH";
|
|
149
152
|
declare function getDefaultConfigPath(): string;
|
|
150
153
|
declare function getConfigPath(): string;
|
|
154
|
+
declare const DEFAULT_WORKSPACE_ROOT = "~/babyclaw";
|
|
155
|
+
/**
|
|
156
|
+
* Resolves the workspace path from the config's workspace.root value.
|
|
157
|
+
* Supports ~ expansion for home-relative paths.
|
|
158
|
+
* Plain relative paths are resolved against the config file's directory
|
|
159
|
+
* so the result is deterministic regardless of where the process starts.
|
|
160
|
+
*/
|
|
161
|
+
declare function resolveWorkspaceRoot({ configRoot }: {
|
|
162
|
+
configRoot: string;
|
|
163
|
+
}): string;
|
|
151
164
|
|
|
152
165
|
declare function getDefaultConfigTemplate(): string;
|
|
153
166
|
|
|
@@ -204,6 +217,83 @@ declare function resolveLanguageModel({ config }: {
|
|
|
204
217
|
config: BabyclawConfig;
|
|
205
218
|
}): LanguageModel;
|
|
206
219
|
|
|
220
|
+
type SkillInstallSpec = {
|
|
221
|
+
id?: string;
|
|
222
|
+
kind: "brew" | "node" | "go" | "uv" | "download";
|
|
223
|
+
label?: string;
|
|
224
|
+
bins?: string[];
|
|
225
|
+
os?: string[];
|
|
226
|
+
formula?: string;
|
|
227
|
+
package?: string;
|
|
228
|
+
module?: string;
|
|
229
|
+
url?: string;
|
|
230
|
+
archive?: string;
|
|
231
|
+
extract?: boolean;
|
|
232
|
+
stripComponents?: number;
|
|
233
|
+
targetDir?: string;
|
|
234
|
+
};
|
|
235
|
+
type OpenClawSkillMetadata = {
|
|
236
|
+
always?: boolean;
|
|
237
|
+
skillKey?: string;
|
|
238
|
+
primaryEnv?: string;
|
|
239
|
+
emoji?: string;
|
|
240
|
+
homepage?: string;
|
|
241
|
+
os?: string[];
|
|
242
|
+
requires?: {
|
|
243
|
+
bins?: string[];
|
|
244
|
+
anyBins?: string[];
|
|
245
|
+
env?: string[];
|
|
246
|
+
config?: string[];
|
|
247
|
+
};
|
|
248
|
+
install?: SkillInstallSpec[];
|
|
249
|
+
};
|
|
250
|
+
type SkillFrontmatter = {
|
|
251
|
+
name: string;
|
|
252
|
+
description: string;
|
|
253
|
+
homepage?: string;
|
|
254
|
+
userInvocable: boolean;
|
|
255
|
+
disableModelInvocation: boolean;
|
|
256
|
+
commandDispatch?: string;
|
|
257
|
+
commandTool?: string;
|
|
258
|
+
commandArgMode?: string;
|
|
259
|
+
openclaw?: OpenClawSkillMetadata;
|
|
260
|
+
};
|
|
261
|
+
type SkillEntry = {
|
|
262
|
+
frontmatter: SkillFrontmatter;
|
|
263
|
+
slug: string;
|
|
264
|
+
relativePath: string;
|
|
265
|
+
};
|
|
266
|
+
declare function getSkillKey({ frontmatter, slug, }: {
|
|
267
|
+
frontmatter: SkillFrontmatter | null;
|
|
268
|
+
slug: string;
|
|
269
|
+
}): string;
|
|
270
|
+
type SkillsConfig = {
|
|
271
|
+
entries: Record<string, {
|
|
272
|
+
enabled: boolean;
|
|
273
|
+
apiKey?: string;
|
|
274
|
+
env?: Record<string, string>;
|
|
275
|
+
}>;
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
type BundledSkillStatus = {
|
|
279
|
+
slug: string;
|
|
280
|
+
frontmatter: SkillFrontmatter | null;
|
|
281
|
+
enabled: boolean;
|
|
282
|
+
eligible: boolean;
|
|
283
|
+
ineligibilityReason: string | null;
|
|
284
|
+
};
|
|
285
|
+
declare function listBundledSkills({ skillsConfig, fullConfig, }: {
|
|
286
|
+
skillsConfig: SkillsConfig;
|
|
287
|
+
fullConfig: Record<string, unknown>;
|
|
288
|
+
}): BundledSkillStatus[];
|
|
289
|
+
declare function getEnabledBundledSkills({ skillsConfig, fullConfig, }: {
|
|
290
|
+
skillsConfig: SkillsConfig;
|
|
291
|
+
fullConfig: Record<string, unknown>;
|
|
292
|
+
}): SkillEntry[];
|
|
293
|
+
declare function getBundledSkillPath({ slug }: {
|
|
294
|
+
slug: string;
|
|
295
|
+
}): string | null;
|
|
296
|
+
|
|
207
297
|
declare const LOG_LEVELS: readonly ["debug", "info", "warn", "error"];
|
|
208
298
|
type LogLevel = (typeof LOG_LEVELS)[number];
|
|
209
299
|
declare const LOG_FORMATS: readonly ["json", "pretty"];
|
|
@@ -225,4 +315,4 @@ declare function createChildLogger({ context }: {
|
|
|
225
315
|
context: Record<string, unknown>;
|
|
226
316
|
}): pino.Logger;
|
|
227
317
|
|
|
228
|
-
export { AdminClient, type BabyclawConfig, CONFIG_PATH_ENV_VAR, ClawHubError, GatewayRuntime, type GatewayStatus, type InstallSkillResult, type LogFormat, type LogLevel, type LoggingConfig, SUPPORTED_PROVIDERS, SkillAlreadyInstalledError, type SkillSetupResult, babyclawConfigSchema, createChildLogger, createLogger, getAdminSocketPath, getConfigPath, getDefaultConfigPath, getDefaultConfigTemplate, getLogger, installSkillFromClawHub, loadConfig, loadConfigRaw, resolveLanguageModel, runSkillSetup, writeConfig };
|
|
318
|
+
export { AdminClient, type BabyclawConfig, type BundledSkillStatus, CONFIG_PATH_ENV_VAR, ClawHubError, DEFAULT_WORKSPACE_ROOT, GatewayRuntime, type GatewayStatus, type InstallSkillResult, type LogFormat, type LogLevel, type LoggingConfig, SUPPORTED_PROVIDERS, SkillAlreadyInstalledError, type SkillSetupResult, babyclawConfigSchema, createChildLogger, createLogger, getAdminSocketPath, getBundledSkillPath, getConfigPath, getDefaultConfigPath, getDefaultConfigTemplate, getEnabledBundledSkills, getLogger, getSkillKey, installSkillFromClawHub, listBundledSkills, loadConfig, loadConfigRaw, resolveLanguageModel, resolveWorkspaceRoot, runSkillSetup, writeConfig };
|