@agent-native/core 0.203.0-nightly-20261007093643 → 0.203.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.
@@ -1,7 +1,7 @@
1
1
  import { type BuilderGatewayLane } from "../../server/credential-provider.js";
2
2
  import type { AgentEngine, EngineCapabilities } from "./types.js";
3
3
  export declare const BUILDER_CAPABILITIES: EngineCapabilities;
4
- export declare const BUILDER_SUPPORTED_MODELS: readonly ["auto", "claude-haiku-4-5", "claude-sonnet-5", "claude-opus-5-5", "gpt-5-4", "gpt-5-5", "gpt-5-4-mini", "gpt-5-1-codex-mini", "gpt-6.1-sol", "gpt-5-6-terra", "gpt-6-luna", "gemini-3-1-pro", "gemini-3-8-flash", "gemini-3-5-flash-lite", "gemini-3-1-flash-lite", "grok-code-fast", "qwen3-coder", "kimi-k2-5", "deepseek-v4-pro", "deepseek-v3-1", "z-ai-glm-4-5", "z-ai-glm-5-1"];
4
+ export declare const BUILDER_SUPPORTED_MODELS: readonly ["auto", "claude-haiku-4-5", "claude-sonnet-5", "claude-opus-5-5", "gpt-5-4", "gpt-5-5", "gpt-5-4-mini", "gpt-5-1-codex-mini", "gpt-6.1-sol", "gpt-5-6-terra", "gpt-6-luna", "gemini-3-1-pro", "gemini-3-8-flash", "gemini-3-5-flash-lite", "gemini-3-1-flash-lite", "qwen3-coder", "kimi-k2-5", "deepseek-v3-1", "z-ai-glm-4-5", "z-ai-glm-5-1"];
5
5
  export declare const BUILDER_MODEL_UNAUTHORIZED_ERROR_CODE = "builder_model_unauthorized";
