@memberjunction/ai-agents 5.47.0 → 5.49.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.
- package/README.md +14 -0
- package/dist/AgentRunner.d.ts.map +1 -1
- package/dist/AgentRunner.js +5 -0
- package/dist/AgentRunner.js.map +1 -1
- package/dist/ConversationCompactionManager.d.ts +198 -0
- package/dist/ConversationCompactionManager.d.ts.map +1 -0
- package/dist/ConversationCompactionManager.js +384 -0
- package/dist/ConversationCompactionManager.js.map +1 -0
- package/dist/ConversationToolManager.d.ts +154 -0
- package/dist/ConversationToolManager.d.ts.map +1 -0
- package/dist/ConversationToolManager.js +336 -0
- package/dist/ConversationToolManager.js.map +1 -0
- package/dist/agent-types/loop-agent-prompt-params.d.ts +8 -0
- package/dist/agent-types/loop-agent-prompt-params.d.ts.map +1 -1
- package/dist/agent-types/loop-agent-prompt-params.js +1 -0
- package/dist/agent-types/loop-agent-prompt-params.js.map +1 -1
- package/dist/agent-types/loop-agent-response-type.d.ts +10 -1
- package/dist/agent-types/loop-agent-response-type.d.ts.map +1 -1
- package/dist/agent-types/loop-agent-response-type.js.map +1 -1
- package/dist/agent-types/loop-agent-type.d.ts +23 -34
- package/dist/agent-types/loop-agent-type.d.ts.map +1 -1
- package/dist/agent-types/loop-agent-type.js +75 -2
- package/dist/agent-types/loop-agent-type.js.map +1 -1
- package/dist/base-agent.d.ts +322 -4
- package/dist/base-agent.d.ts.map +1 -1
- package/dist/base-agent.js +882 -92
- package/dist/base-agent.js.map +1 -1
- package/dist/conversation-history-format.d.ts +19 -0
- package/dist/conversation-history-format.d.ts.map +1 -0
- package/dist/conversation-history-format.js +40 -0
- package/dist/conversation-history-format.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/prior-turn-tool-result-cache.d.ts +71 -0
- package/dist/prior-turn-tool-result-cache.d.ts.map +1 -0
- package/dist/prior-turn-tool-result-cache.js +85 -0
- package/dist/prior-turn-tool-result-cache.js.map +1 -0
- package/dist/realtime/agent-media-library.js +1 -1
- package/dist/realtime/agent-media-library.js.map +1 -1
- package/dist/realtime/realtime-client-session-service.d.ts.map +1 -1
- package/dist/realtime/realtime-client-session-service.js +7 -3
- package/dist/realtime/realtime-client-session-service.js.map +1 -1
- package/dist/realtime/realtime-coagent-config.d.ts +41 -0
- package/dist/realtime/realtime-coagent-config.d.ts.map +1 -1
- package/dist/realtime/realtime-coagent-config.js +69 -0
- package/dist/realtime/realtime-coagent-config.js.map +1 -1
- package/dist/realtime/realtime-session-runner.d.ts +72 -1
- package/dist/realtime/realtime-session-runner.d.ts.map +1 -1
- package/dist/realtime/realtime-session-runner.js +215 -13
- package/dist/realtime/realtime-session-runner.js.map +1 -1
- package/dist/realtime/realtime-tool-broker.d.ts +7 -2
- package/dist/realtime/realtime-tool-broker.d.ts.map +1 -1
- package/dist/realtime/realtime-tool-broker.js +13 -10
- package/dist/realtime/realtime-tool-broker.js.map +1 -1
- package/dist/tool-result-format.d.ts +78 -0
- package/dist/tool-result-format.d.ts.map +1 -0
- package/dist/tool-result-format.js +46 -0
- package/dist/tool-result-format.js.map +1 -0
- package/package.json +18 -18
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Single source of truth for the markdown tool-result section shape
|
|
3
|
+
* rendered back into the LLM's context:
|
|
4
|
+
*
|
|
5
|
+
* ```
|
|
6
|
+
* ### [ordinal. ][prefix.]tool({...input})
|
|
7
|
+
* ```json
|
|
8
|
+
* ...result data...
|
|
9
|
+
* ```
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* Three call sites feed this shape to the model — same-turn conversation-tool
|
|
13
|
+
* injection, same-turn artifact-tool injection, and the prior-turn carry-forward
|
|
14
|
+
* message — and the loop-agent system prompt teaches the model to read it. All of
|
|
15
|
+
* them must render through these functions so the contract cannot drift between
|
|
16
|
+
* paths. Callers own size-capping policy; these functions only own the shape.
|
|
17
|
+
*
|
|
18
|
+
* @module @memberjunction/ai-agents
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* The tool families whose step results are eligible for prior-turn carry-forward —
|
|
22
|
+
* single source of the family values. Stamp sites and the eligibility check both
|
|
23
|
+
* derive from this map so a renamed value breaks at compile time, never silently.
|
|
24
|
+
*/
|
|
25
|
+
export const CarryForwardToolFamily = {
|
|
26
|
+
Conversation: 'conversation',
|
|
27
|
+
Artifact: 'artifact'
|
|
28
|
+
};
|
|
29
|
+
function formatHeading(parts) {
|
|
30
|
+
const ordinal = parts.ordinal !== undefined ? `${parts.ordinal}. ` : '';
|
|
31
|
+
const prefix = parts.signaturePrefix ? `${parts.signaturePrefix}.` : '';
|
|
32
|
+
return `### ${ordinal}${prefix}${parts.tool}(${JSON.stringify(parts.input || {})})`;
|
|
33
|
+
}
|
|
34
|
+
/** Renders result data for the fenced block: strings pass through, everything else pretty-JSON. */
|
|
35
|
+
export function RenderToolResultData(data) {
|
|
36
|
+
return typeof data === 'string' ? data : JSON.stringify(data, null, 2);
|
|
37
|
+
}
|
|
38
|
+
/** One successful tool-result section: heading + fenced JSON body (body already capped by the caller). */
|
|
39
|
+
export function FormatToolResultSection(parts, body) {
|
|
40
|
+
return `${formatHeading(parts)}\n\`\`\`json\n${body}\n\`\`\``;
|
|
41
|
+
}
|
|
42
|
+
/** One failed tool-result section: heading + bolded error line. */
|
|
43
|
+
export function FormatToolErrorSection(parts, errorMessage) {
|
|
44
|
+
return `${formatHeading(parts)}\n**Error:** ${errorMessage}`;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=tool-result-format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-result-format.js","sourceRoot":"","sources":["../src/tool-result-format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IAClC,YAAY,EAAE,cAAc;IAC5B,QAAQ,EAAE,UAAU;CACd,CAAC;AA6CX,SAAS,aAAa,CAAC,KAA6B;IAChD,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IACxE,MAAM,MAAM,GAAG,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IACxE,OAAO,OAAO,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,GAAG,CAAC;AACxF,CAAC;AAED,mGAAmG;AACnG,MAAM,UAAU,oBAAoB,CAAC,IAAa;IAC9C,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC3E,CAAC;AAED,0GAA0G;AAC1G,MAAM,UAAU,uBAAuB,CAAC,KAA6B,EAAE,IAAY;IAC/E,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC,iBAAiB,IAAI,UAAU,CAAC;AAClE,CAAC;AAED,mEAAmE;AACnE,MAAM,UAAU,sBAAsB,CAAC,KAA6B,EAAE,YAAgC;IAClG,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC,gBAAgB,YAAY,EAAE,CAAC;AACjE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ai-agents",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.49.0",
|
|
5
5
|
"description": "MemberJunction: AI Agent Execution and Management",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -17,23 +17,23 @@
|
|
|
17
17
|
"author": "MemberJunction.com",
|
|
18
18
|
"license": "ISC",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@memberjunction/actions": "5.
|
|
21
|
-
"@memberjunction/actions-base": "5.
|
|
22
|
-
"@memberjunction/ai": "5.
|
|
23
|
-
"@memberjunction/ai-core-plus": "5.
|
|
24
|
-
"@memberjunction/ai-engine-base": "5.
|
|
25
|
-
"@memberjunction/ai-prompts": "5.
|
|
26
|
-
"@memberjunction/ai-reranker": "5.
|
|
27
|
-
"@memberjunction/ai-vector-dupe": "5.
|
|
28
|
-
"@memberjunction/ai-vector-sync": "5.
|
|
29
|
-
"@memberjunction/aiengine": "5.
|
|
30
|
-
"@memberjunction/context-crush": "5.
|
|
31
|
-
"@memberjunction/core": "5.
|
|
32
|
-
"@memberjunction/core-entities": "5.
|
|
33
|
-
"@memberjunction/global": "5.
|
|
34
|
-
"@memberjunction/search-engine": "5.
|
|
35
|
-
"@memberjunction/storage": "5.
|
|
36
|
-
"@memberjunction/templates": "5.
|
|
20
|
+
"@memberjunction/actions": "5.49.0",
|
|
21
|
+
"@memberjunction/actions-base": "5.49.0",
|
|
22
|
+
"@memberjunction/ai": "5.49.0",
|
|
23
|
+
"@memberjunction/ai-core-plus": "5.49.0",
|
|
24
|
+
"@memberjunction/ai-engine-base": "5.49.0",
|
|
25
|
+
"@memberjunction/ai-prompts": "5.49.0",
|
|
26
|
+
"@memberjunction/ai-reranker": "5.49.0",
|
|
27
|
+
"@memberjunction/ai-vector-dupe": "5.49.0",
|
|
28
|
+
"@memberjunction/ai-vector-sync": "5.49.0",
|
|
29
|
+
"@memberjunction/aiengine": "5.49.0",
|
|
30
|
+
"@memberjunction/context-crush": "5.49.0",
|
|
31
|
+
"@memberjunction/core": "5.49.0",
|
|
32
|
+
"@memberjunction/core-entities": "5.49.0",
|
|
33
|
+
"@memberjunction/global": "5.49.0",
|
|
34
|
+
"@memberjunction/search-engine": "5.49.0",
|
|
35
|
+
"@memberjunction/storage": "5.49.0",
|
|
36
|
+
"@memberjunction/templates": "5.49.0",
|
|
37
37
|
"dotenv": "^17.2.4",
|
|
38
38
|
"exceljs": "^4.4.0",
|
|
39
39
|
"lodash": "^4.17.23",
|