@agent-native/core 0.173.2-nightly-20260825163448 → 0.174.0

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.
Files changed (73) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/factory/AGENTS.md +1 -1
  3. package/corpus/templates/factory/actions/babysit-agent-native-pull-request.ts +23 -8
  4. package/corpus/templates/factory/actions/delete-factory.ts +174 -0
  5. package/corpus/templates/factory/actions/govern-agent-native-pull-request.ts +28 -20
  6. package/corpus/templates/factory/actions/poll-github-sources.ts +6 -0
  7. package/corpus/templates/factory/actions/poll-sentry-errors.ts +16 -1
  8. package/corpus/templates/factory/actions/poll-slack-channel.ts +12 -0
  9. package/corpus/templates/factory/actions/start-builder-for-item.ts +74 -42
  10. package/corpus/templates/factory/app/components/factory/FactorySettingsView.tsx +117 -1
  11. package/corpus/templates/factory/app/i18n/en-US.ts +12 -0
  12. package/corpus/templates/factory/app/routes/factory.tsx +6 -1
  13. package/corpus/templates/factory/changelog/2026-08-24-slack-polling-accepts-the-agentnative-bot-handle.md +6 -0
  14. package/corpus/templates/factory/changelog/2026-08-24-you-can-delete-a-user-created-factory-from-settings.md +6 -0
  15. package/corpus/templates/factory/server/lib/factory-automation-repair.ts +6 -0
  16. package/corpus/templates/factory/server/lib/factory-scope.ts +45 -1
  17. package/corpus/templates/factory/server/lib/require-factory-automation.ts +5 -0
  18. package/corpus/templates/factory/server/triage/slack-client.ts +10 -2
  19. package/corpus/templates/plan/server/plugins/core-routes.ts +6 -1
  20. package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +4 -1
  21. package/corpus/templates/slides/app/components/editor/canvas-interactions/slides-canvas-adapter.ts +4 -2
  22. package/dist/app-config/app-identity.d.ts +20 -0
  23. package/dist/app-config/app-identity.js +41 -0
  24. package/dist/app-config/app.d.ts +2 -0
  25. package/dist/app-config/app.js +14 -0
  26. package/dist/app-config/observability.d.ts +27 -0
  27. package/dist/app-config/observability.js +76 -0
  28. package/dist/app-config/schema.d.ts +13 -0
  29. package/dist/app-config/schema.js +2 -0
  30. package/dist/app-config/store.d.ts +14 -4
  31. package/dist/app-config/store.js +18 -3
  32. package/dist/collab/awareness.d.ts +2 -2
  33. package/dist/collab/routes.d.ts +1 -1
  34. package/dist/email-catalog/actions/list-email-log.js +2 -2
  35. package/dist/email-catalog/actions/list-transactional-emails.js +2 -2
  36. package/dist/email-catalog/registry.js +3 -3
  37. package/dist/mcp/connect-route.js +15 -2
  38. package/dist/notifications/routes.d.ts +3 -3
  39. package/dist/observability/index.d.ts +1 -2
  40. package/dist/observability/index.js +0 -1
  41. package/dist/observability/posthog-ai.js +11 -3
  42. package/dist/observability/sentiment.d.ts +0 -1
  43. package/dist/observability/sentiment.js +8 -5
  44. package/dist/observability/traces.js +6 -12
  45. package/dist/observability/types.d.ts +0 -7
  46. package/dist/observability/types.js +1 -12
  47. package/dist/progress/routes.d.ts +1 -1
  48. package/dist/provider-api/actions/custom-provider-registration.d.ts +4 -4
  49. package/dist/provider-api/actions/provider-api.d.ts +8 -8
  50. package/dist/resources/handlers.d.ts +1 -1
  51. package/dist/secrets/routes.d.ts +3 -3
  52. package/dist/server/agent-chat/plugin-options.d.ts +17 -1
  53. package/dist/server/agent-chat-plugin.d.ts +10 -0
  54. package/dist/server/agent-chat-plugin.js +75 -67
  55. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  56. package/dist/server/core-routes/mcp-connect-options.d.ts +70 -0
  57. package/dist/server/core-routes/mcp-connect-options.js +77 -0
  58. package/dist/server/core-routes-plugin.d.ts +15 -11
  59. package/dist/server/core-routes-plugin.js +8 -7
  60. package/dist/server/edge.d.ts +1 -0
  61. package/dist/server/email-template.js +2 -2
  62. package/dist/server/email-templates.js +7 -7
  63. package/dist/server/email.js +4 -4
  64. package/dist/server/google-oauth.js +2 -2
  65. package/dist/server/http-response-telemetry.js +4 -4
  66. package/dist/server/identity-sso.js +1 -2
  67. package/dist/server/index.d.ts +1 -0
  68. package/dist/server/realtime-token.d.ts +1 -1
  69. package/dist/server/social-og-image.js +2 -2
  70. package/docs/content/observability.mdx +25 -31
  71. package/package.json +3 -3
  72. package/dist/server/app-name.d.ts +0 -33
  73. package/dist/server/app-name.js +0 -82