6
6
  /**
7
7
  * A truncated stream, not a rejected request: the client continues the partial
@@ -21,7 +21,7 @@ export declare const BUILDER_CLAUDE_SONNET_MODEL_LABEL = "Claude Sonnet 5";
21
21
  export declare const AGENT_MODEL_CONFIG: {
22
22
  readonly builder: {
23
23
  readonly defaultModel: "gpt-6-luna";
24
- readonly supportedModels: readonly ["auto", "claude-haiku-4-5", "claude-sonnet-5", "claude-opus-5-5", "gpt-5-4", "gpt-5-5", "gpt-5-4-mini", "gpt-5-1-codex-mini", "gpt-6.1-sol", "gpt-5-6-terra", "gpt-6-luna", "gemini-3-1-pro", "gemini-3-8-flash", "gemini-3-5-flash-lite", "gemini-3-1-flash-lite", "grok-code-fast", "qwen3-coder", "kimi-k2-5", "deepseek-v4-pro", "deepseek-v3-1", "z-ai-glm-4-5", "z-ai-glm-5-1"];
24
+ readonly supportedModels: readonly ["auto", "claude-haiku-4-5", "claude-sonnet-5", "claude-opus-5-5", "gpt-5-4", "gpt-5-5", "gpt-5-4-mini", "gpt-5-1-codex-mini", "gpt-6.1-sol", "gpt-5-6-terra", "gpt-6-luna", "gemini-3-1-pro", "gemini-3-8-flash", "gemini-3-5-flash-lite", "gemini-3-1-flash-lite", "qwen3-coder", "kimi-k2-5", "deepseek-v3-1", "z-ai-glm-4-5", "z-ai-glm-5-1"];
25
25
  };
26
26
  readonly anthropic: {
27
27
  readonly defaultModel: "claude-sonnet-5-5";
@@ -64,7 +64,7 @@ export declare const AGENT_MODEL_CONFIG: {
64
64
  };
65
65
  export declare const BUILDER_MODEL_CONFIG: {
66
66
  readonly defaultModel: "gpt-6-luna";
67
- readonly supportedModels: readonly ["auto", "claude-haiku-4-5", "claude-sonnet-5", "claude-opus-5-5", "gpt-5-4", "gpt-5-5", "gpt-5-4-mini", "gpt-5-1-codex-mini", "gpt-6.1-sol", "gpt-5-6-terra", "gpt-6-luna", "gemini-3-1-pro", "gemini-3-8-flash", "gemini-3-5-flash-lite", "gemini-3-1-flash-lite", "grok-code-fast", "qwen3-coder", "kimi-k2-5", "deepseek-v4-pro", "deepseek-v3-1", "z-ai-glm-4-5", "z-ai-glm-5-1"];
67
+ readonly supportedModels: readonly ["auto", "claude-haiku-4-5", "claude-sonnet-5", "claude-opus-5-5", "gpt-5-4", "gpt-5-5", "gpt-5-4-mini", "gpt-5-1-codex-mini", "gpt-6.1-sol", "gpt-5-6-terra", "gpt-6-luna", "gemini-3-1-pro", "gemini-3-8-flash", "gemini-3-5-flash-lite", "gemini-3-1-flash-lite", "qwen3-coder", "kimi-k2-5", "deepseek-v3-1", "z-ai-glm-4-5", "z-ai-glm-5-1"];
68
68
  };
69
69
  export declare const ANTHROPIC_MODEL_CONFIG: {
70
70
  readonly defaultModel: "claude-sonnet-5-5";
@@ -174,10 +174,8 @@ export const AGENT_MODEL_CONFIG = {
174
174
  "gemini-3-8-flash",
175
175
  "gemini-3-5-flash-lite",
176
176
  "gemini-3-1-flash-lite",
177
- "grok-code-fast",
178
177
  "qwen3-coder",
179
178
  "kimi-k2-5",
180
- "deepseek-v4-pro",
181
179
  "deepseek-v3-1",
182
180
  "z-ai-glm-4-5",
183
181
  "z-ai-glm-5-1",
@@ -139,8 +139,8 @@ export declare function createAutomationCallbackHandler(runtime: AutomationRunti
139
139
  duplicate?: undefined;
140
140
  eventId?: undefined;
141
141
  } | {
142
- error?: undefined;
143
142
  accepted: boolean;
144
143
  duplicate: boolean;
145
144
  eventId: string;
145
+ error?: undefined;
146
146
  }>;
@@ -8,16 +8,16 @@ export declare const getCollabState: import("h3").EventHandlerWithFetch<import("
8
8
  state: string;
9
9
  }>>;
10
10
  export declare const postCollabUpdate: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
11
- error: string;
12
11
  ok?: undefined;
12
+ error: string;
13
13
  } | {
14
14
  error?: undefined;
15
15
  ok: boolean;
16
16
  }>>;
17
17
  export declare const postCollabText: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
18
18
  ok?: undefined;
19
- error: string;
20
19
  text?: undefined;
20
+ error: string;
21
21
  } | {
22
22
  error?: undefined;
23
23
  ok: boolean;
@@ -42,8 +42,8 @@ declare const _default: import("../../action.js").ActionDefinition<{
42
42
  url: string;
43
43
  id: string;
44
44
  provider: string;
45
- error?: undefined;
46
45
  configured?: undefined;
46
+ error?: undefined;
47
47
  } | {
48
48
  url?: undefined;
49
49
  id?: undefined;
@@ -11,9 +11,9 @@ declare const _default: import("../../action.js").ActionDefinition<{
11
11
  enabled?: undefined;
12
12
  nextRun?: undefined;
13
13
  } | {
14
- deleted?: undefined;
15
14
  name: string;
16
15
  enabled: boolean;
17
16
  nextRun: string;
17
+ deleted?: undefined;
18
18
  }>;
19
19
  export default _default;
@@ -16,6 +16,6 @@ export declare function createNotificationsHandler(): import("h3").EventHandlerW
16
16
  } | {
17
17
  count?: undefined;
18
18
  updated?: undefined;
19
- error?: undefined;
20
19
  ok: boolean;
20
+ error?: undefined;
21
21
  }>>;
@@ -27,38 +27,38 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
27
27
  thumbsUpRate: number;
28
28
  avgEvalScore: number;
29
29
  } | {
30
- id?: undefined;
31
30
  error: string;
32
31
  message: string;
33
32
  summary?: undefined;
34
33
  spans?: undefined;
34
+ id?: undefined;
35
35
  ok?: undefined;
36
36
  } | {
37
- id?: undefined;
38
- error?: undefined;
39
37
  message?: undefined;
40
38
  summary: import("./types.js").TraceSummary;
41
39
  spans: import("./types.js").TraceSpan[];
40
+ id?: undefined;
41
+ error?: undefined;
42
42
  ok?: undefined;
43
43
  } | {
44
- error?: undefined;
45
44
  message?: undefined;
46
45
  summary?: undefined;
47
46
  spans?: undefined;
48
47
  id: string;
48
+ error?: undefined;
49
49
  ok?: undefined;
50
50
  } | {
51
- id?: undefined;
52
51
  message?: undefined;
53
52
  summary?: undefined;
54
53
  spans?: undefined;
54
+ id?: undefined;
55
55
  error: any;
56
56
  ok?: undefined;
57
57
  } | {
58
- id?: undefined;
59
- error?: undefined;
60
58
  message?: undefined;
61
59
  summary?: undefined;
62
60
  spans?: undefined;
61
+ id?: undefined;
62
+ error?: undefined;
63
63
  ok: boolean;
64
64
  }>>;
@@ -71,10 +71,10 @@ export declare const setWorkspaceAppDefaultVisibilityHandler: import("h3").Event
71
71
  visibility: WorkspaceAppDefaultVisibility;
72
72
  }>>;
73
73
  export declare const createOrgHandler: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
74
- success: boolean;
75
- id?: undefined;
76
74
  name?: undefined;
75
+ success: boolean;
77
76
  role?: undefined;
77
+ id?: undefined;
78
78
  } | {
79
79
  success?: undefined;
80
80
  id: string;
@@ -2,6 +2,6 @@ export declare function createProgressHandler(): import("h3").EventHandlerWithFe
2
2
  error: string;
3
3
  ok?: undefined;
4
4
  } | {
5
- error?: undefined;
6
5
  ok: boolean;
6
+ error?: undefined;
7
7
  }>>;
@@ -39,8 +39,8 @@ export declare function handleUpdateResource(event: any): Promise<import("./stor
39
39
  error: string;
40
40
  }>;
41
41
  export declare function handleDeleteResource(event: any): Promise<{
42
- ok?: undefined;
43
42
  error: string;
43
+ ok?: undefined;
44
44
  } | {
45
45
  error?: undefined;
46
46
  ok: boolean;
@@ -65,7 +65,6 @@ export declare function createAgentEngineApiKeyHandler(): import("h3").EventHand
65
65
  error: any;
66
66
  code: any;
67
67
  } | {
68
- error?: undefined;
69
68
  errorCode?: undefined;
70
69
  code?: undefined;
71
70
  ok: boolean;
@@ -73,5 +72,6 @@ export declare function createAgentEngineApiKeyHandler(): import("h3").EventHand
73
72
  baseUrlKey?: string;
74
73
  scope: AgentEngineApiKeyScope;
75
74
  defaultModel?: import("./agent-engine-default-model-route.js").SavedKeyDefaultModelOutcome;
75
+ error?: undefined;
76
76
  }>>;
77
77
  export {};
@@ -8,17 +8,17 @@ export declare const AGENT_ENGINE_API_KEY_ACTION_NAME = "agent-engine-api-key";
8
8
  * resolveEngine's credential detection.
9
9
  */
