@open-mercato/ai-assistant 0.6.8-develop.6889.1.af4501ca97 → 0.6.8-develop.6892.1.f179677788
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/modules/ai_assistant/lib/agent-runtime.js +8 -6
- package/dist/modules/ai_assistant/lib/agent-runtime.js.map +2 -2
- package/dist/modules/ai_assistant/lib/ai-agent-definition.js.map +2 -2
- package/dist/modules/ai_assistant/lib/ai-overrides.js.map +1 -1
- package/package.json +6 -6
- package/src/modules/ai_assistant/lib/__tests__/agent-runtime-object.test.ts +30 -0
- package/src/modules/ai_assistant/lib/__tests__/agent-runtime-tool-loop-onstepfinish.test.ts +163 -0
- package/src/modules/ai_assistant/lib/__tests__/agent-runtime.test.ts +86 -0
- package/src/modules/ai_assistant/lib/agent-runtime.ts +14 -2
- package/src/modules/ai_assistant/lib/ai-agent-definition.ts +19 -0
- package/src/modules/ai_assistant/lib/ai-overrides.ts +3 -3
|
@@ -524,7 +524,7 @@ async function resolveTenantAllowlistSnapshot(container, tenantId, organizationI
|
|
|
524
524
|
return null;
|
|
525
525
|
}
|
|
526
526
|
}
|
|
527
|
-
async function composeSystemPrompt(agent, pageContext, container, tenantId, organizationId) {
|
|
527
|
+
async function composeSystemPrompt(agent, pageContext, container, tenantId, organizationId, userId) {
|
|
528
528
|
const baseFromOverride = await resolveBaseSystemPromptWithOverride(
|
|
529
529
|
agent,
|
|
530
530
|
container,
|
|
@@ -546,7 +546,8 @@ async function composeSystemPrompt(agent, pageContext, container, tenantId, orga
|
|
|
546
546
|
recordId,
|
|
547
547
|
container,
|
|
548
548
|
tenantId,
|
|
549
|
-
organizationId
|
|
549
|
+
organizationId,
|
|
550
|
+
userId: userId ?? null
|
|
550
551
|
};
|
|
551
552
|
try {
|
|
552
553
|
const hydrated = await resolve(hydrationInput);
|
|
@@ -846,7 +847,8 @@ async function runAiAgentText(input) {
|
|
|
846
847
|
input.pageContext,
|
|
847
848
|
input.container,
|
|
848
849
|
input.authContext.tenantId,
|
|
849
|
-
input.authContext.organizationId
|
|
850
|
+
input.authContext.organizationId,
|
|
851
|
+
input.authContext.userId
|
|
850
852
|
);
|
|
851
853
|
const systemPrompt = appendRuntimeMutationPolicy(
|
|
852
854
|
appendRuntimeTaskPlanPrompt(appendAttachmentSummary(baseSystemPrompt, resolvedAttachments), agent),
|
|
@@ -1010,8 +1012,7 @@ async function runAiAgentText(input) {
|
|
|
1010
1012
|
if (builtToolLoopAgent !== void 0) {
|
|
1011
1013
|
const agentStreamResult = await builtToolLoopAgent.stream({
|
|
1012
1014
|
messages: modelMessages,
|
|
1013
|
-
abortSignal: abortController.signal
|
|
1014
|
-
onStepFinish: wiredOnStepFinish
|
|
1015
|
+
abortSignal: abortController.signal
|
|
1015
1016
|
});
|
|
1016
1017
|
if (wallClockTimer !== void 0) {
|
|
1017
1018
|
const clearTimer = () => clearTimeout(wallClockTimer);
|
|
@@ -1138,7 +1139,8 @@ async function runAiAgentObject(input) {
|
|
|
1138
1139
|
input.pageContext,
|
|
1139
1140
|
input.container,
|
|
1140
1141
|
input.authContext.tenantId,
|
|
1141
|
-
input.authContext.organizationId
|
|
1142
|
+
input.authContext.organizationId,
|
|
1143
|
+
input.authContext.userId
|
|
1142
1144
|
);
|
|
1143
1145
|
const systemPrompt = appendRuntimeMutationPolicy(
|
|
1144
1146
|
appendRuntimeTaskPlanPrompt(appendAttachmentSummary(baseSystemPrompt, resolvedAttachments), agent),
|