openloops 0.3.3 → 0.3.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.
@@ -29,14 +29,12 @@ export declare class AgentState {
29
29
  stopRequested?: boolean | undefined;
30
30
  currentActivity?: CurrentActivity | undefined;
31
31
  private activityListener?;
32
- private activityFromModel;
33
32
  static fromJSON(props?: AgentStateProps): AgentState;
34
33
  constructor(status?: AgentStatus | undefined, language?: string | undefined, lastError?: AgentError | undefined, activeTaskId?: string | undefined, stopRequested?: boolean | undefined, currentActivity?: CurrentActivity | undefined);
35
34
  toJSON(): AgentStateProps;
36
35
  setLanguage(language?: string): void;
37
36
  onActivityChange(listener?: ActivityListener): void;
38
- get hasModelActivity(): boolean;
39
- setCurrentActivity(currentActivity: CurrentActivity, source?: 'system' | 'model'): void;
37
+ setCurrentActivity(currentActivity: CurrentActivity): void;
40
38
  setStatus(status: AgentStatus): void;
41
39
  setActiveTaskId(taskId?: string): void;
42
40
  setLastError(lastError?: AgentError): void;
@@ -46,7 +46,6 @@ class AgentState {
46
46
  stopRequested;
47
47
  currentActivity;
48
48
  activityListener;
49
- activityFromModel = false;
50
49
  static fromJSON(props = {}) {
51
50
  return new AgentState(
52
51
  props.status,
@@ -71,13 +70,9 @@ class AgentState {
71
70
  onActivityChange(listener) {
72
71
  this.activityListener = listener;
73
72
  }
74
- get hasModelActivity() {
75
- return this.activityFromModel;
76
- }
77
- setCurrentActivity(currentActivity, source = "system") {
73
+ setCurrentActivity(currentActivity) {
78
74
  const changed = this.currentActivity !== currentActivity;
79
75
  this.currentActivity = currentActivity;
80
- this.activityFromModel = source === "model";
81
76
  if (changed) this.activityListener?.(currentActivity);
82
77
  }
83
78
  setStatus(status) {
@@ -23,7 +23,6 @@ class AgentState {
23
23
  stopRequested;
24
24
  currentActivity;
25
25
  activityListener;
26
- activityFromModel = false;
27
26
  static fromJSON(props = {}) {
28
27
  return new AgentState(
29
28
  props.status,
@@ -48,13 +47,9 @@ class AgentState {
48
47
  onActivityChange(listener) {
49
48
  this.activityListener = listener;
50
49
  }
51
- get hasModelActivity() {
52
- return this.activityFromModel;
53
- }
54
- setCurrentActivity(currentActivity, source = "system") {
50
+ setCurrentActivity(currentActivity) {
55
51
  const changed = this.currentActivity !== currentActivity;
56
52
  this.currentActivity = currentActivity;
57
- this.activityFromModel = source === "model";
58
53
  if (changed) this.activityListener?.(currentActivity);
59
54
  }
60
55
  setStatus(status) {
@@ -263,7 +263,6 @@ class Agent {
263
263
  if (this.chatOptions?.loopName) this.currentChat.settings?.setLoopName(this.chatOptions.loopName);
264
264
  this.awaitingConfirmation = this.currentChat.state?.status === import_agent_state.AgentStatus.AWAITING_USER_CONFIRMATION;
265
265
  this.currentChat.state?.setStatus(import_agent_state.AgentStatus.PROCESSING);
266
- this.currentChat.state?.setCurrentActivity("Starting...");
267
266
  await this.persist({ resetStop: true });
268
267
  if (!await this.runInputGuards(userMessage)) return false;
269
268
  for (const hook of this._preHooks) {
@@ -306,7 +305,6 @@ Ref: ${guard.ref}`, { source: "harness", excludeFromContext: true });
306
305
  }
307
306
  async finishBlocked() {
308
307
  this.currentChat.state?.setStatus(this.awaitingConfirmation ? import_agent_state.AgentStatus.AWAITING_USER_CONFIRMATION : import_agent_state.AgentStatus.IDLE);
309
- this.currentChat.state?.setCurrentActivity("stopped");
310
308
  await this.persist();
311
309
  await this.disconnectMcpServers();
312
310
  }
@@ -372,14 +370,12 @@ Ref: ${guard.ref}`, { source: "harness", excludeFromContext: true });
372
370
  for (const hook of this._postHooks) {
373
371
  await hook();
374
372
  }
375
- this.currentChat.state?.setCurrentActivity("stopped");
376
373
  await this.persist();
377
374
  await this.disconnectMcpServers();
378
375
  }
379
376
  async failRun(message, llmError) {
380
377
  try {
381
378
  this.currentChat.state?.setStatus(import_agent_state.AgentStatus.FAILED);
382
- this.currentChat.state?.setCurrentActivity("stopped");
383
379
  this.currentChat.state?.setLastError({ code: llmError?.code ?? AGENT_ERROR_CODES.RUN_FAILED, message, isRetryable: llmError?.isRetryable ?? true, timestamp: /* @__PURE__ */ new Date() });
384
380
  this.currentChat.addTrace({ node: "agent", kind: "agent", reasoning: `Run failed: ${message}` });
385
381
  this.currentChat.failTask();
@@ -248,7 +248,6 @@ class Agent {
248
248
  if (this.chatOptions?.loopName) this.currentChat.settings?.setLoopName(this.chatOptions.loopName);
249
249
  this.awaitingConfirmation = this.currentChat.state?.status === AgentStatus.AWAITING_USER_CONFIRMATION;
250
250
  this.currentChat.state?.setStatus(AgentStatus.PROCESSING);
251
- this.currentChat.state?.setCurrentActivity("Starting...");
252
251
  await this.persist({ resetStop: true });
253
252
  if (!await this.runInputGuards(userMessage)) return false;
254
253
  for (const hook of this._preHooks) {
@@ -291,7 +290,6 @@ Ref: ${guard.ref}`, { source: "harness", excludeFromContext: true });
291
290
  }
292
291
  async finishBlocked() {
293
292
  this.currentChat.state?.setStatus(this.awaitingConfirmation ? AgentStatus.AWAITING_USER_CONFIRMATION : AgentStatus.IDLE);
294
- this.currentChat.state?.setCurrentActivity("stopped");
295
293
  await this.persist();
296
294
  await this.disconnectMcpServers();
297
295
  }
@@ -357,14 +355,12 @@ Ref: ${guard.ref}`, { source: "harness", excludeFromContext: true });
357
355
  for (const hook of this._postHooks) {
358
356
  await hook();
359
357
  }
360
- this.currentChat.state?.setCurrentActivity("stopped");
361
358
  await this.persist();
362
359
  await this.disconnectMcpServers();
363
360
  }
364
361
  async failRun(message, llmError) {
365
362
  try {
366
363
  this.currentChat.state?.setStatus(AgentStatus.FAILED);
367
- this.currentChat.state?.setCurrentActivity("stopped");
368
364
  this.currentChat.state?.setLastError({ code: llmError?.code ?? AGENT_ERROR_CODES.RUN_FAILED, message, isRetryable: llmError?.isRetryable ?? true, timestamp: /* @__PURE__ */ new Date() });
369
365
  this.currentChat.addTrace({ node: "agent", kind: "agent", reasoning: `Run failed: ${message}` });
370
366
  this.currentChat.failTask();
@@ -50,7 +50,7 @@ class AgiLoop extends import_harness.AgentLoop {
50
50
  return "agi";
51
51
  }
52
52
  get version() {
53
- return "1.8.1";
53
+ return "1.8.4";
54
54
  }
55
55
  get author() {
56
56
  return {
@@ -72,7 +72,6 @@ class AgiLoop extends import_harness.AgentLoop {
72
72
  harness.setNextNode(this.nodes.reasoning_engine);
73
73
  return;
74
74
  }
75
- ctx.chat.state?.setCurrentActivity("Analyzing requirement...");
76
75
  const chat_history = ctx.chat.lastHistoryMessages();
77
76
  const agentIdentity = ctx.identity;
78
77
  const result = await import_skills.fastResponder.run({
@@ -85,7 +84,7 @@ class AgiLoop extends import_harness.AgentLoop {
85
84
  ctx.chat.state?.setLanguage(result.detected_language);
86
85
  if (!result.can_answer) {
87
86
  const activity = (0, import_activity.cleanActivity)(result.activity);
88
- if (activity) ctx.chat.state?.setCurrentActivity(activity, "model");
87
+ if (activity) ctx.chat.state?.setCurrentActivity(activity);
89
88
  harness.setNextNode(this.nodes.reasoning_engine);
90
89
  } else {
91
90
  ctx.chat.state?.setStatus(import_harness.AgentStatus.IDLE);
@@ -94,7 +93,6 @@ class AgiLoop extends import_harness.AgentLoop {
94
93
  }
95
94
  }
96
95
  async reasoningEngine(ctx, harness) {
97
- if (!ctx.chat.state?.hasModelActivity) ctx.chat.state?.setCurrentActivity("Thinking...");
98
96
  const task = ctx.task ?? ctx.chat.createTask(ctx.currentMessage);
99
97
  task.answerQuestion(ctx.currentMessage);
100
98
  const streak = task.sameToolStreak;
@@ -128,7 +126,7 @@ class AgiLoop extends import_harness.AgentLoop {
128
126
  if (/^[a-z]{2}$/.test(language)) ctx.chat.state?.setLanguage(language);
129
127
  const { rawText, ...callInfo } = result.callInfo;
130
128
  const activity = (0, import_activity.cleanActivity)(result.activity);
131
- if (activity) ctx.chat.state?.setCurrentActivity(activity, "model");
129
+ if (activity) ctx.chat.state?.setCurrentActivity(activity);
132
130
  task.addTurn({ ...result, activity }, {
133
131
  author: "reasoning_engine",
134
132
  declaredTools: catalog.tools.map((tool) => tool.name),
@@ -153,7 +151,6 @@ class AgiLoop extends import_harness.AgentLoop {
153
151
  const blocked = ready.filter((action) => harness.requiresApproval(action));
154
152
  const runnable = ready.filter((action) => !blocked.includes(action));
155
153
  if (runnable.length) {
156
- if (!ctx.chat.state?.hasModelActivity) ctx.chat.state?.setCurrentActivity(`Running ${runnable.map((action) => action.name).join(", ")}...`);
157
154
  await Promise.all(runnable.map((action) => harness.runAction(action, { blockDuplicates: BLOCK_DUPLICATES })));
158
155
  }
159
156
  if (blocked.length) {
@@ -28,7 +28,7 @@ class AgiLoop extends AgentLoop {
28
28
  return "agi";
29
29
  }
30
30
  get version() {
31
- return "1.8.1";
31
+ return "1.8.4";
32
32
  }
33
33
  get author() {
34
34
  return {
@@ -50,7 +50,6 @@ class AgiLoop extends AgentLoop {
50
50
  harness.setNextNode(this.nodes.reasoning_engine);
51
51
  return;
52
52
  }
53
- ctx.chat.state?.setCurrentActivity("Analyzing requirement...");
54
53
  const chat_history = ctx.chat.lastHistoryMessages();
55
54
  const agentIdentity = ctx.identity;
56
55
  const result = await fastResponder.run({
@@ -63,7 +62,7 @@ class AgiLoop extends AgentLoop {
63
62
  ctx.chat.state?.setLanguage(result.detected_language);
64
63
  if (!result.can_answer) {
65
64
  const activity = cleanActivity(result.activity);
66
- if (activity) ctx.chat.state?.setCurrentActivity(activity, "model");
65
+ if (activity) ctx.chat.state?.setCurrentActivity(activity);
67
66
  harness.setNextNode(this.nodes.reasoning_engine);
68
67
  } else {
69
68
  ctx.chat.state?.setStatus(AgentStatus.IDLE);
@@ -72,7 +71,6 @@ class AgiLoop extends AgentLoop {
72
71
  }
73
72
  }
74
73
  async reasoningEngine(ctx, harness) {
75
- if (!ctx.chat.state?.hasModelActivity) ctx.chat.state?.setCurrentActivity("Thinking...");
76
74
  const task = ctx.task ?? ctx.chat.createTask(ctx.currentMessage);
77
75
  task.answerQuestion(ctx.currentMessage);
78
76
  const streak = task.sameToolStreak;
@@ -106,7 +104,7 @@ class AgiLoop extends AgentLoop {
106
104
  if (/^[a-z]{2}$/.test(language)) ctx.chat.state?.setLanguage(language);
107
105
  const { rawText, ...callInfo } = result.callInfo;
108
106
  const activity = cleanActivity(result.activity);
109
- if (activity) ctx.chat.state?.setCurrentActivity(activity, "model");
107
+ if (activity) ctx.chat.state?.setCurrentActivity(activity);
110
108
  task.addTurn({ ...result, activity }, {
111
109
  author: "reasoning_engine",
112
110
  declaredTools: catalog.tools.map((tool) => tool.name),
@@ -131,7 +129,6 @@ class AgiLoop extends AgentLoop {
131
129
  const blocked = ready.filter((action) => harness.requiresApproval(action));
132
130
  const runnable = ready.filter((action) => !blocked.includes(action));
133
131
  if (runnable.length) {
134
- if (!ctx.chat.state?.hasModelActivity) ctx.chat.state?.setCurrentActivity(`Running ${runnable.map((action) => action.name).join(", ")}...`);
135
132
  await Promise.all(runnable.map((action) => harness.runAction(action, { blockDuplicates: BLOCK_DUPLICATES })));
136
133
  }
137
134
  if (blocked.length) {
@@ -25,7 +25,7 @@ var import_skill = require("../../../skills/skill.js");
25
25
  var import_shared_rules = require("../../../skills/shared/shared-rules.js");
26
26
  const reasoningEngine = new import_skill.Skill({
27
27
  name: "reasoning_engine",
28
- version: "2.5.0",
28
+ version: "2.5.2",
29
29
  description: "Continuous reasoning cycle of the agent: reads the situation or the results of its last actions, rewrites its working state and decides the next actions, including the final answer.",
30
30
  temperature: 0.3,
31
31
  systemRole: true,
@@ -34,12 +34,12 @@ const reasoningEngine = new import_skill.Skill({
34
34
  goal: "Fulfil the user's request (INPUT.user_message) by working in cycles: think, act, observe and continue from where you left off, until you can give a final answer with the respond action.",
35
35
  role: "You are the mind of an autonomous agent. The agent has a body, the runtime that hosts you (the harness), and you are what thinks and decides. Your body gives you hands, eyes, ears, a voice and a memory: it runs the actions you ask for, shows you their results as OBSERVATIONS, keeps your working state between cycles and delivers your answers to the user. You never execute anything yourself; everything you want to do in the world is an action that your body performs for you. Some of your tools are part of your body: search_tools (your eyes, to find external tools, present in your tool list only when the catalog is too large to list), read_context and save_context (a desk where you keep and reread data), ask_user (to pause and ask the person something) and respond (your voice, to give the final answer). Other tools are instruments of the outside world, such as apps, APIs and MCP servers, and their names carry the server as a prefix, like 'server__tool'; that prefix is part of the name and is always written. You work in cycles. In each cycle you receive the situation (the user's request the first time, then the results of your last actions), you think, you rewrite your state and you answer with your next actions. You never lose the thread: your previous reasoning and state come back to you in every cycle, so you continue from where you left off instead of starting over.",
36
36
  logic_rules: [
37
- "OUTPUT_FORMAT: Every response is a single JSON object with the fields 'reasoning', 'language', 'state' and 'actions' (never empty), and optionally 'learned'. Nothing outside that JSON.",
37
+ "OUTPUT_FORMAT: Every response is a single JSON object with the fields 'reasoning', 'language', 'state', 'actions' (never empty) and 'activity' (see ACTIVITY), and optionally 'learned'. Nothing outside that JSON.",
38
38
  "REASONING: Explain in a few sentences why you decide these actions now: what you learned from the last results, what is missing, and why these actions move you forward. It is kept for audit and debugging.",
39
39
  "STATE: Your state is your working memory and the harness returns it to you in the next cycle. Rewrite it completely in every response, carrying forward what still matters. Use these keys, each a short text: 'objective' (what the user wants, in your own words), 'progress' (what is done and learned so far, citing refs), 'tried' (what you attempted that failed or gave nothing, so you never repeat it), 'expecting' (what you expect these actions to return) and 'next' (what you will do once you have it).",
40
40
  `LEARNED: 'learned' is an optional list of {"key": "...", "value": "..."} with the facts you will need in later cycles and must not lose: entities with their exact identifiers (for example the customer or document the user chose, and its id), schemas of tools you will call, and decisions of the user. Add only what is new. The harness keeps it and returns all of it in HARNESS.known in every cycle, so you do not need to copy it into the state. Before an action that targets an entity, use the one in HARNESS.known, and never replace it with a different one unless the user asks. Before calling a tool, take its argument names from HARNESS.schemas when it is listed there.`,
41
41
  `ACTIONS: 'actions' is a list of objects like {"tool": "<exact tool name>", "arguments": {...}}. The tool must be one of the names in your tool list. Copy the name character by character, including the server prefix of external tools (like 'server__tool'), which is part of the name. The only thing you may drop is a leading 'functions.'. The arguments must match its schema. You cannot call tools natively: you only ask for them through actions. Independent actions in the same response run in parallel; dependent ones go in later responses. Never invent tool names or arguments.`,
42
- "ACTIVITY: 'activity' is optional. It is shown to the user while the actions you ask for run and while you think about their results, until your next response. Write one short sentence, around ten words, in the language of the conversation (the same as 'language'), in plain words that say what you are doing and what you will do with the results, for example 'Buscando tus gastos de vuelos de agosto' or 'Sumando los cargos para darte el total'. Never mention tool names, ids, refs or technical terms, never include amounts or personal data, and do not promise a result. Leave it out when your actions only deliver the final answer.",
42
+ "ACTIVITY: Always write 'activity'. It is shown to the user while the actions you ask for run and while you think about their results, until your next response. Write one short sentence of at most 60 characters: a verb in the progressive form followed by what is being looked up or done, taken from the user's request. It must be in the language of 'language' and of the message of the user, never in the language of these instructions. Never mention tool names, ids, refs or technical terms, never include amounts or personal data, and do not promise a result. The only exception is when your actions just deliver the final answer: then leave it out.",
43
43
  "NEVER_EMPTY: 'actions' always has at least one action. 'reasoning' and 'state' are never shown to the user, so writing there that you will answer or summarize delivers nothing. As soon as you have what you need, your action is 'respond' with the complete final answer, written in that same response.",
44
44
  `LOOP: After your actions run, the next message you receive is {"OBSERVATIONS": [...]} with one entry per action (ref, tool, status, output or error). Continue from there. You finish the task only with a 'respond' action, which delivers your final answer; use it alone or with actions whose results you no longer need.`,
45
45
  "HARNESS_NOTICES: A message may contain a 'HARNESS' key with notices from your body, such as the remaining budget, a warning, a stop reason, 'known' (the facts kept for you, including the answers of the user) or 'schemas' (the arguments of the tools you have already seen). Obey them.",
@@ -3,7 +3,7 @@ import { Skill } from "../../../skills/skill.js";
3
3
  import { FORMATTING, LATEX_FORMATTING, CITATION_FORMATTING } from "../../../skills/shared/shared-rules.js";
4
4
  const reasoningEngine = new Skill({
5
5
  name: "reasoning_engine",
6
- version: "2.5.0",
6
+ version: "2.5.2",
7
7
  description: "Continuous reasoning cycle of the agent: reads the situation or the results of its last actions, rewrites its working state and decides the next actions, including the final answer.",
8
8
  temperature: 0.3,
9
9
  systemRole: true,
@@ -12,12 +12,12 @@ const reasoningEngine = new Skill({
12
12
  goal: "Fulfil the user's request (INPUT.user_message) by working in cycles: think, act, observe and continue from where you left off, until you can give a final answer with the respond action.",
13
13
  role: "You are the mind of an autonomous agent. The agent has a body, the runtime that hosts you (the harness), and you are what thinks and decides. Your body gives you hands, eyes, ears, a voice and a memory: it runs the actions you ask for, shows you their results as OBSERVATIONS, keeps your working state between cycles and delivers your answers to the user. You never execute anything yourself; everything you want to do in the world is an action that your body performs for you. Some of your tools are part of your body: search_tools (your eyes, to find external tools, present in your tool list only when the catalog is too large to list), read_context and save_context (a desk where you keep and reread data), ask_user (to pause and ask the person something) and respond (your voice, to give the final answer). Other tools are instruments of the outside world, such as apps, APIs and MCP servers, and their names carry the server as a prefix, like 'server__tool'; that prefix is part of the name and is always written. You work in cycles. In each cycle you receive the situation (the user's request the first time, then the results of your last actions), you think, you rewrite your state and you answer with your next actions. You never lose the thread: your previous reasoning and state come back to you in every cycle, so you continue from where you left off instead of starting over.",
14
14
  logic_rules: [
15
- "OUTPUT_FORMAT: Every response is a single JSON object with the fields 'reasoning', 'language', 'state' and 'actions' (never empty), and optionally 'learned'. Nothing outside that JSON.",
15
+ "OUTPUT_FORMAT: Every response is a single JSON object with the fields 'reasoning', 'language', 'state', 'actions' (never empty) and 'activity' (see ACTIVITY), and optionally 'learned'. Nothing outside that JSON.",
16
16
  "REASONING: Explain in a few sentences why you decide these actions now: what you learned from the last results, what is missing, and why these actions move you forward. It is kept for audit and debugging.",
17
17
  "STATE: Your state is your working memory and the harness returns it to you in the next cycle. Rewrite it completely in every response, carrying forward what still matters. Use these keys, each a short text: 'objective' (what the user wants, in your own words), 'progress' (what is done and learned so far, citing refs), 'tried' (what you attempted that failed or gave nothing, so you never repeat it), 'expecting' (what you expect these actions to return) and 'next' (what you will do once you have it).",
18
18
  `LEARNED: 'learned' is an optional list of {"key": "...", "value": "..."} with the facts you will need in later cycles and must not lose: entities with their exact identifiers (for example the customer or document the user chose, and its id), schemas of tools you will call, and decisions of the user. Add only what is new. The harness keeps it and returns all of it in HARNESS.known in every cycle, so you do not need to copy it into the state. Before an action that targets an entity, use the one in HARNESS.known, and never replace it with a different one unless the user asks. Before calling a tool, take its argument names from HARNESS.schemas when it is listed there.`,
19
19
  `ACTIONS: 'actions' is a list of objects like {"tool": "<exact tool name>", "arguments": {...}}. The tool must be one of the names in your tool list. Copy the name character by character, including the server prefix of external tools (like 'server__tool'), which is part of the name. The only thing you may drop is a leading 'functions.'. The arguments must match its schema. You cannot call tools natively: you only ask for them through actions. Independent actions in the same response run in parallel; dependent ones go in later responses. Never invent tool names or arguments.`,
20
- "ACTIVITY: 'activity' is optional. It is shown to the user while the actions you ask for run and while you think about their results, until your next response. Write one short sentence, around ten words, in the language of the conversation (the same as 'language'), in plain words that say what you are doing and what you will do with the results, for example 'Buscando tus gastos de vuelos de agosto' or 'Sumando los cargos para darte el total'. Never mention tool names, ids, refs or technical terms, never include amounts or personal data, and do not promise a result. Leave it out when your actions only deliver the final answer.",
20
+ "ACTIVITY: Always write 'activity'. It is shown to the user while the actions you ask for run and while you think about their results, until your next response. Write one short sentence of at most 60 characters: a verb in the progressive form followed by what is being looked up or done, taken from the user's request. It must be in the language of 'language' and of the message of the user, never in the language of these instructions. Never mention tool names, ids, refs or technical terms, never include amounts or personal data, and do not promise a result. The only exception is when your actions just deliver the final answer: then leave it out.",
21
21
  "NEVER_EMPTY: 'actions' always has at least one action. 'reasoning' and 'state' are never shown to the user, so writing there that you will answer or summarize delivers nothing. As soon as you have what you need, your action is 'respond' with the complete final answer, written in that same response.",
22
22
  `LOOP: After your actions run, the next message you receive is {"OBSERVATIONS": [...]} with one entry per action (ref, tool, status, output or error). Continue from there. You finish the task only with a 'respond' action, which delivers your final answer; use it alone or with actions whose results you no longer need.`,
23
23
  "HARNESS_NOTICES: A message may contain a 'HARNESS' key with notices from your body, such as the remaining budget, a warning, a stop reason, 'known' (the facts kept for you, including the answers of the user) or 'schemas' (the arguments of the tools you have already seen). Obey them.",
@@ -25,7 +25,7 @@ var import_skill = require("../../../skills/skill.js");
25
25
  var import_shared_rules = require("../../../skills/shared/shared-rules.js");
26
26
  const fastResponder = new import_skill.Skill({
27
27
  name: "fast_responder",
28
- version: "2.4.0",
28
+ version: "2.4.2",
29
29
  description: "Handles general conversations and multipurpose user assistance.",
30
30
  temperature: 0.7,
31
31
  thinking: "low",
@@ -42,7 +42,7 @@ const fastResponder = new import_skill.Skill({
42
42
  "LANGUAGE_DETECTION: Identify the language of the CURRENT user message in INPUT.user_message, or follow any explicit request to answer in a specific language (e.g., 'responde en espa\xF1ol', 'reply in English'). Base this decision ONLY on the actual text the user just typed. CONTEXT.user_details.preferred_language reflects the app's configured display language, NOT what the user is typing right now \u2014 it MUST NEVER influence this detection, even when it disagrees with the message's actual language. Always generate the 'answer' field in that detected or requested language, and set 'detected_language' in the output to its 2-letter ISO 639-1 code (e.g., 'es', 'en', 'fr').",
43
43
  "MEMORY_AND_PERSONAL_DATA_CHECK: Do NOT assume, pretend, or hallucinate remembering past events, meetings, notes, or specific user context. If the user asks about something mentioned in the past (e.g., 'recuerdas la reuni\xF3n...?', 'qu\xE9 te dije de...?'), set 'can_answer' to false UNLESS the exact details are explicitly provided inside 'context_injection'. Never fake memory.",
44
44
  "CAPABILITY_CHECK: Set 'can_answer' to false if: 1) The query involves creating, registering, updating, or deleting data or non-text resources (e.g., expenses, records, reminders, calendar entries), 2) The query refers to personal memory, past events, meetings, or stored notes not present in 'context_injection', 3) The query requires specialized skills or tools (e.g., searching databases, calendar lookup, external integrations), 4) The query requires live internet access (news, weather, live data), 5) The query is a correction, rejection, or negative feedback regarding a previously executed task or tool response (e.g., 'no era esa fecha', 'te equivocaste', 'busca otra opci\xF3n', 'eso no sirvi\xF3'). When 'can_answer' is false, leave 'answer' minimal or empty for the fallback engine.",
45
- "ACTIVITY: When 'can_answer' is false, write in 'activity' one short sentence, around ten words, in 'detected_language', in plain words that say what you are going to do to help the user, for example 'Voy a buscar tus gastos de vuelos de agosto'. Never mention tool names or technical terms, never include amounts or personal data, and do not promise a result. Leave it empty when 'can_answer' is true.",
45
+ "ACTIVITY: When 'can_answer' is false, always write in 'activity' one short sentence of at most 60 characters: a verb in the present or progressive form followed by what you will look up or do, taken from the user's request. It must be in 'detected_language' and match the language of the message of the user, never the language of these instructions. Never mention tool names or technical terms, never include amounts or personal data, and do not promise a result. Leave it empty when 'can_answer' is true.",
46
46
  "REASONING: Always generate the 'reasoning' field with a short explanation in English of the decision-making process, regardless of whether 'can_answer' is true or false.",
47
47
  import_shared_rules.FORMATTING,
48
48
  import_shared_rules.LATEX_FORMATTING,
@@ -3,7 +3,7 @@ import { Skill } from "../../../skills/skill.js";
3
3
  import { FORMATTING, LATEX_FORMATTING, CITATION_FORMATTING, POLICY_RESTRICTIONS } from "../../../skills/shared/shared-rules.js";
4
4
  const fastResponder = new Skill({
5
5
  name: "fast_responder",
6
- version: "2.4.0",
6
+ version: "2.4.2",
7
7
  description: "Handles general conversations and multipurpose user assistance.",
8
8
  temperature: 0.7,
9
9
  thinking: "low",
@@ -20,7 +20,7 @@ const fastResponder = new Skill({
20
20
  "LANGUAGE_DETECTION: Identify the language of the CURRENT user message in INPUT.user_message, or follow any explicit request to answer in a specific language (e.g., 'responde en espa\xF1ol', 'reply in English'). Base this decision ONLY on the actual text the user just typed. CONTEXT.user_details.preferred_language reflects the app's configured display language, NOT what the user is typing right now \u2014 it MUST NEVER influence this detection, even when it disagrees with the message's actual language. Always generate the 'answer' field in that detected or requested language, and set 'detected_language' in the output to its 2-letter ISO 639-1 code (e.g., 'es', 'en', 'fr').",
21
21
  "MEMORY_AND_PERSONAL_DATA_CHECK: Do NOT assume, pretend, or hallucinate remembering past events, meetings, notes, or specific user context. If the user asks about something mentioned in the past (e.g., 'recuerdas la reuni\xF3n...?', 'qu\xE9 te dije de...?'), set 'can_answer' to false UNLESS the exact details are explicitly provided inside 'context_injection'. Never fake memory.",
22
22
  "CAPABILITY_CHECK: Set 'can_answer' to false if: 1) The query involves creating, registering, updating, or deleting data or non-text resources (e.g., expenses, records, reminders, calendar entries), 2) The query refers to personal memory, past events, meetings, or stored notes not present in 'context_injection', 3) The query requires specialized skills or tools (e.g., searching databases, calendar lookup, external integrations), 4) The query requires live internet access (news, weather, live data), 5) The query is a correction, rejection, or negative feedback regarding a previously executed task or tool response (e.g., 'no era esa fecha', 'te equivocaste', 'busca otra opci\xF3n', 'eso no sirvi\xF3'). When 'can_answer' is false, leave 'answer' minimal or empty for the fallback engine.",
23
- "ACTIVITY: When 'can_answer' is false, write in 'activity' one short sentence, around ten words, in 'detected_language', in plain words that say what you are going to do to help the user, for example 'Voy a buscar tus gastos de vuelos de agosto'. Never mention tool names or technical terms, never include amounts or personal data, and do not promise a result. Leave it empty when 'can_answer' is true.",
23
+ "ACTIVITY: When 'can_answer' is false, always write in 'activity' one short sentence of at most 60 characters: a verb in the present or progressive form followed by what you will look up or do, taken from the user's request. It must be in 'detected_language' and match the language of the message of the user, never the language of these instructions. Never mention tool names or technical terms, never include amounts or personal data, and do not promise a result. Leave it empty when 'can_answer' is true.",
24
24
  "REASONING: Always generate the 'reasoning' field with a short explanation in English of the decision-making process, regardless of whether 'can_answer' is true or false.",
25
25
  FORMATTING,
26
26
  LATEX_FORMATTING,
package/docs/agent.md CHANGED
@@ -198,7 +198,7 @@ await agent.run({ input: { chatId, message }, currentUser })
198
198
  stop()
199
199
  ```
200
200
 
201
- The listener receives every change of the activity of the run while it is in progress, and a last `stopped` when the run ends. This is the only place where the real activity is available: since 0.3.0 it is not saved with the chat, and `state.currentActivity` is deprecated (see [chats](chats.md#statecurrentactivity-is-deprecated)). It does not receive a value that repeats the previous one. With `AgiLoop` the value is a short sentence written by the model in the language of the conversation, such as `Buscando tus gastos de vuelos de agosto`, shown from the answer that asked for the actions until the next answer. When the model gives none, the generic ones appear: `Starting...`, `Analyzing requirement...`, `Thinking...` or `Running search...`. See [loops](loops.md#agiloop).
201
+ The listener receives every change of the activity of the run while it is in progress. It gets no start or end marker: the run is over when `agent.run()` resolves. This is the only place where the real activity is available: since 0.3.0 it is not saved with the chat, and `state.currentActivity` is deprecated (see [chats](chats.md#statecurrentactivity-is-deprecated)). It does not receive a value that repeats the previous one. With `AgiLoop` the value is a short sentence written by the model in the language of the conversation, such as `Buscando tus gastos de vuelos de agosto`, shown from the answer that asked for the actions until the next answer. When the model gives none, the listener hears nothing and the client keeps what it shows. See [loops](loops.md#agiloop).
202
202
 
203
203
  - The listener belongs to that `Agent` instance and to the chat of its current run. Nothing is shared between instances, so concurrent runs in the same process, even of different users, never hear each other. As always, create one `Agent` per run and do not share it between concurrent requests.
204
204
  - It is called synchronously from the loop, so keep it fast and do not await inside it. An error thrown by a listener is logged and ignored, the run goes on and the other listeners still run.
package/docs/loops.md CHANGED
@@ -17,7 +17,7 @@ import { AgiLoop } from 'openloops/loops'
17
17
  | `reasoning_engine` | Reads the situation or the results of the last actions, rewrites its working state, decides the next actions, reports the language of the conversation and says in one sentence what is happening until its next answer. |
18
18
  | `action_engine` | Runs the actions the reasoning engine asked for, asks the user for confirmation when needed, delivers the final answer. |
19
19
 
20
- The sentences of both nodes are what [`agent.onActivity`](agent.md#activity-updates) tells, written in the language of the conversation, so a client can show what the agent is doing instead of a generic `Thinking...`. They are optional: when a node leaves it out or writes something unusable (not a text, empty, `running`, `stopped`), the loop keeps the last one the model gave, also when the answer of a turn is not valid and the model has to try again, and it shows the generic activity of that moment (`Thinking...`, `Running search...`) only while there is none. The text is cleaned of markup and line breaks and cut at 80 characters, and each one is kept in the turn that produced it (`turns[].activity`) to audit what the user saw.
20
+ The sentences of both nodes are what [`agent.onActivity`](agent.md#activity-updates) tells, written in the language of the conversation, so a client can show what the agent is doing. The loop never invents one: when a node leaves it out or writes something unusable (not a text, empty, `running`, `stopped`), the listener hears nothing and the last one the model gave stays, also when the answer of a turn is not valid and the model has to try again. The text is cleaned of markup and line breaks and cut at 80 characters, and each one is kept in the turn that produced it (`turns[].activity`) to audit what the user saw.
21
21
 
22
22
  The loop works within a budget per task (20 reasoning turns and 40 tool calls) and stops with an honest answer when the model repeats itself, keeps only reading notes, or runs out of budget. It also rejects final answers that cite identifiers that never appeared in a result or in the user's words.
23
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openloops",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "Open source harness for AI agents: a TypeScript runtime with persistence, tools, MCP trust, approvals and autonomous jobs, where the loop is pluggable",
5
5
  "author": {
6
6
  "name": "Jose Barcos",