saico 2.2.0 → 2.2.2

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 (3) hide show
  1. package/context.js +4 -3
  2. package/package.json +1 -1
  3. package/sid.js +6 -0
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.2",
4
4
  "main": "index.js",
5
5
  "type": "commonjs",
6
6
  "description": "Hierarchical AI Conversation Orchestrator - Task hierarchy with conversation contexts",
package/sid.js CHANGED
@@ -38,6 +38,8 @@ class Sid extends Itask {
38
38
  token_limit: opt.token_limit,
39
39
  max_depth: opt.max_depth,
40
40
  max_tool_repetition: opt.max_tool_repetition,
41
+ queue_limit: opt.queue_limit,
42
+ min_chat_messages: opt.min_chat_messages,
41
43
  ...opt.sessionConfig
42
44
  };
43
45
 
@@ -53,6 +55,8 @@ class Sid extends Itask {
53
55
  token_limit: this.sessionConfig.token_limit,
54
56
  max_depth: this.sessionConfig.max_depth,
55
57
  max_tool_repetition: this.sessionConfig.max_tool_repetition,
58
+ queue_limit: this.sessionConfig.queue_limit,
59
+ min_chat_messages: this.sessionConfig.min_chat_messages,
56
60
  tool_handler: opt.tool_handler,
57
61
  functions: opt.functions,
58
62
  sequential_mode: opt.sequential_mode,
@@ -162,6 +166,8 @@ class Sid extends Itask {
162
166
  token_limit: opt.token_limit || this.sessionConfig.token_limit,
163
167
  max_depth: opt.max_depth || this.sessionConfig.max_depth,
164
168
  max_tool_repetition: opt.max_tool_repetition || this.sessionConfig.max_tool_repetition,
169
+ queue_limit: opt.queue_limit ?? this.sessionConfig.queue_limit,
170
+ min_chat_messages: opt.min_chat_messages ?? this.sessionConfig.min_chat_messages,
165
171
  tool_handler: opt.tool_handler || this.tool_handler,
166
172
  functions: opt.functions || this.functions
167
173
  });