@agent-native/core 0.168.12 → 0.169.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 (39) hide show
  1. package/corpus/templates/clips/app/lib/capture-install-options.ts +20 -2
  2. package/corpus/templates/dispatch/app/root.tsx +9 -1
  3. package/dist/agent/engine/first-event-timeout.d.ts +8 -0
  4. package/dist/agent/engine/first-event-timeout.js +8 -0
  5. package/dist/agent/production-agent.d.ts +0 -30
  6. package/dist/agent/production-agent.js +17 -38
  7. package/dist/agent/run-loop-with-resume.d.ts +38 -25
  8. package/dist/agent/run-loop-with-resume.js +140 -55
  9. package/dist/agent/run-manager.d.ts +83 -68
  10. package/dist/agent/run-manager.js +280 -94
  11. package/dist/agent/run-store.d.ts +31 -0
  12. package/dist/agent/run-store.js +42 -12
  13. package/dist/app-config/agent.d.ts +2 -0
  14. package/dist/app-config/agent.js +33 -0
  15. package/dist/app-config/run-lifecycle-invariants.d.ts +248 -0
  16. package/dist/app-config/run-lifecycle-invariants.js +342 -0
  17. package/dist/app-config/schema.d.ts +2 -0
  18. package/dist/app-config/store.js +9 -1
  19. package/dist/client/EnvironmentBadge.d.ts +5 -4
  20. package/dist/client/EnvironmentBadge.js +19 -8
  21. package/dist/client/agent-chat-adapter.d.ts +0 -2
  22. package/dist/client/agent-chat-adapter.js +7 -23
  23. package/dist/client/app-providers.d.ts +3 -2
  24. package/dist/client/app-providers.js +3 -2
  25. package/dist/collab/awareness.d.ts +2 -2
  26. package/dist/collab/routes.d.ts +1 -1
  27. package/dist/jobs/background-automation-runner.d.ts +25 -0
  28. package/dist/jobs/background-automation-runner.js +104 -21
  29. package/dist/jobs/run-history.d.ts +7 -1
  30. package/dist/jobs/run-history.js +57 -14
  31. package/dist/notifications/routes.d.ts +3 -3
  32. package/dist/observability/traces.d.ts +13 -0
  33. package/dist/observability/traces.js +369 -317
  34. package/dist/resources/handlers.d.ts +1 -1
  35. package/dist/server/agent-chat-plugin.js +2 -4
  36. package/dist/server/beta-opt-out-html.js +3 -2
  37. package/dist/server/onboarding-html.js +3 -2
  38. package/dist/server/realtime-token.d.ts +1 -1
  39. package/package.json +1 -1
@@ -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
- error: string;
52
51
  ok?: undefined;
52
+ error: string;
53
53
  } | {
54
54
  error?: undefined;
55
55
  ok: boolean;
@@ -14,6 +14,7 @@ import { SYSTEM_PROMPT_CACHE_SPLIT } from "../agent/engine/prompt-cache.js";
14
14
  import { PROVIDER_TO_ENV } from "../agent/engine/provider-env-vars.js";
15
15
  import { hostedHarnessSystemPrompt } from "../agent/harness/hosted.js";
16
16
  import { createProductionAgentHandler, actionsToEngineTools, executeAgentToolCall, filterActionsByAllowedNames, normalizeAgentActionSurfaceResolution, readPersistedActionSurface, toolCallCacheKey, getActiveRunForThreadAsync, abortRunDurably, abortTurnDurably, subscribeToRun, } from "../agent/production-agent.js";
17
+ import { clientAbortReason } from "../agent/run-loop-with-resume.js";
17
18
  import { callerHasRunAccess, callerHasThreadAccess, } from "../agent/run-ownership.js";
18
19
  import { markTurnAborted, readBackgroundRunClaim } from "../agent/run-store.js";
19
20
  import { buildCurrentTimeUserContext, buildRuntimeContextPrompt, } from "../agent/runtime-context.js";
@@ -4142,10 +4143,7 @@ Non-code requests are still fine on this surface: read data, navigate the UI, su
4142
4143
  let reason = "user";
4143
4144
  try {
4144
4145
  const body = await readBody(event);
4145
- if (typeof body?.reason === "string" &&
4146
- /^[a-z0-9_-]{1,64}$/i.test(body.reason)) {
4147
- reason = body.reason;
4148
- }
4146
+ reason = clientAbortReason(body?.reason);
4149
4147
  }
4150
4148
  catch {
4151
4149
  // Empty/invalid body — keep the default user abort reason.
@@ -22,7 +22,7 @@ const environmentSwitcherStyles = `<style ${ENVIRONMENT_SWITCHER_STYLE_MARKER}>
22
22
  color-scheme: dark;
23
23
  .environment-switcher {
24
24
  position: fixed;
25
- right: max(0.75rem, env(safe-area-inset-right));
25
+ left: max(0.75rem, env(safe-area-inset-left));
26
26
  bottom: max(0.75rem, env(safe-area-inset-bottom));
27
27
  z-index: 100;
28
28
  }
@@ -59,9 +59,10 @@ const environmentSwitcherStyles = `<style ${ENVIRONMENT_SWITCHER_STYLE_MARKER}>
59
59
  }
60
60
  .environment-popover {
61
61
  position: absolute;
62
- right: 0;
62
+ left: 0;
63
63
  bottom: calc(100% + 0.5rem);
64
64
  width: min(17.5rem, calc(100vw - 1.5rem));
65
+ box-sizing: border-box;
65
66
  padding: 1.25rem;
66
67
  background: Canvas;
67
68
  color: CanvasText;
@@ -1639,7 +1639,7 @@ ${hasMarketing
1639
1639
  /* guard:allow-raw-color - standalone auth HTML has no app theme token layer */
1640
1640
  .environment-switcher {
1641
1641
  position: fixed;
1642
- right: max(0.75rem, env(safe-area-inset-right));
1642
+ left: max(0.75rem, env(safe-area-inset-left));
1643
1643
  bottom: max(0.75rem, env(safe-area-inset-bottom));
1644
1644
  z-index: 100;
1645
1645
  }
@@ -1674,9 +1674,10 @@ ${hasMarketing
1674
1674
  }
1675
1675
  .environment-popover {
1676
1676
  position: absolute;
1677
- right: 0;
1677
+ left: 0;
1678
1678
  bottom: calc(100% + 0.5rem);
1679
1679
  width: min(17.5rem, calc(100vw - 1.5rem));
1680
+ box-sizing: border-box;
1680
1681
  padding: 1.25rem;
1681
1682
  background: #141414;
1682
1683
  color: #fff;
@@ -26,8 +26,8 @@ export declare function createRealtimeTokenHandler(): import("h3").EventHandlerW
26
26
  expiresAt?: undefined;
27
27
  ttlSeconds?: undefined;
28
28
  } | {
29
- error?: undefined;
30
29
  token: string;
31
30
  expiresAt: string;
32
31
  ttlSeconds: number;
32
+ error?: undefined;
33
33
  }>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.168.12",
3
+ "version": "0.169.0",
4
4
  "description": "Framework for agent-native application development — where AI agents and UI share SQL state, actions, and context",
5
5
  "homepage": "https://github.com/BuilderIO/agent-native#readme",
6
6
  "bugs": {