@karmaniverous/jeeves 0.5.7 → 0.5.8
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/cli/jeeves/index.js +3 -2
- package/dist/cli/plugin/index.js +3 -2
- package/dist/cli/service/index.js +1 -0
- package/dist/index.d.ts +46 -2
- package/dist/index.js +69 -7
- package/package.json +1 -1
package/dist/cli/jeeves/index.js
CHANGED
|
@@ -269,14 +269,14 @@ const PLATFORM_COMPONENTS = [
|
|
|
269
269
|
* Core library version, inlined at build time.
|
|
270
270
|
*
|
|
271
271
|
* @remarks
|
|
272
|
-
* The `0.5.
|
|
272
|
+
* The `0.5.7` placeholder is replaced by
|
|
273
273
|
* `@rollup/plugin-replace` during the build with the actual version
|
|
274
274
|
* from `package.json`. This ensures the correct version survives
|
|
275
275
|
* when consumers bundle core into their own dist (where runtime
|
|
276
276
|
* `import.meta.url`-based resolution would find the wrong package.json).
|
|
277
277
|
*/
|
|
278
278
|
/** The core library version from package.json (inlined at build time). */
|
|
279
|
-
const CORE_VERSION = '0.5.
|
|
279
|
+
const CORE_VERSION = '0.5.7';
|
|
280
280
|
|
|
281
281
|
/**
|
|
282
282
|
* Runtime Node.js version floor check.
|
|
@@ -444,6 +444,7 @@ function init(options) {
|
|
|
444
444
|
workspacePath: options.workspacePath,
|
|
445
445
|
configRoot: options.configRoot,
|
|
446
446
|
coreConfigDir: join(options.configRoot, CORE_CONFIG_DIR),
|
|
447
|
+
componentConfigPaths: new Map(),
|
|
447
448
|
};
|
|
448
449
|
}
|
|
449
450
|
/**
|
package/dist/cli/plugin/index.js
CHANGED
|
@@ -130,14 +130,14 @@ const COMPONENT_VERSIONS_FILE = 'component-versions.json';
|
|
|
130
130
|
* Core library version, inlined at build time.
|
|
131
131
|
*
|
|
132
132
|
* @remarks
|
|
133
|
-
* The `0.5.
|
|
133
|
+
* The `0.5.7` placeholder is replaced by
|
|
134
134
|
* `@rollup/plugin-replace` during the build with the actual version
|
|
135
135
|
* from `package.json`. This ensures the correct version survives
|
|
136
136
|
* when consumers bundle core into their own dist (where runtime
|
|
137
137
|
* `import.meta.url`-based resolution would find the wrong package.json).
|
|
138
138
|
*/
|
|
139
139
|
/** The core library version from package.json (inlined at build time). */
|
|
140
|
-
const CORE_VERSION = '0.5.
|
|
140
|
+
const CORE_VERSION = '0.5.7';
|
|
141
141
|
|
|
142
142
|
/**
|
|
143
143
|
* Shared file I/O helpers for managed section operations.
|
|
@@ -386,6 +386,7 @@ function init(options) {
|
|
|
386
386
|
workspacePath: options.workspacePath,
|
|
387
387
|
configRoot: options.configRoot,
|
|
388
388
|
coreConfigDir: join(options.configRoot, CORE_CONFIG_DIR),
|
|
389
|
+
componentConfigPaths: new Map(),
|
|
389
390
|
};
|
|
390
391
|
}
|
|
391
392
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -652,7 +652,8 @@ interface AsyncContentCacheOptions {
|
|
|
652
652
|
placeholder?: string;
|
|
653
653
|
/**
|
|
654
654
|
* Optional error handler. Called when `fetch` throws.
|
|
655
|
-
* Defaults to
|
|
655
|
+
* Defaults to a handler that logs transient network errors as
|
|
656
|
+
* concise warnings and unexpected errors with full details.
|
|
656
657
|
*/
|
|
657
658
|
onError?: (error: unknown) => void;
|
|
658
659
|
}
|
|
@@ -1111,6 +1112,28 @@ declare function getCoreConfigFile(): string;
|
|
|
1111
1112
|
* @throws Error if `init()` has not been called.
|
|
1112
1113
|
*/
|
|
1113
1114
|
declare function getComponentConfigDir(componentName: string): string;
|
|
1115
|
+
/**
|
|
1116
|
+
* Register the actual config file path for a component.
|
|
1117
|
+
*
|
|
1118
|
+
* @remarks
|
|
1119
|
+
* Call this after resolving the `--config` CLI argument so that
|
|
1120
|
+
* `getComponentConfigPath` returns the real file location instead of
|
|
1121
|
+
* the default derived from `configRoot`.
|
|
1122
|
+
*
|
|
1123
|
+
* @param componentName - The component name (e.g., 'watcher', 'runner').
|
|
1124
|
+
* @param absolutePath - Absolute path to the component's config file.
|
|
1125
|
+
* @throws Error if `init()` has not been called.
|
|
1126
|
+
*/
|
|
1127
|
+
declare function registerComponentConfigPath(componentName: string, absolutePath: string): void;
|
|
1128
|
+
/**
|
|
1129
|
+
* Get the registered config file path for a component, or `undefined`
|
|
1130
|
+
* if no override has been registered.
|
|
1131
|
+
*
|
|
1132
|
+
* @param componentName - The component name.
|
|
1133
|
+
* @returns The registered absolute path, or `undefined`.
|
|
1134
|
+
* @throws Error if `init()` has not been called.
|
|
1135
|
+
*/
|
|
1136
|
+
declare function getComponentConfigPath(componentName: string): string | undefined;
|
|
1114
1137
|
/**
|
|
1115
1138
|
* Reset initialization state. Used for testing only.
|
|
1116
1139
|
*/
|
|
@@ -1895,5 +1918,26 @@ interface ServiceManager {
|
|
|
1895
1918
|
*/
|
|
1896
1919
|
declare function createServiceManager(descriptor: JeevesComponentDescriptor): ServiceManager;
|
|
1897
1920
|
|
|
1898
|
-
|
|
1921
|
+
/**
|
|
1922
|
+
* Shared internal utility functions.
|
|
1923
|
+
*
|
|
1924
|
+
* @packageDocumentation
|
|
1925
|
+
*/
|
|
1926
|
+
/**
|
|
1927
|
+
* Extract a human-readable message from an unknown caught value.
|
|
1928
|
+
*
|
|
1929
|
+
* @param err - The caught value (typically `unknown`).
|
|
1930
|
+
* @returns The error message string.
|
|
1931
|
+
*/
|
|
1932
|
+
declare function getErrorMessage(err: unknown): string;
|
|
1933
|
+
/**
|
|
1934
|
+
* Classify whether an error is a transient network failure.
|
|
1935
|
+
*
|
|
1936
|
+
* @param err - The caught value.
|
|
1937
|
+
* @returns `true` for ECONNRESET, ETIMEDOUT, UND_ERR_CONNECT_TIMEOUT,
|
|
1938
|
+
* AbortError, and timeout-related fetch errors.
|
|
1939
|
+
*/
|
|
1940
|
+
declare function isTransientError(err: unknown): boolean;
|
|
1941
|
+
|
|
1942
|
+
export { AGENTS_MARKERS, CLEANUP_FLAG, COMPONENT_CONFIG_PREFIX, COMPONENT_VERSIONS_FILE, CONFIG_FILE, CORE_CONFIG_DIR, CORE_VERSION, ComponentWriter, DEFAULT_BIND_ADDRESS, DEFAULT_CORE_VERSION, DEFAULT_PORTS, HEARTBEAT_HEADING, JEEVES_SKILL_DIR, MEMORY_HEARTBEAT_NAME, META_PORT, PLATFORM_COMPONENTS, REGISTRY_CACHE_FILE, RUNNER_PORT, SECTION_IDS, SECTION_ORDER, SERVER_PORT, SKILLS_DIR, SOUL_MARKERS, STALENESS_THRESHOLD_MS, STALE_LOCK_MS, TEMPLATES_DIR, TOOLS_MARKERS, VERSION_STAMP_PATTERN, WATCHER_PORT, WORKSPACE_CONFIG_DEFAULTS, WORKSPACE_CONFIG_FILE, WORKSPACE_FILES, analyzeMemory, appendJsonl, atomicWrite, buildEffectiveConfig, buildHeartbeatSection, checkMemoryHealth, checkNodeVersion, checkRegistryVersion, connectionFail, coreConfigSchema, createAsyncContentCache, createComponentWriter, createConfigApplyHandler, createConfigQueryHandler, createGoogleAuth, createPluginCli, createPluginToolset, createServiceCli, createServiceManager, createStatusHandler, ensureDir, extractMostRecentDate, fail, fetchJson, fetchWithTimeout, formatBeginMarker, formatEndMarker, generateJsonSchema, generateWorkspaceJsonSchema, getArg, getBindAddress, getChannelWorkspace, getComponentConfigDir, getComponentConfigPath, getConfigRoot, getCoreConfigDir, getCoreConfigFile, getEffectiveServiceName, getErrorMessage, getPackageRoot, getPackageVersion, getServiceState, getServiceUrl, getWorkspacePath, init, isPrime, isTransientError, jaccard, jeevesComponentDescriptorSchema, loadEnvFile, loadWorkspaceConfig, needsCleanup, nowIso, ok, orchestrateHeartbeat, parseArgs, parseHeartbeat, parseManaged, patchConfig, postJson, readComponentVersions, readJson, readJsonl, refreshPlatformContent, registerComponentConfigPath, removeComponentVersion, removeManagedSection, resetInit, resolveConfigPath, resolveConfigValue, resolveOpenClawHome, resolveOptionalPluginSetting, resolvePluginSetting, resolveWorkspacePath, run, runScript, runWithRetry, saveCache, seedContent, seedSkill, shingles, shouldWrite, sleepAsync, sleepMs, updateManagedSection, uuid, withFileLock, workspaceConfigSchema, writeComponentVersion, writeHeartbeatSection, writeJsonAtomic, writeJsonl };
|
|
1899
1943
|
export type { AccountConfig, AsyncContentCacheOptions, ComponentDependencies, ComponentState, ComponentVersionEntry, ComponentVersionsState, ComponentWriterOptions, ConfigApplyHandler, ConfigApplyRequest, ConfigApplyResult, ConfigProvenance, ConfigQueryHandler, ConfigQueryResponse, CoreConfig, CreatePluginCliOptions, CreateStatusHandlerOptions, GoogleAuthOptions, HeartbeatEntry, InitOptions, JeevesComponentDescriptor, ManagedMarkers, ManagedSection, MemoryHygieneOptions, MemoryHygieneResult, OrchestrateHeartbeatOptions, ParseManagedResult, ParsedHeartbeat, PlatformComponent, PluginApi, PluginInstallRecord, RefreshPlatformContentOptions, RemoveManagedSectionOptions, ResolvedCliConfig, ResolvedValue, RetryOptions, RunOptions, SectionId, SeedContentOptions, ServiceAccountFileConfig, ServiceManager, ServiceManagerOptions, ServiceState, SlackWorkspaceOptions, StatusHandler, StatusHandlerResult, StatusResponse, ToolDescriptor, ToolRegistrationOptions, ToolResult, UpdateManagedSectionOptions, VersionStamp, WorkspaceConfig, WorkspaceOptions, WriteComponentVersionOptions };
|
package/dist/index.js
CHANGED
|
@@ -183,14 +183,14 @@ const PLATFORM_COMPONENTS = [
|
|
|
183
183
|
* Core library version, inlined at build time.
|
|
184
184
|
*
|
|
185
185
|
* @remarks
|
|
186
|
-
* The `0.5.
|
|
186
|
+
* The `0.5.7` placeholder is replaced by
|
|
187
187
|
* `@rollup/plugin-replace` during the build with the actual version
|
|
188
188
|
* from `package.json`. This ensures the correct version survives
|
|
189
189
|
* when consumers bundle core into their own dist (where runtime
|
|
190
190
|
* `import.meta.url`-based resolution would find the wrong package.json).
|
|
191
191
|
*/
|
|
192
192
|
/** The core library version from package.json (inlined at build time). */
|
|
193
|
-
const CORE_VERSION = '0.5.
|
|
193
|
+
const CORE_VERSION = '0.5.7';
|
|
194
194
|
|
|
195
195
|
/**
|
|
196
196
|
* Workspace and config root initialization.
|
|
@@ -213,6 +213,7 @@ function init(options) {
|
|
|
213
213
|
workspacePath: options.workspacePath,
|
|
214
214
|
configRoot: options.configRoot,
|
|
215
215
|
coreConfigDir: join(options.configRoot, CORE_CONFIG_DIR),
|
|
216
|
+
componentConfigPaths: new Map(),
|
|
216
217
|
};
|
|
217
218
|
}
|
|
218
219
|
/**
|
|
@@ -267,6 +268,36 @@ function getComponentConfigDir(componentName) {
|
|
|
267
268
|
throw new Error('jeeves-core: init() must be called first');
|
|
268
269
|
return join(state.configRoot, `${COMPONENT_CONFIG_PREFIX}${componentName}`);
|
|
269
270
|
}
|
|
271
|
+
/**
|
|
272
|
+
* Register the actual config file path for a component.
|
|
273
|
+
*
|
|
274
|
+
* @remarks
|
|
275
|
+
* Call this after resolving the `--config` CLI argument so that
|
|
276
|
+
* `getComponentConfigPath` returns the real file location instead of
|
|
277
|
+
* the default derived from `configRoot`.
|
|
278
|
+
*
|
|
279
|
+
* @param componentName - The component name (e.g., 'watcher', 'runner').
|
|
280
|
+
* @param absolutePath - Absolute path to the component's config file.
|
|
281
|
+
* @throws Error if `init()` has not been called.
|
|
282
|
+
*/
|
|
283
|
+
function registerComponentConfigPath(componentName, absolutePath) {
|
|
284
|
+
if (!state)
|
|
285
|
+
throw new Error('jeeves-core: init() must be called first');
|
|
286
|
+
state.componentConfigPaths.set(componentName, absolutePath);
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Get the registered config file path for a component, or `undefined`
|
|
290
|
+
* if no override has been registered.
|
|
291
|
+
*
|
|
292
|
+
* @param componentName - The component name.
|
|
293
|
+
* @returns The registered absolute path, or `undefined`.
|
|
294
|
+
* @throws Error if `init()` has not been called.
|
|
295
|
+
*/
|
|
296
|
+
function getComponentConfigPath(componentName) {
|
|
297
|
+
if (!state)
|
|
298
|
+
throw new Error('jeeves-core: init() must be called first');
|
|
299
|
+
return state.componentConfigPaths.get(componentName);
|
|
300
|
+
}
|
|
270
301
|
/**
|
|
271
302
|
* Reset initialization state. Used for testing only.
|
|
272
303
|
*/
|
|
@@ -410,6 +441,32 @@ async function withWorkspaceLock(workspacePath, fn) {
|
|
|
410
441
|
function getErrorMessage(err) {
|
|
411
442
|
return err instanceof Error ? err.message : String(err);
|
|
412
443
|
}
|
|
444
|
+
/** Error codes / names that indicate transient network failures. */
|
|
445
|
+
const TRANSIENT_CODES = new Set([
|
|
446
|
+
'ECONNRESET',
|
|
447
|
+
'ETIMEDOUT',
|
|
448
|
+
'UND_ERR_CONNECT_TIMEOUT',
|
|
449
|
+
'AbortError',
|
|
450
|
+
]);
|
|
451
|
+
/**
|
|
452
|
+
* Classify whether an error is a transient network failure.
|
|
453
|
+
*
|
|
454
|
+
* @param err - The caught value.
|
|
455
|
+
* @returns `true` for ECONNRESET, ETIMEDOUT, UND_ERR_CONNECT_TIMEOUT,
|
|
456
|
+
* AbortError, and timeout-related fetch errors.
|
|
457
|
+
*/
|
|
458
|
+
function isTransientError(err) {
|
|
459
|
+
let current = err;
|
|
460
|
+
while (current instanceof Error) {
|
|
461
|
+
if (TRANSIENT_CODES.has(current.name))
|
|
462
|
+
return true;
|
|
463
|
+
const code = current.code;
|
|
464
|
+
if (typeof code === 'string' && TRANSIENT_CODES.has(code))
|
|
465
|
+
return true;
|
|
466
|
+
current = current.cause;
|
|
467
|
+
}
|
|
468
|
+
return false;
|
|
469
|
+
}
|
|
413
470
|
|
|
414
471
|
/**
|
|
415
472
|
* Factory for a framework-agnostic config apply HTTP handler.
|
|
@@ -484,9 +541,9 @@ function readConfigFile(filePath) {
|
|
|
484
541
|
function createConfigApplyHandler(descriptor) {
|
|
485
542
|
return async (request) => {
|
|
486
543
|
const { patch, replace } = request;
|
|
487
|
-
//
|
|
488
|
-
const
|
|
489
|
-
|
|
544
|
+
// Use registered config path if available, otherwise derive from configRoot
|
|
545
|
+
const configPath = getComponentConfigPath(descriptor.name) ??
|
|
546
|
+
join(getComponentConfigDir(descriptor.name), descriptor.configFileName);
|
|
490
547
|
// Read existing config
|
|
491
548
|
const existing = readConfigFile(configPath);
|
|
492
549
|
// Merge or replace
|
|
@@ -4803,7 +4860,12 @@ class ComponentWriter {
|
|
|
4803
4860
|
*/
|
|
4804
4861
|
function createAsyncContentCache(options) {
|
|
4805
4862
|
const { fetch: fetchContent, placeholder = '> Initializing...', onError = (err) => {
|
|
4806
|
-
|
|
4863
|
+
if (isTransientError(err)) {
|
|
4864
|
+
console.warn(`[jeeves] cache refresh: transient error (${getErrorMessage(err)})`);
|
|
4865
|
+
}
|
|
4866
|
+
else {
|
|
4867
|
+
console.warn('[jeeves] cache refresh failed:', err);
|
|
4868
|
+
}
|
|
4807
4869
|
}, } = options;
|
|
4808
4870
|
let cached = placeholder;
|
|
4809
4871
|
let refreshing = false;
|
|
@@ -5323,4 +5385,4 @@ async function getChannelWorkspace(channelId, token, options) {
|
|
|
5323
5385
|
return teamId;
|
|
5324
5386
|
}
|
|
5325
5387
|
|
|
5326
|
-
export { AGENTS_MARKERS, CLEANUP_FLAG, COMPONENT_CONFIG_PREFIX, COMPONENT_VERSIONS_FILE, CONFIG_FILE, CORE_CONFIG_DIR, CORE_VERSION, ComponentWriter, DEFAULT_BIND_ADDRESS, DEFAULT_CORE_VERSION, DEFAULT_PORTS, HEARTBEAT_HEADING, JEEVES_SKILL_DIR, MEMORY_HEARTBEAT_NAME, META_PORT, PLATFORM_COMPONENTS, REGISTRY_CACHE_FILE, RUNNER_PORT, SECTION_IDS, SECTION_ORDER, SERVER_PORT, SKILLS_DIR, SOUL_MARKERS, STALENESS_THRESHOLD_MS, STALE_LOCK_MS, TEMPLATES_DIR, TOOLS_MARKERS, VERSION_STAMP_PATTERN, WATCHER_PORT, WORKSPACE_CONFIG_DEFAULTS, WORKSPACE_CONFIG_FILE, WORKSPACE_FILES, analyzeMemory, appendJsonl, atomicWrite, buildEffectiveConfig, buildHeartbeatSection, checkMemoryHealth, checkNodeVersion, checkRegistryVersion, connectionFail, coreConfigSchema, createAsyncContentCache, createComponentWriter, createConfigApplyHandler, createConfigQueryHandler, createGoogleAuth, createPluginCli, createPluginToolset, createServiceCli, createServiceManager, createStatusHandler, ensureDir, extractMostRecentDate, fail, fetchJson, fetchWithTimeout, formatBeginMarker, formatEndMarker, generateJsonSchema, generateWorkspaceJsonSchema, getArg, getBindAddress, getChannelWorkspace, getComponentConfigDir, getConfigRoot, getCoreConfigDir, getCoreConfigFile, getEffectiveServiceName, getPackageRoot, getPackageVersion, getServiceState, getServiceUrl, getWorkspacePath, init, isPrime, jaccard, jeevesComponentDescriptorSchema, loadEnvFile, loadWorkspaceConfig, needsCleanup, nowIso, ok, orchestrateHeartbeat, parseArgs, parseHeartbeat, parseManaged, patchConfig, postJson, readComponentVersions, readJson, readJsonl, refreshPlatformContent, removeComponentVersion, removeManagedSection, resetInit, resolveConfigPath, resolveConfigValue, resolveOpenClawHome, resolveOptionalPluginSetting, resolvePluginSetting, resolveWorkspacePath, run, runScript, runWithRetry, saveCache, seedContent, seedSkill, shingles, shouldWrite, sleepAsync, sleepMs, updateManagedSection, uuid, withFileLock, workspaceConfigSchema, writeComponentVersion, writeHeartbeatSection, writeJsonAtomic, writeJsonl };
|
|
5388
|
+
export { AGENTS_MARKERS, CLEANUP_FLAG, COMPONENT_CONFIG_PREFIX, COMPONENT_VERSIONS_FILE, CONFIG_FILE, CORE_CONFIG_DIR, CORE_VERSION, ComponentWriter, DEFAULT_BIND_ADDRESS, DEFAULT_CORE_VERSION, DEFAULT_PORTS, HEARTBEAT_HEADING, JEEVES_SKILL_DIR, MEMORY_HEARTBEAT_NAME, META_PORT, PLATFORM_COMPONENTS, REGISTRY_CACHE_FILE, RUNNER_PORT, SECTION_IDS, SECTION_ORDER, SERVER_PORT, SKILLS_DIR, SOUL_MARKERS, STALENESS_THRESHOLD_MS, STALE_LOCK_MS, TEMPLATES_DIR, TOOLS_MARKERS, VERSION_STAMP_PATTERN, WATCHER_PORT, WORKSPACE_CONFIG_DEFAULTS, WORKSPACE_CONFIG_FILE, WORKSPACE_FILES, analyzeMemory, appendJsonl, atomicWrite, buildEffectiveConfig, buildHeartbeatSection, checkMemoryHealth, checkNodeVersion, checkRegistryVersion, connectionFail, coreConfigSchema, createAsyncContentCache, createComponentWriter, createConfigApplyHandler, createConfigQueryHandler, createGoogleAuth, createPluginCli, createPluginToolset, createServiceCli, createServiceManager, createStatusHandler, ensureDir, extractMostRecentDate, fail, fetchJson, fetchWithTimeout, formatBeginMarker, formatEndMarker, generateJsonSchema, generateWorkspaceJsonSchema, getArg, getBindAddress, getChannelWorkspace, getComponentConfigDir, getComponentConfigPath, getConfigRoot, getCoreConfigDir, getCoreConfigFile, getEffectiveServiceName, getErrorMessage, getPackageRoot, getPackageVersion, getServiceState, getServiceUrl, getWorkspacePath, init, isPrime, isTransientError, jaccard, jeevesComponentDescriptorSchema, loadEnvFile, loadWorkspaceConfig, needsCleanup, nowIso, ok, orchestrateHeartbeat, parseArgs, parseHeartbeat, parseManaged, patchConfig, postJson, readComponentVersions, readJson, readJsonl, refreshPlatformContent, registerComponentConfigPath, removeComponentVersion, removeManagedSection, resetInit, resolveConfigPath, resolveConfigValue, resolveOpenClawHome, resolveOptionalPluginSetting, resolvePluginSetting, resolveWorkspacePath, run, runScript, runWithRetry, saveCache, seedContent, seedSkill, shingles, shouldWrite, sleepAsync, sleepMs, updateManagedSection, uuid, withFileLock, workspaceConfigSchema, writeComponentVersion, writeHeartbeatSection, writeJsonAtomic, writeJsonl };
|
package/package.json
CHANGED