10
10
  export declare function createAgentEngineDisconnectHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
11
- ok?: undefined;
12
11
  error: string;
13
12
  scope?: undefined;
13
+ ok?: undefined;
14
14
  } | {
15
15
  ok: boolean;
16
16
  error: any;
17
17
  scope?: undefined;
18
18
  } | {
19
- error?: undefined;
20
19
  ok: boolean;
21
20
  scope: "org" | "user";
21
+ error?: undefined;
22
22
  }>>;
23
23
  export interface DefaultModelSelectionRequest {
24
24
  engine: string;
@@ -13,8 +13,6 @@ declare const _default: import("../../action.js").ActionDefinition<{
13
13
  executionEngine?: string;
14
14
  executionCwd?: string;
15
15
  }, {
16
- deleted?: undefined;
17
- enabled?: undefined;
18
16
  created: boolean;
19
17
  name: string;
20
18
  scope: "organization" | "personal";
@@ -25,31 +23,33 @@ declare const _default: import("../../action.js").ActionDefinition<{
25
23
  reasoningEffort: "auto" | "high" | "low" | "max" | "medium" | "minimal" | "none" | "xhigh";
26
24
  webhookPath: string;
27
25
  nextRun: string;
26
+ deleted?: undefined;
27
+ enabled?: undefined;
28
28
  executionHostId?: undefined;
29
29
  executionEngine?: undefined;
30
30
  executionCwd?: undefined;
31
31
  } | {
32
- enabled?: undefined;
33
- nextRun?: undefined;
34
32
  created?: undefined;
35
33
  scope?: undefined;
36
34
  triggerType?: undefined;
37
35
  event?: undefined;
38
36
  deleted: boolean;
39
37
  name: string;
38
+ enabled?: undefined;
40
39
  schedule?: undefined;
41
40
  timezone?: undefined;
42
41
  reasoningEffort?: undefined;
43
42
  executionHostId?: undefined;
44
43
  executionEngine?: undefined;
45
44
  executionCwd?: undefined;
45
+ nextRun?: undefined;
46
46
  webhookPath?: undefined;
47
47
  } | {
48
- deleted?: undefined;
49
48
  created?: undefined;
50
49
  scope?: undefined;
51
50
  triggerType?: undefined;
52
51
  event?: undefined;
52
+ deleted?: undefined;
53
53
  name: string;
54
54
  enabled: boolean;
55
55
  schedule: string;
@@ -421,6 +421,142 @@ Core also records metrics once the host registers a meter provider with `registe
421
421
 
422
422
  On metrics, `gen_ai.tool.name` is a framework action's name or `other`, and `gen_ai.request.model` is the model id only when the engine lists it as supported, otherwise `_OTHER`. App-defined tools and caller-supplied model ids therefore cannot create unbounded series; spans keep the exact values.
423
423
 
424
+ ## Connecting an OpenTelemetry back end {#otel-provider}
425
+
426
+ Core ships no OpenTelemetry SDK or exporter. An app builds its own SDK providers and hands them to core with `registerObservabilityProvider()` from `@agent-native/core/server`. Core then emits the [spans](#otel) and [metrics](#otel-metrics) above through them, and the app's exporter sends them to any OTLP back end.
427
+
428
+ ### `registerObservabilityProvider()` {#register-observability-provider}
429
+
430
+ `registerObservabilityProvider()` takes one object with two optional fields:
431
+
432
+ - **tracerProvider**: an object with `getTracer(name, version?)`. Core takes its tracer from here. Without one, spans use the global `@opentelemetry/api` tracer.
433
+ - **meterProvider**: an object with `getMeter(name, version?)`. Metrics are recorded only when a meter provider is registered. They have no global fallback, so without one every metric is a no-op.
434
+
435
+ Either provider may also implement `forceFlush()`, which core calls after each response (see [Flushing on serverless](#otel-flush)). The SDK's `BasicTracerProvider` and `MeterProvider` already match these shapes.
436
+
437
+ ```ts
438
+ function registerObservabilityProvider(
439
+ provider: ObservabilityProvider,
440
+ ): () => void;
441
+
442
+ interface ObservabilityProvider {
443
+ tracerProvider?: ObservabilityTracerProvider;
444
+ meterProvider?: ObservabilityMeterProvider;
445
+ }
446
+
447
+ interface ObservabilityTracerProvider {
448
+ getTracer(name: string, version?: string): unknown;
449
+ forceFlush?(): Promise<void>;
450
+ }
451
+
452
+ interface ObservabilityMeterProvider {
453
+ getMeter(name: string, version?: string): unknown;
454
+ forceFlush?(): Promise<void>;
455
+ }
456
+ ```
457
+
458
+ A later call replaces the earlier provider. The returned function unregisters the provider if it is still the registered one. Spans also need `@opentelemetry/api` installed in the app. Without it, core turns tracing off and logs one warning.
459
+
460
+ ### Flushing on serverless {#otel-flush}
461
+
462
+ Serverless functions freeze between invocations, so an SDK's export timer may never fire. When a registered provider implements `forceFlush()`, core calls it from the response hook after every request and waits for it. Each flush races one shared 2-second timeout, so telemetry never holds a response longer than that.
463
+
464
+ When a flush fails or times out, core stops waiting for it and adds 1 to `agent_native.telemetry.flush_failures`, which the next flush exports. A timed-out export keeps running and can still arrive, unless the runtime freezes the process first. The failure's `error.type` is `timeout`, `suspended` when the runtime froze the process mid-flush, or the error's name.
465
+
466
+ On a long-running server, a flush after every response means one export per request. Register providers without `forceFlush()` there and let the SDK's own timers export. `isServerlessRuntime()` from `@agent-native/core/server` tells the two apart. It is true on Netlify, Vercel, AWS Lambda, and Cloudflare.
467
+
468
+ ### Example: OTLP over HTTP {#otel-example}
469
+
470
+ This server plugin wires the OpenTelemetry JS SDK to core. Install the SDK packages first:
471
+
472
+ ```bash
473
+ pnpm add @opentelemetry/api @opentelemetry/context-async-hooks @opentelemetry/exporter-metrics-otlp-proto @opentelemetry/exporter-trace-otlp-proto @opentelemetry/resources @opentelemetry/sdk-metrics @opentelemetry/sdk-trace-base
474
+ ```
475
+
476
+ ```ts filename="server/plugins/otel.ts"
477
+ import { randomUUID } from "node:crypto";
478
+
479
+ import {
480
+ defineNitroPlugin,
481
+ isServerlessRuntime,
482
+ registerObservabilityProvider,
483
+ } from "@agent-native/core/server";
484
+ import { context } from "@opentelemetry/api";
485
+ import { AsyncLocalStorageContextManager } from "@opentelemetry/context-async-hooks";
486
+ import { OTLPMetricExporter } from "@opentelemetry/exporter-metrics-otlp-proto";
487
+ import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-proto";
488
+ import {
489
+ defaultResource,
490
+ detectResources,
491
+ envDetector,
492
+ resourceFromAttributes,
493
+ } from "@opentelemetry/resources";
494
+ import {
495
+ MeterProvider,
496
+ PeriodicExportingMetricReader,
497
+ } from "@opentelemetry/sdk-metrics";
498
+ import {
499
+ BasicTracerProvider,
500
+ BatchSpanProcessor,
501
+ } from "@opentelemetry/sdk-trace-base";
502
+
503
+ export default defineNitroPlugin(() => {
504
+ if (!process.env.OTEL_EXPORTER_OTLP_ENDPOINT) return;
505
+
506
+ // Metric counters are cumulative and restart with each process, so each
507
+ // process needs its own series.
508
+ const resource = defaultResource()
509
+ .merge(resourceFromAttributes({ "service.instance.id": randomUUID() }))
510
+ .merge(detectResources({ detectors: [envDetector] }));
511
+
512
+ const meterProvider = new MeterProvider({
513
+ resource,
514
+ readers: [
515
+ new PeriodicExportingMetricReader({
516
+ exporter: new OTLPMetricExporter(),
517
+ exportIntervalMillis: 60_000,
518
+ }),
519
+ ],
520
+ });
521
+
522
+ context.setGlobalContextManager(
523
+ new AsyncLocalStorageContextManager().enable(),
524
+ );
525
+ const tracerProvider = new BasicTracerProvider({
526
+ resource,
527
+ spanProcessors: [new BatchSpanProcessor(new OTLPTraceExporter())],
528
+ });
529
+
530
+ if (isServerlessRuntime()) {
531
+ registerObservabilityProvider({ meterProvider, tracerProvider });
532
+ return;
533
+ }
534
+ // Without forceFlush(), core leaves exporting to the SDK's own timers.
535
+ registerObservabilityProvider({
536
+ meterProvider: {
537
+ getMeter: (name, version) => meterProvider.getMeter(name, version),
538
+ },
539
+ tracerProvider: {
540
+ getTracer: (name, version) => tracerProvider.getTracer(name, version),
541
+ },
542
+ });
543
+ });
544
+ ```
545
+
546
+ The plugin does nothing until `OTEL_EXPORTER_OTLP_ENDPOINT` is set. The SDK reads the rest of its configuration from the standard OpenTelemetry environment variables:
547
+
548
+ | Variable | Effect |
549
+ | ------------------------------------------------- | ------------------------------------------------------------------------------------- |
550
+ | `OTEL_EXPORTER_OTLP_ENDPOINT` | Base URL of the OTLP receiver. The exporters append `/v1/traces` and `/v1/metrics`. |
551
+ | `OTEL_EXPORTER_OTLP_HEADERS` | Headers sent with every export, e.g. `Authorization=Bearer%20<token>` |
552
+ | `OTEL_SERVICE_NAME` | `service.name` on every span and metric |
553
+ | `OTEL_RESOURCE_ATTRIBUTES` | Extra resource attributes, e.g. `deployment.environment.name=production` |
554
+ | `OTEL_TRACES_SAMPLER` / `OTEL_TRACES_SAMPLER_ARG` | Trace sampling, e.g. `parentbased_traceidratio` and `0.1`. Metrics are never sampled. |
555
+
556
+ The `-proto` exporters send OTLP over HTTP with protobuf, so point the endpoint at the receiver's HTTP port (4318 by default), not its gRPC port. Spans carry no prompt or completion text. The `capture*` settings under [Configuration](#config) apply to the SQL traces and PostHog, not to OTLP.
557
+
558
+ The repository's [`packages/otel`](https://github.com/BuilderIO/agent-native/tree/main/packages/otel) holds a fuller version of this plugin with per-signal endpoints and exporter validation. It is not published to npm, so start from the plugin above instead of installing it.
559
+
424
560
  ## Error reporting (Sentry or PostHog) {#sentry}
425
561
 
426
562
  Server-side errors that escape Nitro route handlers are reported to Sentry when a DSN is configured. Without it the SDK silently no-ops, so it's safe to leave the env vars unset in dev. Browser and server events can go to the same Sentry project; split them into separate projects only when you want operational separation for ownership, volume, quotas, or alert routing.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.203.0-nightly-20261007093643",
3
+ "version": "0.203.0",
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": {
@@ -682,8 +682,8 @@
682
682
  "yaml": "^2.9.0",
683
683
  "yjs": "^13.6.33",
684
684
  "zod": "^4.3.6",
685
- "@agent-native/agentkit": "^0.203.0-nightly-20261007093643",
686
- "@agent-native/recap-cli": "^0.5.63"
685
+ "@agent-native/agentkit": "^0.203.0",
686
+ "@agent-native/recap-cli": "^0.5.64"
687
687
  },
688
688
  "devDependencies": {
689
689
  "@ai-sdk/anthropic": "^3.0.71",
@@ -753,7 +753,7 @@
753
753
  "xlsx": "^0.18.5"
754
754
  },
755
755
  "peerDependencies": {
756
- "@agent-native/core-corpus": "0.203.0-nightly-20261007093643",
756
+ "@agent-native/core-corpus": ">=0.196.0",
757
757
  "@ai-sdk/anthropic": ">=3",
758
758
  "@ai-sdk/cohere": ">=3",
759
759
  "@ai-sdk/google": ">=3",