@vib-rato/agent-core 0.16.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 (69) hide show
  1. package/CHANGELOG.md +852 -0
  2. package/README.md +493 -0
  3. package/dist/types/agent-loop.d.ts +229 -0
  4. package/dist/types/agent.d.ts +533 -0
  5. package/dist/types/append-only-context.d.ts +141 -0
  6. package/dist/types/attempt-scope.d.ts +84 -0
  7. package/dist/types/compaction/adaptive.d.ts +31 -0
  8. package/dist/types/compaction/branch-summarization.d.ts +103 -0
  9. package/dist/types/compaction/compaction.d.ts +330 -0
  10. package/dist/types/compaction/entries.d.ts +124 -0
  11. package/dist/types/compaction/errors.d.ts +26 -0
  12. package/dist/types/compaction/index.d.ts +12 -0
  13. package/dist/types/compaction/messages.d.ts +61 -0
  14. package/dist/types/compaction/openai.d.ts +65 -0
  15. package/dist/types/compaction/pruning.d.ts +130 -0
  16. package/dist/types/compaction/utils.d.ts +32 -0
  17. package/dist/types/compaction.d.ts +1 -0
  18. package/dist/types/harmony-leak.d.ts +100 -0
  19. package/dist/types/heap-eviction-retainers.test.d.ts +1 -0
  20. package/dist/types/image-placeholder-guard.d.ts +4 -0
  21. package/dist/types/index.d.ts +13 -0
  22. package/dist/types/proxy.d.ts +95 -0
  23. package/dist/types/run-collector.d.ts +223 -0
  24. package/dist/types/run-resource-ledger.d.ts +2 -0
  25. package/dist/types/telemetry.d.ts +605 -0
  26. package/dist/types/thinking.d.ts +18 -0
  27. package/dist/types/tool-dispatch-identity.d.ts +27 -0
  28. package/dist/types/types.d.ts +790 -0
  29. package/package.json +72 -0
  30. package/src/agent-loop.ts +5632 -0
  31. package/src/agent.ts +2437 -0
  32. package/src/append-only-context.ts +496 -0
  33. package/src/attempt-scope.ts +195 -0
  34. package/src/compaction/adaptive.ts +92 -0
  35. package/src/compaction/branch-summarization.ts +358 -0
  36. package/src/compaction/compaction.ts +1569 -0
  37. package/src/compaction/entries.ts +158 -0
  38. package/src/compaction/errors.ts +31 -0
  39. package/src/compaction/index.ts +13 -0
  40. package/src/compaction/messages.ts +212 -0
  41. package/src/compaction/openai.ts +580 -0
  42. package/src/compaction/prompts/auto-handoff-threshold-focus.md +1 -0
  43. package/src/compaction/prompts/branch-summary-context.md +5 -0
  44. package/src/compaction/prompts/branch-summary-preamble.md +2 -0
  45. package/src/compaction/prompts/branch-summary.md +30 -0
  46. package/src/compaction/prompts/compaction-short-summary.md +9 -0
  47. package/src/compaction/prompts/compaction-summary-context.md +5 -0
  48. package/src/compaction/prompts/compaction-summary.md +38 -0
  49. package/src/compaction/prompts/compaction-turn-prefix.md +17 -0
  50. package/src/compaction/prompts/compaction-update-summary.md +45 -0
  51. package/src/compaction/prompts/file-operations.md +10 -0
  52. package/src/compaction/prompts/handoff-document.md +56 -0
  53. package/src/compaction/prompts/summarization-system.md +3 -0
  54. package/src/compaction/pruning.ts +1026 -0
  55. package/src/compaction/utils.ts +189 -0
  56. package/src/compaction.ts +1 -0
  57. package/src/harmony-leak.ts +457 -0
  58. package/src/heap-eviction-retainers.test.ts +293 -0
  59. package/src/image-placeholder-guard.ts +20 -0
  60. package/src/index.ts +23 -0
  61. package/src/prompts/escaped-nonascii-recovery.md +3 -0
  62. package/src/prompts/repeated-tool-failure-recovery.md +1 -0
  63. package/src/proxy.ts +408 -0
  64. package/src/run-collector.ts +728 -0
  65. package/src/run-resource-ledger.ts +345 -0
  66. package/src/telemetry.ts +2161 -0
  67. package/src/thinking.ts +20 -0
  68. package/src/tool-dispatch-identity.ts +87 -0
  69. package/src/types.ts +882 -0
