mark-improving-agent 2.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.
Files changed (79) hide show
  1. package/README.md +335 -0
  2. package/VERSION +1 -0
  3. package/bin/cli.js +12 -0
  4. package/dist/agent/context.js +78 -0
  5. package/dist/agent/index.js +6 -0
  6. package/dist/agent/runtime.js +195 -0
  7. package/dist/agent/task-graph.js +209 -0
  8. package/dist/agent/types.js +1 -0
  9. package/dist/cli/index.js +206 -0
  10. package/dist/core/cognition/active-inference.js +296 -0
  11. package/dist/core/cognition/cognitive-architecture.js +263 -0
  12. package/dist/core/cognition/dual-process.js +102 -0
  13. package/dist/core/cognition/index.js +13 -0
  14. package/dist/core/cognition/learning-from-failure.js +184 -0
  15. package/dist/core/cognition/meta-agent.js +407 -0
  16. package/dist/core/cognition/metacognition.js +322 -0
  17. package/dist/core/cognition/react.js +177 -0
  18. package/dist/core/cognition/retrieval-anchor.js +99 -0
  19. package/dist/core/cognition/self-evolution.js +294 -0
  20. package/dist/core/cognition/self-verification.js +190 -0
  21. package/dist/core/cognition/thought-graph.js +495 -0
  22. package/dist/core/cognition/tool-augmented-llm.js +188 -0
  23. package/dist/core/cognition/tool-execution-verifier.js +204 -0
  24. package/dist/core/collaboration/agentic-loop.js +165 -0
  25. package/dist/core/collaboration/index.js +3 -0
  26. package/dist/core/collaboration/multi-agent-system.js +186 -0
  27. package/dist/core/collaboration/multi-agent.js +110 -0
  28. package/dist/core/consciousness/emotion-engine.js +101 -0
  29. package/dist/core/consciousness/flow-machine.js +121 -0
  30. package/dist/core/consciousness/index.js +4 -0
  31. package/dist/core/consciousness/personality.js +103 -0
  32. package/dist/core/consciousness/types.js +1 -0
  33. package/dist/core/emotional-protocol.js +54 -0
  34. package/dist/core/evolution/engine.js +194 -0
  35. package/dist/core/evolution/goal-engine.js +153 -0
  36. package/dist/core/evolution/index.js +6 -0
  37. package/dist/core/evolution/meta-learning.js +172 -0
  38. package/dist/core/evolution/reflection.js +158 -0
  39. package/dist/core/evolution/self-healer.js +139 -0
  40. package/dist/core/evolution/types.js +1 -0
  41. package/dist/core/healing-rl.js +266 -0
  42. package/dist/core/heartbeat.js +408 -0
  43. package/dist/core/identity/index.js +3 -0
  44. package/dist/core/identity/reflexion.js +165 -0
  45. package/dist/core/identity/self-model.js +274 -0
  46. package/dist/core/identity/self-verifier.js +158 -0
  47. package/dist/core/identity/types.js +12 -0
  48. package/dist/core/lesson-bank.js +301 -0
  49. package/dist/core/memory/adaptive-rag.js +440 -0
  50. package/dist/core/memory/archive-store.js +187 -0
  51. package/dist/core/memory/dream-consolidation.js +366 -0
  52. package/dist/core/memory/embedder.js +130 -0
  53. package/dist/core/memory/hopfield-network.js +128 -0
  54. package/dist/core/memory/index.js +9 -0
  55. package/dist/core/memory/knowledge-graph.js +151 -0
  56. package/dist/core/memory/spaced-repetition.js +113 -0
  57. package/dist/core/memory/store.js +404 -0
  58. package/dist/core/memory/types.js +1 -0
  59. package/dist/core/psychology/analysis.js +456 -0
  60. package/dist/core/psychology/index.js +1 -0
  61. package/dist/core/rollback-manager.js +191 -0
  62. package/dist/core/security/index.js +1 -0
  63. package/dist/core/security/privacy.js +132 -0
  64. package/dist/core/truth-teller.js +253 -0
  65. package/dist/core/truthfulness.js +99 -0
  66. package/dist/core/types.js +2 -0
  67. package/dist/event/bus.js +47 -0
  68. package/dist/index.js +8 -0
  69. package/dist/skills/dag.js +181 -0
  70. package/dist/skills/index.js +5 -0
  71. package/dist/skills/registry.js +40 -0
  72. package/dist/skills/types.js +1 -0
  73. package/dist/storage/archive.js +77 -0
  74. package/dist/storage/checkpoint.js +119 -0
  75. package/dist/storage/types.js +1 -0
  76. package/dist/utils/config.js +81 -0
  77. package/dist/utils/logger.js +49 -0
  78. package/dist/version.js +1 -0
  79. package/package.json +37 -0
