@stackbilt/aegis-core 0.1.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/package.json +3 -2
- package/src/core.ts +5 -3
- package/src/schema-enums.ts +20 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackbilt/aegis-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
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": {
|
|
@@ -54,7 +54,8 @@
|
|
|
54
54
|
"./routes/cc-tasks": "./src/routes/cc-tasks.ts",
|
|
55
55
|
"./routes/pages": "./src/routes/pages.ts",
|
|
56
56
|
"./routes/dynamic-tools": "./src/routes/dynamic-tools.ts",
|
|
57
|
-
"./adapters/voice": "./src/adapters/voice/cloudflare-agent.ts"
|
|
57
|
+
"./adapters/voice": "./src/adapters/voice/cloudflare-agent.ts",
|
|
58
|
+
"./schema-enums": "./src/schema-enums.ts"
|
|
58
59
|
},
|
|
59
60
|
"scripts": {
|
|
60
61
|
"dev": "wrangler dev",
|
package/src/core.ts
CHANGED
|
@@ -34,13 +34,14 @@ import { dynamicToolsRoutes } from './routes/dynamic-tools.js';
|
|
|
34
34
|
|
|
35
35
|
export type TaskPhase = 'heartbeat' | 'cron';
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
38
|
+
export interface ScheduledTaskPlugin<TEnv extends EdgeEnv = any> {
|
|
38
39
|
/** Unique task name (used in task_runs table and audit chain) */
|
|
39
40
|
name: string;
|
|
40
41
|
/** heartbeat = runs every hour, cron = time-gated */
|
|
41
42
|
phase: TaskPhase;
|
|
42
43
|
/** The task implementation */
|
|
43
|
-
run: (env:
|
|
44
|
+
run: (env: TEnv) => Promise<void>;
|
|
44
45
|
/**
|
|
45
46
|
* Optional time gate for cron-phase tasks.
|
|
46
47
|
* If provided, the task only runs when `new Date().getUTCHours() % frequency === 0`.
|
|
@@ -115,7 +116,8 @@ export interface AegisAppConfig {
|
|
|
115
116
|
operator: OperatorConfig;
|
|
116
117
|
|
|
117
118
|
/** Additional scheduled tasks to register alongside core tasks */
|
|
118
|
-
|
|
119
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
120
|
+
scheduledTasks?: ScheduledTaskPlugin<any>[];
|
|
119
121
|
|
|
120
122
|
/** Additional executors to register */
|
|
121
123
|
executors?: ExecutorPlugin[];
|
package/src/schema-enums.ts
CHANGED
|
@@ -56,6 +56,13 @@ export type ActionOutcome = EnumValues<typeof ACTION_OUTCOMES>;
|
|
|
56
56
|
export const HEARTBEAT_STATUSES = ['ok', 'error', 'skipped'] as const;
|
|
57
57
|
export type HeartbeatStatus = EnumValues<typeof HEARTBEAT_STATUSES>;
|
|
58
58
|
|
|
59
|
+
// ─── CC Jobs ─────────────────────────────────────────────────
|
|
60
|
+
|
|
61
|
+
export const JOB_STATUSES = ['active', 'paused', 'completed', 'failed', 'cancelled'] as const;
|
|
62
|
+
export type JobStatus = EnumValues<typeof JOB_STATUSES>;
|
|
63
|
+
|
|
64
|
+
export const TERMINAL_JOB_STATUSES = new Set<JobStatus>(['completed', 'failed', 'cancelled']);
|
|
65
|
+
|
|
59
66
|
// ─── CC Tasks ────────────────────────────────────────────────
|
|
60
67
|
|
|
61
68
|
export const TASK_STATUSES = ['pending', 'running', 'completed', 'failed', 'cancelled'] as const;
|
|
@@ -124,6 +131,19 @@ export type ToolExecutor = EnumValues<typeof TOOL_EXECUTORS>;
|
|
|
124
131
|
export const TOOL_STATUSES = ['active', 'promoted', 'retired', 'draft'] as const;
|
|
125
132
|
export type ToolStatus = EnumValues<typeof TOOL_STATUSES>;
|
|
126
133
|
|
|
134
|
+
// ─── Sprint Backlog ──────────────────────────────────────────
|
|
135
|
+
|
|
136
|
+
export const SPRINT_STAGES = ['plan', 'implement', 'review', 'test', 'ship', 'monitor', 'done', 'failed'] as const;
|
|
137
|
+
export type SprintStage = EnumValues<typeof SPRINT_STAGES>;
|
|
138
|
+
|
|
139
|
+
export const RISK_LEVELS = ['low', 'medium', 'high', 'critical'] as const;
|
|
140
|
+
export type RiskLevel = EnumValues<typeof RISK_LEVELS>;
|
|
141
|
+
|
|
142
|
+
// ─── Alerts ──────────────────────────────────────────────────
|
|
143
|
+
|
|
144
|
+
export const ALERT_SEVERITIES = ['critical', 'high', 'medium', 'low'] as const;
|
|
145
|
+
export type AlertSeverity = EnumValues<typeof ALERT_SEVERITIES>;
|
|
146
|
+
|
|
127
147
|
// ─── CodeBeast Findings ─────────────────────────────────────
|
|
128
148
|
|
|
129
149
|
export const FINDING_SEVERITIES = ['HIGH', 'MID', 'LOW', 'INFO'] as const;
|