@agent-native/core 0.12.21 → 0.12.23
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/agent/engine/ai-sdk-engine.d.ts +2 -0
- package/dist/agent/engine/ai-sdk-engine.d.ts.map +1 -1
- package/dist/agent/engine/ai-sdk-engine.js +11 -5
- package/dist/agent/engine/ai-sdk-engine.js.map +1 -1
- package/dist/agent/engine/anthropic-engine.d.ts.map +1 -1
- package/dist/agent/engine/anthropic-engine.js +2 -1
- package/dist/agent/engine/anthropic-engine.js.map +1 -1
- package/dist/agent/engine/builder-engine.d.ts.map +1 -1
- package/dist/agent/engine/builder-engine.js +117 -8
- package/dist/agent/engine/builder-engine.js.map +1 -1
- package/dist/agent/engine/registry.d.ts.map +1 -1
- package/dist/agent/engine/registry.js +24 -13
- package/dist/agent/engine/registry.js.map +1 -1
- package/dist/agent/production-agent.d.ts +2 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +21 -11
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/checkpoints/service.d.ts +1 -0
- package/dist/checkpoints/service.d.ts.map +1 -1
- package/dist/checkpoints/service.js +6 -3
- package/dist/checkpoints/service.js.map +1 -1
- package/dist/client/AgentPanel.js +1 -1
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +133 -6
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/FeedbackButton.js +1 -1
- package/dist/client/FeedbackButton.js.map +1 -1
- package/dist/client/analytics.d.ts.map +1 -1
- package/dist/client/analytics.js +26 -0
- package/dist/client/analytics.js.map +1 -1
- package/dist/client/components/ui/tooltip.js +1 -1
- package/dist/client/components/ui/tooltip.js.map +1 -1
- package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
- package/dist/client/composer/TiptapComposer.js +2 -6
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/composer/useVoiceDictation.d.ts +1 -0
- package/dist/client/composer/useVoiceDictation.d.ts.map +1 -1
- package/dist/client/composer/useVoiceDictation.js +52 -7
- package/dist/client/composer/useVoiceDictation.js.map +1 -1
- package/dist/client/resources/ResourcesPanel.js +1 -1
- package/dist/client/resources/ResourcesPanel.js.map +1 -1
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +3 -0
- package/dist/client/sse-event-processor.js.map +1 -1
- package/dist/extensions/html-shell.d.ts.map +1 -1
- package/dist/extensions/html-shell.js +12 -0
- package/dist/extensions/html-shell.js.map +1 -1
- package/dist/mcp-client/errors.d.ts +2 -0
- package/dist/mcp-client/errors.d.ts.map +1 -0
- package/dist/mcp-client/errors.js +47 -0
- package/dist/mcp-client/errors.js.map +1 -0
- package/dist/mcp-client/manager.d.ts.map +1 -1
- package/dist/mcp-client/manager.js +44 -15
- package/dist/mcp-client/manager.js.map +1 -1
- package/dist/mcp-client/routes.d.ts +1 -2
- package/dist/mcp-client/routes.d.ts.map +1 -1
- package/dist/mcp-client/routes.js +2 -27
- package/dist/mcp-client/routes.js.map +1 -1
- package/dist/progress/store.d.ts +2 -0
- package/dist/progress/store.d.ts.map +1 -1
- package/dist/progress/store.js +44 -0
- package/dist/progress/store.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +38 -6
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +31 -9
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/credential-provider.d.ts +8 -0
- package/dist/server/credential-provider.d.ts.map +1 -1
- package/dist/server/credential-provider.js +29 -3
- package/dist/server/credential-provider.js.map +1 -1
- package/dist/server/security-headers.d.ts +5 -4
- package/dist/server/security-headers.d.ts.map +1 -1
- package/dist/server/security-headers.js +6 -5
- package/dist/server/security-headers.js.map +1 -1
- package/dist/terminal/terminal-plugin.d.ts.map +1 -1
- package/dist/terminal/terminal-plugin.js +4 -3
- package/dist/terminal/terminal-plugin.js.map +1 -1
- package/package.json +1 -1
|
@@ -2618,11 +2618,28 @@ export function createAgentChatPlugin(options) {
|
|
|
2618
2618
|
resolveOrgId: options?.resolveOrgId,
|
|
2619
2619
|
});
|
|
2620
2620
|
}
|
|
2621
|
+
const preRunGitStatusByThread = new Map();
|
|
2622
|
+
async function recordPreRunGitStatus(threadId) {
|
|
2623
|
+
if (!isDevMode())
|
|
2624
|
+
return;
|
|
2625
|
+
try {
|
|
2626
|
+
const { getUncommittedStatus, isGitRepo } = await import("../checkpoints/service.js");
|
|
2627
|
+
const cwd = process.cwd();
|
|
2628
|
+
preRunGitStatusByThread.set(threadId, isGitRepo(cwd) ? getUncommittedStatus(cwd) : null);
|
|
2629
|
+
}
|
|
2630
|
+
catch {
|
|
2631
|
+
preRunGitStatusByThread.set(threadId, null);
|
|
2632
|
+
}
|
|
2633
|
+
}
|
|
2621
2634
|
// Callback to persist agent response when run finishes (even if client disconnected).
|
|
2622
2635
|
// Reconstructs the assistant message from buffered events and appends to thread_data.
|
|
2623
2636
|
const onRunComplete = async (run, threadId) => {
|
|
2624
|
-
|
|
2637
|
+
const runThreadId = String(run?.threadId ?? threadId ?? "");
|
|
2638
|
+
if (!threadId) {
|
|
2639
|
+
if (runThreadId)
|
|
2640
|
+
preRunGitStatusByThread.delete(runThreadId);
|
|
2625
2641
|
return;
|
|
2642
|
+
}
|
|
2626
2643
|
// Serialize the read-modify-write against the same thread's other
|
|
2627
2644
|
// `thread_data` writers (setThreadQueuedMessages, setThreadEngineMeta,
|
|
2628
2645
|
// the frontend-triggered saves below). Without the lock, a concurrent
|
|
@@ -2707,9 +2724,21 @@ export function createAgentChatPlugin(options) {
|
|
|
2707
2724
|
// Auto-checkpoint in dev mode after file-modifying agent turns
|
|
2708
2725
|
if (isDevMode()) {
|
|
2709
2726
|
try {
|
|
2710
|
-
const { createCheckpoint: gitCheckpoint, isGitRepo, hasUncommittedChanges, getChangedFileNames, } = await import("../checkpoints/service.js");
|
|
2727
|
+
const { createCheckpoint: gitCheckpoint, isGitRepo, hasUncommittedChanges, getChangedFileNames, getUncommittedStatus, } = await import("../checkpoints/service.js");
|
|
2711
2728
|
const cwd = process.cwd();
|
|
2712
|
-
|
|
2729
|
+
const preRunStatus = runThreadId
|
|
2730
|
+
? preRunGitStatusByThread.get(runThreadId)
|
|
2731
|
+
: undefined;
|
|
2732
|
+
if (runThreadId)
|
|
2733
|
+
preRunGitStatusByThread.delete(runThreadId);
|
|
2734
|
+
// Only auto-commit checkpoints for changes produced by this run.
|
|
2735
|
+
// If the tree was already dirty, a checkpoint commit would sweep
|
|
2736
|
+
// up the user's unrelated work when a reconnect/refresh finishes.
|
|
2737
|
+
const postRunStatus = getUncommittedStatus(cwd);
|
|
2738
|
+
if (preRunStatus === "" &&
|
|
2739
|
+
postRunStatus?.trim() &&
|
|
2740
|
+
isGitRepo(cwd) &&
|
|
2741
|
+
hasUncommittedChanges(cwd)) {
|
|
2713
2742
|
let summary = "";
|
|
2714
2743
|
// Try to extract the first sentence of the assistant's text response
|
|
2715
2744
|
let assistantText = "";
|
|
@@ -2928,7 +2957,8 @@ export function createAgentChatPlugin(options) {
|
|
|
2928
2957
|
runCtx.model = model;
|
|
2929
2958
|
}
|
|
2930
2959
|
},
|
|
2931
|
-
onRunStart: (send, threadId) => {
|
|
2960
|
+
onRunStart: async (send, threadId) => {
|
|
2961
|
+
await recordPreRunGitStatus(threadId);
|
|
2932
2962
|
_runSendByThread.set(threadId, send);
|
|
2933
2963
|
const runCtx = ensureRequestRunContext();
|
|
2934
2964
|
if (runCtx)
|
|
@@ -2963,7 +2993,8 @@ export function createAgentChatPlugin(options) {
|
|
|
2963
2993
|
runCtx.model = model;
|
|
2964
2994
|
}
|
|
2965
2995
|
},
|
|
2966
|
-
onRunStart: (send, threadId) => {
|
|
2996
|
+
onRunStart: async (send, threadId) => {
|
|
2997
|
+
await recordPreRunGitStatus(threadId);
|
|
2967
2998
|
_runSendByThread.set(threadId, send);
|
|
2968
2999
|
const runCtx = ensureRequestRunContext();
|
|
2969
3000
|
if (runCtx)
|
|
@@ -3046,7 +3077,8 @@ export function createAgentChatPlugin(options) {
|
|
|
3046
3077
|
runCtx.model = model;
|
|
3047
3078
|
}
|
|
3048
3079
|
},
|
|
3049
|
-
onRunStart: (send, threadId) => {
|
|
3080
|
+
onRunStart: async (send, threadId) => {
|
|
3081
|
+
await recordPreRunGitStatus(threadId);
|
|
3050
3082
|
_runSendByThread.set(threadId, send);
|
|
3051
3083
|
const runCtx = ensureRequestRunContext();
|
|
3052
3084
|
if (runCtx)
|