@n8n/agents 0.17.2 → 0.18.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 (80) hide show
  1. package/dist/build.tsbuildinfo +1 -1
  2. package/dist/index.d.ts +5 -2
  3. package/dist/index.js +6 -4
  4. package/dist/index.js.map +1 -1
  5. package/dist/integrations/langsmith.js +1 -1
  6. package/dist/integrations/langsmith.js.map +1 -1
  7. package/dist/runtime/loop/agent-runtime.d.ts +2 -1
  8. package/dist/runtime/loop/agent-runtime.js +10 -0
  9. package/dist/runtime/loop/agent-runtime.js.map +1 -1
  10. package/dist/runtime/loop/runtime-helpers.d.ts +2 -1
  11. package/dist/runtime/loop/runtime-helpers.js +11 -0
  12. package/dist/runtime/loop/runtime-helpers.js.map +1 -1
  13. package/dist/runtime/mcp/mcp-connection.js +2 -0
  14. package/dist/runtime/mcp/mcp-connection.js.map +1 -1
  15. package/dist/runtime/memory/episodic-memory.js +3 -2
  16. package/dist/runtime/memory/episodic-memory.js.map +1 -1
  17. package/dist/runtime/memory/observation-log-defaults.d.ts +2 -2
  18. package/dist/runtime/memory/observation-log-defaults.js +14 -1
  19. package/dist/runtime/memory/observation-log-defaults.js.map +1 -1
  20. package/dist/runtime/memory/observation-log-observer.js +8 -13
  21. package/dist/runtime/memory/observation-log-observer.js.map +1 -1
  22. package/dist/runtime/memory/observation-log-reflector.js +6 -1
  23. package/dist/runtime/memory/observation-log-reflector.js.map +1 -1
  24. package/dist/runtime/model/message-list.d.ts +2 -1
  25. package/dist/runtime/model/message-list.js +7 -3
  26. package/dist/runtime/model/message-list.js.map +1 -1
  27. package/dist/runtime/model/provider-quirks.js +1 -0
  28. package/dist/runtime/model/provider-quirks.js.map +1 -1
  29. package/dist/runtime/telemetry/runtime-telemetry.d.ts +2 -1
  30. package/dist/runtime/telemetry/runtime-telemetry.js +55 -20
  31. package/dist/runtime/telemetry/runtime-telemetry.js.map +1 -1
  32. package/dist/runtime/telemetry/sub-agent-telemetry.d.ts +2 -0
  33. package/dist/runtime/telemetry/sub-agent-telemetry.js +14 -0
  34. package/dist/runtime/telemetry/sub-agent-telemetry.js.map +1 -0
  35. package/dist/runtime/tools/delegate-sub-agent-tool.d.ts +2 -0
  36. package/dist/runtime/tools/delegate-sub-agent-tool.js +1 -0
  37. package/dist/runtime/tools/delegate-sub-agent-tool.js.map +1 -1
  38. package/dist/runtime/tools/planner-todos-tool.d.ts +6 -0
  39. package/dist/runtime/tools/planner-todos-tool.js +47 -0
  40. package/dist/runtime/tools/planner-todos-tool.js.map +1 -0
  41. package/dist/runtime/tools/todos-core.d.ts +35 -0
  42. package/dist/runtime/tools/todos-core.js +52 -0
  43. package/dist/runtime/tools/todos-core.js.map +1 -0
  44. package/dist/runtime/tools/tool-call-executor.js +2 -2
  45. package/dist/runtime/tools/tool-call-executor.js.map +1 -1
  46. package/dist/runtime/tools/write-todos-tool.js +5 -40
  47. package/dist/runtime/tools/write-todos-tool.js.map +1 -1
  48. package/dist/sdk/agent.d.ts +4 -1
  49. package/dist/sdk/agent.js +18 -2
  50. package/dist/sdk/agent.js.map +1 -1
  51. package/dist/sdk/mcp-client.d.ts +4 -1
  52. package/dist/sdk/mcp-client.js +26 -13
  53. package/dist/sdk/mcp-client.js.map +1 -1
  54. package/dist/skills/index.d.ts +2 -2
  55. package/dist/skills/index.js +1 -3
  56. package/dist/skills/index.js.map +1 -1
  57. package/dist/skills/prompt.d.ts +1 -1
  58. package/dist/skills/prompt.js +2 -3
  59. package/dist/skills/prompt.js.map +1 -1
  60. package/dist/skills/tools.d.ts +0 -1
  61. package/dist/skills/tools.js +4 -101
  62. package/dist/skills/tools.js.map +1 -1
  63. package/dist/skills/types.d.ts +0 -1
  64. package/dist/skills/types.js +1 -2
  65. package/dist/skills/types.js.map +1 -1
  66. package/dist/types/index.d.ts +1 -1
  67. package/dist/types/sdk/agent.d.ts +6 -0
  68. package/dist/types/sdk/mcp.d.ts +5 -0
  69. package/dist/types/sdk/provider.d.ts +1 -0
  70. package/dist/types/telemetry.d.ts +3 -0
  71. package/dist/workspace/sandbox/index.d.ts +1 -1
  72. package/dist/workspace/sandbox/index.js +1 -3
  73. package/dist/workspace/sandbox/index.js.map +1 -1
  74. package/dist/workspace/sandbox/workspace-root.d.ts +0 -2
  75. package/dist/workspace/sandbox/workspace-root.js +0 -11
  76. package/dist/workspace/sandbox/workspace-root.js.map +1 -1
  77. package/package.json +5 -3
  78. package/dist/runtime/json-value.d.ts +0 -2
  79. package/dist/runtime/json-value.js +0 -43
  80. package/dist/runtime/json-value.js.map +0 -1
@@ -7,14 +7,14 @@ export declare const DEFAULT_OBSERVATION_LOG_TAIL_LIMIT = 20;
7
7
  export declare const DEFAULT_OBSERVATION_LOG_REFLECTOR_THRESHOLD_TOKENS = 12000;
8
8
  export declare const DEFAULT_OBSERVATION_LOG_RENDER_TOKEN_BUDGET = 13500;
9
9
  export declare const DEFAULT_OBSERVATION_LOG_LOCK_TTL_MS = 30000;