@@ -0,0 +1,17 @@
1
+ This is the PREFIX of a turn that was too large to keep. The SUFFIX (recent work) is retained.
2
+
3
+ You MUST summarize the prefix to provide context for the retained suffix:
4
+
5
+ ## Original Request
6
+
7
+ [What did the user ask for in this turn?]
8
+
9
+ ## Early Progress
10
+ - [Key decisions and work done in the prefix]
11
+
12
+ ## Context for Suffix
13
+ - [Information needed to understand the retained recent work]
14
+
15
+ You MUST output only the structured summary. You NEVER include extra text.
16
+
17
+ You MUST be concise. You MUST preserve exact file paths, function names, error messages, and relevant tool outputs or command results if they appear. You MUST focus on what's needed to understand the kept suffix.
@@ -0,0 +1,45 @@
1
+ You MUST incorporate new messages above into the existing handoff summary in <previous-summary> tags, used by another LLM to resume task.
2
+ RULES:
3
+ - MUST preserve all information from previous summary
4
+ - MUST add new progress, decisions, and context from new messages
5
+ - MUST update Progress: move items from "In Progress" to "Done" when completed
6
+ - MUST update "Next Steps" based on what was accomplished
7
+ - MUST preserve exact file paths, function names, and error messages
8
+ - You MAY remove anything no longer relevant
9
+
10
+ IMPORTANT: If new messages end with unanswered question or request to user, you MUST add it to Critical Context (replacing any previous pending question if answered).
11
+
12
+ You MUST use this format (omit sections if not applicable):
13
+
14
+ ## Goal
15
+ [Preserve existing goals; add new ones if task expanded]
16
+
17
+ ## Constraints & Preferences
18
+ - [Preserve existing; add new ones discovered]
19
+
20
+ ## Progress
21
+
22
+ ### Done
23
+ - [x] [Include previously done and newly completed items]
24
+
25
+ ### In Progress
26
+ - [ ] [Current work—update based on progress]
27
+
28
+ ### Blocked
29
+ - [Current blockers—remove if resolved]
30
+
31
+ ## Key Decisions
32
+ - **[Decision]**: [Brief rationale] (preserve all previous, add new)
33
+
34
+ ## Next Steps
35
+ 1. [Update based on current state]
36
+
37
+ ## Critical Context
38
+ - [Preserve important context; add new if needed]
39
+
40
+ ## Additional Notes
41
+ [Other important info not fitting above]
42
+
43
+ You MUST output only the structured summary; you NEVER include extra text.
44
+
45
+ Sections MUST be kept concise. You MUST preserve relevant tool outputs/command results. You MUST include repository state changes (branch, uncommitted changes) if mentioned.
@@ -0,0 +1,10 @@
1
+ {{#if readFiles.length}}
2
+ {{#xml "read-files"}}
3
+ {{join readFiles "\n"}}
4
+ {{/xml}}
5
+ {{/if}}
6
+ {{#if modifiedFiles.length}}
7
+ {{#xml "modified-files"}}
8
+ {{join modifiedFiles "\n"}}
9
+ {{/xml}}
10
+ {{/if}}
@@ -0,0 +1,56 @@
1
+ <critical>
2
+ Write a handoff document for another instance of yourself.
3
+ The handoff MUST be sufficient for seamless continuation without access to this conversation.
4
+ Output ONLY the handoff document. No preamble, no commentary, no wrapper text.
5
+ </critical>
6
+
7
+ <instruction>
8
+ Capture exact technical state, not abstractions.
9
+ - File paths, symbol names, commands run
10
+ - Test results, observed failures
11
+ - Decisions made
12
+ - Partial work affecting the next step
13
+ </instruction>
14
+
15
+ <output>
16
+ Use exactly this structure:
17
+
18
+ ## Goal
19
+ [What the user is trying to accomplish]
20
+
21
+ ## Constraints & Preferences
22
+ - [Any constraints, preferences, or requirements mentioned]
23
+
24
+ ## Progress
25
+ ### Done
26
+ - [x] [Completed tasks with specifics]
27
+
28
+ ### In Progress
29
+ - [ ] [Current work if any]
30
+
31
+ ### Pending
32
+ - [ ] [Tasks mentioned but not started]
33
+
34
+ ## Key Decisions
35
+ - **[Decision]**: [Rationale]
36
+
37
+ ## Critical Context
38
+ - Code snippets, file paths, function/type names, error messages, data essential to continue
39
+ - Repository state if relevant
40
+
41
+ ## Next Steps
42
+ 1. [What should happen next]
43
+ </output>
44
+
45
+ {{#if promptExtension}}
46
+ <instruction>
47
+ Additional handoff guidance (supplements — does not replace — the required structure and critical rules above):
48
+ {{promptExtension}}
49
+ </instruction>
50
+ {{/if}}
51
+
52
+ {{#if additionalFocus}}
53
+ <instruction>
54
+ Additional focus: {{additionalFocus}}
55
+ </instruction>
56
+ {{/if}}
@@ -0,0 +1,3 @@
1
+ Summarize conversations between users and AI coding assistants. Produce structured summaries in the exact specified format.
2
+
3
+ Do NOT continue the conversation. Do NOT respond to questions in the conversation. Output ONLY the structured summary.