@agent-native/core 0.185.0 → 0.186.0-nightly-20260923174435
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/corpus/README.md +1 -1
- package/corpus/templates/calendar/actions/delete-event.ts +6 -4
- package/corpus/templates/calendar/actions/delete-events.ts +10 -11
- package/corpus/templates/calendar/actions/event-action-helpers.ts +53 -0
- package/corpus/templates/calendar/actions/get-event.ts +59 -14
- package/corpus/templates/calendar/actions/rsvp-event.ts +5 -3
- package/corpus/templates/calendar/actions/update-event.ts +15 -7
- package/corpus/templates/calendar/actions/update-events.ts +29 -11
- package/corpus/templates/calendar/changelog/2026-09-21-events-stay-editable-when-their-calendar-is-connected-throug.md +6 -0
- package/corpus/templates/calendar/server/lib/google-calendar.ts +70 -18
- package/corpus/templates/calendar/shared/google-calendar-sources.ts +47 -0
- package/corpus/templates/clips/actions/finalize-recording.ts +35 -1
- package/corpus/templates/clips/app/components/player/delete-recording-menu.tsx +5 -1
- package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +18 -1
- package/corpus/templates/clips/app/routes/_app.r.$recordingId.tsx +2 -2
- package/corpus/templates/clips/app/routes/record.tsx +1 -0
- package/corpus/templates/clips/changelog/2026-09-23-long-recording-menus-scroll-within-the-visible-space-so-ever.md +6 -0
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/chunk.post.ts +14 -4
- package/corpus/templates/content/app/blocks/contentBlockRegistry.tsx +9 -1
- package/corpus/templates/content/app/components/editor/SlashCommandMenu.tsx +16 -2
- package/corpus/templates/content/app/components/editor/registrySlashItems.ts +61 -40
- package/corpus/templates/content/app/i18n-data.ts +12 -0
- package/corpus/templates/content/app/routes/_app.settings.tsx +36 -9
- package/corpus/templates/content/docs/product/capabilities/content.renderer.custom-block.md +1 -1
- package/corpus/templates/content/server/plugins/agent-chat.ts +1 -0
- package/corpus/templates/content/shared/labs.ts +35 -1
- package/corpus/templates/slides/actions/get-design-system.ts +4 -2
- package/dist/agent/engine/openai-compatible-endpoint.d.ts +7 -0
- package/dist/agent/engine/openai-compatible-endpoint.js +9 -0
- package/dist/agent/engine/provider-endpoint-validation.d.ts +8 -1
- package/dist/agent/engine/provider-endpoint-validation.js +47 -10
- package/dist/agent/engine/registry.js +8 -5
- package/dist/automation/index.d.ts +1 -1
- package/dist/cli/skills.d.ts +3 -0
- package/dist/cli/skills.js +45 -9
- package/dist/client/agent-engine-key.d.ts +7 -0
- package/dist/client/agent-engine-key.js +37 -0
- package/dist/client/agent-provider-catalog.js +1 -1
- package/dist/client/settings/ProviderSetupForm.js +80 -7
- package/dist/client/settings/SettingsPanel.js +149 -11
- package/dist/client/use-chat-models.js +31 -0
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/routes.d.ts +1 -1
- package/dist/labs/actions/set-lab.js +1 -0
- package/dist/labs/registry.js +6 -1
- package/dist/localization/default-messages.d.ts +7 -1
- package/dist/localization/default-messages.js +7 -1
- package/dist/mcp/screen-memory-stdio.d.ts +7 -7
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/observability/routes.d.ts +3 -3
- package/dist/org/index.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +6 -6
- package/dist/provider-api/actions/provider-api.d.ts +3 -3
- package/dist/scripts/agent-engines/test-agent-engine.js +9 -7
- package/dist/secrets/routes.d.ts +3 -3
- package/dist/server/agent-engine-api-key-route.d.ts +3 -3
- package/dist/server/agent-engine-api-key-route.js +8 -5
- package/dist/server/agent-engine-ollama-models-route.d.ts +15 -0
- package/dist/server/agent-engine-ollama-models-route.js +105 -0
- package/dist/server/core-routes-plugin.js +5 -0
- package/dist/server/credential-provider.d.ts +13 -0
- package/dist/server/credential-provider.js +19 -0
- package/package.json +3 -3
|
@@ -312,8 +312,8 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
|
|
|
312
312
|
scope?: "org" | "user" | undefined;
|
|
313
313
|
}, {
|
|
314
314
|
id?: undefined;
|
|
315
|
-
provider?: undefined;
|
|
316
315
|
deleted?: undefined;
|
|
316
|
+
provider?: undefined;
|
|
317
317
|
providers: {
|
|
318
318
|
id: string;
|
|
319
319
|
label: string;
|
|
@@ -339,8 +339,8 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
|
|
|
339
339
|
label?: undefined;
|
|
340
340
|
message?: undefined;
|
|
341
341
|
} | {
|
|
342
|
-
provider?: undefined;
|
|
343
342
|
deleted?: undefined;
|
|
343
|
+
provider?: undefined;
|
|
344
344
|
count?: undefined;
|
|
345
345
|
providers?: undefined;
|
|
346
346
|
found: boolean;
|
|
@@ -359,8 +359,8 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
|
|
|
359
359
|
label?: undefined;
|
|
360
360
|
message?: undefined;
|
|
361
361
|
} | {
|
|
362
|
-
provider?: undefined;
|
|
363
362
|
deleted?: undefined;
|
|
363
|
+
provider?: undefined;
|
|
364
364
|
count?: undefined;
|
|
365
365
|
providers?: undefined;
|
|
366
366
|
found?: undefined;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { getAgentEngineEntry, registerBuiltinEngines, } from "../../agent/engine/index.js";
|
|
5
5
|
import { OLLAMA_BASE_URL_ENV_VAR, OPENAI_BASE_URL_ENV_VAR, } from "../../agent/engine/openai-compatible-endpoint.js";
|
|
6
6
|
import { validateProviderBaseUrl } from "../../agent/engine/provider-endpoint-validation.js";
|
|
7
|
-
import { canUseDeployCredentialFallbackForRequest, readDeployCredentialEnv, resolveSecret, } from "../../server/credential-provider.js";
|
|
7
|
+
import { canUseDeployCredentialFallbackForRequest, isTrustedSelfHostedRuntime, readDeployCredentialEnv, resolveSecret, } from "../../server/credential-provider.js";
|
|
8
8
|
export const tool = {
|
|
9
9
|
description: "Test an agent engine by sending a trivial prompt and measuring latency. Useful for verifying API keys and connectivity before switching engines.",
|
|
10
10
|
parameters: {
|
|
@@ -42,18 +42,19 @@ async function resolveAgentEngineSecret(key) {
|
|
|
42
42
|
: undefined;
|
|
43
43
|
}
|
|
44
44
|
async function resolveAgentEngineEndpoint(key) {
|
|
45
|
+
const isOllama = key === OLLAMA_BASE_URL_ENV_VAR;
|
|
45
46
|
const value = await resolveSecret(key);
|
|
46
47
|
if (value) {
|
|
47
48
|
return validateProviderBaseUrl(value, {
|
|
48
|
-
allowLocalOllama:
|
|
49
|
-
|
|
49
|
+
allowLocalOllama: isOllama && isTrustedSelfHostedRuntime(),
|
|
50
|
+
isOllama,
|
|
50
51
|
});
|
|
51
52
|
}
|
|
52
53
|
if (!canUseDeployCredentialFallbackForRequest(key))
|
|
53
54
|
return undefined;
|
|
54
55
|
const deployValue = readDeployCredentialEnv(key);
|
|
55
56
|
return deployValue
|
|
56
|
-
? validateProviderBaseUrl(deployValue, { allowPrivate: true })
|
|
57
|
+
? validateProviderBaseUrl(deployValue, { allowPrivate: true, isOllama })
|
|
57
58
|
: undefined;
|
|
58
59
|
}
|
|
59
60
|
function canUseDeployEnvForEntry(entry) {
|
|
@@ -69,14 +70,15 @@ async function createEngineConfig(entry, args) {
|
|
|
69
70
|
allowEnvFallback: canUseDeployEnvForEntry(entry),
|
|
70
71
|
};
|
|
71
72
|
if (entry.name === "ai-sdk:openai" || entry.name === "ai-sdk:ollama") {
|
|
72
|
-
const
|
|
73
|
+
const isOllama = entry.name === "ai-sdk:ollama";
|
|
74
|
+
const endpointKey = isOllama
|
|
73
75
|
? OLLAMA_BASE_URL_ENV_VAR
|
|
74
76
|
: OPENAI_BASE_URL_ENV_VAR;
|
|
75
77
|
const explicitBaseUrl = args.baseUrl?.trim();
|
|
76
78
|
const baseUrl = explicitBaseUrl
|
|
77
79
|
? await validateProviderBaseUrl(explicitBaseUrl, {
|
|
78
|
-
allowLocalOllama:
|
|
79
|
-
|
|
80
|
+
allowLocalOllama: isOllama && isTrustedSelfHostedRuntime(),
|
|
81
|
+
isOllama,
|
|
80
82
|
})
|
|
81
83
|
: await resolveAgentEngineEndpoint(endpointKey);
|
|
82
84
|
if (baseUrl)
|
package/dist/secrets/routes.d.ts
CHANGED
|
@@ -57,16 +57,16 @@ export declare function createListSecretsHandler(): import("h3").EventHandlerWit
|
|
|
57
57
|
/** POST /_agent-native/secrets/:key — write a secret. */
|
|
58
58
|
export declare function createWriteSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
59
59
|
error: string;
|
|
60
|
-
ok?: undefined;
|
|
61
60
|
status?: undefined;
|
|
61
|
+
ok?: undefined;
|
|
62
62
|
} | {
|
|
63
63
|
ok: boolean;
|
|
64
64
|
status: string;
|
|
65
65
|
error?: undefined;
|
|
66
66
|
} | {
|
|
67
|
-
ok?: undefined;
|
|
68
67
|
error: string;
|
|
69
68
|
removed?: undefined;
|
|
69
|
+
ok?: undefined;
|
|
70
70
|
} | {
|
|
71
71
|
ok: boolean;
|
|
72
72
|
removed: boolean;
|
|
@@ -77,9 +77,9 @@ export declare function createWriteSecretHandler(): import("h3").EventHandlerWit
|
|
|
77
77
|
* or the current stored value without changing anything.
|
|
78
78
|
*/
|
|
79
79
|
export declare function createTestSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
80
|
-
ok?: undefined;
|
|
81
80
|
error: string;
|
|
82
81
|
note?: undefined;
|
|
82
|
+
ok?: undefined;
|
|
83
83
|
} | {
|
|
84
84
|
ok: boolean;
|
|
85
85
|
note?: undefined;
|
|
@@ -43,8 +43,8 @@ export declare function resolveAgentEngineApiKeyWriteTarget(event: H3Event, scop
|
|
|
43
43
|
export declare function createAgentEngineApiKeyHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
44
44
|
error: any;
|
|
45
45
|
key?: undefined;
|
|
46
|
-
ok?: undefined;
|
|
47
46
|
scope?: undefined;
|
|
47
|
+
ok?: undefined;
|
|
48
48
|
} | {
|
|
49
49
|
ok: boolean;
|
|
50
50
|
key: string;
|
|
@@ -52,14 +52,14 @@ export declare function createAgentEngineApiKeyHandler(): import("h3").EventHand
|
|
|
52
52
|
error?: undefined;
|
|
53
53
|
} | {
|
|
54
54
|
key?: undefined;
|
|
55
|
+
scope?: undefined;
|
|
55
56
|
ok: boolean;
|
|
56
57
|
error: string;
|
|
57
|
-
scope?: undefined;
|
|
58
58
|
} | {
|
|
59
|
+
error?: undefined;
|
|
59
60
|
ok: boolean;
|
|
60
61
|
key: string;
|
|
61
62
|
baseUrlKey?: string;
|
|
62
63
|
scope: AgentEngineApiKeyScope;
|
|
63
|
-
error?: undefined;
|
|
64
64
|
}>>;
|
|
65
65
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineEventHandler, getMethod, setResponseStatus, } from "h3";
|
|
2
|
-
import { normalizeOpenAiBaseUrl } from "../agent/engine/openai-compatible-endpoint.js";
|
|
2
|
+
import { normalizeOpenAiBaseUrl, stripOllamaV1Suffix, } from "../agent/engine/openai-compatible-endpoint.js";
|
|
3
3
|
import { validateProviderBaseUrl } from "../agent/engine/provider-endpoint-validation.js";
|
|
4
4
|
import { OLLAMA_BASE_URL_ENV_VAR, OPENAI_BASE_URL_ENV_VAR, PROVIDER_ENV_META, } from "../agent/engine/provider-env-vars.js";
|
|
5
5
|
import { getOrgContext } from "../org/context.js";
|
|
6
6
|
import { deleteAppSecret, writeAppSecret } from "../secrets/storage.js";
|
|
7
|
-
import { getSession
|
|
8
|
-
import { clearProviderCredentialAuthFailure } from "./credential-provider.js";
|
|
7
|
+
import { getSession } from "./auth.js";
|
|
8
|
+
import { clearProviderCredentialAuthFailure, isTrustedSelfHostedRuntime, } from "./credential-provider.js";
|
|
9
9
|
import { readBody } from "./h3-helpers.js";
|
|
10
10
|
const PROVIDER_TO_ENV_VAR = new Map(Object.entries(PROVIDER_ENV_META).map(([provider, meta]) => [
|
|
11
11
|
provider,
|
|
@@ -89,6 +89,9 @@ export function normalizeAgentEngineApiKeyPayload(body) {
|
|
|
89
89
|
}
|
|
90
90
|
try {
|
|
91
91
|
baseUrl = normalizeOpenAiBaseUrl(rawBaseUrl);
|
|
92
|
+
if (key === OLLAMA_BASE_URL_ENV_VAR) {
|
|
93
|
+
baseUrl = stripOllamaV1Suffix(baseUrl);
|
|
94
|
+
}
|
|
92
95
|
}
|
|
93
96
|
catch (err) {
|
|
94
97
|
return {
|
|
@@ -236,9 +239,9 @@ export function createAgentEngineApiKeyHandler() {
|
|
|
236
239
|
if (payload.baseUrl) {
|
|
237
240
|
try {
|
|
238
241
|
await validateProviderBaseUrl(payload.baseUrl, {
|
|
242
|
+
isOllama: payload.key === OLLAMA_BASE_URL_ENV_VAR,
|
|
239
243
|
allowLocalOllama: payload.key === OLLAMA_BASE_URL_ENV_VAR &&
|
|
240
|
-
|
|
241
|
-
isLoopbackRequest(event),
|
|
244
|
+
isTrustedSelfHostedRuntime(),
|
|
242
245
|
});
|
|
243
246
|
}
|
|
244
247
|
catch (err) {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GET /_agent-native/agent-engine/ollama-models — lists the models an Ollama
|
|
3
|
+
* server actually has pulled, via its native `/api/tags` endpoint. Backs the
|
|
4
|
+
* provider setup form so it shows real installed models instead of only the
|
|
5
|
+
* static suggestion list in `model-config.ts`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function createAgentEngineOllamaModelsHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
8
|
+
error: string;
|
|
9
|
+
models?: undefined;
|
|
10
|
+
ok?: undefined;
|
|
11
|
+
} | {
|
|
12
|
+
ok: boolean;
|
|
13
|
+
models: string[];
|
|
14
|
+
error?: undefined;
|
|
15
|
+
}>>;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { defineEventHandler, getQuery, setResponseStatus, } from "h3";
|
|
2
|
+
import { validateProviderBaseUrl } from "../agent/engine/provider-endpoint-validation.js";
|
|
3
|
+
import { OLLAMA_BASE_URL_ENV_VAR } from "../agent/engine/provider-env-vars.js";
|
|
4
|
+
import { ssrfSafeFetch } from "../extensions/url-safety.js";
|
|
5
|
+
import { getOrgContext } from "../org/context.js";
|
|
6
|
+
import { getSession } from "./auth.js";
|
|
7
|
+
import { isTrustedSelfHostedRuntime, resolveSecret, } from "./credential-provider.js";
|
|
8
|
+
import { runWithRequestContext } from "./request-context.js";
|
|
9
|
+
const DEFAULT_OLLAMA_BASE_URL = "http://localhost:11434";
|
|
10
|
+
/**
|
|
11
|
+
* `resolveSecret` reads through the ambient request context set by
|
|
12
|
+
* `runWithRequestContext`, not from this event directly — a plain route
|
|
13
|
+
* handler that never establishes it (unlike action routes, which are wrapped
|
|
14
|
+
* upstream) sees no signed-in user/org, so every saved secret read comes back
|
|
15
|
+
* empty and the caller silently falls back to a default. Mirrors
|
|
16
|
+
* `resolveAgentEngineStatusIdentity` in `core-routes-plugin.ts`.
|
|
17
|
+
*/
|
|
18
|
+
async function resolveRequestIdentity(event) {
|
|
19
|
+
// coercion-ok: a session lookup failure here degrades to the unauthenticated
|
|
20
|
+
// path (401, same as no session at all) rather than 500ing this route.
|
|
21
|
+
const session = await getSession(event).catch(() => null);
|
|
22
|
+
const userEmail = session?.email;
|
|
23
|
+
if (!userEmail)
|
|
24
|
+
return { userEmail: undefined, orgId: undefined };
|
|
25
|
+
try {
|
|
26
|
+
const orgCtx = await getOrgContext(event);
|
|
27
|
+
return { userEmail, orgId: orgCtx.orgId ?? undefined };
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return { userEmail, orgId: undefined };
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function parseModelNames(payload) {
|
|
34
|
+
const models = payload?.models;
|
|
35
|
+
if (!Array.isArray(models))
|
|
36
|
+
return [];
|
|
37
|
+
const names = models
|
|
38
|
+
.map((entry) => (typeof entry?.name === "string" ? entry.name.trim() : ""))
|
|
39
|
+
.filter((name) => name.length > 0);
|
|
40
|
+
return [...new Set(names)];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* GET /_agent-native/agent-engine/ollama-models — lists the models an Ollama
|
|
44
|
+
* server actually has pulled, via its native `/api/tags` endpoint. Backs the
|
|
45
|
+
* provider setup form so it shows real installed models instead of only the
|
|
46
|
+
* static suggestion list in `model-config.ts`.
|
|
47
|
+
*/
|
|
48
|
+
export function createAgentEngineOllamaModelsHandler() {
|
|
49
|
+
return defineEventHandler(async (event) => {
|
|
50
|
+
const { userEmail, orgId } = await resolveRequestIdentity(event);
|
|
51
|
+
// This route lets the caller name an arbitrary `baseUrl` and makes the
|
|
52
|
+
// server fetch it — a session is required so it can't become an
|
|
53
|
+
// anonymous SSRF/outbound-request primitive, mirroring the DELETE
|
|
54
|
+
// handler in `agent-engine-api-key-route.ts`.
|
|
55
|
+
if (!userEmail) {
|
|
56
|
+
setResponseStatus(event, 401);
|
|
57
|
+
return { error: "Authentication required" };
|
|
58
|
+
}
|
|
59
|
+
const query = getQuery(event);
|
|
60
|
+
const requestedBaseUrl = typeof query.baseUrl === "string" ? query.baseUrl.trim() : "";
|
|
61
|
+
return runWithRequestContext({ userEmail, orgId }, async () => {
|
|
62
|
+
const trusted = isTrustedSelfHostedRuntime();
|
|
63
|
+
let baseUrl;
|
|
64
|
+
try {
|
|
65
|
+
if (requestedBaseUrl) {
|
|
66
|
+
baseUrl = await validateProviderBaseUrl(requestedBaseUrl, {
|
|
67
|
+
allowLocalOllama: trusted,
|
|
68
|
+
isOllama: true,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
const saved = await resolveSecret(OLLAMA_BASE_URL_ENV_VAR);
|
|
73
|
+
baseUrl = await validateProviderBaseUrl(saved ?? DEFAULT_OLLAMA_BASE_URL, { allowLocalOllama: trusted, isOllama: true });
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
setResponseStatus(event, 400);
|
|
78
|
+
return { error: err instanceof Error ? err.message : String(err) };
|
|
79
|
+
}
|
|
80
|
+
try {
|
|
81
|
+
// `validateProviderBaseUrl` already approved this exact URL above;
|
|
82
|
+
// `ssrfSafeFetch` runs its own independent private-address check on
|
|
83
|
+
// every request (by design — it has no idea about the Ollama
|
|
84
|
+
// allowance), so the same trusted local/LAN origin must be passed
|
|
85
|
+
// through here too, or a loopback/LAN endpoint we just approved would
|
|
86
|
+
// be blocked again at fetch time.
|
|
87
|
+
const response = await ssrfSafeFetch(`${baseUrl}/api/tags`, { signal: AbortSignal.timeout(8_000) }, { allowedPrivateOrigins: trusted ? [baseUrl] : [] });
|
|
88
|
+
if (!response.ok) {
|
|
89
|
+
setResponseStatus(event, 502);
|
|
90
|
+
return {
|
|
91
|
+
error: `Ollama responded with HTTP ${response.status}. Is the server running at ${baseUrl}?`,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
const models = parseModelNames(await response.json());
|
|
95
|
+
return { ok: true, models };
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
setResponseStatus(event, 502);
|
|
99
|
+
return {
|
|
100
|
+
error: `Could not reach Ollama at ${baseUrl}. Check that it's running and the address is correct.`,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
}
|
|
@@ -44,6 +44,7 @@ import { registerBuiltinProviders } from "../tracking/providers.js";
|
|
|
44
44
|
import { validateTrackPayload } from "../tracking/route.js";
|
|
45
45
|
import { createAutomationsHandler } from "../triggers/routes.js";
|
|
46
46
|
import { createAgentEngineApiKeyHandler } from "./agent-engine-api-key-route.js";
|
|
47
|
+
import { createAgentEngineOllamaModelsHandler } from "./agent-engine-ollama-models-route.js";
|
|
47
48
|
import { readAnalyticsClientPlatformHeader, readBrowserSessionIdHeader, } from "./agent-run-context.js";
|
|
48
49
|
import { getConfiguredAppBasePath, stripAppBasePath } from "./app-base-path.js";
|
|
49
50
|
import { getSession } from "./auth.js";
|
|
@@ -3296,6 +3297,10 @@ export function createCoreRoutesPlugin(options = {}) {
|
|
|
3296
3297
|
}));
|
|
3297
3298
|
}
|
|
3298
3299
|
getH3App(nitroApp).use(`${P}/agent-engine/api-key`, createAgentEngineApiKeyHandler());
|
|
3300
|
+
// GET /_agent-native/agent-engine/ollama-models — lists the models an
|
|
3301
|
+
// Ollama server actually has installed, so the provider setup form can
|
|
3302
|
+
// show real options instead of only the static suggestion list.
|
|
3303
|
+
getH3App(nitroApp).use(`${P}/agent-engine/ollama-models`, createAgentEngineOllamaModelsHandler());
|
|
3299
3304
|
// GET /_agent-native/agent-engine/status — reports whether an engine
|
|
3300
3305
|
// is configured (settings row, settings+env, or auto-detected from env).
|
|
3301
3306
|
// The agent-chat UI uses this to skip the onboarding gate for providers
|
|
@@ -101,6 +101,19 @@ export declare const BUILDER_GATEWAY_SPACE_ID_ENV_VAR = "BUILDER_GATEWAY_SPACE_I
|
|
|
101
101
|
*/
|
|
102
102
|
export declare function hasPlatformRuntimeMarker(): boolean;
|
|
103
103
|
export declare function isProductionLikeRuntime(): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Whether this process is a genuinely self-hosted, single-tenant deployment
|
|
106
|
+
* rather than the hosted multi-tenant workspace runtime — the same bar
|
|
107
|
+
* `canUseDeployCredentialFallbackForRequest` uses to decide whether relaxing
|
|
108
|
+
* a security boundary for "this is the operator's own machine" is safe.
|
|
109
|
+
* `NODE_ENV` alone proves nothing (it travels with a copied `.env`), so a
|
|
110
|
+
* production-shaped runtime still counts as trusted when it is backed by the
|
|
111
|
+
* local embedded database, which has no cross-tenant blast radius.
|
|
112
|
+
*
|
|
113
|
+
* Used to allow a user-supplied Ollama endpoint to target a LAN address
|
|
114
|
+
* instead of only loopback — see `provider-endpoint-validation.ts`.
|
|
115
|
+
*/
|
|
116
|
+
export declare function isTrustedSelfHostedRuntime(): boolean;
|
|
104
117
|
type BuilderCredentialSource = "user" | "org" | "workspace" | "env";
|
|
105
118
|
export interface BuilderCredentialLookupIdentity {
|
|
106
119
|
/** The verified owner of a background run, when it has no browser request. */
|
|
@@ -245,6 +245,25 @@ export function hasPlatformRuntimeMarker() {
|
|
|
245
245
|
export function isProductionLikeRuntime() {
|
|
246
246
|
return process.env.NODE_ENV === "production" || hasPlatformRuntimeMarker();
|
|
247
247
|
}
|
|
248
|
+
/**
|
|
249
|
+
* Whether this process is a genuinely self-hosted, single-tenant deployment
|
|
250
|
+
* rather than the hosted multi-tenant workspace runtime — the same bar
|
|
251
|
+
* `canUseDeployCredentialFallbackForRequest` uses to decide whether relaxing
|
|
252
|
+
* a security boundary for "this is the operator's own machine" is safe.
|
|
253
|
+
* `NODE_ENV` alone proves nothing (it travels with a copied `.env`), so a
|
|
254
|
+
* production-shaped runtime still counts as trusted when it is backed by the
|
|
255
|
+
* local embedded database, which has no cross-tenant blast radius.
|
|
256
|
+
*
|
|
257
|
+
* Used to allow a user-supplied Ollama endpoint to target a LAN address
|
|
258
|
+
* instead of only loopback — see `provider-endpoint-validation.ts`.
|
|
259
|
+
*/
|
|
260
|
+
export function isTrustedSelfHostedRuntime() {
|
|
261
|
+
if (isHostedWorkspaceRuntime())
|
|
262
|
+
return false;
|
|
263
|
+
if (!isProductionLikeRuntime())
|
|
264
|
+
return true;
|
|
265
|
+
return isLocalDatabase();
|
|
266
|
+
}
|
|
248
267
|
/**
|
|
249
268
|
* Whether deployment-level Builder env keys may back the current request.
|
|
250
269
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.186.0-nightly-20260923174435",
|
|
4
4
|
"description": "The agentic application framework for building autonomous agents with intuitive UIs",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/agent-native#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -493,9 +493,9 @@
|
|
|
493
493
|
"yaml": "^2.9.0",
|
|
494
494
|
"yjs": "^13.6.32",
|
|
495
495
|
"zod": "^4.3.6",
|
|
496
|
+
"@agent-native/toolkit": "^0.20.7",
|
|
496
497
|
"@agent-native/agentkit": "^0.2.7",
|
|
497
|
-
"@agent-native/recap-cli": "0.5.37"
|
|
498
|
-
"@agent-native/toolkit": "^0.20.7"
|
|
498
|
+
"@agent-native/recap-cli": "0.5.37"
|
|
499
499
|
},
|
|
500
500
|
"devDependencies": {
|
|
501
501
|
"@ai-sdk/anthropic": "^3.0.71",
|