@evo-dev/core 0.0.1-alpha.3 → 0.0.1-alpha.4

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 (45) hide show
  1. package/dist/config/index.js +164 -125
  2. package/dist/index.js +8999 -7914
  3. package/package.json +1 -1
  4. package/src/agents/index.ts +1 -1
  5. package/src/code-agent-traces/index.ts +3 -10
  6. package/src/config/settings.ts +14 -0
  7. package/src/config/store.ts +1 -1
  8. package/src/daemon/index.ts +1 -1
  9. package/src/evolution/candidates/index.ts +235 -0
  10. package/src/evolution/control/index.ts +19 -0
  11. package/src/evolution/evidence/analysis.ts +529 -0
  12. package/src/evolution/evidence/index.ts +3 -0
  13. package/src/evolution/evidence/session-memory/constants.ts +12 -0
  14. package/src/evolution/evidence/session-memory/index.ts +4 -0
  15. package/src/evolution/evidence/session-memory/paths.ts +29 -0
  16. package/src/evolution/evidence/session-memory/policy.ts +39 -0
  17. package/src/evolution/evidence/session-memory/segment.ts +192 -0
  18. package/src/evolution/evidence/session-memory/state-machine.ts +249 -0
  19. package/src/evolution/evidence/session-memory/storage.ts +145 -0
  20. package/src/evolution/evidence/session-memory/types.ts +207 -0
  21. package/src/evolution/evidence/session-memory/updater.ts +184 -0
  22. package/src/evolution/formatters.ts +169 -0
  23. package/src/evolution/index.ts +12 -2827
  24. package/src/{knowledge → evolution/knowledge}/index.ts +7 -7
  25. package/src/evolution/paths.ts +41 -0
  26. package/src/evolution/processor/distillation.ts +436 -0
  27. package/src/evolution/processor/index.ts +3 -0
  28. package/src/evolution/processor/process.ts +306 -0
  29. package/src/evolution/schema.ts +522 -0
  30. package/src/evolution/shared.ts +677 -0
  31. package/src/evolution/triggers/classification.ts +102 -0
  32. package/src/evolution/triggers/index.ts +295 -0
  33. package/src/hooks/index.ts +54 -7
  34. package/src/index.ts +10 -2
  35. package/src/runtime-logs/index.ts +4 -12
  36. package/src/team/index.ts +1 -1
  37. package/src/utils/errors.ts +13 -0
  38. package/src/utils/fs.ts +40 -0
  39. package/src/utils/hash.ts +9 -0
  40. package/src/utils/ids.ts +12 -0
  41. package/src/utils/index.ts +7 -0
  42. package/src/utils/parsing.ts +11 -0
  43. package/src/utils/text.ts +18 -0
  44. package/src/utils/time.ts +5 -0
  45. /package/src/{learning → evolution/review}/index.ts +0 -0
@@ -0,0 +1,11 @@
1
+ export function optionalString(value: unknown): string | null {
2
+ return typeof value === "string" && value.trim() !== "" ? value : null;
3
+ }
4
+
5
+ export function optionalBoolean(value: unknown, fallback: boolean): boolean {
6
+ return typeof value === "boolean" ? value : fallback;
7
+ }
8
+
9
+ export function positiveInteger(value: unknown, fallback: number): number {
10
+ return typeof value === "number" && Number.isInteger(value) && value > 0 ? value : fallback;
11
+ }
@@ -0,0 +1,18 @@
1
+ export function sanitizeSummary(value: string): string {
2
+ const trimmed = value.replace(/\s+/g, " ").trim();
3
+ return trimmed.length === 0 ? "Session memory event observed." : trimmed.slice(0, 600);
4
+ }
5
+
6
+ export function truncateUtf8Tail(
7
+ value: string,
8
+ maxBytes: number,
9
+ ): { content: string; truncated: boolean } {
10
+ if (Buffer.byteLength(value, "utf8") <= maxBytes) {
11
+ return { content: value, truncated: false };
12
+ }
13
+ let content = value.slice(Math.max(0, value.length - maxBytes));
14
+ while (Buffer.byteLength(content, "utf8") > maxBytes && content.length > 0) {
15
+ content = content.slice(1);
16
+ }
17
+ return { content, truncated: true };
18
+ }
@@ -0,0 +1,5 @@
1
+ export function normalizeTimestamp(value?: string | Date): string {
2
+ if (value instanceof Date) return value.toISOString();
3
+ if (typeof value === "string" && value.trim() !== "") return new Date(value).toISOString();
4
+ return new Date().toISOString();
5
+ }
File without changes