@soleri/core 2.8.0 → 2.9.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/extensions/index.d.ts +3 -0
- package/dist/extensions/index.d.ts.map +1 -0
- package/dist/extensions/index.js +2 -0
- package/dist/extensions/index.js.map +1 -0
- package/dist/extensions/middleware.d.ts +13 -0
- package/dist/extensions/middleware.d.ts.map +1 -0
- package/dist/extensions/middleware.js +47 -0
- package/dist/extensions/middleware.js.map +1 -0
- package/dist/extensions/types.d.ts +64 -0
- package/dist/extensions/types.d.ts.map +1 -0
- package/dist/extensions/types.js +2 -0
- package/dist/extensions/types.js.map +1 -0
- package/dist/index.d.ts +8 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -16
- package/dist/index.js.map +1 -1
- package/dist/runtime/core-ops.d.ts +1 -1
- package/dist/runtime/core-ops.js +1 -1
- package/dist/runtime/facades/admin-facade.d.ts +8 -0
- package/dist/runtime/facades/admin-facade.d.ts.map +1 -0
- package/dist/runtime/facades/admin-facade.js +90 -0
- package/dist/runtime/facades/admin-facade.js.map +1 -0
- package/dist/runtime/facades/brain-facade.d.ts +8 -0
- package/dist/runtime/facades/brain-facade.d.ts.map +1 -0
- package/dist/runtime/facades/brain-facade.js +294 -0
- package/dist/runtime/facades/brain-facade.js.map +1 -0
- package/dist/runtime/facades/cognee-facade.d.ts +8 -0
- package/dist/runtime/facades/cognee-facade.d.ts.map +1 -0
- package/dist/runtime/facades/cognee-facade.js +154 -0
- package/dist/runtime/facades/cognee-facade.js.map +1 -0
- package/dist/runtime/facades/control-facade.d.ts +8 -0
- package/dist/runtime/facades/control-facade.d.ts.map +1 -0
- package/dist/runtime/facades/control-facade.js +244 -0
- package/dist/runtime/facades/control-facade.js.map +1 -0
- package/dist/runtime/facades/curator-facade.d.ts +8 -0
- package/dist/runtime/facades/curator-facade.d.ts.map +1 -0
- package/dist/runtime/facades/curator-facade.js +117 -0
- package/dist/runtime/facades/curator-facade.js.map +1 -0
- package/dist/runtime/facades/index.d.ts +10 -0
- package/dist/runtime/facades/index.d.ts.map +1 -0
- package/dist/runtime/facades/index.js +71 -0
- package/dist/runtime/facades/index.js.map +1 -0
- package/dist/runtime/facades/loop-facade.d.ts +8 -0
- package/dist/runtime/facades/loop-facade.d.ts.map +1 -0
- package/dist/runtime/facades/loop-facade.js +9 -0
- package/dist/runtime/facades/loop-facade.js.map +1 -0
- package/dist/runtime/facades/memory-facade.d.ts +8 -0
- package/dist/runtime/facades/memory-facade.d.ts.map +1 -0
- package/dist/runtime/facades/memory-facade.js +108 -0
- package/dist/runtime/facades/memory-facade.js.map +1 -0
- package/dist/runtime/facades/orchestrate-facade.d.ts +8 -0
- package/dist/runtime/facades/orchestrate-facade.d.ts.map +1 -0
- package/dist/runtime/facades/orchestrate-facade.js +58 -0
- package/dist/runtime/facades/orchestrate-facade.js.map +1 -0
- package/dist/runtime/facades/plan-facade.d.ts +8 -0
- package/dist/runtime/facades/plan-facade.d.ts.map +1 -0
- package/dist/runtime/facades/plan-facade.js +110 -0
- package/dist/runtime/facades/plan-facade.js.map +1 -0
- package/dist/runtime/facades/vault-facade.d.ts +8 -0
- package/dist/runtime/facades/vault-facade.d.ts.map +1 -0
- package/dist/runtime/facades/vault-facade.js +194 -0
- package/dist/runtime/facades/vault-facade.js.map +1 -0
- package/dist/runtime/vault-extra-ops.d.ts +2 -2
- package/dist/runtime/vault-extra-ops.d.ts.map +1 -1
- package/dist/runtime/vault-extra-ops.js +37 -2
- package/dist/runtime/vault-extra-ops.js.map +1 -1
- package/dist/streams/index.d.ts +4 -0
- package/dist/streams/index.d.ts.map +1 -0
- package/dist/streams/index.js +3 -0
- package/dist/streams/index.js.map +1 -0
- package/dist/streams/normalize.d.ts +14 -0
- package/dist/streams/normalize.d.ts.map +1 -0
- package/dist/streams/normalize.js +43 -0
- package/dist/streams/normalize.js.map +1 -0
- package/dist/streams/replayable-stream.d.ts +19 -0
- package/dist/streams/replayable-stream.d.ts.map +1 -0
- package/dist/streams/replayable-stream.js +90 -0
- package/dist/streams/replayable-stream.js.map +1 -0
- package/dist/vault/content-hash.d.ts +16 -0
- package/dist/vault/content-hash.d.ts.map +1 -0
- package/dist/vault/content-hash.js +21 -0
- package/dist/vault/content-hash.js.map +1 -0
- package/dist/vault/vault.d.ts +9 -0
- package/dist/vault/vault.d.ts.map +1 -1
- package/dist/vault/vault.js +49 -3
- package/dist/vault/vault.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/content-hash.test.ts +60 -0
- package/src/__tests__/core-ops.test.ts +10 -7
- package/src/__tests__/extensions.test.ts +233 -0
- package/src/__tests__/grading-ops.test.ts +2 -2
- package/src/__tests__/memory-cross-project-ops.test.ts +2 -2
- package/src/__tests__/normalize.test.ts +75 -0
- package/src/__tests__/playbook.test.ts +4 -4
- package/src/__tests__/replayable-stream.test.ts +66 -0
- package/src/__tests__/vault-extra-ops.test.ts +1 -1
- package/src/__tests__/vault.test.ts +72 -0
- package/src/extensions/index.ts +2 -0
- package/src/extensions/middleware.ts +53 -0
- package/src/extensions/types.ts +64 -0
- package/src/index.ts +14 -17
- package/src/runtime/facades/admin-facade.ts +101 -0
- package/src/runtime/facades/brain-facade.ts +331 -0
- package/src/runtime/facades/cognee-facade.ts +162 -0
- package/src/runtime/facades/control-facade.ts +279 -0
- package/src/runtime/facades/curator-facade.ts +132 -0
- package/src/runtime/facades/index.ts +74 -0
- package/src/runtime/facades/loop-facade.ts +12 -0
- package/src/runtime/facades/memory-facade.ts +114 -0
- package/src/runtime/facades/orchestrate-facade.ts +68 -0
- package/src/runtime/facades/plan-facade.ts +119 -0
- package/src/runtime/facades/vault-facade.ts +223 -0
- package/src/runtime/vault-extra-ops.ts +38 -2
- package/src/streams/index.ts +3 -0
- package/src/streams/normalize.ts +56 -0
- package/src/streams/replayable-stream.ts +92 -0
- package/src/vault/content-hash.ts +31 -0
- package/src/vault/vault.ts +73 -3
- package/src/runtime/core-ops.ts +0 -1443
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/extensions/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/extensions/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FacadeConfig } from '../facades/types.js';
|
|
2
|
+
import type { OpMiddleware } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Wrap all ops in the given facades with middleware.
|
|
5
|
+
*
|
|
6
|
+
* Middleware chain follows the onion model:
|
|
7
|
+
* - before hooks: first middleware → last middleware → handler
|
|
8
|
+
* - after hooks: last middleware → first middleware (reverse)
|
|
9
|
+
*
|
|
10
|
+
* This mutates the facade ops in-place (replaces handlers).
|
|
11
|
+
*/
|
|
12
|
+
export declare function wrapWithMiddleware(facades: FacadeConfig[], middleware: OpMiddleware[]): void;
|
|
13
|
+
//# sourceMappingURL=middleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/extensions/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,IAAI,CAwC5F"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wrap all ops in the given facades with middleware.
|
|
3
|
+
*
|
|
4
|
+
* Middleware chain follows the onion model:
|
|
5
|
+
* - before hooks: first middleware → last middleware → handler
|
|
6
|
+
* - after hooks: last middleware → first middleware (reverse)
|
|
7
|
+
*
|
|
8
|
+
* This mutates the facade ops in-place (replaces handlers).
|
|
9
|
+
*/
|
|
10
|
+
export function wrapWithMiddleware(facades, middleware) {
|
|
11
|
+
if (middleware.length === 0)
|
|
12
|
+
return;
|
|
13
|
+
for (const facade of facades) {
|
|
14
|
+
for (const op of facade.ops) {
|
|
15
|
+
const originalHandler = op.handler;
|
|
16
|
+
op.handler = async (params) => {
|
|
17
|
+
// Run before hooks (first → last)
|
|
18
|
+
let currentParams = params;
|
|
19
|
+
for (const mw of middleware) {
|
|
20
|
+
if (mw.before) {
|
|
21
|
+
currentParams = await mw.before({
|
|
22
|
+
facade: facade.name,
|
|
23
|
+
op: op.name,
|
|
24
|
+
params: currentParams,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
// Run original handler
|
|
29
|
+
let result = await originalHandler(currentParams);
|
|
30
|
+
// Run after hooks (last → first)
|
|
31
|
+
for (let i = middleware.length - 1; i >= 0; i--) {
|
|
32
|
+
const mw = middleware[i];
|
|
33
|
+
if (mw.after) {
|
|
34
|
+
result = await mw.after({
|
|
35
|
+
facade: facade.name,
|
|
36
|
+
op: op.name,
|
|
37
|
+
params: currentParams,
|
|
38
|
+
result,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return result;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=middleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../src/extensions/middleware.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAuB,EAAE,UAA0B;IACpF,IAAI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{ OpDefinition, FacadeConfig } from '../facades/types.js';
|
|
2
|
+
import type { AgentRuntime } from '../runtime/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Middleware that wraps op execution with before/after hooks.
|
|
5
|
+
*
|
|
6
|
+
* - `before` runs before the op handler. Return modified params or throw to reject.
|
|
7
|
+
* - `after` runs after the op handler. Return modified result or throw.
|
|
8
|
+
*
|
|
9
|
+
* Multiple middleware are chained: before hooks run first→last,
|
|
10
|
+
* after hooks run last→first (onion model).
|
|
11
|
+
*/
|
|
12
|
+
export interface OpMiddleware {
|
|
13
|
+
/** Middleware name (for logging/debugging) */
|
|
14
|
+
name: string;
|
|
15
|
+
/** Runs before op handler. Return modified params or throw to reject. */
|
|
16
|
+
before?: (ctx: MiddlewareContext) => Promise<Record<string, unknown>>;
|
|
17
|
+
/** Runs after op handler. Return modified result or throw. */
|
|
18
|
+
after?: (ctx: MiddlewareContext & {
|
|
19
|
+
result: unknown;
|
|
20
|
+
}) => Promise<unknown>;
|
|
21
|
+
}
|
|
22
|
+
export interface MiddlewareContext {
|
|
23
|
+
facade: string;
|
|
24
|
+
op: string;
|
|
25
|
+
params: Record<string, unknown>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* User-defined extensions for a Soleri agent.
|
|
29
|
+
*
|
|
30
|
+
* Extensions live in `src/extensions/` and are auto-discovered by the entry
|
|
31
|
+
* point at startup. Core ops from `@soleri/core` are never modified — extensions
|
|
32
|
+
* are additive (new ops, new facades) or decorative (middleware).
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* // src/extensions/index.ts
|
|
37
|
+
* import type { AgentExtensions } from '@soleri/core';
|
|
38
|
+
* import type { AgentRuntime } from '@soleri/core';
|
|
39
|
+
*
|
|
40
|
+
* export default function loadExtensions(runtime: AgentRuntime): AgentExtensions {
|
|
41
|
+
* return {
|
|
42
|
+
* ops: [myCustomOp(runtime)],
|
|
43
|
+
* facades: [myCustomFacade(runtime)],
|
|
44
|
+
* middleware: [auditLogger],
|
|
45
|
+
* };
|
|
46
|
+
* }
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export interface AgentExtensions {
|
|
50
|
+
/** Extra ops merged into the core facade */
|
|
51
|
+
ops?: OpDefinition[];
|
|
52
|
+
/** New facades registered as separate MCP tools */
|
|
53
|
+
facades?: FacadeConfig[];
|
|
54
|
+
/** Middleware applied to all ops across all facades */
|
|
55
|
+
middleware?: OpMiddleware[];
|
|
56
|
+
/** Lifecycle hooks */
|
|
57
|
+
hooks?: {
|
|
58
|
+
/** Called after runtime init, before MCP server starts */
|
|
59
|
+
onStartup?: (runtime: AgentRuntime) => Promise<void>;
|
|
60
|
+
/** Called on SIGTERM/SIGINT before process exits */
|
|
61
|
+
onShutdown?: (runtime: AgentRuntime) => Promise<void>;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/extensions/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAY;IAC3B,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACtE,8DAA8D;IAC9D,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,GAAG;QAAE,MAAM,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAC5E;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,eAAe;IAC9B,4CAA4C;IAC5C,GAAG,CAAC,EAAE,YAAY,EAAE,CAAC;IACrB,mDAAmD;IACnD,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,uDAAuD;IACvD,UAAU,CAAC,EAAE,YAAY,EAAE,CAAC;IAC5B,sBAAsB;IACtB,KAAK,CAAC,EAAE;QACN,0DAA0D;QAC1D,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;QACrD,oDAAoD;QACpD,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;KACvD,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/extensions/types.ts"],"names":[],"mappings":""}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export { validatePlaybook, parsePlaybookFromEntry } from './vault/playbook.js';
|
|
|
6
6
|
export type { Playbook, PlaybookStep, PlaybookValidationResult } from './vault/playbook.js';
|
|
7
7
|
export { getBuiltinPlaybook, getAllBuiltinPlaybooks, scorePlaybook, mergePlaybooks, matchPlaybooks, seedDefaultPlaybooks, playbookDefinitionToEntry, entryToPlaybookDefinition, } from './playbooks/index.js';
|
|
8
8
|
export type { PlaybookTier, PlaybookIntent, BrainstormSection, PlaybookGate, PlaybookTaskTemplate, PlaybookDefinition, MergedPlaybook, PlaybookMatchResult, } from './playbooks/index.js';
|
|
9
|
-
export { createPlaybookOps } from './runtime/playbook-ops.js';
|
|
10
9
|
export { tokenize, calculateTf, calculateTfIdf, cosineSimilarity, jaccardSimilarity, } from './text/similarity.js';
|
|
11
10
|
export type { SparseVector } from './text/similarity.js';
|
|
12
11
|
export { Curator } from './curator/curator.js';
|
|
@@ -38,6 +37,8 @@ export type { LLMCallOptions, LLMCallResult, CircuitState, CircuitBreakerConfig,
|
|
|
38
37
|
export { CircuitBreaker, CircuitOpenError, computeDelay, retry, parseRateLimitHeaders, } from './llm/utils.js';
|
|
39
38
|
export { KeyPool, loadKeyPoolConfig } from './llm/key-pool.js';
|
|
40
39
|
export type { KeyPoolFiles } from './llm/key-pool.js';
|
|
40
|
+
export type { AgentExtensions, OpMiddleware, MiddlewareContext } from './extensions/index.js';
|
|
41
|
+
export { wrapWithMiddleware } from './extensions/index.js';
|
|
41
42
|
export { registerFacade, registerAllFacades } from './facades/facade-factory.js';
|
|
42
43
|
export { facadeInputSchema } from './facades/types.js';
|
|
43
44
|
export type { OpHandler, AuthLevel, OpDefinition, FacadeConfig, FacadeResponse, FacadeInput, } from './facades/types.js';
|
|
@@ -52,28 +53,19 @@ export type { FacadeCall, TelemetryStats } from './telemetry/telemetry.js';
|
|
|
52
53
|
export { Logger, createLogger } from './logging/logger.js';
|
|
53
54
|
export type { LogLevel, LogEntry, LogContext, LoggerConfig } from './logging/types.js';
|
|
54
55
|
export { createAgentRuntime } from './runtime/runtime.js';
|
|
55
|
-
export {
|
|
56
|
+
export { createSemanticFacades } from './runtime/facades/index.js';
|
|
56
57
|
export { createDomainFacade, createDomainFacades } from './runtime/domain-ops.js';
|
|
57
|
-
export { createPlanningExtraOps } from './runtime/planning-extra-ops.js';
|
|
58
|
-
export { createMemoryExtraOps } from './runtime/memory-extra-ops.js';
|
|
59
|
-
export { createVaultExtraOps } from './runtime/vault-extra-ops.js';
|
|
60
|
-
export { createAdminOps } from './runtime/admin-ops.js';
|
|
61
|
-
export { createAdminExtraOps } from './runtime/admin-extra-ops.js';
|
|
62
|
-
export { createLoopOps } from './runtime/loop-ops.js';
|
|
63
|
-
export { createOrchestrateOps } from './runtime/orchestrate-ops.js';
|
|
64
|
-
export { createGradingOps } from './runtime/grading-ops.js';
|
|
65
|
-
export { createCaptureOps } from './runtime/capture-ops.js';
|
|
66
|
-
export { createCuratorExtraOps } from './runtime/curator-extra-ops.js';
|
|
67
|
-
export { createProjectOps } from './runtime/project-ops.js';
|
|
68
|
-
export { createMemoryCrossProjectOps } from './runtime/memory-cross-project-ops.js';
|
|
69
|
-
export { createCogneeSyncOps } from './runtime/cognee-sync-ops.js';
|
|
70
|
-
export { createIntakeOps } from './runtime/intake-ops.js';
|
|
71
58
|
export type { AgentRuntimeConfig, AgentRuntime } from './runtime/types.js';
|
|
72
59
|
export { SoleriErrorCode, SoleriError, ok, err, isOk, isErr, classifyError, retryWithPreset, shouldRetry, getRetryDelay, RETRY_PRESETS, } from './errors/index.js';
|
|
73
60
|
export type { ErrorClassification, Result, SoleriErrorOptions, RetryPreset, RetryConfig as SoleriRetryConfig, RetryOptions, } from './errors/index.js';
|
|
74
61
|
export { SQLitePersistenceProvider } from './persistence/index.js';
|
|
75
62
|
export { PostgresPersistenceProvider, translateSql } from './persistence/index.js';
|
|
76
63
|
export type { PersistenceProvider, PersistenceParams, RunResult, PersistenceConfig, FtsSearchOptions, } from './persistence/index.js';
|
|
64
|
+
export { ReplayableStream } from './streams/index.js';
|
|
65
|
+
export { normalize, collect } from './streams/index.js';
|
|
66
|
+
export type { NestableInput } from './streams/index.js';
|
|
67
|
+
export { computeContentHash } from './vault/content-hash.js';
|
|
68
|
+
export type { HashableEntry } from './vault/content-hash.js';
|
|
77
69
|
export { TemplateManager, parseVariables, resolveIncludes } from './prompts/index.js';
|
|
78
70
|
export type { PromptTemplate, TemplateVariable, RenderOptions } from './prompts/index.js';
|
|
79
71
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,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,EACnB,MAAM,EACN,kBAAkB,EAClB,WAAW,EACX,WAAW,IAAI,iBAAiB,EAChC,YAAY,GACb,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,2BAA2B,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACnF,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACtF,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,6 @@ export { Vault } from './vault/vault.js';
|
|
|
4
4
|
export { validatePlaybook, parsePlaybookFromEntry } from './vault/playbook.js';
|
|
5
5
|
// ─── Playbook System (registry, matching, seeding) ─────────────────
|
|
6
6
|
export { getBuiltinPlaybook, getAllBuiltinPlaybooks, scorePlaybook, mergePlaybooks, matchPlaybooks, seedDefaultPlaybooks, playbookDefinitionToEntry, entryToPlaybookDefinition, } from './playbooks/index.js';
|
|
7
|
-
export { createPlaybookOps } from './runtime/playbook-ops.js';
|
|
8
7
|
// ─── Text Utilities ─────────────────────────────────────────────────
|
|
9
8
|
export { tokenize, calculateTf, calculateTfIdf, cosineSimilarity, jaccardSimilarity, } from './text/similarity.js';
|
|
10
9
|
// ─── Curator ────────────────────────────────────────────────────────
|
|
@@ -35,6 +34,7 @@ export { SecretString, LLMError } from './llm/types.js';
|
|
|
35
34
|
export { CircuitBreaker, CircuitOpenError, computeDelay, retry, parseRateLimitHeaders, } from './llm/utils.js';
|
|
36
35
|
// ─── LLM Key Pool ───────────────────────────────────────────────────
|
|
37
36
|
export { KeyPool, loadKeyPoolConfig } from './llm/key-pool.js';
|
|
37
|
+
export { wrapWithMiddleware } from './extensions/index.js';
|
|
38
38
|
// ─── Facades ─────────────────────────────────────────────────────────
|
|
39
39
|
export { registerFacade, registerAllFacades } from './facades/facade-factory.js';
|
|
40
40
|
export { facadeInputSchema } from './facades/types.js';
|
|
@@ -51,27 +51,18 @@ export { Telemetry } from './telemetry/telemetry.js';
|
|
|
51
51
|
export { Logger, createLogger } from './logging/logger.js';
|
|
52
52
|
// ─── Runtime Factory ────────────────────────────────────────────────
|
|
53
53
|
export { createAgentRuntime } from './runtime/runtime.js';
|
|
54
|
-
export {
|
|
54
|
+
export { createSemanticFacades } from './runtime/facades/index.js';
|
|
55
55
|
export { createDomainFacade, createDomainFacades } from './runtime/domain-ops.js';
|
|
56
|
-
export { createPlanningExtraOps } from './runtime/planning-extra-ops.js';
|
|
57
|
-
export { createMemoryExtraOps } from './runtime/memory-extra-ops.js';
|
|
58
|
-
export { createVaultExtraOps } from './runtime/vault-extra-ops.js';
|
|
59
|
-
export { createAdminOps } from './runtime/admin-ops.js';
|
|
60
|
-
export { createAdminExtraOps } from './runtime/admin-extra-ops.js';
|
|
61
|
-
export { createLoopOps } from './runtime/loop-ops.js';
|
|
62
|
-
export { createOrchestrateOps } from './runtime/orchestrate-ops.js';
|
|
63
|
-
export { createGradingOps } from './runtime/grading-ops.js';
|
|
64
|
-
export { createCaptureOps } from './runtime/capture-ops.js';
|
|
65
|
-
export { createCuratorExtraOps } from './runtime/curator-extra-ops.js';
|
|
66
|
-
export { createProjectOps } from './runtime/project-ops.js';
|
|
67
|
-
export { createMemoryCrossProjectOps } from './runtime/memory-cross-project-ops.js';
|
|
68
|
-
export { createCogneeSyncOps } from './runtime/cognee-sync-ops.js';
|
|
69
|
-
export { createIntakeOps } from './runtime/intake-ops.js';
|
|
70
56
|
// ─── Errors ────────────────────────────────────────────────────────────
|
|
71
57
|
export { SoleriErrorCode, SoleriError, ok, err, isOk, isErr, classifyError, retryWithPreset, shouldRetry, getRetryDelay, RETRY_PRESETS, } from './errors/index.js';
|
|
72
58
|
// ─── Persistence ───────────────────────────────────────────────────────
|
|
73
59
|
export { SQLitePersistenceProvider } from './persistence/index.js';
|
|
74
60
|
export { PostgresPersistenceProvider, translateSql } from './persistence/index.js';
|
|
61
|
+
// ─── Streams ──────────────────────────────────────────────────────────
|
|
62
|
+
export { ReplayableStream } from './streams/index.js';
|
|
63
|
+
export { normalize, collect } from './streams/index.js';
|
|
64
|
+
// ─── Content Hashing ──────────────────────────────────────────────────
|
|
65
|
+
export { computeContentHash } from './vault/content-hash.js';
|
|
75
66
|
// ─── Prompts ───────────────────────────────────────────────────────────
|
|
76
67
|
export { TemplateManager, parseVariables, resolveIncludes } from './prompts/index.js';
|
|
77
68
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,wEAAwE;AACxE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAG/E,sEAAsE;AACtE,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAW9B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":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EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAGlF,0EAA0E;AAC1E,OAAO,EACL,eAAe,EACf,WAAW,EACX,EAAE,EACF,GAAG,EACH,IAAI,EACJ,KAAK,EACL,aAAa,EACb,eAAe,EACf,WAAW,EACX,aAAa,EACb,aAAa,GACd,MAAM,mBAAmB,CAAC;AAU3B,0EAA0E;AAC1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,2BAA2B,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AASnF,yEAAyE;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAGxD,yEAAyE;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D,0EAA0E;AAC1E,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generic core operations factory —
|
|
2
|
+
* Generic core operations factory — 209 ops that every agent gets.
|
|
3
3
|
*
|
|
4
4
|
* These ops are agent-agnostic (no persona, no activation).
|
|
5
5
|
* The 5 agent-specific ops (health, identity, activate, inject_claude_md, setup)
|
package/dist/runtime/core-ops.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generic core operations factory —
|
|
2
|
+
* Generic core operations factory — 209 ops that every agent gets.
|
|
3
3
|
*
|
|
4
4
|
* These ops are agent-agnostic (no persona, no activation).
|
|
5
5
|
* The 5 agent-specific ops (health, identity, activate, inject_claude_md, setup)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Admin facade — infrastructure ops.
|
|
3
|
+
* health, config, telemetry, tokens, LLM, prompts.
|
|
4
|
+
*/
|
|
5
|
+
import type { OpDefinition } from '../../facades/types.js';
|
|
6
|
+
import type { AgentRuntime } from '../types.js';
|
|
7
|
+
export declare function createAdminFacadeOps(runtime: AgentRuntime): OpDefinition[];
|
|
8
|
+
//# sourceMappingURL=admin-facade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-facade.d.ts","sourceRoot":"","sources":["../../../src/runtime/facades/admin-facade.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAIhD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,YAAY,GAAG,YAAY,EAAE,CAyF1E"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Admin facade — infrastructure ops.
|
|
3
|
+
* health, config, telemetry, tokens, LLM, prompts.
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { createAdminOps } from '../admin-ops.js';
|
|
7
|
+
import { createAdminExtraOps } from '../admin-extra-ops.js';
|
|
8
|
+
export function createAdminFacadeOps(runtime) {
|
|
9
|
+
const { llmClient, keyPool } = runtime;
|
|
10
|
+
return [
|
|
11
|
+
// ─── LLM (inline from core-ops.ts) ──────────────────────────
|
|
12
|
+
{
|
|
13
|
+
name: 'llm_rotate',
|
|
14
|
+
description: 'Force rotate the active API key for a provider. Useful when rate-limited or key is failing.',
|
|
15
|
+
auth: 'write',
|
|
16
|
+
schema: z.object({
|
|
17
|
+
provider: z.enum(['openai', 'anthropic']),
|
|
18
|
+
}),
|
|
19
|
+
handler: async (params) => {
|
|
20
|
+
const provider = params.provider;
|
|
21
|
+
const pool = keyPool[provider];
|
|
22
|
+
if (!pool.hasKeys)
|
|
23
|
+
return { rotated: false, error: `No ${provider} keys configured` };
|
|
24
|
+
const newKey = pool.rotateOnError();
|
|
25
|
+
return {
|
|
26
|
+
rotated: newKey !== null,
|
|
27
|
+
activeKeyIndex: pool.activeKeyIndex,
|
|
28
|
+
poolSize: pool.poolSize,
|
|
29
|
+
exhausted: pool.exhausted,
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'llm_call',
|
|
35
|
+
description: 'Make an LLM completion call. Uses model routing config and key pool rotation.',
|
|
36
|
+
auth: 'write',
|
|
37
|
+
schema: z.object({
|
|
38
|
+
systemPrompt: z.string().describe('System prompt for the LLM.'),
|
|
39
|
+
userPrompt: z.string().describe('User prompt / task input.'),
|
|
40
|
+
model: z
|
|
41
|
+
.string()
|
|
42
|
+
.optional()
|
|
43
|
+
.describe('Model name. Routed via model-routing.json if omitted.'),
|
|
44
|
+
temperature: z.number().optional().describe('Sampling temperature (0-2). Default 0.3.'),
|
|
45
|
+
maxTokens: z.number().optional().describe('Max output tokens. Default 500.'),
|
|
46
|
+
caller: z.string().optional().describe('Caller name for routing. Default "core-ops".'),
|
|
47
|
+
task: z.string().optional().describe('Task name for routing.'),
|
|
48
|
+
}),
|
|
49
|
+
handler: async (params) => {
|
|
50
|
+
return llmClient.complete({
|
|
51
|
+
provider: 'openai',
|
|
52
|
+
model: params.model ?? '',
|
|
53
|
+
systemPrompt: params.systemPrompt,
|
|
54
|
+
userPrompt: params.userPrompt,
|
|
55
|
+
temperature: params.temperature,
|
|
56
|
+
maxTokens: params.maxTokens,
|
|
57
|
+
caller: params.caller ?? 'core-ops',
|
|
58
|
+
task: params.task,
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
// ─── Prompt Templates (inline from core-ops.ts) ─────────────
|
|
63
|
+
{
|
|
64
|
+
name: 'render_prompt',
|
|
65
|
+
description: 'Render a prompt template with variable substitution. Templates are .prompt files loaded from the templates directory.',
|
|
66
|
+
auth: 'read',
|
|
67
|
+
schema: z.object({
|
|
68
|
+
template: z.string().describe('Template name (without .prompt extension)'),
|
|
69
|
+
variables: z.record(z.string()).optional().default({}),
|
|
70
|
+
strict: z.boolean().optional().default(true),
|
|
71
|
+
}),
|
|
72
|
+
handler: async (params) => {
|
|
73
|
+
const rendered = runtime.templateManager.render(params.template, (params.variables ?? {}), { strict: params.strict });
|
|
74
|
+
return { rendered };
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'list_templates',
|
|
79
|
+
description: 'List all loaded prompt templates.',
|
|
80
|
+
auth: 'read',
|
|
81
|
+
handler: async () => ({
|
|
82
|
+
templates: runtime.templateManager.listTemplates(),
|
|
83
|
+
}),
|
|
84
|
+
},
|
|
85
|
+
// ─── Satellite ops ───────────────────────────────────────────
|
|
86
|
+
...createAdminOps(runtime),
|
|
87
|
+
...createAdminExtraOps(runtime),
|
|
88
|
+
];
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=admin-facade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-facade.js","sourceRoot":"","sources":["../../../src/runtime/facades/admin-facade.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,oBAAoB,CAAC,OAAqB;IACxD,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAEvC,OAAO;QACL,+DAA+D;QAC/D;YACE,IAAI,EAAE,YAAY;YAClB,WAAW,EACT,6FAA6F;YAC/F,IAAI,EAAE,OAAO;YACb,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;gBACf,QAAQ,EAAE,CAAC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MAAM,CAAC,MAAiB,EAAE,CACrC,CAAC;gBACF,OAAO,EAAE,QAAQ,EAAE,CAAC;YACtB,CAAC;SACF;QACD;YACE,IAAI,EAAE,gBAAgB;YACtB,WAAW,EAAE,mCAAmC;YAChD,IAAI,EAAE,MAAe;YACrB,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;gBACpB,SAAS,EAAE,OAAO,CAAC,eAAe,CAAC,aAAa,EAAE;aACnD,CAAC;SACH;QAED,gEAAgE;QAChE,GAAG,cAAc,CAAC,OAAO,CAAC;QAC1B,GAAG,mBAAmB,CAAC,OAAO,CAAC;KAChC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Brain facade — learning system ops.
|
|
3
|
+
* intelligence pipeline, strengths, feedback, sessions.
|
|
4
|
+
*/
|
|
5
|
+
import type { OpDefinition } from '../../facades/types.js';
|
|
6
|
+
import type { AgentRuntime } from '../types.js';
|
|
7
|
+
export declare function createBrainFacadeOps(runtime: AgentRuntime): OpDefinition[];
|
|
8
|
+
//# sourceMappingURL=brain-facade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brain-facade.d.ts","sourceRoot":"","sources":["../../../src/runtime/facades/brain-facade.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,YAAY,GAAG,YAAY,EAAE,CAiU1E"}
|