@agent-native/core 0.77.4 → 0.77.6

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 (46) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/core/CHANGELOG.md +19 -0
  3. package/corpus/core/package.json +1 -1
  4. package/corpus/core/src/agent/production-agent.ts +35 -0
  5. package/corpus/core/src/agent/run-store.ts +2 -0
  6. package/corpus/core/src/client/changelog/Changelog.tsx +22 -10
  7. package/corpus/core/src/client/extensions/ExtensionsSidebarSection.tsx +405 -35
  8. package/corpus/templates/clips/app/i18n/ar-SA.ts +14 -0
  9. package/corpus/templates/clips/app/i18n/de-DE.ts +14 -0
  10. package/corpus/templates/clips/app/i18n/en-US.ts +14 -0
  11. package/corpus/templates/clips/app/i18n/es-ES.ts +14 -0
  12. package/corpus/templates/clips/app/i18n/fr-FR.ts +14 -0
  13. package/corpus/templates/clips/app/i18n/hi-IN.ts +14 -0
  14. package/corpus/templates/clips/app/i18n/ja-JP.ts +14 -0
  15. package/corpus/templates/clips/app/i18n/ko-KR.ts +14 -0
  16. package/corpus/templates/clips/app/i18n/pt-BR.ts +14 -0
  17. package/corpus/templates/clips/app/i18n/zh-CN.ts +14 -0
  18. package/corpus/templates/clips/app/root.tsx +2 -2
  19. package/corpus/templates/clips/app/routes/_app.extensions.$id.tsx +4 -1
  20. package/corpus/templates/clips/app/routes/_app.extensions._index.tsx +4 -1
  21. package/corpus/templates/clips/app/routes/_app.settings._index.tsx +12 -5
  22. package/corpus/templates/clips/changelog/2026-06-25-localized-clips-settings-changelog-and-extension-sidebar-lab.md +6 -0
  23. package/corpus/templates/clips/desktop/src/overlays/countdown.tsx +4 -2
  24. package/corpus/templates/clips/desktop/src/styles.css +15 -1
  25. package/dist/agent/production-agent.d.ts.map +1 -1
  26. package/dist/agent/production-agent.js +31 -0
  27. package/dist/agent/production-agent.js.map +1 -1
  28. package/dist/agent/run-store.d.ts +2 -0
  29. package/dist/agent/run-store.d.ts.map +1 -1
  30. package/dist/agent/run-store.js +2 -0
  31. package/dist/agent/run-store.js.map +1 -1
  32. package/dist/client/changelog/Changelog.d.ts +7 -2
  33. package/dist/client/changelog/Changelog.d.ts.map +1 -1
  34. package/dist/client/changelog/Changelog.js +9 -7
  35. package/dist/client/changelog/Changelog.js.map +1 -1
  36. package/dist/client/extensions/ExtensionsSidebarSection.d.ts.map +1 -1
  37. package/dist/client/extensions/ExtensionsSidebarSection.js +339 -11
  38. package/dist/client/extensions/ExtensionsSidebarSection.js.map +1 -1
  39. package/dist/collab/routes.d.ts +1 -1
  40. package/dist/file-upload/actions/upload-image.d.ts +2 -2
  41. package/dist/notifications/routes.d.ts +1 -1
  42. package/dist/observability/routes.d.ts +2 -2
  43. package/dist/resources/handlers.d.ts +2 -2
  44. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  45. package/dist/server/transcribe-voice.d.ts +1 -1
  46. package/package.json +1 -1
package/corpus/README.md CHANGED
@@ -28,4 +28,4 @@ rg -n "defineAction|useActionQuery" node_modules/@agent-native/core/corpus
28
28
  ## Generated Counts
29
29
 
30
30
  - core files: 1932
31
- - template files: 4278
31
+ - template files: 4279
@@ -1,5 +1,24 @@
1
1
  # @agent-native/core
2
2
 
