@agent-native/core 0.7.26 → 0.7.28
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/dist/a2a/handlers.d.ts +1 -1
- package/dist/a2a/handlers.d.ts.map +1 -1
- package/dist/a2a/handlers.js +8 -7
- package/dist/a2a/handlers.js.map +1 -1
- package/dist/a2a/server.js +1 -1
- package/dist/a2a/server.js.map +1 -1
- package/dist/a2a/types.d.ts +2 -0
- package/dist/a2a/types.d.ts.map +1 -1
- package/dist/a2a/types.js.map +1 -1
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +77 -1
- package/dist/cli/create.js.map +1 -1
- package/dist/integrations/a2a-continuation-processor.d.ts.map +1 -1
- package/dist/integrations/a2a-continuation-processor.js +60 -15
- package/dist/integrations/a2a-continuation-processor.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +15 -14
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/package.json +1 -1
|
@@ -2004,6 +2004,18 @@ export function createAgentChatPlugin(options) {
|
|
|
2004
2004
|
toolActions = createToolActionEntries();
|
|
2005
2005
|
}
|
|
2006
2006
|
catch { }
|
|
2007
|
+
const resolveExtraContext = async (event, owner) => {
|
|
2008
|
+
if (!options?.extraContext)
|
|
2009
|
+
return "";
|
|
2010
|
+
try {
|
|
2011
|
+
const extra = await options.extraContext(event, owner);
|
|
2012
|
+
return extra ? `\n\n${extra}` : "";
|
|
2013
|
+
}
|
|
2014
|
+
catch (err) {
|
|
2015
|
+
console.warn("[agent-chat] extraContext threw:", err instanceof Error ? err.message : err);
|
|
2016
|
+
return "";
|
|
2017
|
+
}
|
|
2018
|
+
};
|
|
2007
2019
|
// In dev mode, template actions (templateScripts and discoveredActions) are
|
|
2008
2020
|
// NOT registered as native tools — the agent invokes them via shell instead.
|
|
2009
2021
|
// This avoids degenerate empty-object tool calls that Anthropic models
|
|
@@ -2190,9 +2202,10 @@ export function createAgentChatPlugin(options) {
|
|
|
2190
2202
|
const schemaBlock = lazyContext
|
|
2191
2203
|
? ""
|
|
2192
2204
|
: await buildSchemaBlock(owner, devActive);
|
|
2205
|
+
const extra = await resolveExtraContext(context.event, owner);
|
|
2193
2206
|
const systemPrompt = devActive
|
|
2194
|
-
? devPrompt + resources + schemaBlock
|
|
2195
|
-
: basePrompt + resources + schemaBlock;
|
|
2207
|
+
? devPrompt + resources + schemaBlock + extra
|
|
2208
|
+
: basePrompt + resources + schemaBlock + extra;
|
|
2196
2209
|
const model = options?.model ?? DEFAULT_MODEL;
|
|
2197
2210
|
// Build tools — same as interactive handler but WITHOUT call-agent
|
|
2198
2211
|
// to prevent infinite recursive A2A loops (agent calling itself).
|
|
@@ -2679,18 +2692,6 @@ export function createAgentChatPlugin(options) {
|
|
|
2679
2692
|
// Always build the production handler (includes resource tools + call-agent + team tools)
|
|
2680
2693
|
// In production mode (!canToggle), resolve the owner from the request session.
|
|
2681
2694
|
const isHostedProd = !canToggle;
|
|
2682
|
-
const resolveExtraContext = async (event, owner) => {
|
|
2683
|
-
if (!options?.extraContext)
|
|
2684
|
-
return "";
|
|
2685
|
-
try {
|
|
2686
|
-
const extra = await options.extraContext(event, owner);
|
|
2687
|
-
return extra ? `\n\n${extra}` : "";
|
|
2688
|
-
}
|
|
2689
|
-
catch (err) {
|
|
2690
|
-
console.warn("[agent-chat] extraContext threw:", err instanceof Error ? err.message : err);
|
|
2691
|
-
return "";
|
|
2692
|
-
}
|
|
2693
|
-
};
|
|
2694
2695
|
// Lean mode: use only the template's systemPrompt + actions list.
|
|
2695
2696
|
// Skip resource loading and schema block — those add DB round-trips
|
|
2696
2697
|
// and tokens that minimal/voice apps don't need.
|