@agent-native/core 0.12.5 → 0.12.6
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/index.d.ts +1 -1
- package/dist/agent/engine/index.d.ts.map +1 -1
- package/dist/agent/engine/index.js +1 -1
- package/dist/agent/engine/index.js.map +1 -1
- package/dist/agent/thread-data-builder.d.ts.map +1 -1
- package/dist/agent/thread-data-builder.js +2 -0
- package/dist/agent/thread-data-builder.js.map +1 -1
- package/dist/client/AgentPanel.js +3 -2
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/CommandMenu.d.ts +1 -0
- package/dist/client/CommandMenu.d.ts.map +1 -1
- package/dist/client/CommandMenu.js +11 -3
- package/dist/client/CommandMenu.js.map +1 -1
- package/dist/client/ErrorBoundary.d.ts.map +1 -1
- package/dist/client/ErrorBoundary.js +15 -5
- package/dist/client/ErrorBoundary.js.map +1 -1
- package/dist/client/FeedbackButton.d.ts.map +1 -1
- package/dist/client/FeedbackButton.js +7 -3
- package/dist/client/FeedbackButton.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +112 -33
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +63 -14
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/components/icons/AgentNativeIcon.d.ts +20 -0
- package/dist/client/components/icons/AgentNativeIcon.d.ts.map +1 -0
- package/dist/client/components/icons/AgentNativeIcon.js +12 -0
- package/dist/client/components/icons/AgentNativeIcon.js.map +1 -0
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/notifications/NotificationsBell.d.ts +5 -1
- package/dist/client/notifications/NotificationsBell.d.ts.map +1 -1
- package/dist/client/notifications/NotificationsBell.js +2 -2
- package/dist/client/notifications/NotificationsBell.js.map +1 -1
- package/dist/client/settings/UsageSection.d.ts.map +1 -1
- package/dist/client/settings/UsageSection.js +41 -8
- package/dist/client/settings/UsageSection.js.map +1 -1
- package/dist/client/sharing/ShareButton.js +19 -7
- package/dist/client/sharing/ShareButton.js.map +1 -1
- package/dist/client/sharing/ShareDialog.d.ts.map +1 -1
- package/dist/client/sharing/ShareDialog.js +16 -6
- package/dist/client/sharing/ShareDialog.js.map +1 -1
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +43 -4
- package/dist/client/sse-event-processor.js.map +1 -1
- package/dist/client/use-chat-threads.d.ts +1 -1
- package/dist/client/use-chat-threads.d.ts.map +1 -1
- package/dist/client/use-chat-threads.js +2 -2
- package/dist/client/use-chat-threads.js.map +1 -1
- package/dist/client/useProductionAgent.js +2 -2
- package/dist/client/useProductionAgent.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +45 -5
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/ssr-handler.d.ts.map +1 -1
- package/dist/server/ssr-handler.js +16 -6
- package/dist/server/ssr-handler.js.map +1 -1
- package/dist/sharing/actions/share-resource.d.ts +1 -0
- package/dist/sharing/actions/share-resource.d.ts.map +1 -1
- package/dist/sharing/actions/share-resource.js +65 -3
- package/dist/sharing/actions/share-resource.js.map +1 -1
- package/dist/sharing/registry.d.ts +5 -0
- package/dist/sharing/registry.d.ts.map +1 -1
- package/dist/sharing/registry.js.map +1 -1
- package/dist/usage/store.d.ts +16 -0
- package/dist/usage/store.d.ts.map +1 -1
- package/dist/usage/store.js +31 -0
- package/dist/usage/store.js.map +1 -1
- package/docs/content/sharing.md +9 -7
- package/package.json +1 -1
|
@@ -30,6 +30,7 @@ import { createVoiceProvidersStatusHandler } from "./voice-providers-status.js";
|
|
|
30
30
|
import { PROVIDER_ENV_META } from "../agent/engine/provider-env-vars.js";
|
|
31
31
|
import { canUpdateAgentLoopSettings, readAgentLoopSettings, resetAgentLoopSettings, validateMaxIterationsInput, writeAgentLoopSettings, } from "../agent/loop-settings.js";
|
|
32
32
|
import { isAgentEngineSettingConfigured, getAgentEngineEntry, detectEngineFromEnv, detectEngineFromUserSecrets, isStoredEngineUsable, } from "../agent/engine/registry.js";
|
|
33
|
+
import { registerBuiltinEngines } from "../agent/engine/builtin.js";
|
|
33
34
|
import { getOrgContext } from "../org/context.js";
|
|
34
35
|
import { isEnvVarWriteAllowed } from "./env-var-writes.js";
|
|
35
36
|
/**
|
|
@@ -38,6 +39,38 @@ import { isEnvVarWriteAllowed } from "./env-var-writes.js";
|
|
|
38
39
|
* collisions with template-specific `/api/*` routes.
|
|
39
40
|
*/
|
|
40
41
|
export const FRAMEWORK_ROUTE_PREFIX = "/_agent-native";
|
|
42
|
+
registerBuiltinEngines();
|
|
43
|
+
async function detectUsageEngineName(event, userEmail) {
|
|
44
|
+
try {
|
|
45
|
+
const stored = (await getSetting("agent-engine"));
|
|
46
|
+
if (isAgentEngineSettingConfigured(stored)) {
|
|
47
|
+
return stored.engine;
|
|
48
|
+
}
|
|
49
|
+
if (stored && typeof stored.engine === "string") {
|
|
50
|
+
const entry = getAgentEngineEntry(stored.engine);
|
|
51
|
+
if (entry && isStoredEngineUsable(stored, entry)) {
|
|
52
|
+
return stored.engine;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
let orgId;
|
|
56
|
+
if (userEmail) {
|
|
57
|
+
try {
|
|
58
|
+
const orgCtx = await getOrgContext(event);
|
|
59
|
+
orgId = orgCtx.orgId ?? undefined;
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
/* org module not present in this template */
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const detectedFromUser = await runWithRequestContext({ userEmail, orgId }, () => detectEngineFromUserSecrets());
|
|
66
|
+
if (detectedFromUser)
|
|
67
|
+
return detectedFromUser.name;
|
|
68
|
+
return detectEngineFromEnv()?.name ?? null;
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
41
74
|
function trackBuilderLifecycle(name, userEmail, properties = {}) {
|
|
42
75
|
if (!userEmail)
|
|
43
76
|
return;
|
|
@@ -1235,11 +1268,18 @@ export function createCoreRoutesPlugin(options = {}) {
|
|
|
1235
1268
|
}
|
|
1236
1269
|
const sinceDaysParam = new URL(`${event.url?.pathname || "/"}${event.url?.search || ""}`, "http://x").searchParams.get("sinceDays");
|
|
1237
1270
|
const sinceDays = Math.max(1, Math.min(365, Number(sinceDaysParam) || 30));
|
|
1238
|
-
const { getUsageSummary } = await import("../usage/store.js");
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1271
|
+
const { getUsageSummary, usageBillingForEngine } = await import("../usage/store.js");
|
|
1272
|
+
const [summary, engineName] = await Promise.all([
|
|
1273
|
+
getUsageSummary({
|
|
1274
|
+
ownerEmail: session.email,
|
|
1275
|
+
sinceMs: Date.now() - sinceDays * 86_400_000,
|
|
1276
|
+
}),
|
|
1277
|
+
detectUsageEngineName(event, session.email),
|
|
1278
|
+
]);
|
|
1279
|
+
return {
|
|
1280
|
+
...summary,
|
|
1281
|
+
billing: usageBillingForEngine(engineName),
|
|
1282
|
+
};
|
|
1243
1283
|
}));
|
|
1244
1284
|
// ─── File upload primitive ──────────────────────────────────────
|
|
1245
1285
|
// GET /_agent-native/file-upload/status — report active provider
|