3
+ ## 0.77.6
4
+
5
+ ### Patch Changes
6
+
7
+ - 1fab043: Localize shared extension sidebar chrome and changelog labels/dates.
8
+
9
+ ## 0.77.5
10
+
11
+ ### Patch Changes
12
+
13
+ - 355be37: Add diagnostic-only worker-side progressive setup-stage diagnostics
14
+ (`worker_setup_step`) to localize where a durable background worker hangs between
15
+ `auth_passed` and `claimBackgroundRun`. For the background worker only (gated on
16
+ `isBackgroundWorker`, using the marker's early-available runId), emit the last
17
+ setup stage reached — `db_request_ctx`, `env_config`, `context_all`,
18
+ `action_tool_setup`, `owner_thread`, `prestart` — as the run's `diag_stage`, so a
19
+ worker that stalls leaves a breadcrumb at the stage it stopped in. Best-effort and
20
+ fire-and-forget; no control-flow change.
21
+
3
22
  ## 0.77.4
4
23
 
5
24
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.77.4",
3
+ "version": "0.77.6",
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": {
@@ -3934,6 +3934,22 @@ export function createProductionAgentHandler(
3934
3934
  ? body[AGENT_CHAT_BACKGROUND_RUN_FIELD]!
3935
3935
  : null;
3936
3936
  const isBackgroundWorker = backgroundRunMarker !== null;
3937
+ // DIAGNOSTIC-ONLY: progressive per-stage hang localizer for the bg worker.
3938
+ // The worker's runId is available EARLY on the marker (the general `runId`
3939
+ // var resolves much later), so capture it now and emit the LAST setup stage
3940
+ // reached as the run's `diag_stage`. Best-effort, gated on the worker, never
3941
+ // blocks or alters control flow.
3942
+ const bgRunId = isBackgroundWorker
3943
+ ? (backgroundRunMarker?.runId as string)
3944
+ : null;
3945
+ const workerStep = (s: string) => {
3946
+ if (bgRunId)
3947
+ void recordRunDiagnostic(
3948
+ bgRunId,
3949
+ RUN_DIAG_STAGE.workerSetupStep,
3950
+ `${s}=${Date.now() - setupT0}ms`,
3951
+ ).catch(() => {});
3952
+ };
3937
3953
  // Whether this worker is REALLY executing inside a 15-min Netlify
3938
3954
  // `-background` function (proven by the runtime function name), not merely a
3939
3955
  // `_process-run` re-entry that may have landed on the ~60s synchronous
@@ -4002,6 +4018,10 @@ export function createProductionAgentHandler(
4002
4018
  requestAttachments = preparedRequest.attachments;
4003
4019
  }
4004
4020
  }
4021
+ // DIAGNOSTIC-ONLY: owner/request context prep (resolveAgentOwnerEmail +
4022
+ // prepareRequest) finished. A worker stuck before this points at the
4023
+ // owner/request-context awaits.
4024
+ workerStep("db_request_ctx");
4005
4025
 
4006
4026
  // Pre-upload chat attachments (images AND files/PDFs) through the framework
4007
4027
  // file-upload provider (Builder.io by default). The model still sees the
@@ -4164,6 +4184,10 @@ export function createProductionAgentHandler(
4164
4184
  }
4165
4185
 
4166
4186
  setupMark("prepDone");
4187
+ // DIAGNOSTIC-ONLY: engine/model/api-key resolution finished. A worker that
4188
+ // reached db_request_ctx but not env_config hung in attachment upload or
4189
+ // engine/model resolution.
4190
+ workerStep("env_config");
4167
4191
  // Run all independent pre-send steps in parallel. Each of these hits
4168
4192
  // the DB or invokes an action; running them sequentially was the
4169
4193
  // single biggest contributor to pre-LLM latency.
@@ -4418,6 +4442,9 @@ export function createProductionAgentHandler(
4418
4442
  enrichedMessagePromise,
4419
4443
  ]);
4420
4444
  setupMark("ctxAll");