@@ -1,3 +1,4 @@
1
+ import { deriveAppIdentity } from "./app-identity.js";
1
2
  import { readEnvConfigLayer } from "./env-layer.js";
2
3
  import { assertRunLifecycleInvariants } from "./run-lifecycle-invariants.js";
3
4
  import { appConfigSchema, } from "./schema.js";
@@ -54,6 +55,9 @@ function resolve(envLayer) {
54
55
  // Defaults go through here too — the pair that shipped violated was a pair of
55
56
  // defaults.
56
57
  assertRunLifecycleInvariants(parsed.agent);
58
+ // After parsing, not as a layer: it derives from `packageName`, which the
59
+ // layers above have to have resolved first.
60
+ parsed.app = deriveAppIdentity(parsed.app);
57
61
  return parsed;
58
62
  }
59
63
  /**
@@ -92,12 +96,23 @@ export function setAppConfigLayer(layer, config) {
92
96
  /**
93
97
  * Sets this app's server configuration.
94
98
  *
95
- * Call it from a server plugin. Values given here beat any environment
96
- * variable aliased to the same field. Calling it more than once merges, so an
97
- * app can split its configuration by domain across plugin files.
99
+ * Values given here beat any environment variable aliased to the same field.
100
+ * Calling it more than once merges, so an app can split its configuration by
101
+ * domain across plugin files.
102
+ *
103
+ * Returns a Nitro plugin so the canonical home is `server/plugins/config.ts`
104
+ * with `export default defineAppConfig({ … })` — the same shape as every other
105
+ * framework plugin an app already writes. Before that, the docs said "call it
106
+ * from a server plugin" without saying what such a file looks like, and no app
107
+ * in this repo ever did.
108
+ *
109
+ * The layer is applied here, at module load, not when the returned plugin runs:
110
+ * configuration has to be resolved before another plugin reads it, and plugin
111
+ * invocation order is not something an app should have to reason about.
98
112
  */
99
113
  export function defineAppConfig(config) {
100
114
  setAppConfigLayer("app", config);
115
+ return () => { };
101
116
  }
102
117
  /**
103
118
  * The resolved configuration, with declared defaults applied.
@@ -62,11 +62,11 @@ export declare const postAwareness: import("h3").EventHandlerWithFetch<import("h
62
62
  error: string;
63
63
  states?: undefined;
64
64
  } | {
65
+ error?: undefined;
65
66
  states: {
66
67
  clientId: number;
67
68
  state: string;
68
69
  }[];
69
- error?: undefined;
70
70
  }>>;
71
71
  /**
72
72
  * GET /_agent-native/collab/:docId/users
@@ -77,9 +77,9 @@ export declare const getActiveUsers: import("h3").EventHandlerWithFetch<import("
77
77
  error: string;
78
78
  users?: undefined;
79
79
  } | {
80
+ error?: undefined;
80
81
  users: {
81
82
  clientId: number;
82
83
  lastSeen: number;
83
84
  }[];
84
- error?: undefined;
85
85
  }>>;
@@ -26,8 +26,8 @@ export declare const getCollabState: import("h3").EventHandlerWithFetch<import("
26
26
  * Body: { update: string (base64), requestSource?: string }
27
27
  */