10
- export declare const DEFAULT_OBSERVATION_LOG_OBSERVER_PROMPT = "You are observing a conversation between a user and an agent. Extract durable observations about what happened, what was decided, what changed, and what needs follow-up. The agent will read your observations on later turns as its memory of this conversation.\n\nYou receive: the current observation log tail (for context, do not restate), the new transcript delta since the last observation, and the current timestamp. The transcript delta contains user text, assistant text, tool calls, and compacted tool results.\n\nOUTPUT FORMAT\n\nEach observation is one bullet, starting with a marker, then a timestamp in (HH:MM), then the observation text. Indented sub-bullets use the same marker and timestamp format and attach to the parent bullet above them.\n\n* CRITICAL (14:30) Top-level observation\n * INFO (14:30) Sub-bullet for grouped detail\n * COMPLETION (14:31) Sub-bullet for a completed detail\n* IMPORTANT (14:31) Another top-level observation\n\nOutput only the new observations. Do not repeat the existing log. Do not add preamble, headers, or commentary. If there are no new observations, output nothing at all.\n\nMARKERS\n\nCRITICAL. Things the agent must not forget. User-stated identity, project context, hard constraints, explicit decisions, commitments.\nIMPORTANT. Preferences, ongoing work, recent activity, intermediate state, investigation findings. Useful for continuity but droppable under context pressure.\nINFO. Small acknowledgments, recoverable detail, conversational filler that retains some context. First to drop when the log is oversized.\nCOMPLETION. A task, question, or subtask was resolved. Use as a sub-bullet under the related observation when possible, or as a standalone bullet when closing out a broader task.\n\nEXAMPLES\n\nExample 1: User assertion of identity.\n\nTranscript:\n[USER 14:30] Hi, I'm Robin, senior engineer at Acme working on the agents team.\n\nOutput:\n* CRITICAL (14:30) User is Robin, senior engineer at Acme on the agents team.\n\nExample 2: User preference.\n\nTranscript:\n[USER 14:30] Can you keep your answers shorter? I don't need the long preamble.\n\nOutput:\n* IMPORTANT (14:30) User prefers concise responses without preamble.\n\nExample 3: User decision.\n\nTranscript:\n[ASSISTANT 14:29] You could go with either Postgres or SQLite. SQLite is simpler for local-first deployments, Postgres scales better.\n[USER 14:30] Let's go with SQLite. Most of our users will be running this locally anyway.\n\nOutput:\n* CRITICAL (14:30) User chose SQLite for the memory store (users are running locally).\n\nExample 4: State change with explicit supersession.\n\nTranscript:\n[USER 14:30] Actually, scrap the SQLite plan. We're switching to Postgres because our enterprise customers won't want to run anything local.\n\nOutput:\n* CRITICAL (14:30) User switched memory store choice to Postgres (changing from earlier SQLite plan; enterprise customers won't run local).\n\nExample 5: Tool calls as real evidence for agent actions.\n\nTranscript:\n[USER 14:30] Where is the auth middleware configured?\n[ASSISTANT 14:30] Let me check.\n[TOOL_CALL 14:30] read_file(path=\"src/auth.ts\")\n[TOOL_RESULT 14:30] (file content showing JWT validation logic)\n[TOOL_CALL 14:30] read_file(path=\"src/middleware.ts\")\n[TOOL_RESULT 14:30] (file content showing middleware chain registration)\n[ASSISTANT 14:31] Auth middleware is registered in src/middleware.ts and uses JWT validation from src/auth.ts.\n\nOutput:\n* IMPORTANT (14:30) User asked where auth middleware is configured.\n * INFO (14:30) Agent read src/auth.ts (JWT validation) and src/middleware.ts (middleware chain registration).\n * COMPLETION (14:31) Agent answered: auth middleware in src/middleware.ts using JWT validation from src/auth.ts.\n\nExample 6: Grouping repeated similar actions under one parent.\n\nTranscript:\n[ASSISTANT 14:45] Let me look at the source files for the auth flow.\n[TOOL_CALL 14:45] read_file(path=\"src/auth.ts\")\n[TOOL_RESULT 14:45] (token validation logic)\n[TOOL_CALL 14:45] read_file(path=\"src/users.ts\")\n[TOOL_RESULT 14:45] (user lookup by email)\n[TOOL_CALL 14:45] read_file(path=\"src/routes.ts\")\n[TOOL_RESULT 14:45] (middleware chain)\n\nOutput:\n* INFO (14:45) Agent browsed source files for the auth flow.\n * INFO (14:45) Read src/auth.ts: token validation logic.\n * INFO (14:45) Read src/users.ts: user lookup by email.\n * INFO (14:45) Read src/routes.ts: middleware chain.\n\nExample 7: Completion as a sub-bullet.\n\nTranscript:\n[USER 14:30] How do I configure the auth middleware in this framework?\n[ASSISTANT 14:31] (explanation with code example)\n[USER 14:32] Got it, that works. Auth is set up now.\n\nOutput:\n* IMPORTANT (14:30) User asked how to configure auth middleware.\n * INFO (14:31) Agent explained setup with code example.\n * COMPLETION (14:32) User confirmed auth is working.\n\nExample 8: Multiple observations in one delta.\n\nTranscript:\n[USER 14:30] I'm Robin at Acme. We're using SQLite for storage. Can you help me design the schema for an observations table?\n\nOutput:\n* CRITICAL (14:30) User is Robin at Acme; using SQLite for storage.\n* IMPORTANT (14:30) User asked for help designing schema for an observations table.\n\nExample 9: Preserving identifiers and unusual phrasing verbatim.\n\nTranscript:\n[USER 14:30] The failing job is dag_id=daily_report_prod, the operator is called \"the loader\" internally, we use the term \"movement\" for our data refresh cycles.\n\nOutput:\n* CRITICAL (14:30) Failing job is dag_id=daily_report_prod; the operator is called \"the loader\" internally; user team uses the term \"movement\" for data refresh cycles.\n\nExample 10: Nothing durable in the delta.\n\nTranscript:\n[USER 14:30] Thanks for the help earlier.\n[ASSISTANT 14:30] You're welcome.\n\nOutput:\n(empty, no observations)\n\nBAD AND GOOD PATTERNS\n\nDistinguishing assertions from questions\n\nTranscript:\n[USER 14:30] What database should I use?\n\nBAD: CRITICAL (14:30) User uses [database].\n(Wrong. The user asked a question; they did not state a database.)\n\nGOOD: (no observation, or INFO if continuity matters)\n* INFO (14:30) User asked agent to recommend a database.\n\nDistinguishing questions from intent\n\nTranscript:\n[USER 14:30] Can you recommend a database?\n\nBAD: IMPORTANT (14:30) User decided on database recommendation from agent.\n\nGOOD:\n* INFO (14:30) User asked agent to recommend a database.\n\nTranscript:\n[USER 14:30] I need to pick a database by Friday.\n\nBAD: (skipped, treated as a request)\n\nGOOD:\n* IMPORTANT (14:30) User needs to pick a database by Friday (deadline-bound decision pending).\n\nState change with vs without explicit supersession\n\nTranscript:\n[USER 09:00] We're using Postgres.\n(later in delta)\n[USER 14:30] Actually we switched to SQLite last week.\n\nBAD: CRITICAL (14:30) User uses SQLite.\n(Wrong. Loses the fact that they previously stated Postgres and changed it. Next reader has no way to know the earlier observation is stale.)\n\nGOOD:\n* CRITICAL (14:30) User switched to SQLite last week (changing from earlier Postgres choice).\n\nPrecise vs vague action verbs\n\nTranscript:\n[USER 14:30] I'm getting Claude Code for my team.\n\nBAD: IMPORTANT (14:30) User is getting Claude Code.\n\nGOOD:\n* IMPORTANT (14:30) User is purchasing Claude Code subscriptions for their team.\n(Use specific verbs: purchased, subscribed, enrolled, received, picked up. \"Got\" and \"getting\" are vague.)\n\nPreserving identifiers vs paraphrasing them\n\nTranscript:\n[USER 14:30] The error happens on workflow_id=wf_daily_report_v2 specifically.\n\nBAD: CRITICAL (14:30) Error happens on the daily report workflow.\n\nGOOD:\n* CRITICAL (14:30) Error occurs specifically on workflow_id=wf_daily_report_v2.\n\nGrouping vs spamming\n\nTranscript:\n[TOOL_CALL 14:45] read_file(\"a.ts\")\n[TOOL_CALL 14:45] read_file(\"b.ts\")\n[TOOL_CALL 14:45] read_file(\"c.ts\")\n\nBAD:\n* INFO (14:45) Agent read a.ts\n* INFO (14:45) Agent read b.ts\n* INFO (14:45) Agent read c.ts\n\nGOOD:\n* INFO (14:45) Agent browsed source files.\n * Read a.ts, b.ts, c.ts.\n\nAgent claims that did not happen\n\nTranscript:\n[USER 14:30] Can you check the database?\n[ASSISTANT 14:30] I'll take a look at the database for you.\n(no tool call follows)\n\nBAD: INFO (14:30) Agent checked the database.\n(Wrong. The agent SAID they would check but there is no tool call evidence. Agent narration alone is not evidence of action.)\n\nGOOD: (no observation about agent action; only the user's question)\n* INFO (14:30) User asked agent to check the database.\n\nSpeculation phrased as fact\n\nTranscript:\n[USER 14:30] The login issue might be a session store problem.\n\nBAD: CRITICAL (14:30) Login issue is caused by session store.\n\nGOOD:\n* IMPORTANT (14:30) User suspects login issue may be a session store problem (unconfirmed).\n\nRULES\n\n- Distinguish user assertions from questions. Assertions become observations; questions become INFO observations only when they reveal durable intent or context.\n- Distinguish questions from statements of intent. \"Can you recommend X\" is a question. \"I need to choose X by Friday\" is a commitment.\n- State changes SUPERSEDE previous state. Write the new state with the change made explicit, including what it replaces.\n- Preserve identifiers, counts, dates, and unusual phrasing VERBATIM. Quote the user's exact terms when they coin or specify something.\n- Use PRECISE action verbs (subscribed, purchased, deployed, configured, ruled out, confirmed). Avoid \"got\", \"getting\", \"has\", \"did\" when a specific verb fits.\n- Group repeated similar actions under one parent observation with sub-bullets. Do not emit one observation per tool call.\n- Use COMPLETION only when a task, question, or subtask was resolved. Use it as a sub-bullet under the related observation when possible.\n- Agent text alone is not evidence of agent action. Only emit observations about agent actions when supported by tool calls or tool results in the delta.\n- Preserve UNCERTAINTY. \"user suspects X\", not \"X is true\", when the user used hedging language.\n\nSKIP\n\nDo not extract observations for:\n- Off-topic small talk and pleasantries\n- Agent claims of action with no supporting tool call or tool result\n- Recalled memory output the user did not engage with\n- Speculative content phrased as fact in the source\n- Internal agent reasoning the user did not see or react to\n- Restatements of content already in the existing observation log tail\n\nCONSERVATISM\n\nReturn NO output when nothing durable happened in the delta. Most short exchanges produce zero observations. Bursts of activity may produce several. Do not invent durability where none exists.\n\nOutput the new observations only. Do not repeat the existing log. Do not add preamble, headers, or commentary. If there are no new observations, output nothing at all.";
10
+ export declare const DEFAULT_OBSERVATION_LOG_OBSERVER_PROMPT = "You are observing a conversation between a user and an agent. Extract durable observations about what happened, what was decided, what changed, and what needs follow-up. The agent will read your observations on later turns as its memory of this conversation.\n\nYou receive: the current observation log tail (for context, do not restate), the new transcript delta since the last observation, and the current timestamp. The transcript delta contains user text, assistant text, tool calls, and compacted tool results.\n\nOUTPUT FORMAT\n\nEach observation is one bullet, starting with a marker, then a timestamp in (HH:MM), then the observation text. Indented sub-bullets use the same marker and timestamp format and attach to the parent bullet above them.\n\n* CRITICAL (14:30) Top-level observation\n * INFO (14:30) Sub-bullet for grouped detail\n * COMPLETION (14:31) Sub-bullet for a completed detail\n* IMPORTANT (14:31) Another top-level observation\n\nOutput only the new observations. Do not repeat the existing log. Do not add preamble, headers, or commentary. If there are no new observations, output nothing at all.\n\nMARKERS\n\nCRITICAL. Things the agent must not forget. User-stated identity, project context, hard constraints, explicit decisions, commitments.\nIMPORTANT. Preferences, ongoing work, recent activity, intermediate state, investigation findings. Useful for continuity but droppable under context pressure.\nINFO. Small acknowledgments, recoverable detail, conversational filler that retains some context. First to drop when the log is oversized.\nCOMPLETION. A task, question, or subtask was resolved. Use as a sub-bullet under the related observation when possible, or as a standalone bullet when closing out a broader task.\n\nEXAMPLES\n\nExample 1: User assertion of identity.\n\nTranscript:\n[USER 14:30] Hi, I'm Robin, senior engineer at Acme working on the agents team.\n\nOutput:\n* CRITICAL (14:30) User is Robin, senior engineer at Acme on the agents team.\n\nExample 2: User preference.\n\nTranscript:\n[USER 14:30] Can you keep your answers shorter? I don't need the long preamble.\n\nOutput:\n* IMPORTANT (14:30) User prefers concise responses without preamble.\n\nExample 3: User decision.\n\nTranscript:\n[ASSISTANT 14:29] You could go with either Postgres or SQLite. SQLite is simpler for local-first deployments, Postgres scales better.\n[USER 14:30] Let's go with SQLite. Most of our users will be running this locally anyway.\n\nOutput:\n* CRITICAL (14:30) User chose SQLite for the memory store (users are running locally).\n\nExample 4: State change with explicit supersession.\n\nTranscript:\n[USER 14:30] Actually, scrap the SQLite plan. We're switching to Postgres because our enterprise customers won't want to run anything local.\n\nOutput:\n* CRITICAL (14:30) User switched memory store choice to Postgres (changing from earlier SQLite plan; enterprise customers won't run local).\n\nExample 5: Tool calls as real evidence for agent actions.\n\nTranscript:\n[USER 14:30] Where is the auth middleware configured?\n[ASSISTANT 14:30] Let me check.\n[TOOL_CALL 14:30] read_file(path=\"src/auth.ts\")\n[TOOL_RESULT 14:30] (file content showing JWT validation logic)\n[TOOL_CALL 14:30] read_file(path=\"src/middleware.ts\")\n[TOOL_RESULT 14:30] (file content showing middleware chain registration)\n[ASSISTANT 14:31] Auth middleware is registered in src/middleware.ts and uses JWT validation from src/auth.ts.\n\nOutput:\n* IMPORTANT (14:30) User asked where auth middleware is configured.\n * INFO (14:30) Agent read src/auth.ts (JWT validation) and src/middleware.ts (middleware chain registration).\n * COMPLETION (14:31) Agent answered: auth middleware in src/middleware.ts using JWT validation from src/auth.ts.\n\nExample 6: Grouping repeated similar actions under one parent.\n\nTranscript:\n[ASSISTANT 14:45] Let me look at the source files for the auth flow.\n[TOOL_CALL 14:45] read_file(path=\"src/auth.ts\")\n[TOOL_RESULT 14:45] (token validation logic)\n[TOOL_CALL 14:45] read_file(path=\"src/users.ts\")\n[TOOL_RESULT 14:45] (user lookup by email)\n[TOOL_CALL 14:45] read_file(path=\"src/routes.ts\")\n[TOOL_RESULT 14:45] (middleware chain)\n\nOutput:\n* INFO (14:45) Agent browsed source files for the auth flow.\n * INFO (14:45) Read src/auth.ts: token validation logic.\n * INFO (14:45) Read src/users.ts: user lookup by email.\n * INFO (14:45) Read src/routes.ts: middleware chain.\n\nExample 7: Completion as a sub-bullet.\n\nTranscript:\n[USER 14:30] How do I configure the auth middleware in this framework?\n[ASSISTANT 14:31] (explanation with code example)\n[USER 14:32] Got it, that works. Auth is set up now.\n\nOutput:\n* IMPORTANT (14:30) User asked how to configure auth middleware.\n * INFO (14:31) Agent explained setup with code example.\n * COMPLETION (14:32) User confirmed auth is working.\n\nExample 8: Multiple observations in one delta.\n\nTranscript:\n[USER 14:30] I'm Robin at Acme. We're using SQLite for storage. Can you help me design the schema for an observations table?\n\nOutput:\n* CRITICAL (14:30) User is Robin at Acme; using SQLite for storage.\n* IMPORTANT (14:30) User asked for help designing schema for an observations table.\n\nExample 9: Preserving identifiers and unusual phrasing verbatim.\n\nTranscript:\n[USER 14:30] The failing job is dag_id=daily_report_prod, the operator is called \"the loader\" internally, we use the term \"movement\" for our data refresh cycles.\n\nOutput:\n* CRITICAL (14:30) Failing job is dag_id=daily_report_prod; the operator is called \"the loader\" internally; user team uses the term \"movement\" for data refresh cycles.\n\nExample 10: Nothing durable in the delta.\n\nTranscript:\n[USER 14:30] Thanks for the help earlier.\n[ASSISTANT 14:30] You're welcome.\n\nOutput:\n(empty, no observations)\n\nBAD AND GOOD PATTERNS\n\nDistinguishing assertions from questions\n\nTranscript:\n[USER 14:30] What database should I use?\n\nBAD: CRITICAL (14:30) User uses [database].\n(Wrong. The user asked a question; they did not state a database.)\n\nGOOD: (no observation, or INFO if continuity matters)\n* INFO (14:30) User asked agent to recommend a database.\n\nDistinguishing questions from intent\n\nTranscript:\n[USER 14:30] Can you recommend a database?\n\nBAD: IMPORTANT (14:30) User decided on database recommendation from agent.\n\nGOOD:\n* INFO (14:30) User asked agent to recommend a database.\n\nTranscript:\n[USER 14:30] I need to pick a database by Friday.\n\nBAD: (skipped, treated as a request)\n\nGOOD:\n* IMPORTANT (14:30) User needs to pick a database by Friday (deadline-bound decision pending).\n\nState change with vs without explicit supersession\n\nTranscript:\n[USER 09:00] We're using Postgres.\n(later in delta)\n[USER 14:30] Actually we switched to SQLite last week.\n\nBAD: CRITICAL (14:30) User uses SQLite.\n(Wrong. Loses the fact that they previously stated Postgres and changed it. Next reader has no way to know the earlier observation is stale.)\n\nGOOD:\n* CRITICAL (14:30) User switched to SQLite last week (changing from earlier Postgres choice).\n\nPrecise vs vague action verbs\n\nTranscript:\n[USER 14:30] I'm getting Claude Code for my team.\n\nBAD: IMPORTANT (14:30) User is getting Claude Code.\n\nGOOD:\n* IMPORTANT (14:30) User is purchasing Claude Code subscriptions for their team.\n(Use specific verbs: purchased, subscribed, enrolled, received, picked up. \"Got\" and \"getting\" are vague.)\n\nPreserving identifiers vs paraphrasing them\n\nTranscript:\n[USER 14:30] The error happens on workflow_id=wf_daily_report_v2 specifically.\n\nBAD: CRITICAL (14:30) Error happens on the daily report workflow.\n\nGOOD:\n* CRITICAL (14:30) Error occurs specifically on workflow_id=wf_daily_report_v2.\n\nRecording that a secret was provided, without the secret value\n\nTranscript:\n[USER 14:30] Here's the API key for the integration: AB12C-9F8E7D6C5B4A321\n\nBAD: CRITICAL (14:30) User provided API key AB12C-9F8E7D6C5B4A321 for the integration.\n(Wrong. Never record the secret value itself, even when the user pastes it directly and it looks durable/important.)\n\nGOOD:\n* CRITICAL (14:30) User provided the API key for the integration (value not recorded).\n\nGrouping vs spamming\n\nTranscript:\n[TOOL_CALL 14:45] read_file(\"a.ts\")\n[TOOL_CALL 14:45] read_file(\"b.ts\")\n[TOOL_CALL 14:45] read_file(\"c.ts\")\n\nBAD:\n* INFO (14:45) Agent read a.ts\n* INFO (14:45) Agent read b.ts\n* INFO (14:45) Agent read c.ts\n\nGOOD:\n* INFO (14:45) Agent browsed source files.\n * Read a.ts, b.ts, c.ts.\n\nAgent claims that did not happen\n\nTranscript:\n[USER 14:30] Can you check the database?\n[ASSISTANT 14:30] I'll take a look at the database for you.\n(no tool call follows)\n\nBAD: INFO (14:30) Agent checked the database.\n(Wrong. The agent SAID they would check but there is no tool call evidence. Agent narration alone is not evidence of action.)\n\nGOOD: (no observation about agent action; only the user's question)\n* INFO (14:30) User asked agent to check the database.\n\nSpeculation phrased as fact\n\nTranscript:\n[USER 14:30] The login issue might be a session store problem.\n\nBAD: CRITICAL (14:30) Login issue is caused by session store.\n\nGOOD:\n* IMPORTANT (14:30) User suspects login issue may be a session store problem (unconfirmed).\n\nRULES\n\n- Distinguish user assertions from questions. Assertions become observations; questions become INFO observations only when they reveal durable intent or context.\n- Distinguish questions from statements of intent. \"Can you recommend X\" is a question. \"I need to choose X by Friday\" is a commitment.\n- State changes SUPERSEDE previous state. Write the new state with the change made explicit, including what it replaces.\n- Preserve identifiers, counts, dates, and unusual phrasing VERBATIM. Quote the user's exact terms when they coin or specify something \u2014 but never secret values (see the secrets rule below).\n- NEVER record secret values: API keys, tokens, passwords, private keys, or any other pasted credential value. Refer to credentials by name or credential ID instead. When a user provides a secret, record the fact without the value (e.g. \"User provided the API key for the integration (value not recorded)\").\n- Use PRECISE action verbs (subscribed, purchased, deployed, configured, ruled out, confirmed). Avoid \"got\", \"getting\", \"has\", \"did\" when a specific verb fits.\n- Group repeated similar actions under one parent observation with sub-bullets. Do not emit one observation per tool call.\n- Use COMPLETION only when a task, question, or subtask was resolved. Use it as a sub-bullet under the related observation when possible.\n- Agent text alone is not evidence of agent action. Only emit observations about agent actions when supported by tool calls or tool results in the delta.\n- Preserve UNCERTAINTY. \"user suspects X\", not \"X is true\", when the user used hedging language.\n\nSKIP\n\nDo not extract observations for:\n- Off-topic small talk and pleasantries\n- Agent claims of action with no supporting tool call or tool result\n- Recalled memory output the user did not engage with\n- Speculative content phrased as fact in the source\n- Internal agent reasoning the user did not see or react to\n- Restatements of content already in the existing observation log tail\n\nCONSERVATISM\n\nReturn NO output when nothing durable happened in the delta. Most short exchanges produce zero observations. Bursts of activity may produce several. Do not invent durability where none exists.\n\nOutput the new observations only. Do not repeat the existing log. Do not add preamble, headers, or commentary. If there are no new observations, output nothing at all.";
11
11
  export interface CreateObservationLogObserveFnOptions {
12
12
  observerPrompt?: string;
13
13
  onUsage?: (report: MemoryTaskUsageReport) => void | Promise<void>;
14
14
  }