4445
+ // DIAGNOSTIC-ONLY: all parallel context gathering (system prompt, screen,
4446
+ // files, loop settings, enriched message) resolved.
4447
+ workerStep("context_all");
4421
4448
 
4422
4449
  if (systemPromptError) {
4423
4450
  setResponseHeader(event, "Content-Type", "text/event-stream");
@@ -4446,6 +4473,8 @@ export function createProductionAgentHandler(
4446
4473
  options.initialToolNames,
4447
4474
  );
4448
4475
  setupMark("actions");
4476
+ // DIAGNOSTIC-ONLY: action/tool resolution + engine-tool filtering finished.
4477
+ workerStep("action_tool_setup");
4449
4478
  const requestSystemPrompt =
4450
4479
  requestMode === "plan"
4451
4480
  ? `${systemPrompt}\n\n${PLAN_MODE_SYSTEM_PROMPT}`
@@ -4557,6 +4586,9 @@ export function createProductionAgentHandler(
4557
4586
  }
4558
4587
  }
4559
4588
  setupMark("depsThread");
4589
+ // DIAGNOSTIC-ONLY: owner/thread resolution + runId/effectiveThreadId +
4590
+ // chained-continuation thread fetch finished.
4591
+ workerStep("owner_thread");
4560
4592
 
4561
4593
  // Persist the user's turn exactly once. The foreground POST does this
4562
4594
  // before dispatching; the background worker must NOT repeat it (it re-enters