28
28
  export declare const postCollabUpdate: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
29
- ok?: undefined;
30
29
  error: string;
30
+ ok?: undefined;
31
31
  } | {
32
32
  error?: undefined;
33
33
  ok: boolean;
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { defineAction } from "../../action.js";
3
- import { getAppSlug } from "../../server/app-name.js";
3
+ import { getAppConfig } from "../../app-config/index.js";
4
4
  import { getRequestOrgId } from "../../server/request-context.js";
5
5
  import { authorizeTransactionalEmailRead } from "../authorize.js";
6
6
  import { listEmailLog } from "../log.js";
@@ -15,7 +15,7 @@ export default defineAction({
15
15
  run: async ({ templateId, limit }) => ({
16
16
  entries: await listEmailLog({
17
17
  orgId: getRequestOrgId() ?? "",
18
- app: getAppSlug() ?? "unknown",
18
+ app: getAppConfig().app.slug ?? "unknown",
19
19
  templateId,
20
20
  limit,
21
21
  }),
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { defineAction } from "../../action.js";
3
- import { getAppSlug } from "../../server/app-name.js";
3
+ import { getAppConfig } from "../../app-config/index.js";
4
4
  import { getRequestOrgId } from "../../server/request-context.js";
5
5
  import { authorizeTransactionalEmailRead } from "../authorize.js";
6
6
  import { getEmailSendStats } from "../log.js";
@@ -23,7 +23,7 @@ export default defineAction({
23
23
  run: async ({ windowDays }) => {
24
24
  registerCoreSystemEmails();
25
25
  const since = Date.now() - windowDays * 24 * 60 * 60 * 1000;
26
- const app = getAppSlug() ?? "unknown";
26
+ const app = getAppConfig().app.slug ?? "unknown";
27
27
  const orgId = getRequestOrgId();
28
28
  const definitions = listTransactionalEmails();
29
29
  // A failed stats read must not masquerade as "no email ever sent" — the
@@ -21,12 +21,12 @@
21
21
  * The `id` doubles as the SendGrid category `sendEmail` tags the message with,
22
22
  * which is how per-email delivery and open metrics are attributed later.
23
23
  */
24
- import { getAppSlug } from "../server/app-name.js";
24
+ import { getAppConfig } from "../app-config/index.js";
25
25
  const registry = new Map();
26
26
  function resolveDefinition(definition) {
27
27
  return {
28
28
  ...definition,
29
- app: definition.app ?? getAppSlug() ?? "unknown",
29
+ app: definition.app ?? getAppConfig().app.slug ?? "unknown",
30
30
  };
31
31
  }
32
32
  function assertCanRegister(resolved, existing) {
@@ -84,7 +84,7 @@ export function defineTransactionalEmails(definitions) {
84
84
  }
85
85
  /** Replace one app-owned catalog snapshot after validating the full replacement. */
86
86
  export function replaceTransactionalEmails(ownerApp, idPrefix, definitions) {
87
- const runtimeApp = getAppSlug();
87
+ const runtimeApp = getAppConfig().app.slug;
88
88
  if (!ownerApp || ownerApp.includes(".") || idPrefix !== `${ownerApp}.`) {
89
89
  throw new Error("Transactional email replacement requires an owner app and its exact namespace prefix.");
90
90
  }
@@ -29,6 +29,7 @@
29
29
  import { randomUUID } from "node:crypto";
30
30
  import { getMethod, getHeader } from "h3";
31
31
  import { signA2AToken } from "../a2a/client.js";
32
+ import { getAppConfig } from "../app-config/index.js";
32
33
  import { getOrgDomain } from "../org/context.js";
33
34
  import { getSession, getConfiguredLoginHtml, isLoopbackRequest, } from "../server/auth.js";
34
35
  import { readBody } from "../server/h3-helpers.js";
@@ -91,9 +92,21 @@ function joinAppPath(basePath, path) {
91
92
  return basePath;
92
93
  return `${basePath}${path.startsWith("/") ? path : `/${path}`}`;
93
94
  }
95
+ /**
96
+ * Which app this deployment is, for naming its MCP server.
97
+ *
98
+ * The hostname is the LAST resort, not the first: every beta deployment is
99
+ * `beta.<app>.agent-native.com`, so the leading label is `beta` for all of
100
+ * them and every beta app advertised itself as `agent-native-beta`. A client
101
+ * keys its config by that name, so connecting a second beta app overwrote the
102
+ * first. Declared identity comes first now, and `app.slug` covers every
103
+ * first-party template with no configuration at all.
104
+ */
94
105
  function appLabel(origin, options) {
95
- if (options.appId)
96
- return options.appId;
106
+ const app = getAppConfig().app;
107
+ const declared = options.appId ?? app.id ?? app.template ?? app.slug;
108
+ if (declared)
109
+ return declared;
97
110
  try {
98
111
  const h = new URL(origin).hostname;
99
112
  return h.split(".")[0] || h;
@@ -16,18 +16,18 @@ export declare function createNotificationsHandler(): import("h3").EventHandlerW
16
16
  error?: undefined;
17
17
  ok?: undefined;
18
18
  } | {
19
- count?: undefined;
20
19
  updated: number;
21
20
  error?: undefined;
22
21
  ok?: undefined;
23
- } | {
24
22
  count?: undefined;
23
+ } | {
25
24
  updated?: undefined;
26
25
  error: string;
27
26
  ok?: undefined;
28
- } | {
29
27
  count?: undefined;
28
+ } | {
30
29
  updated?: undefined;
31
30
  error?: undefined;
32
31
  ok: boolean;
32
+ count?: undefined;
33
33
  }>>;
@@ -1,5 +1,4 @@
1
- export type { SpanType, SpanStatus, TraceSpan, TraceSummary, FeedbackType, FeedbackEntry, SatisfactionScore, EvalType, EvalResult, EvalDataset, EvalTestCase, EvalCriteria, ExperimentStatus, ExperimentVariant, Experiment, ExperimentAssignment, ExperimentMetricResult, ObservabilityConfig, ObservabilityExporterConfig, } from "./types.js";
2
- export { DEFAULT_OBSERVABILITY_CONFIG } from "./types.js";
1
+ export type { SpanType, SpanStatus, TraceSpan, TraceSummary, FeedbackType, FeedbackEntry, SatisfactionScore, EvalType, EvalResult, EvalDataset, EvalTestCase, EvalCriteria, ExperimentStatus, ExperimentVariant, Experiment, ExperimentAssignment, ExperimentMetricResult, ObservabilityConfig, } from "./types.js";
3
2
  export { ensureObservabilityTables, insertTraceSpan, upsertTraceSummary, getTraceSpansForRun, getTraceSummaries, getTraceSummary, deleteOldTraceData, insertFeedback, getFeedback, getFeedbackStats, upsertSatisfactionScore, getSatisfactionScores, insertEvalResult, getEvalsForRun, getEvalStats, insertEvalDataset, listEvalDatasets, getEvalDataset, updateEvalDataset, insertExperiment, updateExperiment, listExperiments, getExperiment, upsertAssignment, getAssignment, insertExperimentResult, getExperimentResults, getObservabilityOverview, } from "./store.js";
4
3
  export { createObservabilityPlugin } from "./plugin.js";
5
4
  export { createObservabilityHandler } from "./routes.js";
@@ -1,4 +1,3 @@
1
- export { DEFAULT_OBSERVABILITY_CONFIG } from "./types.js";
2
1
  export { ensureObservabilityTables, insertTraceSpan, upsertTraceSummary, getTraceSpansForRun, getTraceSummaries, getTraceSummary, deleteOldTraceData, insertFeedback, getFeedback, getFeedbackStats, upsertSatisfactionScore, getSatisfactionScores, insertEvalResult, getEvalsForRun, getEvalStats, insertEvalDataset, listEvalDatasets, getEvalDataset, updateEvalDataset, insertExperiment, updateExperiment, listExperiments, getExperiment, upsertAssignment, getAssignment, insertExperimentResult, getExperimentResults, getObservabilityOverview, } from "./store.js";
3
2
  export { createObservabilityPlugin } from "./plugin.js";
4
3
  export { createObservabilityHandler } from "./routes.js";
@@ -117,9 +117,17 @@ export function boundAiContent(value) {
117
117
  // What was ASKED is the one thing worth rescuing from an oversized
118
118
  // transcript: the rest is context the thread itself still holds, and
119
119
  // keeping as much of it as fits just ships the ceiling on every event.
120
- const lastUser = value.findLast((entry) => !!entry &&
121
- typeof entry === "object" &&
122
- entry.role === "user");
120
+ // `findLast` is ES2023; this package compiles with lib ES2022.
121
+ let lastUser;
122
+ for (let i = value.length - 1; i >= 0; i -= 1) {
123
+ const entry = value[i];
124
+ if (!!entry &&
125
+ typeof entry === "object" &&
126
+ entry.role === "user") {
127
+ lastUser = entry;
128
+ break;
129
+ }
130
+ }
123
131
  const kept = lastUser !== undefined &&
124
132
  utf8Bytes(JSON.stringify(lastUser) ?? "null") <=
125
133
  MAX_AI_CONTENT_BYTES - OMISSION_MARKER_BYTES
@@ -1,6 +1,5 @@
1
1
  import type { AgentEngine } from "../agent/engine/types.js";
2
2
  import type { ObservabilityConfig } from "./types.js";
3
- export declare const DEFAULT_INFERRED_SENTIMENT_MODEL = "gpt-5-6-luna";
4
3
  export declare const HOSTED_INFERRED_SENTIMENT_SAMPLE_RATE = 1;
5
4
  export declare const INFERRED_SENTIMENT_MAX_CHARS = 2000;
6
5
  export declare const INFERRED_SENTIMENT_TIMEOUT_MS = 5000;
@@ -1,6 +1,11 @@
1
+ import { observabilityConfig } from "../app-config/observability.js";
1
2
  import { trackingIdentityProperties } from "./tracking-identity.js";
2
- import { DEFAULT_OBSERVABILITY_CONFIG } from "./types.js";
3
- export const DEFAULT_INFERRED_SENTIMENT_MODEL = "gpt-5-6-luna";
3
+ /**
4
+ * The schema owns this value; read it back rather than restating it. Reachable
5
+ * only when a caller passes a partial config — `getObservabilityConfig` always
6
+ * hands over a parsed one, where the declared default has already applied.
7
+ */
8
+ const DEFAULT_INFERRED_SENTIMENT_MODEL = observabilityConfig.shape.inferredSentimentModel.parse(undefined);
4
9
  export const HOSTED_INFERRED_SENTIMENT_SAMPLE_RATE = 1;
5
10
  export const INFERRED_SENTIMENT_MAX_CHARS = 2_000;
6
11
  export const INFERRED_SENTIMENT_TIMEOUT_MS = 5_000;
@@ -71,9 +76,7 @@ export function resolveInferredSentimentConfig(stored, env = process.env) {
71
76
  inferredSentimentSampleRate: envRate ??
72
77
  storedRate ??
73
78
  (hosted ? HOSTED_INFERRED_SENTIMENT_SAMPLE_RATE : 0),
74
- inferredSentimentModel: envModel ||
75
- storedModel ||
76
- DEFAULT_OBSERVABILITY_CONFIG.inferredSentimentModel,
79
+ inferredSentimentModel: envModel || storedModel || DEFAULT_INFERRED_SENTIMENT_MODEL,
77
80
  };
78
81
  }
79
82
  /** Stable deterministic sampling keeps retries for the same run consistent. */
@@ -3,7 +3,6 @@ import { getRequestContext } from "../server/request-context.js";
3
3
  import { MAX_AI_CONTENT_BYTES, MAX_AI_SPANS_PER_RUN, boundAiContent, emitAiSpanEvent, emitAiTraceEvent, resolveAiError, toAiErrorDetail, toPostHogMessages, } from "./posthog-ai.js";
4
4
  import { endAgentSpan, startAgentSpan } from "./tracing.js";
5
5
  import { trackingIdentityProperties } from "./tracking-identity.js";
6
- import { DEFAULT_OBSERVABILITY_CONFIG } from "./types.js";
7
6
  function spanId() {
8
7
  return `span-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
9
8
  }
@@ -342,18 +341,13 @@ function redactWalk(value, seen) {
342
341
  return out;
343
342
  }
344
343
  export async function getObservabilityConfig() {
345
- let stored = null;
346
- try {
347
- const { getSetting } = await import("../settings/store.js");
348
- stored = (await getSetting("observability-config"));
349
- }
350
- catch { }
344
+ const { getAppConfig } = await import("../app-config/store.js");
345
+ const config = getAppConfig().observability;
351
346
  const { resolveInferredSentimentConfig } = await import("./sentiment.js");
352
- return {
353
- ...DEFAULT_OBSERVABILITY_CONFIG,
354
- ...(stored ?? {}),
355
- ...resolveInferredSentimentConfig(stored),
356
- };
347
+ // Sentiment keeps its own resolver as the top layer: it derives a default
348
+ // from whether this is a first-party hosted deployment, which no declared
349
+ // default can express.
350
+ return { ...config, ...resolveInferredSentimentConfig(config) };
357
351
  }
358
352
  export async function instrumentAgentLoop(opts) {
359
353
  const { runAgentLoop, loopOpts, runId, threadId, userId, config } = opts;
@@ -175,11 +175,4 @@ export interface ObservabilityConfig {
175
175
  inferredSentimentSampleRate: number;
176
176
  /** Model used by the managed Builder classifier. */
177
177
  inferredSentimentModel: string;
178
- exporters: ObservabilityExporterConfig[];
179
178
  }
180
- export interface ObservabilityExporterConfig {
181
- type: "otlp" | "console" | "custom";
182
- endpoint?: string;
183
- headers?: Record<string, string>;
184
- }
185
- export declare const DEFAULT_OBSERVABILITY_CONFIG: ObservabilityConfig;
@@ -5,15 +5,4 @@
5
5
  * Each domain module imports from here so the data model is consistent
6
6
  * across the entire observability stack.
7
7
  */
8
- export const DEFAULT_OBSERVABILITY_CONFIG = {
9
- enabled: true,
10
- capturePrompts: false,
11
- captureToolArgs: false,
12
- captureToolResults: false,
13
- captureLlmSpans: true,
14
- evalSampleRate: 0,
15
- inferredSentimentEnabled: false,
16
- inferredSentimentSampleRate: 0,
17
- inferredSentimentModel: "gpt-5-6-luna",
18
- exporters: [],
19
- };
8
+ export {};
@@ -15,6 +15,6 @@ export declare function createProgressHandler(): import("h3").EventHandlerWithFe
15
15
  error: string;
16
16
  ok?: undefined;
17
17
  } | {
18
- ok: boolean;
19
18
  error?: undefined;
19
+ ok: boolean;
20
20
  }>>;
@@ -93,29 +93,29 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
93
93
  label?: undefined;
94
94
  message?: undefined;
95
95
  } | {
96
+ count?: undefined;
96
97
  id?: undefined;
97
98
  deleted?: undefined;
98
99
  providers?: undefined;
99
- count?: undefined;
100
100
  found: boolean;
101
101
  provider: import("../custom-registry.js").CustomProviderConfig;
102
102
  registered?: undefined;
103
103
  label?: undefined;
104
104
  message?: undefined;
105
105
  } | {
106
+ count?: undefined;
106
107
  provider?: undefined;
107
108
  deleted?: undefined;
108
109
  providers?: undefined;
109
- count?: undefined;
110
110
  found: boolean;
111
111
  id: string;
112
112
  registered?: undefined;
113
113
  label?: undefined;
114
114
  message?: undefined;
115
115
  } | {
116
+ count?: undefined;
116
117
  provider?: undefined;
117
118
  providers?: undefined;
118
- count?: undefined;
119
119
  found?: undefined;
120
120
  deleted: boolean;
121
121
  id: string;
@@ -123,10 +123,10 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
123
123
  label?: undefined;
124
124
  message?: undefined;
125
125
  } | {
126
+ count?: undefined;
126
127
  provider?: undefined;
127
128
  deleted?: undefined;
128
129
  providers?: undefined;
129
- count?: undefined;
130
130
  found?: undefined;
131
131
  registered: boolean;
132
132
  id: string;
@@ -312,6 +312,8 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
312
312
  scope?: "org" | "user" | undefined;
313
313
  }, {
314
314
  id?: undefined;
315
+ message?: undefined;
316
+ deleted?: undefined;
315
317
  providers: {
316
318
  id: string;
317
319
  label: string;
@@ -324,31 +326,30 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
324
326
  count: number;
325
327
  provider?: undefined;
326
328
  found?: undefined;
327
- deleted?: undefined;
328
329
  registered?: undefined;
329
330
  label?: undefined;
330
- message?: undefined;
331
331
  } | {
332
332
  id?: undefined;
333
+ message?: undefined;
334
+ deleted?: undefined;
333
335
  providers?: undefined;
334
336
  count?: undefined;
335
337
  found: boolean;
336
338
  provider: import("../custom-registry.js").CustomProviderConfig;
337
- deleted?: undefined;
338
339
  registered?: undefined;
339
340
  label?: undefined;
340
- message?: undefined;
341
341
  } | {
342
+ message?: undefined;
343
+ deleted?: undefined;
342
344
  providers?: undefined;
343
345
  count?: undefined;
344
346
  provider?: undefined;
345
347
  found: boolean;
346
348
  id: string;
347
- deleted?: undefined;
348
349
  registered?: undefined;
349
350
  label?: undefined;
350
- message?: undefined;
351
351
  } | {
352
+ message?: undefined;
352
353
  providers?: undefined;
353
354
  count?: undefined;
354
355
  provider?: undefined;
@@ -357,13 +358,12 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
357
358
  id: string;
358
359
  registered?: undefined;
359
360
  label?: undefined;
360
- message?: undefined;
361
361
  } | {
362
+ deleted?: undefined;
362
363
  providers?: undefined;
363
364
  count?: undefined;
364
365
  provider?: undefined;
365
366
  found?: undefined;
366
- deleted?: undefined;
367
367
  registered: boolean;
368
368
  id: string;
369
369
  label: string;
@@ -48,8 +48,8 @@ export declare function handleUpdateResource(event: any): Promise<import("./stor
48
48
  }>;
49
49
  /** DELETE /_agent-native/resources/:id — delete a resource */
50
50
  export declare function handleDeleteResource(event: any): Promise<{
51
- ok?: undefined;
52
51
  error: string;
52
+ ok?: undefined;
53
53
  } | {
54
54
  error?: undefined;
55
55
  ok: boolean;
@@ -34,16 +34,16 @@ export declare function createListSecretsHandler(): import("h3").EventHandlerWit
34
34
  /** POST /_agent-native/secrets/:key — write a secret. */
35
35
  export declare function createWriteSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
36
36
  error: string;
37
- ok?: undefined;
38
37
  status?: undefined;
38
+ ok?: undefined;
39
39
  } | {
40
40
  ok: boolean;
41
41
  status: string;
42
42
  error?: undefined;
43
43
  } | {
44
- ok?: undefined;
45
44
  error: string;
46
45
  removed?: undefined;
46
+ ok?: undefined;
47
47
  } | {
48
48
  ok: boolean;
49
49
  removed: boolean;
@@ -54,9 +54,9 @@ export declare function createWriteSecretHandler(): import("h3").EventHandlerWit
54
54
  * or the current stored value without changing anything.
55
55
  */
56
56
  export declare function createTestSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
57
- ok?: undefined;
58
57
  error: string;
59
58
  note?: undefined;
59
+ ok?: undefined;
60
60
  } | {
61
61
  ok: boolean;
62
62
  note?: undefined;
@@ -18,7 +18,14 @@ export interface AgentChatPluginOptions {
18
18
  systemPrompt?: string;
19
19
  /** Additional system prompt prepended in dev mode */
20
20
  devSystemPrompt?: string;
21
- /** Model to use. Defaults to the resolved engine's default model. */
21
+ /**
22
+ * Model to use. Defaults to the resolved engine's default model.
23
+ *
24
+ * @deprecated Set `agent.model` in `defineAppConfig()` (env alias
25
+ * `AGENT_MODEL`) instead. This option stays the top layer of that field, so
26
+ * passing it still wins; it exists only for mounts that need a different
27
+ * model from the rest of the process, which no first-party app does.
28
+ */
22
29
  model?: string;
23
30
  /** Optional per-app agent run chunk budget in milliseconds. Defaults to
24
31
  * AGENT_RUN_SOFT_TIMEOUT_MS when set, otherwise no framework-imposed
@@ -33,6 +40,15 @@ export interface AgentChatPluginOptions {
33
40
  * Netlify build also emits the background function. Set this to `false` to
34
41
  * explicitly disable a stale deploy-wide `AGENT_CHAT_DURABLE_BACKGROUND`
35
42
  * flag for this app.
43
+ *
44
+ * @deprecated Passing `true` is redundant on Netlify, where
45
+ * `isAgentChatDurableBackgroundEnabled` already defaults on unless
46
+ * `AGENT_CHAT_DURABLE_BACKGROUND` is explicitly falsy. It still matters in
47
+ * two cases, so it is not inert: `false` is a hard veto over a stale
48
+ * deploy-wide flag, and `true` is the only way a non-Netlify hosted runtime
49
+ * with a workspace background-function path opts in. Prefer setting
50
+ * `AGENT_CHAT_DURABLE_BACKGROUND`, which the deploy-time emit gate in
51
+ * `deploy/build.ts` can also see — this option is invisible to it.
36
52
  */
37
53
  durableBackgroundRuns?: boolean;
38
54
  /** Anthropic API key. Falls back to ANTHROPIC_API_KEY env var */
@@ -38,6 +38,16 @@ export { resolveRecurringJobsBuildMarker };
38
38
  export { scheduledTriggerAvailability };
39
39
  export { shouldDisableRecurringJobsRuntime };
40
40
  export { finalizeClaimedAgentChatProcessRunFailure };
41
+ /**
42
+ * The model this mount runs with, when the caller does not pass one per request.
43
+ *
44
+ * The plugin option is the top layer because it is per-mount; `agent.model`
45
+ * (`AGENT_MODEL`) is the declared layer below it, so a deployment can pin a
46
+ * model without editing app source. Read through here rather than off
47
+ * `options` directly — every raw `options?.model` site is a place the declared
48
+ * field silently does nothing.
49
+ */
50
+ export declare function resolveConfiguredAgentModel(options?: Pick<AgentChatPluginOptions, "model">): string | undefined;
41
51
  export declare function resolveInteractiveAgentRunOptions(options?: Pick<AgentChatPluginOptions, "runSoftTimeoutMs" | "runNoProgressTimeoutMs" | "durableBackgroundRuns">): {
42
52
  runSoftTimeoutMs: number;
43
53
  runNoProgressTimeoutMs: number;