@karmaniverous/jeeves-meta 0.17.0 → 0.18.0-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.
- package/README.md +1 -2
- package/dist/cli/jeeves-meta/index.js +1235 -1198
- package/dist/prompts/architect.md +31 -59
- package/dist/prompts/critic.md +18 -33
- package/package.json +18 -22
- package/dist/archive/index.d.ts +0 -10
- package/dist/archive/listArchive.d.ts +0 -12
- package/dist/archive/prune.d.ts +0 -14
- package/dist/archive/readArchive.d.ts +0 -30
- package/dist/archive/readLatest.d.ts +0 -13
- package/dist/archive/snapshot.d.ts +0 -17
- package/dist/bootstrap.d.ts +0 -26
- package/dist/cache.d.ts +0 -22
- package/dist/cli/jeeves-meta/architect.md +0 -173
- package/dist/cli/jeeves-meta/critic.md +0 -104
- package/dist/cli.d.ts +0 -10
- package/dist/configHotReload.d.ts +0 -30
- package/dist/configLoader.d.ts +0 -36
- package/dist/constants.d.ts +0 -13
- package/dist/customCliCommands.d.ts +0 -13
- package/dist/descriptor.d.ts +0 -19
- package/dist/discovery/buildMinimalNode.d.ts +0 -22
- package/dist/discovery/computeSummary.d.ts +0 -17
- package/dist/discovery/discoverMetas.d.ts +0 -19
- package/dist/discovery/getAncestorMeta.d.ts +0 -16
- package/dist/discovery/index.d.ts +0 -12
- package/dist/discovery/listMetas.d.ts +0 -63
- package/dist/discovery/ownershipTree.d.ts +0 -25
- package/dist/discovery/scope.d.ts +0 -47
- package/dist/discovery/types.d.ts +0 -25
- package/dist/ema.d.ts +0 -14
- package/dist/errors.d.ts +0 -15
- package/dist/escapeGlob.d.ts +0 -23
- package/dist/executor/GatewayExecutor.d.ts +0 -79
- package/dist/executor/SpawnAbortedError.d.ts +0 -9
- package/dist/executor/SpawnTimeoutError.d.ts +0 -13
- package/dist/executor/index.d.ts +0 -8
- package/dist/index.d.ts +0 -35
- package/dist/index.js +0 -5797
- package/dist/interfaces/MetaContext.d.ts +0 -38
- package/dist/interfaces/MetaExecutor.d.ts +0 -44
- package/dist/interfaces/WatcherClient.d.ts +0 -75
- package/dist/interfaces/index.d.ts +0 -8
- package/dist/lock.d.ts +0 -70
- package/dist/logger/index.d.ts +0 -27
- package/dist/mtimeFilter.d.ts +0 -26
- package/dist/normalizePath.d.ts +0 -6
- package/dist/orchestrator/buildTask.d.ts +0 -38
- package/dist/orchestrator/contextPackage.d.ts +0 -30
- package/dist/orchestrator/index.d.ts +0 -10
- package/dist/orchestrator/orchestratePhase.d.ts +0 -44
- package/dist/orchestrator/parseOutput.d.ts +0 -42
- package/dist/orchestrator/runPhase.d.ts +0 -40
- package/dist/phaseState/derivePhaseState.d.ts +0 -39
- package/dist/phaseState/index.d.ts +0 -9
- package/dist/phaseState/invalidate.d.ts +0 -39
- package/dist/phaseState/phaseScheduler.d.ts +0 -76
- package/dist/phaseState/phaseTransitions.d.ts +0 -83
- package/dist/progress/index.d.ts +0 -73
- package/dist/prompts/index.d.ts +0 -12
- package/dist/queue/index.d.ts +0 -90
- package/dist/readMetaJson.d.ts +0 -17
- package/dist/routes/__testUtils.d.ts +0 -37
- package/dist/routes/config.d.ts +0 -11
- package/dist/routes/configApply.d.ts +0 -13
- package/dist/routes/index.d.ts +0 -50
- package/dist/routes/metas.d.ts +0 -9
- package/dist/routes/metasUpdate.d.ts +0 -11
- package/dist/routes/preview.d.ts +0 -8
- package/dist/routes/queue.d.ts +0 -13
- package/dist/routes/seed.d.ts +0 -8
- package/dist/routes/status.d.ts +0 -13
- package/dist/routes/synthesize.d.ts +0 -12
- package/dist/routes/unlock.d.ts +0 -8
- package/dist/rules/healthCheck.d.ts +0 -36
- package/dist/rules/index.d.ts +0 -37
- package/dist/rules/verify.d.ts +0 -22
- package/dist/scheduler/index.d.ts +0 -71
- package/dist/scheduling/index.d.ts +0 -7
- package/dist/scheduling/staleness.d.ts +0 -68
- package/dist/scheduling/weightedFormula.d.ts +0 -38
- package/dist/schema/config.d.ts +0 -67
- package/dist/schema/error.d.ts +0 -6
- package/dist/schema/index.d.ts +0 -8
- package/dist/schema/meta.d.ts +0 -72
- package/dist/seed/autoSeed.d.ts +0 -30
- package/dist/seed/createMeta.d.ts +0 -38
- package/dist/seed/index.d.ts +0 -7
- package/dist/server.d.ts +0 -24
- package/dist/shutdown/index.d.ts +0 -33
- package/dist/structureHash.d.ts +0 -15
- package/dist/watcher-client/HttpWatcherClient.d.ts +0 -38
- package/dist/watcher-client/index.d.ts +0 -6
package/dist/ema.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Exponential moving average helper for token tracking.
|
|
3
|
-
*
|
|
4
|
-
* @module ema
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Compute exponential moving average.
|
|
8
|
-
*
|
|
9
|
-
* @param current - New observation.
|
|
10
|
-
* @param previous - Previous EMA value, or undefined for first observation.
|
|
11
|
-
* @param decay - Decay factor (0-1). Higher = more weight on new value. Default 0.3.
|
|
12
|
-
* @returns Updated EMA.
|
|
13
|
-
*/
|
|
14
|
-
export declare function computeEma(current: number, previous: number | undefined, decay?: number): number;
|
package/dist/errors.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared error utilities.
|
|
3
|
-
*
|
|
4
|
-
* @module errors
|
|
5
|
-
*/
|
|
6
|
-
import type { MetaError } from './schema/index.js';
|
|
7
|
-
/**
|
|
8
|
-
* Wrap an unknown caught value into a MetaError.
|
|
9
|
-
*
|
|
10
|
-
* @param step - Which synthesis step failed.
|
|
11
|
-
* @param err - The caught error value.
|
|
12
|
-
* @param code - Error classification code.
|
|
13
|
-
* @returns A structured MetaError.
|
|
14
|
-
*/
|
|
15
|
-
export declare function toMetaError(step: MetaError['step'], err: unknown, code?: string): MetaError;
|
package/dist/escapeGlob.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Escape special glob characters in a path so it can be used as a literal
|
|
3
|
-
* prefix in glob patterns.
|
|
4
|
-
*
|
|
5
|
-
* Glob metacharacters `* ? [ ] { } ( ) !` are escaped with a backslash so
|
|
6
|
-
* that paths containing parentheses (e.g. Slack channel IDs) or other
|
|
7
|
-
* special characters are matched literally by the watcher's walk endpoint.
|
|
8
|
-
*
|
|
9
|
-
* @module escapeGlob
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Escape glob metacharacters in a string using character-class wrapping.
|
|
13
|
-
*
|
|
14
|
-
* Backslash escaping (`\(`) does not work reliably on Windows where `\` is
|
|
15
|
-
* the path separator. Instead, each metacharacter is wrapped in a character
|
|
16
|
-
* class (e.g. `(` → `[(]`) which is universally supported by glob libraries.
|
|
17
|
-
*
|
|
18
|
-
* Square brackets themselves are escaped as `[[]` and `[]]`.
|
|
19
|
-
*
|
|
20
|
-
* @param s - Raw path string.
|
|
21
|
-
* @returns String with glob metacharacters wrapped in character classes.
|
|
22
|
-
*/
|
|
23
|
-
export declare function escapeGlob(s: string): string;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MetaExecutor implementation using the OpenClaw gateway HTTP API.
|
|
3
|
-
*
|
|
4
|
-
* Lives in the library package so both plugin and runner can import it.
|
|
5
|
-
* Spawns sub-agent sessions via the gateway's `/tools/invoke` endpoint,
|
|
6
|
-
* polls for completion, and extracts output text.
|
|
7
|
-
*
|
|
8
|
-
* @module executor/GatewayExecutor
|
|
9
|
-
*/
|
|
10
|
-
import type { MetaExecutor, MetaSpawnOptions, MetaSpawnResult } from '../interfaces/index.js';
|
|
11
|
-
/** Options for the GatewayExecutor. */
|
|
12
|
-
export interface GatewayExecutorOptions {
|
|
13
|
-
/** OpenClaw gateway base URL. Default: http://127.0.0.1:18789 */
|
|
14
|
-
gatewayUrl?: string;
|
|
15
|
-
/** Bearer token for gateway authentication. */
|
|
16
|
-
apiKey?: string;
|
|
17
|
-
/** Polling interval in ms. Default: 5000. */
|
|
18
|
-
pollIntervalMs?: number;
|
|
19
|
-
/** Workspace directory for output staging. Default: OS temp dir + /jeeves-meta. */
|
|
20
|
-
workspaceDir?: string;
|
|
21
|
-
/** Max retries when staging file not yet visible after session completion. Default: 10. */
|
|
22
|
-
stagingRetries?: number;
|
|
23
|
-
/** Delay between retries in ms. Default: 250. */
|
|
24
|
-
stagingRetryDelayMs?: number;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* MetaExecutor that spawns OpenClaw sessions via the gateway's
|
|
28
|
-
* `/tools/invoke` endpoint.
|
|
29
|
-
*
|
|
30
|
-
* Used by both the OpenClaw plugin (in-process tool calls) and the
|
|
31
|
-
* runner/CLI (external invocation). Constructs from `gatewayUrl` and
|
|
32
|
-
* optional `apiKey` — typically sourced from `MetaConfig`.
|
|
33
|
-
*/
|
|
34
|
-
export declare class GatewayExecutor implements MetaExecutor {
|
|
35
|
-
private readonly gatewayUrl;
|
|
36
|
-
private readonly apiKey;
|
|
37
|
-
private readonly pollIntervalMs;
|
|
38
|
-
private readonly workspaceDir;
|
|
39
|
-
private readonly stagingRetries;
|
|
40
|
-
private readonly stagingRetryDelayMs;
|
|
41
|
-
private controller;
|
|
42
|
-
constructor(options?: GatewayExecutorOptions);
|
|
43
|
-
/** Remove a temp output file if it exists. */
|
|
44
|
-
private cleanupOutputFile;
|
|
45
|
-
/** Read and clean up the staging output file. Returns content or undefined if absent. */
|
|
46
|
-
private readStagingFile;
|
|
47
|
-
/** Extract plain text from a message content field, skipping ANNOUNCE_SKIP sentinels. */
|
|
48
|
-
private static extractMessageText;
|
|
49
|
-
/**
|
|
50
|
-
* Check history messages for timeout detection.
|
|
51
|
-
*
|
|
52
|
-
* Does NOT determine completion — session completion is authoritative
|
|
53
|
-
* (via sessions_list). History stop reasons can false-positive on
|
|
54
|
-
* sessions_yield artifacts (#200).
|
|
55
|
-
*/
|
|
56
|
-
private static checkHistoryCompletion;
|
|
57
|
-
/** Invoke a gateway tool via the /tools/invoke HTTP endpoint. */
|
|
58
|
-
private invoke;
|
|
59
|
-
/**
|
|
60
|
-
* Look up session metadata (tokens, completion status) via sessions_list.
|
|
61
|
-
*
|
|
62
|
-
* Detects gateway-side timeout (`status: "timeout"`) and killed sessions
|
|
63
|
-
* (`status: "killed"`) as completed, with a `timedOut` flag to distinguish
|
|
64
|
-
* timeout from normal completion.
|
|
65
|
-
*/
|
|
66
|
-
private getSessionInfo;
|
|
67
|
-
/** Whether this executor has been aborted by the operator. */
|
|
68
|
-
get aborted(): boolean;
|
|
69
|
-
/** Abort the currently running spawn, if any. */
|
|
70
|
-
abort(): void;
|
|
71
|
-
/**
|
|
72
|
-
* Query the gateway's configured subagent run timeout.
|
|
73
|
-
*
|
|
74
|
-
* Returns the value in milliseconds, or `undefined` if the query fails
|
|
75
|
-
* or the value is absent/zero (no timeout configured).
|
|
76
|
-
*/
|
|
77
|
-
private queryGatewayRunTimeout;
|
|
78
|
-
spawn(task: string, options?: MetaSpawnOptions): Promise<MetaSpawnResult>;
|
|
79
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error thrown when a spawned subprocess is aborted via AbortController.
|
|
3
|
-
*
|
|
4
|
-
* @module executor/SpawnAbortedError
|
|
5
|
-
*/
|
|
6
|
-
/** Error indicating a spawn was deliberately aborted. */
|
|
7
|
-
export declare class SpawnAbortedError extends Error {
|
|
8
|
-
constructor(message?: string);
|
|
9
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error thrown when a spawned subprocess times out.
|
|
3
|
-
*
|
|
4
|
-
* Carries the output file path so callers can attempt partial output recovery.
|
|
5
|
-
*
|
|
6
|
-
* @module executor/SpawnTimeoutError
|
|
7
|
-
*/
|
|
8
|
-
/** Error indicating a spawn timeout with a recoverable output path. */
|
|
9
|
-
export declare class SpawnTimeoutError extends Error {
|
|
10
|
-
/** Path to the (possibly partial) output file written before timeout. */
|
|
11
|
-
readonly outputPath: string;
|
|
12
|
-
constructor(message: string, outputPath: string);
|
|
13
|
-
}
|
package/dist/executor/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Re-exports for the executor module.
|
|
3
|
-
*
|
|
4
|
-
* @module executor
|
|
5
|
-
*/
|
|
6
|
-
export { GatewayExecutor, type GatewayExecutorOptions, } from './GatewayExecutor.js';
|
|
7
|
-
export { SpawnAbortedError } from './SpawnAbortedError.js';
|
|
8
|
-
export { SpawnTimeoutError } from './SpawnTimeoutError.js';
|
package/dist/index.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Jeeves Meta Service — knowledge synthesis HTTP service for the Jeeves platform.
|
|
3
|
-
*
|
|
4
|
-
* @packageDocumentation
|
|
5
|
-
*/
|
|
6
|
-
export { createSnapshot, listArchiveFiles, pruneArchive, readLatestArchive, } from './archive/index.js';
|
|
7
|
-
export { DEFAULT_PORT, DEFAULT_PORT_STR, SERVICE_NAME, SERVICE_VERSION, } from './constants.js';
|
|
8
|
-
export { registerCustomCliCommands } from './customCliCommands.js';
|
|
9
|
-
export { metaDescriptor, RESTART_REQUIRED_FIELDS } from './descriptor.js';
|
|
10
|
-
export { loadServiceConfig, migrateConfigPath, resolveConfigPath, } from './configLoader.js';
|
|
11
|
-
export { buildOwnershipTree, discoverMetas, filterInScope, findNode, getScopePrefix, listMetas, type MetaEntry, type MetaListResult, type MetaListSummary, type MetaNode, type OwnershipTree, } from './discovery/index.js';
|
|
12
|
-
export { computeEma } from './ema.js';
|
|
13
|
-
export { toMetaError } from './errors.js';
|
|
14
|
-
export { acquireLock, cleanupStaleLocks, isLocked, type LockState, readLockState, releaseLock, resolveMetaDir, } from './lock.js';
|
|
15
|
-
export { normalizePath } from './normalizePath.js';
|
|
16
|
-
export { computeStructureHash } from './structureHash.js';
|
|
17
|
-
export { GatewayExecutor, type GatewayExecutorOptions, } from './executor/index.js';
|
|
18
|
-
export type { InferenceRuleSpec, MetaContext, MetaExecutor, MetaSpawnOptions, MetaSpawnResult, WatcherClient, WatcherScanPoint, WatcherScanRequest, WatcherScanResult, } from './interfaces/index.js';
|
|
19
|
-
export type { LoggerConfig } from './logger/index.js';
|
|
20
|
-
export { createLogger, type MinimalLogger } from './logger/index.js';
|
|
21
|
-
export { buildArchitectTask, buildBuilderTask, buildContextPackage, buildCriticTask, type BuilderOutput, orchestratePhase, type OrchestratePhaseResult, parseArchitectOutput, parseBuilderOutput, parseCriticOutput, type PhaseProgressCallback, type PhaseResult, runArchitect, runBuilder, runCritic, } from './orchestrator/index.js';
|
|
22
|
-
export { type ProgressEvent, type ProgressPhase, ProgressReporter, type ProgressReporterConfig, renderProgressEvent, type TemplateStrings, } from './progress/index.js';
|
|
23
|
-
export { actualStaleness, computeEffectiveStaleness, hasSteerChanged, isArchitectTriggered, isStale, MAX_STALENESS_SECONDS, type StalenessCandidate, } from './scheduling/index.js';
|
|
24
|
-
export { type MetaConfig, metaConfigSchema, type MetaError, metaErrorSchema, type MetaJson, metaJsonSchema, type ServiceConfig, serviceConfigSchema, } from './schema/index.js';
|
|
25
|
-
export { Scheduler } from './scheduler/index.js';
|
|
26
|
-
export { type CurrentItem, type EnqueueResult, type QueueEntry, type QueueState, SynthesisQueue, } from './queue/index.js';
|
|
27
|
-
export { registerRoutes, type RouteDeps, type ServiceStats, } from './routes/index.js';
|
|
28
|
-
export { RuleRegistrar } from './rules/index.js';
|
|
29
|
-
export { verifyRuleApplication } from './rules/verify.js';
|
|
30
|
-
export { sleepAsync as sleep } from '@karmaniverous/jeeves';
|
|
31
|
-
export type { ServerOptions } from './server.js';
|
|
32
|
-
export { createServer } from './server.js';
|
|
33
|
-
export { registerShutdownHandlers } from './shutdown/index.js';
|
|
34
|
-
export { HttpWatcherClient, type HttpWatcherClientOptions, } from './watcher-client/index.js';
|
|
35
|
-
export { startService } from './bootstrap.js';
|