saico 2.2.0 → 2.2.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.
Files changed (2) hide show
  1. package/context.js +4 -3
  2. package/package.json +1 -1
package/context.js CHANGED
@@ -801,21 +801,22 @@ class Context {
801
801
  const fullQueue = [];
802
802
  const ancestorContexts = this.getAncestorContexts();
803
803
 
804
- // Layer 1: System prompts from ancestor hierarchy + own prompt
804
+ // Layer 1+2: Each level's prompt followed immediately by its state summary
805
805
  for (const ctx of ancestorContexts) {
806
806
  if (ctx.prompt) {
807
807
  const prompt = {role: 'system', content: ctx.prompt};
808
808
  if (add_tag) prompt.tag = ctx.tag;
809
809
  fullQueue.push(prompt);
810
810
  }
811
+ const ctxSummary = ctx.getStateSummary();
812
+ if (ctxSummary)
813
+ fullQueue.push({role: 'system', content: '[State Summary]\n' + ctxSummary});
811
814
  }
812
815
  if (this.prompt) {
813
816
  const prompt = {role: 'system', content: this.prompt};
814
817
  if (add_tag) prompt.tag = this.tag;
815
818
  fullQueue.push(prompt);
816
819
  }
817
-
818
- // Layer 2: State summary (if non-empty)
819
820
  const stateSummary = this.getStateSummary();
820
821
  if (stateSummary)
821
822
  fullQueue.push({role: 'system', content: '[State Summary]\n' + stateSummary});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saico",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "main": "index.js",
5
5
  "type": "commonjs",
6
6
  "description": "Hierarchical AI Conversation Orchestrator - Task hierarchy with conversation contexts",