@agent-native/core 0.203.0-nightly-20261007064822 → 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.
Files changed (63) hide show
  1. package/dist/agent/engine/builder-engine.d.ts +1 -1
  2. package/dist/agent/model-config.d.ts +2 -2
  3. package/dist/agent/model-config.js +0 -2
  4. package/dist/agent/thread-data-builder.d.ts +6 -0
  5. package/dist/agent/thread-data-builder.js +747 -25
  6. package/dist/agent/thread-message-projection.d.ts +20 -0
  7. package/dist/agent/thread-message-projection.js +300 -0
  8. package/dist/automation/index.d.ts +1 -1
  9. package/dist/chat-threads/store.d.ts +4 -1
  10. package/dist/chat-threads/store.js +92 -17
  11. package/dist/cli/skills-content/turn-into-app-skill.d.ts +10 -4
  12. package/dist/cli/skills-content/turn-into-app-skill.js +2454 -705
  13. package/dist/cli/skills.d.ts +6 -0
  14. package/dist/cli/skills.js +8 -2
  15. package/dist/client/chat/agentkit-agent-native.js +839 -89
  16. package/dist/client/chat/agentkit-protocol.js +67 -17
  17. package/dist/collab/routes.d.ts +2 -2
  18. package/dist/jobs/actions/manage-recurring-job.d.ts +1 -1
  19. package/dist/mcp/build-server.d.ts +5 -1
  20. package/dist/mcp/build-server.js +56 -13
  21. package/dist/mcp/embed-app.js +6 -1
  22. package/dist/notifications/routes.d.ts +1 -1
  23. package/dist/observability/routes.d.ts +3 -3
  24. package/dist/org/index.d.ts +2 -2
  25. package/dist/provider-api/actions/provider-api.d.ts +4 -4
  26. package/dist/resources/handlers.d.ts +1 -1
  27. package/dist/server/agent-chat/mcp-options.d.ts +4 -0
  28. package/dist/server/agent-chat-plugin.js +97 -22
  29. package/dist/server/agent-engine-default-model-route.d.ts +2 -2
  30. package/dist/server/onboarding-html.js +1 -1
  31. package/dist/server/realtime-token.d.ts +1 -1
  32. package/dist/server/transcribe-voice.d.ts +1 -1
  33. package/dist/shared/embed-auth.js +5 -4
  34. package/dist/sharing/actions/list-resource-shares.d.ts +1 -1
  35. package/dist/templates/factory/.agents/skills/review-latest-feedback/SKILL.md +26 -24
  36. package/dist/templates/factory/.agents/skills/review-latest-feedback/references/deployment-recovery.md +53 -0
  37. package/dist/templates/factory/.agents/skills/review-latest-feedback/references/documentation-proof.md +7 -0
  38. package/dist/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +284 -461
  39. package/dist/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  40. package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +65 -90
  41. package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/local-run-and-deploy.md +161 -0
  42. package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/review-loop.md +384 -0
  43. package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/source-brief.md +116 -0
  44. package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/spreadsheet-source.md +206 -190
  45. package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/ui-archetypes.md +381 -0
  46. package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/ui-direction.md +323 -0
  47. package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/ui-palettes.md +564 -0
  48. package/dist/triggers/actions/manage-automation.d.ts +7 -7
  49. package/docs/content/observability.mdx +136 -0
  50. package/package.json +4 -4
  51. package/src/templates/factory/.agents/skills/review-latest-feedback/SKILL.md +26 -24
  52. package/src/templates/factory/.agents/skills/review-latest-feedback/references/deployment-recovery.md +53 -0
  53. package/src/templates/factory/.agents/skills/review-latest-feedback/references/documentation-proof.md +7 -0
  54. package/src/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +284 -461
  55. package/src/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  56. package/src/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +65 -90
  57. package/src/templates/workspace-core/.agents/skills/turn-into-app/references/local-run-and-deploy.md +161 -0
  58. package/src/templates/workspace-core/.agents/skills/turn-into-app/references/review-loop.md +384 -0
  59. package/src/templates/workspace-core/.agents/skills/turn-into-app/references/source-brief.md +116 -0
  60. package/src/templates/workspace-core/.agents/skills/turn-into-app/references/spreadsheet-source.md +206 -190
  61. package/src/templates/workspace-core/.agents/skills/turn-into-app/references/ui-archetypes.md +381 -0
  62. package/src/templates/workspace-core/.agents/skills/turn-into-app/references/ui-direction.md +323 -0
  63. package/src/templates/workspace-core/.agents/skills/turn-into-app/references/ui-palettes.md +564 -0
@@ -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-20261007064822",
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-20261007064822",
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-20261007064822",
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",
@@ -1,12 +1,10 @@
1
1
  ---