@@ -0,0 +1,181 @@
1
+ function createSkillDAG() {
2
+ const nodes = new Map();
3
+ const adjacencyList = new Map();
4
+ const reverseAdjacencyList = new Map();
5
+ function getIncomingEdges(nodeId) {
6
+ return reverseAdjacencyList.get(nodeId) ?? new Set();
7
+ }
8
+ function getOutgoingEdges(nodeId) {
9
+ return adjacencyList.get(nodeId) ?? new Set();
10
+ }
11
+ // DFS-based cycle detection using three-color marking
12
+ function detectCycle() {
13
+ const color = new Map();
14
+ for (const id of nodes.keys()) {
15
+ color.set(id, 'white');
16
+ }
17
+ function dfs(nodeId) {
18
+ color.set(nodeId, 'grey');
19
+ const neighbors = getOutgoingEdges(nodeId);
20
+ for (const neighbor of neighbors) {
21
+ if (color.get(neighbor) === 'grey') {
22
+ return true; // Back edge found - cycle detected
23
+ }
24
+ if (color.get(neighbor) === 'white' && dfs(neighbor)) {
25
+ return true;
26
+ }
27
+ }
28
+ color.set(nodeId, 'black');
29
+ return false;
30
+ }
31
+ for (const id of nodes.keys()) {
32
+ if (color.get(id) === 'white') {
33
+ if (dfs(id)) {
34
+ return true;
35
+ }
36
+ }
37
+ }
38
+ return false;
39
+ }
40
+ // Kahn's algorithm for topological sort
41
+ function topologicalSort() {
42
+ if (detectCycle()) {
43
+ throw new Error('Cycle detected in DAG - cannot compute topological order');
44
+ }
45
+ const inDegree = new Map();
46
+ const result = [];
47
+ const queue = [];
48
+ // Initialize in-degree counts
49
+ for (const id of nodes.keys()) {
50
+ inDegree.set(id, getIncomingEdges(id).size);
51
+ }
52
+ // Find all nodes with no incoming edges
53
+ for (const [id, degree] of inDegree) {
54
+ if (degree === 0) {
55
+ queue.push(id);
56
+ }
57
+ }
58
+ // Process nodes in topological order
59
+ while (queue.length > 0) {
60
+ const current = queue.shift();
61
+ result.push(current);
62
+ for (const neighbor of getOutgoingEdges(current)) {
63
+ const newDegree = (inDegree.get(neighbor) ?? 0) - 1;
64
+ inDegree.set(neighbor, newDegree);
65
+ if (newDegree === 0) {
66
+ queue.push(neighbor);
67
+ }
68
+ }
69
+ }
70
+ // If we processed all nodes, return the result
71
+ if (result.length === nodes.size) {
72
+ return result;
73
+ }
74
+ // This shouldn't happen if cycle detection passed
75
+ throw new Error('Topological sort failed - possible cycle detected');
76
+ }
77
+ return {
78
+ addSkill(skill) {
79
+ nodes.set(skill.id, skill);
80
+ // Initialize adjacency lists for the node
81
+ if (!adjacencyList.has(skill.id)) {
82
+ adjacencyList.set(skill.id, new Set());
83
+ }
84
+ if (!reverseAdjacencyList.has(skill.id)) {
85
+ reverseAdjacencyList.set(skill.id, new Set());
86
+ }
87
+ // Validate and add dependencies
88
+ for (const depId of skill.deps) {
89
+ if (!nodes.has(depId)) {
90
+ throw new Error(`Skill "${skill.id}" depends on non-existent skill "${depId}"`);
91
+ }
92
+ adjacencyList.get(skill.id).add(depId);
93
+ if (!reverseAdjacencyList.has(depId)) {
94
+ reverseAdjacencyList.set(depId, new Set());
95
+ }
96
+ reverseAdjacencyList.get(depId).add(skill.id);
97
+ }
98
+ },
99
+ removeSkill(id) {
100
+ const skill = nodes.get(id);
101
+ if (!skill) {
102
+ return false;
103
+ }
104
+ // Remove this node from all adjacency lists
105
+ for (const depId of skill.deps) {
106
+ reverseAdjacencyList.get(depId)?.delete(id);
107
+ }
108
+ for (const [nodeId, neighbors] of adjacencyList) {
109
+ neighbors.delete(id);
110
+ }
111
+ adjacencyList.delete(id);
112
+ reverseAdjacencyList.delete(id);
113
+ return nodes.delete(id);
114
+ },
115
+ getExecutionOrder() {
116
+ return topologicalSort();
117
+ },
118
+ hasCycle() {
119
+ return detectCycle();
120
+ },
121
+ getReadySkills(completed) {
122
+ const ready = [];
123
+ for (const [id, skill] of nodes) {
124
+ if (completed.has(id)) {
125
+ continue;
126
+ }
127
+ // Check if all dependencies are completed
128
+ const allDepsCompleted = skill.deps.every(depId => completed.has(depId));
129
+ if (allDepsCompleted) {
130
+ ready.push(skill);
131
+ }
132
+ }
133
+ return ready;
134
+ },
135
+ };
136
+ }
137
+ function createDAGExecutor(registry, dag) {
138
+ return {
139
+ async execute(skillIds, input) {
140
+ const results = new Map();
141
+ const completed = new Set();
142
+ // Topologically sort the requested skills
143
+ const sorted = dag.getExecutionOrder().filter(id => skillIds.includes(id));
144
+ for (const skillId of sorted) {
145
+ const skill = registry.get(skillId);
146
+ if (!skill) {
147
+ throw new Error(`Skill "${skillId}" not found in registry`);
148
+ }
149
+ // Get input for this skill (use result of last skill or initial input)
150
+ const skillInput = results.size > 0
151
+ ? Array.from(results.values()).pop()
152
+ : input;
153
+ try {
154
+ const output = await skill.execute(skillInput);
155
+ results.set(skillId, output);
156
+ completed.add(skillId);
157
+ }
158
+ catch (error) {
159
+ throw new Error(`Skill "${skillId}" execution failed: ${error instanceof Error ? error.message : String(error)}`);
160
+ }
161
+ }
162
+ return results;
163
+ },
164
+ async executeWithDeps(skillId, input) {
165
+ const skill = registry.get(skillId);
166
+ if (!skill) {
167
+ throw new Error(`Skill "${skillId}" not found in registry`);
168
+ }
169
+ // Get execution order for all dependencies
170
+ const executionOrder = dag.getExecutionOrder();
171
+ const skillsToExecute = executionOrder.filter(id => {
172
+ const s = registry.get(id);
173
+ return s && (id === skillId || skill.deps.includes(id) || executionOrder.indexOf(id) < executionOrder.indexOf(skillId));
174
+ });
175
+ const results = await this.execute(skillsToExecute, input);
176
+ return results.get(skillId);
177
+ },
178
+ };
179
+ }
180
+ export { createSkillDAG, createDAGExecutor };
181
+ export default { createSkillDAG, createDAGExecutor };
@@ -0,0 +1,5 @@
1
+ export * from './types.js';
2
+ export * from './registry.js';
3
+ export * from './dag.js';
4
+ export { createSkillRegistry } from './registry.js';
5
+ export { createSkillDAG, createDAGExecutor } from './dag.js';
@@ -0,0 +1,40 @@
1
+ function createSkillRegistry() {
2
+ const skills = new Map();
3
+ return {
4
+ register(skill) {
5
+ if (!skill.id) {
6
+ throw new Error('Skill must have an id');
7
+ }
8
+ if (!skill.name) {
9
+ throw new Error('Skill must have a name');
10
+ }
11
+ if (!skill.execute || typeof skill.execute !== 'function') {
12
+ throw new Error('Skill must have an execute function');
13
+ }
14
+ skills.set(skill.id, skill);
15
+ },
16
+ unregister(id) {
17
+ return skills.delete(id);
18
+ },
19
+ get(id) {
20
+ return skills.get(id);
21
+ },
22
+ findByTag(tag) {
23
+ const result = [];
24
+ for (const skill of skills.values()) {
25
+ if (skill.tags.includes(tag)) {
26
+ result.push(skill);
27
+ }
28
+ }
29
+ return result;
30
+ },
31
+ list() {
32
+ return Array.from(skills.values());
33
+ },
34
+ has(id) {
35
+ return skills.has(id);
36
+ },
37
+ };
38
+ }
39
+ export { createSkillRegistry };
40
+ export default createSkillRegistry;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,77 @@
1
+ import { writeFile, readFile, mkdir, rename, readdir } from 'fs/promises';
2
+ import { existsSync } from 'fs';
3
+ import { dirname } from 'path';
4
+ const TEMP_SUFFIX = '.tmp';
5
+ const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
6
+ export async function ensureDir(dir) {
7
+ if (!existsSync(dir)) {
8
+ await mkdir(dir, { recursive: true });
9
+ }
10
+ }
11
+ export async function safeReadDir(dir) {
12
+ try {
13
+ if (!existsSync(dir)) {
14
+ return [];
15
+ }
16
+ const entries = await readdir(dir, { withFileTypes: true });
17
+ return entries
18
+ .filter(e => e.isFile())
19
+ .map(e => e.name);
20
+ }
21
+ catch {
22
+ return [];
23
+ }
24
+ }
25
+ export async function atomicWrite(path, content) {
26
+ const dir = dirname(path);
27
+ await ensureDir(dir);
28
+ const tmpPath = `${path}${TEMP_SUFFIX}`;
29
+ let attempts = 0;
30
+ const maxAttempts = 3;
31
+ while (attempts < maxAttempts) {
32
+ try {
33
+ await writeFile(tmpPath, content, 'utf-8');
34
+ await rename(tmpPath, path);
35
+ return;
36
+ }
37
+ catch (err) {
38
+ attempts++;
39
+ if (attempts >= maxAttempts) {
40
+ try {
41
+ const { unlink } = await import('fs/promises');
42
+ await unlink(tmpPath);
43
+ }
44
+ catch { }
45
+ throw err;
46
+ }
47
+ await sleep(10 * attempts);
48
+ }
49
+ }
50
+ }
51
+ export async function atomicWriteJSON(path, data) {
52
+ const content = JSON.stringify(data, null, 2);
53
+ await atomicWrite(path, content);
54
+ }
55
+ export function atomicWriteJSONSync(path, data) {
56
+ const content = JSON.stringify(data, null, 2);
57
+ const dir = dirname(path);
58
+ if (!existsSync(dir)) {
59
+ require('fs').mkdirSync(dir, { recursive: true });
60
+ }
61
+ const tmpPath = `${path}${TEMP_SUFFIX}`;
62
+ require('fs').writeFileSync(tmpPath, content, 'utf-8');
63
+ require('fs').renameSync(tmpPath, path);
64
+ }
65
+ export async function readJSON(path, fallback) {
66
+ try {
67
+ if (!existsSync(path)) {
68
+ return fallback;
69
+ }
70
+ const content = await readFile(path, 'utf-8');
71
+ const parsed = JSON.parse(content);
72
+ return parsed;
73
+ }
74
+ catch {
75
+ return fallback;
76
+ }
77
+ }
@@ -0,0 +1,119 @@
1
+ import { randomUUID } from 'crypto';
2
+ import { atomicWriteJSON, readJSON, ensureDir } from './archive.js';
3
+ import { VERSION } from '../version.js';
4
+ import { createLogger } from '../utils/logger.js';
5
+ const logger = createLogger('checkpoint');
6
+ export function createCheckpointManager(dataDir, maxKeep = 10) {
7
+ const checkpointDir = `${dataDir}/checkpoints`;
8
+ const metaPath = `${checkpointDir}/meta.json`;
9
+ const meta = async () => {
10
+ return readJSON(metaPath, { checkpoints: [], latest: null });
11
+ };
12
+ const saveMeta = async (m) => {
13
+ await atomicWriteJSON(metaPath, m);
14
+ };
15
+ const getCheckpointPath = (id) => {
16
+ return `${checkpointDir}/checkpoint-${id}.json`;
17
+ };
18
+ return {
19
+ async save(label) {
20
+ await ensureDir(checkpointDir);
21
+ const m = await meta();
22
+ const id = randomUUID();
23
+ const timestamp = Date.now();
24
+ const checkpointData = {
25
+ id,
26
+ timestamp,
27
+ state: {
28
+ version: VERSION,
29
+ timestamp,
30
+ data: {},
31
+ },
32
+ };
33
+ const size = JSON.stringify(checkpointData).length;
34
+ const info = {
35
+ id,
36
+ label: label ?? null,
37
+ timestamp,
38
+ size,
39
+ version: VERSION,
40
+ };
41
+ m.checkpoints.push(info);
42
+ m.latest = id;
43
+ if (m.checkpoints.length > maxKeep) {
44
+ const sorted = [...m.checkpoints].sort((a, b) => b.timestamp - a.timestamp);
45
+ const toRemove = sorted.slice(maxKeep);
46
+ for (const cp of toRemove) {
47
+ try {
48
+ const { unlink } = await import('fs/promises');
49
+ await unlink(getCheckpointPath(cp.id));
50
+ }
51
+ catch { }
52
+ }
53
+ m.checkpoints = sorted.slice(0, maxKeep);
54
+ }
55
+ await atomicWriteJSON(getCheckpointPath(id), checkpointData);
56
+ await saveMeta(m);
57
+ logger.info(`Checkpoint saved: ${id}`, { label, size });
58
+ return id;
59
+ },
60
+ async load(id) {
61
+ const m = await meta();
62
+ const targetId = id ?? m.latest;
63
+ if (!targetId) {
64
+ return null;
65
+ }
66
+ const info = m.checkpoints.find(cp => cp.id === targetId);
67
+ if (!info) {
68
+ return null;
69
+ }
70
+ try {
71
+ const data = await readJSON(getCheckpointPath(targetId), {
72
+ id: '',
73
+ timestamp: 0,
74
+ state: { version: '', timestamp: 0, data: {} },
75
+ });
76
+ return data.state;
77
+ }
78
+ catch {
79
+ logger.warn(`Failed to load checkpoint: ${targetId}`);
80
+ return null;
81
+ }
82
+ },
83
+ async list() {
84
+ const m = await meta();
85
+ return [...m.checkpoints].sort((a, b) => b.timestamp - a.timestamp);
86
+ },
87
+ async prune(keep = maxKeep) {
88
+ const m = await meta();
89
+ if (m.checkpoints.length <= keep) {
90
+ return 0;
91
+ }
92
+ const sorted = [...m.checkpoints].sort((a, b) => b.timestamp - a.timestamp);
93
+ const toRemove = sorted.slice(keep);
94
+ let removed = 0;
95
+ for (const cp of toRemove) {
96
+ try {
97
+ const { unlink } = await import('fs/promises');
98
+ await unlink(getCheckpointPath(cp.id));
99
+ m.checkpoints = m.checkpoints.filter(c => c.id !== cp.id);
100
+ removed++;
101
+ }
102
+ catch { }
103
+ }
104
+ if (m.latest && !m.checkpoints.find(c => c.id === m.latest)) {
105
+ m.latest = m.checkpoints[0]?.id ?? null;
106
+ }
107
+ await saveMeta(m);
108
+ logger.info(`Pruned ${removed} checkpoints, kept ${m.checkpoints.length}`);
109
+ return removed;
110
+ },
111
+ async getLatest() {
112
+ const m = await meta();
113
+ if (!m.latest) {
114
+ return null;
115
+ }
116
+ return m.checkpoints.find(cp => cp.id === m.latest) ?? null;
117
+ },
118
+ };
119
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,81 @@
1
+ import { z } from 'zod';
2
+ const HeartFlowConfigSchema = z.object({
3
+ version: z.string(),
4
+ dataDir: z.string(),
5
+ logLevel: z.enum(['debug', 'info', 'warn', 'error']),
6
+ memory: z.object({
7
+ archiveThreshold: z.number().min(0).max(100),
8
+ maxEphemeral: z.number().positive(),
9
+ learnedTtlDays: z.number().positive(),
10
+ }),
11
+ evolution: z.object({
12
+ maxGoals: z.number().positive(),
13
+ cycleIntervalMs: z.number().positive(),
14
+ }),
15
+ checkpoint: z.object({
16
+ maxKeep: z.number().positive(),
17
+ intervalInteractions: z.number().positive(),
18
+ }),
19
+ identity: z.object({
20
+ driftThreshold: z.number().min(0).max(1),
21
+ }),
22
+ consciousness: z.object({
23
+ emotionDecay: z.number().min(0).max(1),
24
+ flowThreshold: z.number().min(0).max(1),
25
+ }),
26
+ agent: z.object({
27
+ maxContext: z.number().positive(),
28
+ }),
29
+ });
30
+ export const DEFAULT_CONFIG = {
31
+ version: '2.0.0',
32
+ dataDir: './data',
33
+ logLevel: 'info',
34
+ memory: {
35
+ archiveThreshold: 70,
36
+ maxEphemeral: 1000,
37
+ learnedTtlDays: 90,
38
+ },
39
+ evolution: {
40
+ maxGoals: 5,
41
+ cycleIntervalMs: 3600000,
42
+ },
43
+ checkpoint: {
44
+ maxKeep: 10,
45
+ intervalInteractions: 100,
46
+ },
47
+ identity: {
48
+ driftThreshold: 0.15,
49
+ },
50
+ consciousness: {
51
+ emotionDecay: 0.95,
52
+ flowThreshold: 0.7,
53
+ },
54
+ agent: {
55
+ maxContext: 100000,
56
+ },
57
+ };
58
+ export function loadConfig() {
59
+ const configPath = process.env['HEARTFLOW_CONFIG_PATH'];
60
+ if (!configPath) {
61
+ return { ...DEFAULT_CONFIG };
62
+ }
63
+ try {
64
+ const fs = require('fs');
65
+ const fileContent = fs.readFileSync(configPath, 'utf-8');
66
+ const parsed = JSON.parse(fileContent);
67
+ return validateConfig(parsed);
68
+ }
69
+ catch {
70
+ console.warn(`Failed to load config from ${configPath}, using defaults`);
71
+ return { ...DEFAULT_CONFIG };
72
+ }
73
+ }
74
+ export function validateConfig(config) {
75
+ const result = HeartFlowConfigSchema.safeParse(config);
76
+ if (!result.success) {
77
+ const errors = result.error.issues.map(i => `${i.path.join('.')}: ${i.message}`).join(', ');
78
+ throw new Error(`Invalid configuration: ${errors}`);
79
+ }
80
+ return result.data;
81
+ }
@@ -0,0 +1,49 @@
1
+ const LOG_LEVELS = {
2
+ debug: 0,
3
+ info: 1,
4
+ warn: 2,
5
+ error: 3,
6
+ };
7
+ const currentLevel = () => {
8
+ const envLevel = process.env['LOG_LEVEL'];
9
+ return envLevel && LOG_LEVELS[envLevel] !== undefined ? envLevel : 'info';
10
+ };
11
+ const formatTimestamp = () => {
12
+ return new Date().toISOString();
13
+ };
14
+ const formatMessage = (level, name, message, ctx) => {
15
+ const timestamp = formatTimestamp();
16
+ const levelStr = level.toUpperCase().padEnd(5, ' ');
17
+ const nameStr = `\x1b[34m${name}\x1b[0m`;
18
+ const ctxStr = ctx ? ` ${JSON.stringify(ctx)}` : '';
19
+ return `${timestamp} ${levelStr} ${nameStr} ${message}${ctxStr}`;
20
+ };
21
+ const shouldLog = (level) => {
22
+ return LOG_LEVELS[level] >= LOG_LEVELS[currentLevel()];
23
+ };
24
+ export const createLogger = (name, level) => {
25
+ const effectiveLevel = level ?? currentLevel();
26
+ return {
27
+ debug(message, ctx) {
28
+ if (shouldLog('debug')) {
29
+ console.debug(formatMessage('debug', name, message, ctx));
30
+ }
31
+ },
32
+ info(message, ctx) {
33
+ if (shouldLog('info')) {
34
+ console.info(formatMessage('info', name, message, ctx));
35
+ }
36
+ },
37
+ warn(message, ctx) {
38
+ if (shouldLog('warn')) {
39
+ console.warn(formatMessage('warn', name, message, ctx));
40
+ }
41
+ },
42
+ error(message, ctx) {
43
+ if (shouldLog('error')) {
44
+ console.error(formatMessage('error', name, message, ctx));
45
+ }
46
+ },
47
+ };
48
+ };
49
+ export const DEFAULT_LOGGER = createLogger('mark-improving-agent');
@@ -0,0 +1 @@
1
+ export const VERSION = '2.2.0';
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "mark-improving-agent",
3
+ "version": "2.2.0",
4
+ "description": "Self-evolving AI agent with permanent memory, identity continuity, and self-evolution — for AI agents that need to remember, learn, and evolve across sessions",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "bin": {
8
+ "heartflow": "dist/cli/index.js"
9
+ },
10
+ "scripts": {
11
+ "build": "tsc",
12
+ "start": "node bin/cli.js",
13
+ "test": "vitest run",
14
+ "prepublish": "npm run build"
15
+ },
16
+ "keywords": [
17
+ "ai",
18
+ "agent",
19
+ "identity",
20
+ "self-evolution",
21
+ "memory"
22
+ ],
23
+ "license": "MIT",
24
+ "dependencies": {
25
+ "events": "3.3.0",
26
+ "zod": "3.25.76"
27
+ },
28
+ "devDependencies": {
29
+ "@types/events": "3.0.0",
30
+ "@types/node": "22.19.19",
31
+ "typescript": "5.7.3",
32
+ "vitest": "4.1.6"
33
+ },
34
+ "engines": {
35
+ "node": ">=18.0.0"
36
+ }
37
+ }