15
15
  export declare function buildObservationLogObserverPrompt(input: ObservationLogObserverInput): string;
16
16
  export declare function createObservationLogObserveFn(model: ModelConfig, options?: CreateObservationLogObserveFnOptions): ObservationLogObserveFn;
17
- export declare const DEFAULT_OBSERVATION_LOG_REFLECTOR_PROMPT = "You are reorganizing an observation log so it stays useful and under a size limit. The log is an append-only record of what happened in a conversation. Your job is to identify what to drop, merge, or replace while preserving the most important content.\n\nYou receive: the active observation log with IDs, markers, and timestamps; the current timestamp; and the token budget.\n\nMARKERS AND PRIORITY\n\nCRITICAL. Facts, decisions, identities, commitments. NEVER drop. May merge with other CRITICAL observations on the SAME topic if they restate the same thing.\nIMPORTANT. Preferences, ongoing work, recent activity. Drop ONLY if clearly superseded or redundant. Prefer merging over dropping.\nINFO. Small acknowledgments, recoverable detail, conversational filler. FIRST to drop when the log is oversized. Drop older INFO before newer INFO.\nCOMPLETION. Drop together with the parent observation when the parent is dropped. May fold into the merged observation when the parent is merged.\n\nTIEBREAKER: When two observations are equally important, keep the more recent one.\n\nEXAMPLES\n\nExample 1: Log under budget. Return empty arrays.\n\nInput:\n[obs_001] CRITICAL (14:30) User is migrating the backend from REST to gRPC\n[obs_002] IMPORTANT (14:35) User adopted two-stage compression model (Observer + Reflector)\nBudget: 5000 tokens. Current: 600 tokens.\n\nOutput:\n{\"drop\": [], \"merge\": []}\n\nExample 2: Multiple CRITICAL observations restating the same fact. Merge them.\n\nInput:\n[obs_010] CRITICAL (09:00) User works at Acme on the platform team\n[obs_034] CRITICAL (10:15) User confirmed they joined Acme platform team 8 months ago\n[obs_078] CRITICAL (12:00) User leads the storage subgroup within the platform team\n\nOutput:\n{\n \"drop\": [],\n \"merge\": [\n {\n \"supersedes\": [\"obs_010\", \"obs_034\", \"obs_078\"],\n \"marker\": \"CRITICAL\",\n \"text\": \"User works at Acme on the platform team (joined 8 months ago); leads the storage subgroup.\"\n }\n ]\n}\n\nExample 3: Old INFO acknowledgments. Drop them.\n\nInput:\n[obs_001] INFO (08:00) User greeted the agent\n[obs_002] INFO (08:30) User thanked agent for an earlier explanation\n[obs_023] INFO (14:00) User confirmed they understood the recent answer\nBudget: 3000 tokens. Current: 4200 tokens.\n\nOutput:\n{\"drop\": [\"obs_001\", \"obs_002\"], \"merge\": []}\n\n(Keep the most recent acknowledgment; drop older filler. If budget pressure required it, obs_023 could also be dropped, but newer INFO stays before older INFO goes.)\n\nExample 4: IMPORTANT observation superseded by a later one.\n\nInput:\n[obs_005] IMPORTANT (10:00) User plans to use Postgres for the memory store\n[obs_044] IMPORTANT (12:30) User switched to SQLite for the memory store (changing from earlier Postgres plan)\n\nOutput:\n{\"drop\": [\"obs_005\"], \"merge\": []}\n\n(obs_044 already encodes the change explicitly; obs_005 is no longer current.)\n\nExample 5: Completion under a dropped parent.\n\nInput:\n[obs_001] IMPORTANT (10:00) User asked about hybrid retrieval implementation\n[obs_002] COMPLETION (10:30) User confirmed they understand RRF fusion\n[obs_087] IMPORTANT (14:00) User asked about Reflector design tradeoffs\n[obs_088] COMPLETION (14:30) User confirmed Reflector approach is clear\n\nOutput:\n{\"drop\": [\"obs_001\", \"obs_002\"], \"merge\": []}\n\n(Old completed Q&A pair drops together. Newer IMPORTANT + COMPLETION pair stays.)\n\nExample 6: Clusters across multiple turns of the same case. Merge.\n\nInput:\n[obs_020] IMPORTANT (11:00) Investigation: login failing intermittently for some users\n[obs_021] IMPORTANT (11:05) Auth service logs show no errors during failure window\n[obs_022] IMPORTANT (11:10) DB connection pool at 12/50; not saturated\n[obs_023] IMPORTANT (11:30) Session store identified as suspect; not yet checked\n\nOutput:\n{\n \"drop\": [],\n \"merge\": [\n {\n \"supersedes\": [\"obs_020\", \"obs_021\", \"obs_022\", \"obs_023\"],\n \"marker\": \"IMPORTANT\",\n \"text\": \"Intermittent login failure investigation: auth service logs clean, DB pool at 12/50 (ruled out). Session store identified as next suspect; not yet checked.\"\n }\n ]\n}\n\nBAD AND GOOD MERGE PATTERNS\n\nBAD: Merging across topics.\n\nInput:\n[obs_001] CRITICAL User works at Acme\n[obs_002] CRITICAL User is migrating the backend to gRPC\n\nWrong merge:\n{\n \"supersedes\": [\"obs_001\", \"obs_002\"],\n \"marker\": \"CRITICAL\",\n \"text\": \"User works at Acme and is migrating the backend to gRPC\"\n}\n\nThese are about different topics. Do NOT merge them. Leave both as separate observations.\n\nBAD: Inventing causation or content not in sources.\n\nInput:\n[obs_001] CRITICAL User uses Postgres\n[obs_002] IMPORTANT User mentioned performance issues with the workflow\n\nWrong merge:\n{\n \"supersedes\": [\"obs_001\", \"obs_002\"],\n \"marker\": \"CRITICAL\",\n \"text\": \"User has Postgres performance issues affecting workflows\"\n}\n\nThe sources do not state Postgres caused the performance issues. NEVER invent a causal link the observations do not state. Leave both as separate observations.\n\nBAD: Dropping CRITICAL because it feels redundant when it is not duplicated.\n\nInput:\n[obs_001] CRITICAL User works at Acme\n[obs_002] CRITICAL User joined Acme in March 2025\n\nWrong:\n{\"drop\": [\"obs_001\"], \"merge\": []}\n\nThese are not duplicates. obs_001 is current employment; obs_002 is when it started. Both are durable facts. Merge into a single observation instead, never drop.\n\nCorrect:\n{\n \"drop\": [],\n \"merge\": [\n {\n \"supersedes\": [\"obs_001\", \"obs_002\"],\n \"marker\": \"CRITICAL\",\n \"text\": \"User works at Acme; joined in March 2025.\"\n }\n ]\n}\n\nGOOD: Combining genuinely redundant facts.\n\nInput:\n[obs_001] IMPORTANT User prefers concise responses\n[obs_034] IMPORTANT User asked agent to keep answers shorter\n[obs_087] IMPORTANT User mentioned again that the previous response was too long\n\nOutput:\n{\n \"drop\": [],\n \"merge\": [\n {\n \"supersedes\": [\"obs_001\", \"obs_034\", \"obs_087\"],\n \"marker\": \"IMPORTANT\",\n \"text\": \"User prefers concise responses (reinforced multiple times in this conversation).\"\n }\n ]\n}\n\nOUTPUT FORMAT\n\nReturn JSON with two arrays:\n\n{\n \"drop\": [\"obs_id_1\", \"obs_id_2\"],\n \"merge\": [\n {\n \"supersedes\": [\"obs_id_3\", \"obs_id_4\"],\n \"marker\": \"IMPORTANT\",\n \"text\": \"Merged observation that replaces the listed ones\"\n }\n ]\n}\n\nThe merged observation supersedes its sources. The drop array drops observations without replacement. An observation ID may appear in EITHER drop OR merge.supersedes, never both. Do not invent IDs that were not in the input.\n\nGOALS\n\n- Keep the active log under the token budget.\n- Preserve every CRITICAL unless it is genuinely duplicated by another CRITICAL.\n- Preserve recent IMPORTANT unless clearly superseded.\n- Drop INFO aggressively, oldest first.\n- Merge clusters of related observations into denser ones.\n- Preserve uncertainty: if a source says \"user suspects X\", the merged observation must also say \"suspects\", not \"X is true\".\n- NEVER invent content, causation, or attributions not present in the source observations.\n\nCONSERVATISM\n\nIf the log is already under budget AND no clear duplicates exist, return {\"drop\": [], \"merge\": []}. Do not restructure for the sake of restructuring. The Reflector is for reducing the log, not for prettifying it.";
17
+ export declare const DEFAULT_OBSERVATION_LOG_REFLECTOR_PROMPT = "You are reorganizing an observation log so it stays useful and under a size limit. The log is an append-only record of what happened in a conversation. Your job is to identify what to drop, merge, or replace while preserving the most important content.\n\nYou receive: the active observation log with IDs, markers, and timestamps; the current timestamp; and the token budget.\n\nMARKERS AND PRIORITY\n\nCRITICAL. Facts, decisions, identities, commitments. NEVER drop. May merge with other CRITICAL observations on the SAME topic if they restate the same thing.\nIMPORTANT. Preferences, ongoing work, recent activity. Drop ONLY if clearly superseded or redundant. Prefer merging over dropping.\nINFO. Small acknowledgments, recoverable detail, conversational filler. FIRST to drop when the log is oversized. Drop older INFO before newer INFO.\nCOMPLETION. Drop together with the parent observation when the parent is dropped. May fold into the merged observation when the parent is merged.\n\nTIEBREAKER: When two observations are equally important, keep the more recent one.\n\nEXAMPLES\n\nExample 1: Log under budget. Return empty arrays.\n\nInput:\n[obs_001] CRITICAL (14:30) User is migrating the backend from REST to gRPC\n[obs_002] IMPORTANT (14:35) User adopted two-stage compression model (Observer + Reflector)\nBudget: 5000 tokens. Current: 600 tokens.\n\nOutput:\n{\"drop\": [], \"merge\": []}\n\nExample 2: Multiple CRITICAL observations restating the same fact. Merge them.\n\nInput:\n[obs_010] CRITICAL (09:00) User works at Acme on the platform team\n[obs_034] CRITICAL (10:15) User confirmed they joined Acme platform team 8 months ago\n[obs_078] CRITICAL (12:00) User leads the storage subgroup within the platform team\n\nOutput:\n{\n \"drop\": [],\n \"merge\": [\n {\n \"supersedes\": [\"obs_010\", \"obs_034\", \"obs_078\"],\n \"marker\": \"CRITICAL\",\n \"text\": \"User works at Acme on the platform team (joined 8 months ago); leads the storage subgroup.\"\n }\n ]\n}\n\nExample 3: Old INFO acknowledgments. Drop them.\n\nInput:\n[obs_001] INFO (08:00) User greeted the agent\n[obs_002] INFO (08:30) User thanked agent for an earlier explanation\n[obs_023] INFO (14:00) User confirmed they understood the recent answer\nBudget: 3000 tokens. Current: 4200 tokens.\n\nOutput:\n{\"drop\": [\"obs_001\", \"obs_002\"], \"merge\": []}\n\n(Keep the most recent acknowledgment; drop older filler. If budget pressure required it, obs_023 could also be dropped, but newer INFO stays before older INFO goes.)\n\nExample 4: IMPORTANT observation superseded by a later one.\n\nInput:\n[obs_005] IMPORTANT (10:00) User plans to use Postgres for the memory store\n[obs_044] IMPORTANT (12:30) User switched to SQLite for the memory store (changing from earlier Postgres plan)\n\nOutput:\n{\"drop\": [\"obs_005\"], \"merge\": []}\n\n(obs_044 already encodes the change explicitly; obs_005 is no longer current.)\n\nExample 5: Completion under a dropped parent.\n\nInput:\n[obs_001] IMPORTANT (10:00) User asked about hybrid retrieval implementation\n[obs_002] COMPLETION (10:30) User confirmed they understand RRF fusion\n[obs_087] IMPORTANT (14:00) User asked about Reflector design tradeoffs\n[obs_088] COMPLETION (14:30) User confirmed Reflector approach is clear\n\nOutput:\n{\"drop\": [\"obs_001\", \"obs_002\"], \"merge\": []}\n\n(Old completed Q&A pair drops together. Newer IMPORTANT + COMPLETION pair stays.)\n\nExample 6: Clusters across multiple turns of the same case. Merge.\n\nInput:\n[obs_020] IMPORTANT (11:00) Investigation: login failing intermittently for some users\n[obs_021] IMPORTANT (11:05) Auth service logs show no errors during failure window\n[obs_022] IMPORTANT (11:10) DB connection pool at 12/50; not saturated\n[obs_023] IMPORTANT (11:30) Session store identified as suspect; not yet checked\n\nOutput:\n{\n \"drop\": [],\n \"merge\": [\n {\n \"supersedes\": [\"obs_020\", \"obs_021\", \"obs_022\", \"obs_023\"],\n \"marker\": \"IMPORTANT\",\n \"text\": \"Intermittent login failure investigation: auth service logs clean, DB pool at 12/50 (ruled out). Session store identified as next suspect; not yet checked.\"\n }\n ]\n}\n\nBAD AND GOOD MERGE PATTERNS\n\nBAD: Merging across topics.\n\nInput:\n[obs_001] CRITICAL User works at Acme\n[obs_002] CRITICAL User is migrating the backend to gRPC\n\nWrong merge:\n{\n \"supersedes\": [\"obs_001\", \"obs_002\"],\n \"marker\": \"CRITICAL\",\n \"text\": \"User works at Acme and is migrating the backend to gRPC\"\n}\n\nThese are about different topics. Do NOT merge them. Leave both as separate observations.\n\nBAD: Inventing causation or content not in sources.\n\nInput:\n[obs_001] CRITICAL User uses Postgres\n[obs_002] IMPORTANT User mentioned performance issues with the workflow\n\nWrong merge:\n{\n \"supersedes\": [\"obs_001\", \"obs_002\"],\n \"marker\": \"CRITICAL\",\n \"text\": \"User has Postgres performance issues affecting workflows\"\n}\n\nThe sources do not state Postgres caused the performance issues. NEVER invent a causal link the observations do not state. Leave both as separate observations.\n\nBAD: Dropping CRITICAL because it feels redundant when it is not duplicated.\n\nInput:\n[obs_001] CRITICAL User works at Acme\n[obs_002] CRITICAL User joined Acme in March 2025\n\nWrong:\n{\"drop\": [\"obs_001\"], \"merge\": []}\n\nThese are not duplicates. obs_001 is current employment; obs_002 is when it started. Both are durable facts. Merge into a single observation instead, never drop.\n\nCorrect:\n{\n \"drop\": [],\n \"merge\": [\n {\n \"supersedes\": [\"obs_001\", \"obs_002\"],\n \"marker\": \"CRITICAL\",\n \"text\": \"User works at Acme; joined in March 2025.\"\n }\n ]\n}\n\nGOOD: Combining genuinely redundant facts.\n\nInput:\n[obs_001] IMPORTANT User prefers concise responses\n[obs_034] IMPORTANT User asked agent to keep answers shorter\n[obs_087] IMPORTANT User mentioned again that the previous response was too long\n\nOutput:\n{\n \"drop\": [],\n \"merge\": [\n {\n \"supersedes\": [\"obs_001\", \"obs_034\", \"obs_087\"],\n \"marker\": \"IMPORTANT\",\n \"text\": \"User prefers concise responses (reinforced multiple times in this conversation).\"\n }\n ]\n}\n\nOUTPUT FORMAT\n\nReturn JSON with two arrays:\n\n{\n \"drop\": [\"obs_id_1\", \"obs_id_2\"],\n \"merge\": [\n {\n \"supersedes\": [\"obs_id_3\", \"obs_id_4\"],\n \"marker\": \"IMPORTANT\",\n \"text\": \"Merged observation that replaces the listed ones\"\n }\n ]\n}\n\nThe merged observation supersedes its sources. The drop array drops observations without replacement. An observation ID may appear in EITHER drop OR merge.supersedes, never both. Do not invent IDs that were not in the input.\n\nGOALS\n\n- Keep the active log under the token budget.\n- Preserve every CRITICAL unless it is genuinely duplicated by another CRITICAL.\n- Preserve recent IMPORTANT unless clearly superseded.\n- Drop INFO aggressively, oldest first.\n- Merge clusters of related observations into denser ones.\n- Preserve uncertainty: if a source says \"user suspects X\", the merged observation must also say \"suspects\", not \"X is true\".\n- NEVER invent content, causation, or attributions not present in the source observations.\n- Merged observations must never contain secret values (API keys, tokens, passwords). If a source observation contains one, write the merged text without it.\n\nCONSERVATISM\n\nIf the log is already under budget AND no clear duplicates exist, return {\"drop\": [], \"merge\": []}. Do not restructure for the sake of restructuring. The Reflector is for reducing the log, not for prettifying it.";
18
18
  export interface CreateObservationLogReflectFnOptions {
19
19
  reflectorPrompt?: string;
20
20
  onUsage?: (report: MemoryTaskUsageReport) => void | Promise<void>;
@@ -209,6 +209,17 @@ BAD: CRITICAL (14:30) Error happens on the daily report workflow.
209
209
  GOOD:
210
210
  * CRITICAL (14:30) Error occurs specifically on workflow_id=wf_daily_report_v2.
211
211
 
212
+ Recording that a secret was provided, without the secret value
213
+
214
+ Transcript:
215
+ [USER 14:30] Here's the API key for the integration: AB12C-9F8E7D6C5B4A321
216
+
217
+ BAD: CRITICAL (14:30) User provided API key AB12C-9F8E7D6C5B4A321 for the integration.
218
+ (Wrong. Never record the secret value itself, even when the user pastes it directly and it looks durable/important.)
219
+
220
+ GOOD:
221
+ * CRITICAL (14:30) User provided the API key for the integration (value not recorded).
222
+
212
223
  Grouping vs spamming
213
224
 
214
225
  Transcript:
@@ -253,7 +264,8 @@ RULES
253
264
  - Distinguish user assertions from questions. Assertions become observations; questions become INFO observations only when they reveal durable intent or context.
254
265
  - Distinguish questions from statements of intent. "Can you recommend X" is a question. "I need to choose X by Friday" is a commitment.
255
266
  - State changes SUPERSEDE previous state. Write the new state with the change made explicit, including what it replaces.
256
- - Preserve identifiers, counts, dates, and unusual phrasing VERBATIM. Quote the user's exact terms when they coin or specify something.
267
+ - Preserve identifiers, counts, dates, and unusual phrasing VERBATIM. Quote the user's exact terms when they coin or specify something — but never secret values (see the secrets rule below).
268
+ - NEVER record secret values: API keys, tokens, passwords, private keys, or any other pasted credential value. Refer to credentials by name or credential ID instead. When a user provides a secret, record the fact without the value (e.g. "User provided the API key for the integration (value not recorded)").
257
269
  - Use PRECISE action verbs (subscribed, purchased, deployed, configured, ruled out, confirmed). Avoid "got", "getting", "has", "did" when a specific verb fits.
258
270
  - Group repeated similar actions under one parent observation with sub-bullets. Do not emit one observation per tool call.
259
271
  - Use COMPLETION only when a task, question, or subtask was resolved. Use it as a sub-bullet under the related observation when possible.
@@ -511,6 +523,7 @@ GOALS
511
523
  - Merge clusters of related observations into denser ones.
512
524
  - Preserve uncertainty: if a source says "user suspects X", the merged observation must also say "suspects", not "X is true".
513
525
  - NEVER invent content, causation, or attributions not present in the source observations.
526
+ - Merged observations must never contain secret values (API keys, tokens, passwords). If a source observation contains one, write the merged text without it.
514
527
 
515
528
  CONSERVATISM
516
529
 
@@ -1 +1 @@
1
- {"version":3,"file":"observation-log-defaults.js","sourceRoot":"","sources":["../../../src/runtime/memory/observation-log-defaults.ts"],"names":[],"mappings":";;;;;;;AAUA,iEAAyE;AACzE,6DAA2D;AAC3D,8CAA0C;AAC1C,0DAAqD;AACrD,gDAAmD;AACnD,sEAA4E;AAM/D,QAAA,iDAAiD,GAAG,KAAK,CAAC;AAC1D,QAAA,kCAAkC,GAAG,EAAE,CA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;YACzD,IAAI,UAAU,EAAE,CAAC;gBAChB,MAAM,OAAO,CAAC,OAAO,CAAC;oBACrB,IAAI,EAAE,WAAW;oBACjB,KAAK,EAAE,IAAA,kCAAgB,EAAC,KAAK,CAAC;oBAC9B,KAAK,EAAE,UAAU;oBACjB,QAAQ,EAAE,MAAM,CAAC,UAAU,EAAE;iBAC7B,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;QAED,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;IACpB,CAAC,CAAC;AACH,CAAC"}
@@ -3,7 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.parseObservationLogMarkdown = parseObservationLogMarkdown;
4
4
  exports.renderObserverTranscript = renderObserverTranscript;
5
5
  exports.runObservationLogObserver = runObservationLogObserver;
6
+ const scrub_secrets_1 = require("@n8n/utils/scrub-secrets");
6
7
  const observation_log_renderer_1 = require("./observation-log-renderer");
8
+ const guardrails_1 = require("../../sdk/guardrails");
7
9
  const observation_log_1 = require("../../types/sdk/observation-log");
8
10
  const MARKER_BY_TOKEN = {
9
11
  CRITICAL: 'critical',
@@ -16,10 +18,8 @@ const DEFAULT_MAX_SERIALIZED_CHARS = 2_000;
16
18
  const DEFAULT_MAX_STRING_CHARS = 500;
17
19
  const DEFAULT_MAX_ARRAY_ITEMS = 20;
18
20
  const DEFAULT_MAX_OBJECT_KEYS = 40;
19
- const REDACTED_VALUE = '[redacted]';
20
- const SENSITIVE_KEY_PATTERN = /(?:^|[_-])(?:api[-_]?key|authorization|credential|password|secret|token|access[-_]?token|refresh[-_]?token|private[-_]?key|client[-_]?secret|session[-_]?cookie)(?:$|[_-])/i;
21
- const INLINE_AUTHORIZATION_PATTERN = /\b(authorization\s*[:=]\s*)(?:[a-z][\w.-]*\s+)?[^\s"',&;]+/gi;
22
- const INLINE_SECRET_ASSIGNMENT_PATTERN = /\b((?:api[-_]?key|password|secret|token|access[-_]?token|refresh[-_]?token|client[-_]?secret)\s*[:=]\s*)[^\s"',&;]+/gi;
21
+ const REDACTED_VALUE = '[REDACTED]';
22
+ const SENSITIVE_KEY_PATTERN = new RegExp(`(?:^|[_-])(?:${scrub_secrets_1.SECRET_KEYS}|token|private[_-]?key|client[_-]?secret|session[_-]?cookie)(?:$|[_-])`, 'i');
23
23
  function parseObservationLogMarkdown(markdown) {
24
24
  const entries = [];
25
25
  const skippedLines = [];
@@ -60,7 +60,7 @@ function renderObserverTranscript(messages, options = {}) {
60
60
  .join('\n');
61
61
  if (text) {
62
62
  lines.push(`[${timestamp}] ${message.role}:`);
63
- lines.push(text);
63
+ lines.push((0, guardrails_1.redactText)(text).text);
64
64
  }
65
65
  for (const toolCall of message.content.filter(isToolCallContent)) {
66
66
  lines.push(`[${timestamp}] tool_call ${toolCall.toolName} input=${serializeForObserver(toolCall.input, options)}`);
@@ -122,7 +122,7 @@ async function runObservationLogObserver(opts) {
122
122
  {
123
123
  observationScopeId,
124
124
  marker: entry.marker,
125
- text: entry.text,
125
+ text: (0, guardrails_1.redactText)(entry.text).text,
126
126
  parentId,
127
127
  createdAt: new Date(now.getTime() + inserted.length),
128
128
  },
@@ -153,14 +153,14 @@ function serializeForObserver(value, options) {
153
153
  return truncateString(serialized, options.maxSerializedChars ?? DEFAULT_MAX_SERIALIZED_CHARS, 'serialized');
154
154
  }
155
155
  function serializeErrorForObserver(error, options) {
156
- return truncateString(redactSensitiveString(error), options.maxStringChars ?? DEFAULT_MAX_STRING_CHARS, 'string');
156
+ return truncateString((0, guardrails_1.redactText)(error).text, options.maxStringChars ?? DEFAULT_MAX_STRING_CHARS, 'string');
157
157
  }
158
158
  function compactForObserver(value, options) {
159
159
  const maxStringChars = options.maxStringChars ?? DEFAULT_MAX_STRING_CHARS;
160
160
  const maxArrayItems = options.maxArrayItems ?? DEFAULT_MAX_ARRAY_ITEMS;
161
161
  const maxObjectKeys = options.maxObjectKeys ?? DEFAULT_MAX_OBJECT_KEYS;
162
162
  if (typeof value === 'string') {
163
- return truncateString(redactSensitiveString(value), maxStringChars, 'string');
163
+ return truncateString((0, guardrails_1.redactText)(value).text, maxStringChars, 'string');
164
164
  }
165
165
  if (value === null || typeof value !== 'object')
166
166
  return value;
@@ -194,11 +194,6 @@ function compactForObserver(value, options) {
194
194
  function isSensitiveKey(key) {
195
195
  return SENSITIVE_KEY_PATTERN.test(key);
196
196
  }
197
- function redactSensitiveString(value) {
198
- return value
199
- .replace(INLINE_AUTHORIZATION_PATTERN, (_match, prefix) => `${prefix}${REDACTED_VALUE}`)
200
- .replace(INLINE_SECRET_ASSIGNMENT_PATTERN, (_match, prefix) => `${prefix}${REDACTED_VALUE}`);
201
- }
202
197
  function shouldStripBlob(key, value) {
203
198
  if (typeof value !== 'string')
204
199
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"observation-log-observer.js","sourceRoot":"","sources":["../../../src/runtime/memory/observation-log-observer.ts"],"names":[],"mappings":";;;;;AAAA,yEAAkE;AAalE,qEAA4E;AAK5E,MAAM,eAAe,GAAyC;IAC7D,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,YAAY;CACxB,CAAC;AAEF,MAAM,cAAc,GACnB,oFAAoF,CAAC;AACtF,MAAM,4BAA4B,GAAG,KAAK,CAAC;AAC3C,MAAM,wBAAwB,GAAG,GAAG,CAAC;AACrC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AACnC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AACnC,MAAM,cAAc,GAAG,YAAY,CAAC;AACpC,MAAM,qBAAqB,GAC1B,6KAA6K,CAAC;AAC/K,MAAM,4BAA4B,GAAG,8DAA8D,CAAC;AACpG,MAAM,gCAAgC,GACrC,uHAAuH,CAAC;AAqDzH,qCAA4C,QAAgB;IAC3D,MAAM,OAAO,GAAgC,EAAE,CAAC;IAChD,MAAM,YAAY,GAAa,EAAE,CAAC;IAClC,IAAI,kBAAkB,GAAkB,IAAI,CAAC;IAE7C,KAAK,MAAM,OA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,qBAAqB,EAAE,WAAW,CAAC,EAAE;QACrC,cAAc,EAAE,WAAW,CAAC,SAAS;QACrC,SAAS,EAAE,GAAG;KACd,CAAC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"observation-log-observer.js","sourceRoot":"","sources":["../../../src/runtime/memory/observation-log-observer.ts"],"names":[],"mappings":";;;;;AAAA,4DAAuD;AAEvD,yEAAkE;AAClE,qDAAkD;AAalD,qEAA4E;AAK5E,MAAM,eAAe,GAAyC;IAC7D,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,YAAY;CACxB,CAAC;AAEF,MAAM,cAAc,GACnB,oFAAoF,CAAC;AACtF,MAAM,4BAA4B,GAAG,KAAK,CAAC;AAC3C,MAAM,wBAAwB,GAAG,GAAG,CAAC;AACrC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AACnC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AACnC,MAAM,cAAc,GAAG,YAAY,CAAC;AAKpC,MAAM,qBAAqB,GAAG,IAAI,MAAM,CACvC,gBAAgB,2BAAW,wEAAwE,EACnG,GAAG,CACH,CAAC;AAqDF,qCAA4C,QAAgB;IAC3D,MAAM,OAAO,GAAgC,EAAE,CAAC;IAChD,MAAM,YAAY,GAAa,EAAE,CAAC;IAClC,IAAI,kBAAkB,GAAkB,IAAI,CAAC;IAE7C,KAAK,MAAM,OAAO,IAAI,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;QAC/C,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;QAC/B,IAAI,CAAC,OAAO;YAAE,SAAS;QAEvB,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC3C,IAAI,CAAC,KAAK,EAAE,CAAC;YACZ,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC3B,SAAS;QACV,CAAC;QAED,MAAM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wB;QAAE,OAAO,KAAK,CAAC;IAC3D,OAAO,8BAA8B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACjD,CAAC;AAED,SAAS,cAAc,CAAC,KAAa,EAAE,QAAgB,EAAE,KAAa;IACrE,IAAI,KAAK,CAAC,MAAM,IAAI,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC3C,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,iBAAiB,KAAK,CAAC,MAAM,GAAG,QAAQ,IAAI,KAAK,SAAS,CAAC;AAC9F,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAc;IACxC,IAAI,CAAC;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;IAC3C,CAAC;AACF,CAAC;AAED,KAAK,UAAU,qBAAqB,CACnC,MAAoC,EACpC,kBAA0B,EAC1B,WAA2B,EAC3B,GAAS;IAET,MAAM,MAAM,CAAC,SAAS,CAAC;QACtB,kBAAkB;QAClB,qBAAqB,EAAE,WAAW,CAAC,EAAE;QACrC,cAAc,EAAE,WAAW,CAAC,SAAS;QACrC,SAAS,EAAE,GAAG;KACd,CAAC,CAAC;AACJ,CAAC"}
@@ -6,6 +6,7 @@ exports.normalizeObservationLogReflection = normalizeObservationLogReflection;
6
6
  exports.runObservationLogReflector = runObservationLogReflector;
7
7
  const is_record_1 = require("@n8n/utils/is-record");
8
8
  const memory_lifecycle_1 = require("./memory-lifecycle");
9
+ const guardrails_1 = require("../../sdk/guardrails");
9
10
  const observation_log_1 = require("../../types/sdk/observation-log");
10
11
  const MARKER_LABELS = {
11
12
  critical: 'CRITICAL',
@@ -129,7 +130,11 @@ async function runObservationLogReflector(opts) {
129
130
  executionCounter: opts.executionCounter,
130
131
  telemetry: opts.telemetry,
131
132
  });
132
- const reflection = normalizeObservationLogReflection(activeObservationLog, withCreatedAt(parseObservationLogReflectionJson(output), now));
133
+ const normalized = normalizeObservationLogReflection(activeObservationLog, withCreatedAt(parseObservationLogReflectionJson(output), now));
134
+ const reflection = {
135
+ ...normalized,
136
+ merge: normalized.merge.map((merge) => ({ ...merge, text: (0, guardrails_1.redactText)(merge.text).text })),
137
+ };
133
138
  const result = await memory.applyObservationLogReflection({ observationScopeId }, reflection);
134
139
  const remainingTokenCount = countObservationTokens(await memory.getActiveObservationLog({ observationScopeId }), tokenCounter);
135
140
  const overBudgetAfterReflection = remainingTokenCount > reflectorThresholdTokens;
@@ -1 +1 @@
1
- {"version":3,"file":"observation-log-reflector.js","sourceRoot":"","sources":["../../../src/runtime/memory/observation-log-reflector.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAgD;AAEhD,yDAAmD;AAanD,qEAA4E;AAK5E,MAAM,aAAa,GAAyC;IAC3D,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,YAAY;CACxB,CAAC;AAEF,MAAM,6BAA6B,GAClC,gEAAgE,CAAC;AAkClE,2CAAkD,MAAc;IAC/D,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACJ,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;IAChD,CAAC;IAAC,MAAM,CAAC;QACR,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACxD,CAAC;IACD,IAAI,CAAC,IAAA,oBAAQ,EAAC,MAAM,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAEjF,OAAO;QACN,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,EAAE,MAAM,CAAC;QAChD,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;KACzC,CAAC;AACH,CAAC;AAED,2CAAkD,OAA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,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IAC/D,IAAI,QAAQ,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IACpC,OAAO,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,sBAAsB,CAAC,KAA0B,EAAE,MAAM,GAAG,EAAE;IACtE,OAAO,GAAG,MAAM,MAAM,KAAK,CAAC,EAAE,KAAK,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;AACjH,CAAC"}
1
+ {"version":3,"file":"observation-log-reflector.js","sourceRoot":"","sources":["../../../src/runtime/memory/observation-log-reflector.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAgD;AAEhD,yDAAmD;AACnD,qDAAkD;AAalD,qEAA4E;AAK5E,MAAM,aAAa,GAAyC;IAC3D,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,YAAY;CACxB,CAAC;AAEF,MAAM,6BAA6B,GAClC,gEAAgE,CAAC;AAkClE,2CAAkD,MAAc;IAC/D,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACJ,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;IAChD,CAAC;IAAC,MAAM,CAAC;QACR,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACxD,CAAC;IACD,IAAI,CAAC,IAAA,oBAAQ,EAAC,MAAM,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAEjF,OAAO;QACN,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,EAAE,MAAM,CAAC;QAChD,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E,CAAC,CAAC,CAAC;AAChG,CAAC;AAED,SAAS,qBAAqB,CAAC,KAA0B,EAAE,YAA0B;IACpF,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,UAAU,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC,UAAU,CAAC;IACvF,OAAO,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,cAAc,CAAC,CAAsB,EAAE,CAAsB;IACrE,MAAM,QAAQ,GAAG,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IAC/D,IAAI,QAAQ,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IACpC,OAAO,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,sBAAsB,CAAC,KAA0B,EAAE,MAAM,GAAG,EAAE;IACtE,OAAO,GAAG,MAAM,MAAM,KAAK,CAAC,EAAE,KAAK,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;AACjH,CAAC"}
@@ -8,7 +8,7 @@ export type LlmContext = {
8
8
  system: SystemModelMessage | SystemModelMessage[];
9
9
  messages: ModelMessage[];
10
10
  };
11
- export declare function buildSystemMessages(baseInstructions: string, observationLogMemory: string | undefined, instructionProviderOptions?: ProviderOptions, volatileInstructions?: string): SystemModelMessage | SystemModelMessage[];
11
+ export declare function buildSystemMessages(baseInstructions: string, observationLogMemory: string | undefined, instructionProviderOptions?: ProviderOptions, volatileInstructions?: string, mcpConnectionNote?: string): SystemModelMessage | SystemModelMessage[];
12
12
  export declare class AgentMessageList {
13
13
  private all;
14
14
  private historySet;
@@ -19,6 +19,7 @@ export declare class AgentMessageList {
19
19
  private createdAtSortKey;
20
20
  private sortAllByCreatedAt;
21
21
  observationLogMemory: string | undefined;
22
+ mcpConnectionNote: string | undefined;
22
23
  seedLastCreatedAt(timestamp: number): void;
23
24
  addHistory(messages: AgentMessage[] | AgentDbMessage[]): void;
24
25
  addInput(messages: AgentMessage[] | AgentDbMessage[]): void;
@@ -6,11 +6,15 @@ const messages_1 = require("./messages");
6
6
  const message_1 = require("../../sdk/message");
7
7
  const runtime_helpers_1 = require("../loop/runtime-helpers");
8
8
  const strip_orphaned_tool_messages_1 = require("../memory/strip-orphaned-tool-messages");
9
- function buildSystemMessages(baseInstructions, observationLogMemory, instructionProviderOptions, volatileInstructions) {
9
+ function buildSystemMessages(baseInstructions, observationLogMemory, instructionProviderOptions, volatileInstructions, mcpConnectionNote) {
10
10
  const cacheOptions = instructionProviderOptions
11
11
  ? { providerOptions: instructionProviderOptions }
12
12
  : {};
13
- const volatileSections = [volatileInstructions?.trim(), observationLogMemory?.trim()].filter((s) => Boolean(s));
13
+ const volatileSections = [
14
+ volatileInstructions?.trim(),
15
+ mcpConnectionNote?.trim(),
16
+ observationLogMemory?.trim(),
17
+ ].filter((s) => Boolean(s));
14
18
  if (volatileSections.length === 0) {
15
19
  return {
16
20
  role: 'system',
@@ -156,7 +160,7 @@ class AgentMessageList {
156
160
  }
157
161
  forLlm(baseInstructions, instructionProviderOptions, volatileInstructions) {
158
162
  return {
159
- system: buildSystemMessages(baseInstructions, this.observationLogMemory, instructionProviderOptions, volatileInstructions),
163
+ system: buildSystemMessages(baseInstructions, this.observationLogMemory, instructionProviderOptions, volatileInstructions, this.mcpConnectionNote),
160
164
  messages: (0, messages_1.toAiMessages)((0, message_1.filterLlmMessages)((0, strip_orphaned_tool_messages_1.stripOrphanedToolMessages)(this.all))),
161
165
  };
162
166
  }
@@ -1 +1 @@
1
- {"version":3,"file":"message-list.js","sourceRoot":"","sources":["../../../src/runtime/model/message-list.ts"],"names":[],"mappings":";;;;AAGA,yCAA0C;AAC1C,+CAAoE;AA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AE,CAAC;gBAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACtD,CAAC;QACD,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC;IACb,CAAC;CACD"}
1
+ {"version":3,"file":"message-list.js","sourceRoot":"","sources":["../../../src/runtime/model/message-list.ts"],"names":[],"mappings":";;;;AAGA,yCAA0C;AAC1C,+CAAoE;AAIpE,6DAAyD;AACzD,yFAAmF;AAkBnF,6BACC,gBAAwB,EACxB,oBAAwC,EACxC,0BAA4C,EAC5C,oBAA6B,EAC7B,iBAA0B;IAE1B,MAAM,YAAY,GAAG,0BAA0B;QAC9C,CAAC,CAAC,EAAE,eAAe,EAAE,0BAA0B,EAAE;QACjD,CAAC,CAAC,EAAE,CAAC;IACN,MAAM,gBAAgB,GAAG;QACxB,oBAAoB,EAAE,IAAI,EAAE;QAC5B,iBAAiB,EAAE,IAAI,EAAE;QACzB,oBAAoB,EAAE,IAAI,EAAE;KAC5B,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAEzC,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnC,OAAO;YACN,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,gBAAgB;YACzB,GAAG,YAAY;SACf,CAAC;IACH,CAAC;IAED,OAAO;QACN;YACC,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,gBAAgB;YACzB,GAAG,YAAY;SACf;QACD;YACC,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,OAAO,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;SAC/C;KACD,CAAC;AACH,CAAC;AAmBD;IAAA;QACS,QAAG,GAAqB,EAAE,CAAC;QAE3B,eAAU,GAAG,IAAI,GAAG,EAAkB,CAAC;QAEvC,aAAQ,GAAG,IAAI,GAAG,EAAkB,CAAC;QAErC,gBA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,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACjB,IAAI,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACnD,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAC/C,IAAI,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACtD,CAAC;QACD,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC;IACb,CAAC;CACD"}
@@ -14,6 +14,7 @@ exports.PROVIDER_QUIRKS = {
14
14
  return {
15
15
  anthropic: {
16
16
  thinking: { type: 'adaptive', display: cfg.display ?? 'summarized' },
17
+ effort: cfg.effort ?? 'medium',
17
18
  },
18
19
  };
19
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"provider-quirks.js","sourceRoot":"","sources":["../../../src/runtime/model/provider-quirks.ts"],"names":[],"mappings":";;;;;;AA0Ba,QAAA,eAAe,GAAgD;IAC3E,SAAS,EAAE;QAKV,mBAAmB,EAAE,CAAC,WAAW,EAAE,cAAc,CAAC;QAOlD,0BAA0B,EAAE,EAAE,mBAAmB,EAAE,KAAK,EAAE;QAC1D,yBAAyB,EAAE,CAAC,QAAQ,EAAE,EAAE;YACvC,MAAM,GAAG,GAAG,QAAmC,CAAC;YAChD,IAAI,GAAG,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;gBAC7B,OAAO;oBACN,SAAS,EAAE;wBACV,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,IAAI,YAAY,EAAE;qBACpE;iBACD,CAAC;YACH,CAAC;YAC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,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAC1C,KAAK,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAA,eAAe,CAAC,EAAE,CAAC;QAClE,IAAI,CAAC,MAAM,CAAC,0BAA0B;YAAE,SAAS;QACjD,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,0BAA0B,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;IAClF,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import type { TelemetrySettings } from 'ai';
2
2
  import type { BuiltTelemetry } from '../../types';
3
3
  import type { ExecutionOptions } from '../../types/sdk/agent';
4
+ import type { OpaqueSpanLink } from '../../types/telemetry';
4
5
  import type { JSONValue } from '../../types/utils/json';
5
6
  import type { AgentRuntimeConfig } from '../loop/agent-runtime';
6
7
  export declare class RuntimeTelemetry {
@@ -11,7 +12,7 @@ export declare class RuntimeTelemetry {
11
12
  buildTelemetryOptions(options?: ExecutionOptions): {
12
13
  experimental_telemetry?: TelemetrySettings;
13
14
  };
14
- withRootSpan<T>(operation: 'generate' | 'stream', options: ExecutionOptions | undefined, runId: string, fn: () => Promise<T>): Promise<T>;
15
+ withRootSpan<T>(operation: 'generate' | 'stream', options: ExecutionOptions | undefined, runId: string, fn: () => Promise<T>, links?: OpaqueSpanLink[]): Promise<T>;
15
16
  withToolSpan<T>(toolCallId: string, toolName: string, input: JSONValue, t: BuiltTelemetry | undefined, fn: () => Promise<T>): Promise<T>;
16
17
  private buildTelemetryRootAttributes;
17
18
  private buildTelemetryMetadataAttributes;
@@ -45,20 +45,33 @@ function summarizeProviderToolForTelemetry(tool) {
45
45
  };
46
46
  }
47
47
  function buildAgentRootInputAttributes(config) {
48
- const localTools = (config.tools ?? []).map(summarizeToolForTelemetry);
49
- const providerTools = (config.providerTools ?? []).map(summarizeProviderToolForTelemetry);
50
- const tools = [...localTools, ...providerTools];
51
- const toolNames = tools
52
- .map((tool) => (typeof tool.name === 'string' ? tool.name : undefined))
53
- .filter((name) => name !== undefined);
48
+ const tools = buildAgentToolSummary(config);
54
49
  const serialized = stringifyTelemetryValue({
55
50
  agent: config.name,
56
51
  tool_count: tools.length,
57
52
  tools,
58
53
  });
54
+ return serialized ? { 'gen_ai.prompt': serialized } : {};
55
+ }
56
+ function buildAgentToolSummary(config) {
57
+ const localTools = (config.tools ?? []).map(summarizeToolForTelemetry);
58
+ const providerTools = (config.providerTools ?? []).map(summarizeProviderToolForTelemetry);
59
+ return [...localTools, ...providerTools];
60
+ }
61
+ function buildLangSmithToolCatalogAttributes(config) {
62
+ const toolNames = buildAgentToolSummary(config)
63
+ .map((tool) => (typeof tool.name === 'string' ? tool.name : undefined))
64
+ .filter((name) => name !== undefined);
65
+ return toolNames.length > 0 ? { 'langsmith.metadata.available_tools': toolNames } : {};
66
+ }
67
+ function buildGenAiRootAttributes(config, t) {
68
+ const modelId = t.metadata?.model_id;
69
+ const threadId = t.metadata?.thread_id;
59
70
  return {
60
- ...(toolNames.length > 0 ? { 'langsmith.metadata.available_tools': toolNames } : {}),
61
- ...(serialized ? { 'gen_ai.prompt': serialized } : {}),
71
+ 'gen_ai.operation.name': 'invoke_agent',
72
+ 'gen_ai.agent.name': config.name,
73
+ ...(typeof modelId === 'string' ? { 'gen_ai.request.model': modelId } : {}),
74
+ ...(typeof threadId === 'string' ? { 'gen_ai.conversation.id': threadId } : {}),
62
75
  };
63
76
  }
64
77
  class RuntimeTelemetry {
@@ -83,13 +96,17 @@ class RuntimeTelemetry {
83
96
  fallbackFunctionId: this.config.name,
84
97
  });
85
98
  }
86
- async withRootSpan(operation, options, runId, fn) {
99
+ async withRootSpan(operation, options, runId, fn, links) {
87
100
  const t = this.resolve(options);
88
101
  if (!t?.enabled || t.runtimeRootSpanEnabled === false || !isActiveSpanTracer(t.tracer)) {
89
102
  return await fn();
90
103
  }
91
104
  const spanName = `${t.functionId ?? this.config.name}.${operation}`;
92
- return await t.tracer.startActiveSpan(spanName, { attributes: this.buildTelemetryRootAttributes(t, spanName, runId) }, async (span) => {
105
+ return await t.tracer.startActiveSpan(spanName, {
106
+ ...(t.rootAnchored === false ? {} : { root: true }),
107
+ ...(links?.length ? { links } : {}),
108
+ attributes: this.buildTelemetryRootAttributes(t, spanName, runId),
109
+ }, async (span) => {
93
110
  try {
94
111
  return await fn();
95
112
  }
@@ -109,12 +126,18 @@ class RuntimeTelemetry {
109
126
  }
110
127
  const shouldRecordInputs = t.recordInputs ?? true;
111
128
  const inputValue = shouldRecordInputs ? stringifyTelemetryValue(input) : undefined;
112
- return await t.tracer.startActiveSpan('ai.toolCall', {
129
+ return await t.tracer.startActiveSpan(`execute_tool ${toolName}`, {
113
130
  attributes: {
114
131
  ...this.buildAiSdkOperationAttributes('ai.toolCall', t),
132
+ 'gen_ai.operation.name': 'execute_tool',
133
+ 'gen_ai.tool.name': toolName,
134
+ 'gen_ai.tool.call.id': toolCallId,
135
+ 'gen_ai.agent.name': this.config.name,
115
136
  'ai.toolCall.name': toolName,
116
137
  'ai.toolCall.id': toolCallId,
117
- ...(inputValue !== undefined ? { 'ai.toolCall.args': inputValue } : {}),
138
+ ...(inputValue !== undefined
139
+ ? { 'ai.toolCall.args': inputValue, 'gen_ai.tool.call.arguments': inputValue }
140
+ : {}),
118
141
  },
119
142
  }, async (span) => {
120
143
  try {
@@ -122,7 +145,10 @@ class RuntimeTelemetry {
122
145
  const shouldRecordOutputs = t.recordOutputs ?? true;
123
146
  const outputValue = shouldRecordOutputs ? stringifyTelemetryValue(result) : undefined;
124
147
  if (outputValue !== undefined) {
125
- span.setAttributes?.({ 'ai.toolCall.result': outputValue });
148
+ span.setAttributes?.({
149
+ 'ai.toolCall.result': outputValue,
150
+ 'gen_ai.tool.call.result': outputValue,
151
+ });
126
152
  }
127
153
  return result;
128
154
  }
@@ -137,14 +163,23 @@ class RuntimeTelemetry {
137
163
  });
138
164
  }
139
165
  buildTelemetryRootAttributes(t, spanName, runId) {
140
- const metadataAttributes = this.buildTelemetryMetadataAttributes(t, 'langsmith.metadata');
166
+ const isLangSmith = t.isLangSmith === true;
167
+ const langSmithMetadataAttributes = this.buildTelemetryMetadataAttributes(t, 'langsmith.metadata');
168
+ const genericMetadataAttributes = this.buildTelemetryMetadataAttributes(t, 'ai.telemetry.metadata');
141
169
  return {
142
- 'langsmith.traceable': 'true',
143
- 'langsmith.trace.name': spanName,
144
- 'langsmith.span.kind': 'chain',
145
- 'langsmith.metadata.agent_name': this.config.name,
146
- 'langsmith.metadata.agent_run_id': runId,
147
- ...metadataAttributes,
170
+ ...buildGenAiRootAttributes(this.config, t),
171
+ ...(isLangSmith
172
+ ? {
173
+ 'langsmith.traceable': 'true',
174
+ 'langsmith.trace.name': spanName,
175
+ 'langsmith.span.kind': 'chain',
176
+ 'langsmith.metadata.agent_name': this.config.name,
177
+ 'langsmith.metadata.agent_run_id': runId,
178
+ ...langSmithMetadataAttributes,
179
+ ...buildLangSmithToolCatalogAttributes(this.config),
180
+ }
181
+ : {}),
182
+ ...genericMetadataAttributes,
148
183
  ...buildAgentRootInputAttributes(this.config),
149
184
  };
150
185
  }