2
2
  name: review-latest-feedback
3
3
  description: >-
4
- Sweep recent Slack, GitHub issues, Sentry, Agent-Native Analytics errors,
5
- actionable automated diagnostics, and linked-tracker feedback: answer
6
- reporters first, then fix verified bugs and actionable
7
- objective UI defects at the owning boundary, require human signoff for
8
- subjective UI changes, build features the invoking user endorsed with an
9
- :upvote:, and recap every disposition. Use for scheduled or manual sweeps.
4
+ Sweep Slack, GitHub, Sentry, Analytics, trackers, and automated diagnostics,
5
+ plus app/template, desktop, and package deploy/release/publish lanes. Fix
6
+ verified defects, verify recovery targets, and recap. Use for scheduled or
7
+ manual sweeps.
10
8
  user-invocable: true
11
9
  scope: dev
12
10
  metadata:
@@ -326,6 +324,16 @@ correlation. Apply the same local-first rule. Fix worthwhile repo-owned failures
326
324
  at their boundary; record external, deployment, or unclear issues without
327
325
  inventing a fix.
328
326
 
327
+ ### Deployment, release, and publish failures
328
+
329
+ Scan app/template, desktop build/release, and package-publish lanes on every
330
+ sweep, even without a linked report. Include queued/running runs, run-only
331
+ failures, and missing/stale artifacts; carry active run IDs and rows across
332
+ cursors. Fix verified repo-owned causes; record external/manual causes with the
333
+ next owner/action. Use [`deployment-recovery.md`](references/deployment-recovery.md)
334
+ for lane-specific recovery and target proof. Green CI or merged source
335
+ does not prove delivery.
336
+
329
337
  ## Phase 2: fix
330
338
 
331
339
  Before changing code, read `fix-at-the-boundary`, `verifying-changes`, and
@@ -426,24 +434,16 @@ pre-existing.
426
434
 
427
435
  ### Npx and package reports have a release follow-up
428
436
 
429
- Npx scaffolds are versioned. Record pinned/filed versions, fresh npm cache/no
430
- local override, candidate result, release, and existing-app path (`pnpm add
431
- @agent-native/core@<version>` or hand edit).
432
-
433
- Local proof, beta promises, and scaffolds aren't **Shipped**/**Live verified**
434
- until published. A verified merge is **Fixed**; follow the issue-closure rule
435
- above. Record merge proof, release, verification, and bump/re-scaffold
436
- follow-up. Unknown package/endpoint context is a release follow-up. Ask only if
437
- scope or reporter input is unclear. Missing evidence alone doesn't keep a
438
- verified merge open.
439
- Merge/beta is not npx delivery.
437
+ Use [`deployment-recovery.md`](references/deployment-recovery.md) for npx
438
+ version evidence, registry proof, publication status, and existing-app upgrade
439
+ verification. A verified merge may be **Fixed** under the issue-closure rule
440
+ above while its delivery row stays open; a local scaffold or beta promise is not
441
+ delivery.
440
442
 
441
443
  ### Documentation has a runnable proof obligation
442
444
 
443
- For each docs row, copy commands into a clean temporary scaffold; verify every
444
- referenced file, directory, script, env var, deploy target, link, and fence
445
- order. A docs diff/build is not enough. Update configured locales and run
446
- `guard:i18n-catalogs` plus `guard:i18n-changed-copy`.
445
+ For each docs row, use [`documentation-proof.md`](references/documentation-proof.md).
446
+ A docs diff/build alone isn't proof.
447
447
 
448
448
  Choose the narrowest seam the evidence supports:
449
449
 
@@ -577,14 +577,16 @@ message details.
577
577
  Start cursors: product [Slack message](...) · QA [Slack message](...) · dev [Slack message](...)
578
578
  Reply cursors (reuse next run): product <timestamp> · QA <timestamp> · dev <timestamp>
579
579
  Messages: product N · QA N · dev N (total N)
580
+ Deployment cursor: <timestamp> · carried active run IDs/rows: <ids/count>
581
+ Release lanes: N inspected · failed/stale N · target verified N
580
582
  Reaction-gated skips: N · claimed N · answered N
581
583
  Questions asked: N/3 · Dropped at 4 days: N
582
584
  Repeats of a prior Fixed claim: N (each with its earlier thread and failed fix)
583
585
  Upvoted items in scope: N (built: N)
584
586
 
585
- | Tracker/source | Reporter | Status | Repro (expected/actual) | Pre/post | Runtime proof | Locales | Handoff (action/owner/ticket) | Replied | Reactions |
587
+ | Tracker/source or workflow run | Reporter/owner | Status | Repro or failed step | Pre/post/recovery | Run/SHA/target/version/artifact/runtime proof | Locales | Handoff (action/owner/ticket) | Replied | Reactions |
586
588
  | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
