@cogitator-ai/self-modifying 19.4.0 → 19.4.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/package.json +3 -3
- package/src/__tests__/index.test.ts +55 -81
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cogitator-ai/self-modifying",
|
|
3
|
-
"version": "19.4.
|
|
3
|
+
"version": "19.4.1",
|
|
4
4
|
"description": "Self-modifying agent capabilities for Cogitator - tool generation, meta-reasoning, architecture evolution",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"node": ">=22.12.0"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@cogitator-ai/core": "0.
|
|
25
|
-
"@cogitator-ai/types": "0.
|
|
24
|
+
"@cogitator-ai/core": "0.35.0",
|
|
25
|
+
"@cogitator-ai/types": "0.37.0",
|
|
26
26
|
"nanoid": "^6.0.1",
|
|
27
27
|
"zod": "^4.6.5"
|
|
28
28
|
},
|
|
@@ -1,86 +1,60 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import * as selfModifying from '../index';
|
|
2
3
|
|
|
4
|
+
/**
|
|
5
|
+
* The package is imported once, while the file is collected: a cold import of
|
|
6
|
+
* every module behind the entry point is slow on a busy CI runner, and inside
|
|
7
|
+
* a test it ran into the per-test timeout.
|
|
8
|
+
*/
|
|
3
9
|
describe('@cogitator-ai/self-modifying', () => {
|
|
4
|
-
it(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
expect(
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('exports default configs', async () => {
|
|
56
|
-
const {
|
|
57
|
-
DEFAULT_SANDBOX_CONFIG,
|
|
58
|
-
DEFAULT_META_REASONING_CONFIG,
|
|
59
|
-
DEFAULT_MODE_PROFILES,
|
|
60
|
-
DEFAULT_SAFETY_CONSTRAINTS,
|
|
61
|
-
DEFAULT_CAPABILITY_CONSTRAINTS,
|
|
62
|
-
DEFAULT_RESOURCE_CONSTRAINTS,
|
|
63
|
-
} = await import('../index');
|
|
64
|
-
|
|
65
|
-
expect(DEFAULT_SANDBOX_CONFIG).toBeDefined();
|
|
66
|
-
expect(DEFAULT_META_REASONING_CONFIG).toBeDefined();
|
|
67
|
-
expect(DEFAULT_MODE_PROFILES).toBeDefined();
|
|
68
|
-
expect(DEFAULT_SAFETY_CONSTRAINTS).toBeDefined();
|
|
69
|
-
expect(DEFAULT_CAPABILITY_CONSTRAINTS).toBeDefined();
|
|
70
|
-
expect(DEFAULT_RESOURCE_CONSTRAINTS).toBeDefined();
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
it('exports prompt builders', async () => {
|
|
74
|
-
const {
|
|
75
|
-
buildGapAnalysisPrompt,
|
|
76
|
-
buildToolGenerationPrompt,
|
|
77
|
-
buildMetaAssessmentPrompt,
|
|
78
|
-
buildTaskProfilePrompt,
|
|
79
|
-
} = await import('../index');
|
|
80
|
-
|
|
81
|
-
expect(buildGapAnalysisPrompt).toBeDefined();
|
|
82
|
-
expect(buildToolGenerationPrompt).toBeDefined();
|
|
83
|
-
expect(buildMetaAssessmentPrompt).toBeDefined();
|
|
84
|
-
expect(buildTaskProfilePrompt).toBeDefined();
|
|
10
|
+
it.each([
|
|
11
|
+
['the agent', ['SelfModifyingAgent']],
|
|
12
|
+
[
|
|
13
|
+
'tool generation components',
|
|
14
|
+
[
|
|
15
|
+
'GapAnalyzer',
|
|
16
|
+
'ToolGenerator',
|
|
17
|
+
'ToolValidator',
|
|
18
|
+
'ToolSandbox',
|
|
19
|
+
'InMemoryGeneratedToolStore',
|
|
20
|
+
],
|
|
21
|
+
],
|
|
22
|
+
['meta-reasoning components', ['MetaReasoner', 'ObservationCollector', 'StrategySelector']],
|
|
23
|
+
[
|
|
24
|
+
'architecture evolution components',
|
|
25
|
+
['CapabilityAnalyzer', 'EvolutionStrategy', 'ParameterOptimizer'],
|
|
26
|
+
],
|
|
27
|
+
[
|
|
28
|
+
'constraints components',
|
|
29
|
+
[
|
|
30
|
+
'ModificationValidator',
|
|
31
|
+
'RollbackManager',
|
|
32
|
+
'InMemoryCheckpointStore',
|
|
33
|
+
'DEFAULT_SAFETY_CONSTRAINTS',
|
|
34
|
+
],
|
|
35
|
+
],
|
|
36
|
+
['events components', ['SelfModifyingEventEmitter']],
|
|
37
|
+
[
|
|
38
|
+
'default configs',
|
|
39
|
+
[
|
|
40
|
+
'DEFAULT_SANDBOX_CONFIG',
|
|
41
|
+
'DEFAULT_META_REASONING_CONFIG',
|
|
42
|
+
'DEFAULT_MODE_PROFILES',
|
|
43
|
+
'DEFAULT_SAFETY_CONSTRAINTS',
|
|
44
|
+
'DEFAULT_CAPABILITY_CONSTRAINTS',
|
|
45
|
+
'DEFAULT_RESOURCE_CONSTRAINTS',
|
|
46
|
+
],
|
|
47
|
+
],
|
|
48
|
+
[
|
|
49
|
+
'prompt builders',
|
|
50
|
+
[
|
|
51
|
+
'buildGapAnalysisPrompt',
|
|
52
|
+
'buildToolGenerationPrompt',
|
|
53
|
+
'buildMetaAssessmentPrompt',
|
|
54
|
+
'buildTaskProfilePrompt',
|
|
55
|
+
],
|
|
56
|
+
],
|
|
57
|
+
] as const)('exports %s', (_, names) => {
|
|
58
|
+
for (const name of names) expect(selfModifying[name], name).toBeDefined();
|
|
85
59
|
});
|
|
86
60
|
});
|