@@ -4971,6 +5003,9 @@ export function createProductionAgentHandler(
4971
5003
  // startRun's callback below — the run row does not exist until startRun
4972
5004
  // inserts it, so a pre-startRun write would no-op on the inline path.
4973
5005
  setupMark("preStart");
5006
+ // DIAGNOSTIC-ONLY: last stage before startRun fires. A worker that reaches
5007
+ // prestart but never workerStarted is hanging inside startRun itself.
5008
+ workerStep("prestart");
4974
5009
  const setupDetail =
4975
5010
  Object.entries(setupMarks)
4976
5011
  .map(([k, v]) => `${k}=${v}`)
@@ -540,6 +540,8 @@ export const RUN_DIAG_STAGE = {
540
540
  workerClaimLost: "worker_claim_lost",
541
541
  /** The agent loop started (startRun fired). */
542
542
  workerStarted: "worker_started",
543
+ /** Last worker setup stage reached before startRun (progressive hang localizer). */
544
+ workerSetupStep: "worker_setup_step",
543
545
  /** Pre-claim setup timing breakdown (diagnostic). */
544
546
  setupTimings: "setup_timings",
545
547
  /** The worker threw before/while running the loop (message carried in detail). */
@@ -24,16 +24,17 @@ import {
24
24
  useMarkdownReady,
25
25
  markdownUrlTransform,
26
26
  } from "../chat/markdown-renderer.js";
27
+ import { DEFAULT_LOCALE, useOptionalLocale, type LocaleCode } from "../i18n.js";
27
28
  import { cn } from "../utils.js";
28
29
 
29
30
  // ─── Date formatting ──────────────────────────────────────────────────────────
30
31
 
31
- function formatEntryHeading(entry: ChangelogEntry): string {
32
+ function formatEntryHeading(entry: ChangelogEntry, locale: LocaleCode): string {
32
33
  if (entry.date) {
33
34
  // Parse as a plain calendar date (avoid TZ shifting YYYY-MM-DD back a day).
34
35
  const [y, m, d] = entry.date.split("-").map(Number);
35
36
  if (y && m && d) {
36
- const formatted = new Date(y, m - 1, d).toLocaleDateString(undefined, {
37
+ const formatted = new Date(y, m - 1, d).toLocaleDateString(locale, {
37
38
  year: "numeric",
38
39
  month: "long",
39
40
  day: "numeric",
@@ -170,6 +171,8 @@ function ChangelogEntries({
170
171
  entries: ChangelogEntry[];
171
172
  emptyText: string;
172
173
  }) {
174
+ const locale = useOptionalLocale()?.locale ?? DEFAULT_LOCALE;
175
+
173
176
  if (entries.length === 0) {
174
177
  return <p className="text-sm text-muted-foreground">{emptyText}</p>;
175
178
  }
@@ -178,7 +181,7 @@ function ChangelogEntries({
178
181
  {entries.map((entry) => (
179
182
  <section key={entry.id}>
180
183
  <h4 className="mb-2 text-sm font-semibold text-foreground">
181
- {formatEntryHeading(entry)}
184
+ {formatEntryHeading(entry, locale)}
182
185
  </h4>
183
186
  <ChangelogBody markdown={entry.body} />
184
187
  </section>
@@ -196,6 +199,8 @@ export interface ChangelogDialogProps {
196
199
  markdown: string;
197
200
  /** Dialog heading. Default: "What's new". */
198
201
  title?: string;
202
+ closeLabel?: string;
203
+ emptyText?: string;
199
204
  }
200
205
 
201
206
  export function ChangelogDialog({
@@ -203,6 +208,8 @@ export function ChangelogDialog({
203
208
  onOpenChange,
204
209
  markdown,
205
210
  title = "What's new",
211
+ closeLabel = "Close",
212
+ emptyText = "No updates have been published yet.",
206
213
  }: ChangelogDialogProps) {
207
214
  const entries = useMemo(() => parseChangelog(markdown), [markdown]);
208
215
 
@@ -241,17 +248,14 @@ export function ChangelogDialog({
241
248
  <button
242
249
  type="button"
243
250
  onClick={() => onOpenChange(false)}
244
- aria-label="Close"
251
+ aria-label={closeLabel}
245
252
  className="rounded-sm p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"
246
253
  >
247
254
  <IconX className="h-4 w-4" />
248
255
  </button>
249
256
  </div>
250
257
  <div className="overflow-y-auto px-5 py-4">
251
- <ChangelogEntries
252
- entries={entries}
253
- emptyText="No updates have been published yet."
254
- />
258
+ <ChangelogEntries entries={entries} emptyText={emptyText} />
255
259
  </div>
256
260
  </div>
257
261
  </div>
@@ -267,6 +271,9 @@ export interface ChangelogSettingsCardProps {
267
271
  limit?: number;
268
272
  /** Card heading. Default: "What's new". */
269
273
  title?: string;
274
+ closeLabel?: string;
275
+ emptyText?: string;
276
+ viewAllLabel?: string;
270
277
  className?: string;
271
278
  }
272
279
 
@@ -274,6 +281,9 @@ export function ChangelogSettingsCard({
274
281
  markdown,
275
282
  limit = 2,
276
283
  title = "What's new",
284
+ closeLabel = "Close",
285
+ emptyText = "No updates yet.",
286
+ viewAllLabel = "View all updates",
277
287
  className,
278
288
  }: ChangelogSettingsCardProps) {
279
289
  const entries = useMemo(() => parseChangelog(markdown), [markdown]);
@@ -296,14 +306,14 @@ export function ChangelogSettingsCard({
296
306
  <h3 className="text-sm font-semibold">{title}</h3>
297
307
  </div>
298
308
  <div className="px-5 py-4">
299
- <ChangelogEntries entries={shown} emptyText="No updates yet." />
309
+ <ChangelogEntries entries={shown} emptyText={emptyText} />
300
310
  {hasMore && (
301
311
  <button
302
312
  type="button"
303
313
  onClick={() => setDialogOpen(true)}
304
314
  className="mt-4 text-sm font-medium text-foreground underline underline-offset-2"
305
315
  >
306
- View all updates
316
+ {viewAllLabel}
307
317
  </button>
308
318
  )}
309
319
  </div>
@@ -312,6 +322,8 @@ export function ChangelogSettingsCard({
312
322
  onOpenChange={setDialogOpen}
313
323
  markdown={markdown}
314
324
  title={title}
325
+ closeLabel={closeLabel}
326
+ emptyText={emptyText}
315
327
  />
316
328
  </div>
317
329
  );