587
- | 18 / [thread](...) | ... | <disposition> | steps; expected/actual | before/after | source/tests/build/URL | updated/N/A/pending | none or action/owner/[ticket](...) | yes/no | 👀 claim; ✅ Fixed; 🎫 ticketed only |
589
+ | 18 / [thread](...) or [workflow run](...) | ... | <disposition> | steps; expected/actual or failed job/step | before/after/recovery run | source/tests/build/run/SHA/target/version/URL | updated/N/A/pending | none or action/owner/[ticket](...) | yes/no | 👀 claim; ✅ Fixed; 🎫 ticketed only |
588
590
 
589
591
  Sibling sweep: <fingerprint> - N hits, M fixed, K triaged
590
592
  Tracker: <sheet/export and bounded range> - N rows enumerated, N ledgers complete
@@ -601,4 +603,4 @@ cursor stated.
601
603
  ## Related skills
602
604
 
603
605
  `address-feedback`, `address-feedback-with-replies`, `fix-at-the-boundary`,
604
- `concurrent-agents`, `verifying-changes`, `ship`
606
+ `concurrent-agents`, `verifying-changes`, `ship`, `ship-and-monitor`
@@ -0,0 +1,53 @@
1
+ # Deployment, release, and publish recovery
2
+
3
+ Use this guide for each `review-latest-feedback` sweep, even when no report
4
+ links a failed run.
5
+
6
+ ## Scan and classify
7
+
8
+ - Inspect recent deploy, release, desktop build/sign/notarize/update, and
9
+ package-publish runs since the previous deployment cursor; on the first run,
10
+ use the last 7 days for completed-run history and independently include every
11
+ nonterminal run regardless of age. Seed the carried-run list with all active
12
+ runs before advancing the cursor. Include queued, approval-waiting, and
13
+ running jobs, and recheck them regardless of age. Finish all result pages
14
+ before advancing the cursor. Cover app/template beta, docs, and production
15
+ lanes where configured. Use current workflow/target maps and provider or
16
+ registry state.
17
+ - Check deployed app revisions, desktop release assets, and package versions
18
+ for missing or stale artifacts, including when a workflow reports success.
19
+ - For each failure or target mismatch, inspect authoritative logs. Record the
20
+ run URL, workflow, failed job/step, target/platform/package/version, source
21
+ SHA, and error in the ledger.
22
+ - Separate repo-owned source/workflow/config defects from provider errors,
23
+ skipped or manual gates, cancellations, and superseded runs. Fix confirmed
24
+ repo-owned causes at their owning boundary. Record an external owner and exact
25
+ next action when the cause is outside the repo.
26
+
27
+ ## Recover and verify
28
+
29
+ Use the lane's normal workflow and the invocation's applicable publish/deploy
30
+ authority. Recover only affected lanes. Read `ship` for PR/push/merge work and
31
+ `ship-and-monitor` for beta, docs, release-tail, or manual-production proof.
32
+ If a required release action is not authorized, keep its operational row active
33
+ with the exact next action.
34
+
35
+ Verify the intended source and delivery artifact at the target:
36
+
37
+ - **Apps:** confirm the target has the intended revision and smoke-test the
38
+ affected URL or health path, including cache behavior when relevant.
39
+ - **Desktop:** confirm the expected version and platform assets exist, then
40
+ exercise the affected install or update path through launch.
41
+ - **Packages:** confirm the exact version is in the registry and install or
42
+ scaffold it from a clean cache. For npx, record pinned/filed versions, remove
43
+ local overrides, verify the candidate and published release, and check the
44
+ existing-app upgrade path (for example, `pnpm add
45
+ @agent-native/core@<version>` or the documented hand edit).
46
+
47
+ A green workflow, merged source, beta promise, or local scaffold alone does not
48
+ prove delivery. Keep carrying each operational row and nonterminal run ID until
49
+ the intended artifact is present and its target check passes; a linked source issue can be **Fixed**
50
+ while the operational row remains open. Run-only failures get a ledger row, not
51
+ a fabricated Slack reaction. Local proof is not **Shipped**/**Live verified**
52
+ until the relevant artifact is published and its delivery/runtime bar passes.
53
+ Link the merge, release, verification, and any bump/re-scaffold follow-up.
@@ -0,0 +1,7 @@
1
+ # Documentation proof checklist
2
+
3
+ For each documentation row, copy its commands into a clean temporary scaffold.
4
+ Verify referenced files, directories, scripts, environment variables, deploy
5
+ targets, links, and fenced-command order. Update configured locales when source
6
+ meaning changes. Run `guard:i18n-catalogs` and `guard:i18n-changed-copy`; a docs
7
+ diff or build alone is not proof.