@stackbilt/aegis-core 0.6.0 → 0.6.2
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/package.json +3 -2
- package/src/exports.ts +9 -0
- package/src/kernel/memory/blocks.ts +4 -2
- package/src/kernel/patterns.ts +76 -0
- package/src/kernel/types.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackbilt/aegis-core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Persistent AI agent framework for Cloudflare Workers. Multi-tier memory, autonomous goals, dreaming cycles, MCP native.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -67,7 +67,8 @@
|
|
|
67
67
|
"./kernel/grounding/verify": "./src/kernel/grounding/verify.ts",
|
|
68
68
|
"./kernel/grounding/fanout": "./src/kernel/grounding/fanout.ts",
|
|
69
69
|
"./kernel/grounding/fabrication-detector": "./src/kernel/grounding/fabrication-detector.ts",
|
|
70
|
-
"./kernel/grounding/semantic-sanhedrin": "./src/kernel/grounding/semantic-sanhedrin.ts"
|
|
70
|
+
"./kernel/grounding/semantic-sanhedrin": "./src/kernel/grounding/semantic-sanhedrin.ts",
|
|
71
|
+
"./kernel/patterns": "./src/kernel/patterns.ts"
|
|
71
72
|
},
|
|
72
73
|
"scripts": {
|
|
73
74
|
"dev": "wrangler dev",
|
package/src/exports.ts
CHANGED
|
@@ -154,3 +154,12 @@ export { VERSION } from './version.js';
|
|
|
154
154
|
|
|
155
155
|
// ─── Observability ──────────────────────────────────────────
|
|
156
156
|
export { InMemoryErrorTracker } from './lib/observability/errors.js';
|
|
157
|
+
|
|
158
|
+
// ─── Convergence Patterns ────────────────────────────────────
|
|
159
|
+
export {
|
|
160
|
+
POSITIONAL_DISPATCH_PATTERN_ID,
|
|
161
|
+
POSITIONAL_DISPATCH_CONTRACT_VERSION,
|
|
162
|
+
TIERED_EXECUTION_PATTERN_ID,
|
|
163
|
+
TIERED_EXECUTION_CONTRACT_VERSION,
|
|
164
|
+
} from './kernel/patterns.js';
|
|
165
|
+
export type { PositionalDispatch, TieredExecution } from './kernel/patterns.js';
|
|
@@ -36,8 +36,10 @@ const EXECUTOR_ATTACHMENTS: Record<Executor, readonly BlockId[]> = {
|
|
|
36
36
|
gpt_oss: ['identity', 'operator_profile', 'operating_rules'],
|
|
37
37
|
groq: CORE_BLOCKS,
|
|
38
38
|
workers_ai: MINIMAL_BLOCKS,
|
|
39
|
-
direct:
|
|
40
|
-
tarotscript:
|
|
39
|
+
direct: [],
|
|
40
|
+
tarotscript: [],
|
|
41
|
+
cerebras_mid: CORE_BLOCKS,
|
|
42
|
+
cerebras_reasoning: CORE_BLOCKS,
|
|
41
43
|
};
|
|
42
44
|
|
|
43
45
|
// ─── CRUD ────────────────────────────────────────────────────
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convergence Pattern Contracts
|
|
3
|
+
*
|
|
4
|
+
* TypeScript structural contracts for patterns in the Stackbilt convergence
|
|
5
|
+
* catalog (docs/routines/convergence-patterns.md in aegis-daemon). These are
|
|
6
|
+
* compile-time-only artifacts — no runtime code.
|
|
7
|
+
*
|
|
8
|
+
* Intended use: tag an implementation by assigning an object satisfying the
|
|
9
|
+
* interface to a const (optionally unused):
|
|
10
|
+
*
|
|
11
|
+
* import type { PositionalDispatch } from '@stackbilt/aegis-core/kernel/patterns';
|
|
12
|
+
* const _p1: PositionalDispatch<KernelIntent, Executor, ExecFn> = { classify, select };
|
|
13
|
+
*
|
|
14
|
+
* The convergence-thesis routine uses PATTERN_ID constants as catalog keys.
|
|
15
|
+
* Consumer repos that implement a mirrored version import the interface and
|
|
16
|
+
* write a structural-compat test pinning the shapes (see P5 contract-mirroring
|
|
17
|
+
* for the full discipline).
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
// ─── P1: Positional Dispatch ─────────────────────────────────────────────────
|
|
21
|
+
|
|
22
|
+
export const POSITIONAL_DISPATCH_PATTERN_ID = 'positional-dispatch' as const;
|
|
23
|
+
export const POSITIONAL_DISPATCH_CONTRACT_VERSION = '1.0.0';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* P1: Positional Dispatch
|
|
27
|
+
*
|
|
28
|
+
* Input acquires meaning through context; a pattern match on the
|
|
29
|
+
* contextualized input selects the handler. The two-phase structure
|
|
30
|
+
* (classify → select) is the invariant. Specific type shapes are
|
|
31
|
+
* consumer-defined.
|
|
32
|
+
*
|
|
33
|
+
* Canonical implementation: aegis kernel/dispatch.ts + kernel/router.ts
|
|
34
|
+
* - classify: route(intent, env) → ExecutionPlan (executor = classification)
|
|
35
|
+
* - select: switch(plan.executor) → executor function
|
|
36
|
+
*
|
|
37
|
+
* Known mirrors:
|
|
38
|
+
* - tarotscript spread-selector.ts: detectMode(intent) + selectSpread(mode)
|
|
39
|
+
* - charter command router: command + project-type context → rule selection
|
|
40
|
+
*/
|
|
41
|
+
export interface PositionalDispatch<TInput, TClassification, THandler> {
|
|
42
|
+
/** Assigns a classification to raw input, optionally using captured context */
|
|
43
|
+
classify(input: TInput): TClassification | Promise<TClassification>;
|
|
44
|
+
/** Maps a classification to the appropriate handler */
|
|
45
|
+
select(classification: TClassification): THandler;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// ─── P7: Tiered Execution ────────────────────────────────────────────────────
|
|
49
|
+
|
|
50
|
+
export const TIERED_EXECUTION_PATTERN_ID = 'tiered-execution' as const;
|
|
51
|
+
export const TIERED_EXECUTION_CONTRACT_VERSION = '1.0.0';
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* P7: Tiered Execution
|
|
55
|
+
*
|
|
56
|
+
* Tasks are routed to one of several ordered execution tiers based on
|
|
57
|
+
* resource cost, reasoning depth, and budget constraints. The tier selection
|
|
58
|
+
* function maps task characteristics to a tier; the executor runs the
|
|
59
|
+
* tier-appropriate implementation with budget enforcement.
|
|
60
|
+
*
|
|
61
|
+
* Canonical implementation: aegis kernel/dispatch.ts
|
|
62
|
+
* - selectTier: SHADOW_DEMOTION map + cost ceiling → Executor tier
|
|
63
|
+
* - execute: executor switch → execute* function
|
|
64
|
+
*
|
|
65
|
+
* Known mirrors:
|
|
66
|
+
* - llm-providers factory.ts: getPrioritizedProviders() + buildProviderChain()
|
|
67
|
+
* - tarotscript spread-selector.ts: complexity → spread depth
|
|
68
|
+
*
|
|
69
|
+
* Extraction candidate: a shared cost-aware routing primitive (see #230).
|
|
70
|
+
*/
|
|
71
|
+
export interface TieredExecution<TInput, TTier extends string, TResult> {
|
|
72
|
+
/** Maps task characteristics to an execution tier */
|
|
73
|
+
selectTier(input: TInput): TTier;
|
|
74
|
+
/** Executes using the selected tier, with budget/capacity enforcement */
|
|
75
|
+
execute(tier: TTier, input: TInput): TResult | Promise<TResult>;
|
|
76
|
+
}
|
package/src/kernel/types.ts
CHANGED
|
@@ -88,7 +88,7 @@ export interface MemoryEntry {
|
|
|
88
88
|
|
|
89
89
|
// ─── Execution Plan ──────────────────────────────────────────
|
|
90
90
|
|
|
91
|
-
export type Executor = 'claude' | 'groq' | 'direct' | 'claude_code' | 'workers_ai' | 'claude_opus' | 'gpt_oss' | 'composite' | 'tarotscript';
|
|
91
|
+
export type Executor = 'claude' | 'groq' | 'direct' | 'claude_code' | 'workers_ai' | 'claude_opus' | 'gpt_oss' | 'composite' | 'tarotscript' | 'cerebras_mid' | 'cerebras_reasoning';
|
|
92
92
|
|
|
93
93
|
export interface ExecutionPlan {
|
|
94
94
|
executor: Executor;
|