@agent-native/core 0.84.36 → 0.84.37
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.
- package/corpus/core/CHANGELOG.md +6 -0
- package/corpus/core/docs/content/getting-started.mdx +3 -3
- package/corpus/core/docs/content/locales/ar-SA/getting-started.mdx +2 -2
- package/corpus/core/docs/content/locales/de-DE/getting-started.mdx +2 -2
- package/corpus/core/docs/content/locales/es-ES/getting-started.mdx +2 -2
- package/corpus/core/docs/content/locales/fr-FR/getting-started.mdx +2 -2
- package/corpus/core/docs/content/locales/hi-IN/getting-started.mdx +2 -2
- package/corpus/core/docs/content/locales/ja-JP/getting-started.mdx +2 -2
- package/corpus/core/docs/content/locales/ko-KR/getting-started.mdx +2 -2
- package/corpus/core/docs/content/locales/pt-BR/getting-started.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-CN/getting-started.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-TW/getting-started.mdx +2 -2
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/client/AssistantChat.tsx +27 -13
- package/corpus/core/src/client/RunStuckBanner.tsx +23 -3
- package/corpus/core/src/client/use-run-stuck-detection.ts +14 -1
- package/corpus/core/src/server/agent-chat-plugin.ts +5 -2
- package/dist/client/AssistantChat.d.ts +6 -0
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +19 -13
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/RunStuckBanner.d.ts.map +1 -1
- package/dist/client/RunStuckBanner.js +16 -1
- package/dist/client/RunStuckBanner.js.map +1 -1
- package/dist/client/use-run-stuck-detection.d.ts +4 -0
- package/dist/client/use-run-stuck-detection.d.ts.map +1 -1
- package/dist/client/use-run-stuck-detection.js +7 -1
- package/dist/client/use-run-stuck-detection.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/progress/routes.d.ts +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +3 -2
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/docs/content/getting-started.mdx +3 -3
- package/docs/content/locales/ar-SA/getting-started.mdx +2 -2
- package/docs/content/locales/de-DE/getting-started.mdx +2 -2
- package/docs/content/locales/es-ES/getting-started.mdx +2 -2
- package/docs/content/locales/fr-FR/getting-started.mdx +2 -2
- package/docs/content/locales/hi-IN/getting-started.mdx +2 -2
- package/docs/content/locales/ja-JP/getting-started.mdx +2 -2
- package/docs/content/locales/ko-KR/getting-started.mdx +2 -2
- package/docs/content/locales/pt-BR/getting-started.mdx +2 -2
- package/docs/content/locales/zh-CN/getting-started.mdx +2 -2
- package/docs/content/locales/zh-TW/getting-started.mdx +2 -2
- package/package.json +1 -1
|
@@ -59,7 +59,7 @@ An action is one typed operation your agent and UI can both call. Replace the
|
|
|
59
59
|
starter `hello` action with the first real operation in your domain. This example
|
|
60
60
|
analyzes form responses and returns a validated shape for a custom chat chart:
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
<!-- prettier-ignore -->
|
|
63
63
|
```ts
|
|
64
64
|
// actions/analyze-responses.ts
|
|
65
65
|
import { defineAction } from "@agent-native/core/action";
|
|
@@ -108,7 +108,7 @@ The action above declares `outputSchema` and a product-specific
|
|
|
108
108
|
into prose. Register a React component for that exact renderer id, for example
|
|
109
109
|
by importing `app/chat-renderers.tsx` once from `app/root.tsx`:
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
<!-- prettier-ignore -->
|
|
112
112
|
```tsx
|
|
113
113
|
import { registerActionChatRenderer, type ToolRendererProps,} from "@agent-native/core/client/chat";
|
|
114
114
|
|
|
@@ -209,7 +209,7 @@ separate REST route just for the browser if an action is the operation.
|
|
|
209
209
|
|
|
210
210
|
Now add a durable page for the data behind the chat result:
|
|
211
211
|
|
|
212
|
-
|
|
212
|
+
<!-- prettier-ignore -->
|
|
213
213
|
```tsx
|
|
214
214
|
// app/routes/response-insights.tsx
|
|
215
215
|
import { useActionMutation, useActionQuery } from "@agent-native/core/client";
|
|
@@ -32,7 +32,7 @@ pnpm dev
|
|
|
32
32
|
|
|
33
33
|
Action هي عملية typed operation مشتركة بين agent و UI. في هذا المسار أنشئ `actions/analyze-responses.ts`: تحلل ردود النماذج وتعيد شكلاً موثقًا لرسم مخصص داخل الدردشة.
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
<!-- prettier-ignore -->
|
|
36
36
|
```ts
|
|
37
37
|
// actions/analyze-responses.ts
|
|
38
38
|
import { defineAction } from "@agent-native/core/action";
|
|
@@ -75,7 +75,7 @@ pnpm action analyze-responses --formId demo
|
|
|
75
75
|
|
|
76
76
|
لأن action تعلن `outputSchema` و `chatUI.renderer` خاصًا بالمنتج، لا يحول transcript البيانات المنظمة إلى نص عادي. سجّل مكون React لذلك المعرّف نفسه عند بدء التطبيق، مثل استيراد `app/chat-renderers.tsx` مرة واحدة من `app/root.tsx`:
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
<!-- prettier-ignore -->
|
|
79
79
|
```tsx
|
|
80
80
|
import { registerActionChatRenderer, type ToolRendererProps,} from "@agent-native/core/client/chat";
|
|
81
81
|
|
|
@@ -32,7 +32,7 @@ Das Template enthält durable chat threads, auth, live sync, ein `actions/`-Verz
|
|
|
32
32
|
|
|
33
33
|
Eine action ist eine typisierte Operation, die Agent und UI gemeinsam aufrufen. Für diesen Ablauf erstellen Sie `actions/analyze-responses.ts`: Sie analysiert Formularantworten und gibt eine validierte Form für ein eigenes Chat-Diagramm zurück.
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
<!-- prettier-ignore -->
|
|
36
36
|
```ts
|
|
37
37
|
// actions/analyze-responses.ts
|
|
38
38
|
import { defineAction } from "@agent-native/core/action";
|
|
@@ -75,7 +75,7 @@ Oder im Browser den Agent fragen:
|
|
|
75
75
|
|
|
76
76
|
Weil die action `outputSchema` und eine produktspezifische `chatUI.renderer` deklariert, muss der Transcript strukturierte Daten nicht in Fließtext verwandeln. Registrieren Sie beim App-Start eine React-Komponente für genau diese Renderer-ID, zum Beispiel indem `app/chat-renderers.tsx` einmal aus `app/root.tsx` importiert wird:
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
<!-- prettier-ignore -->
|
|
79
79
|
```tsx
|
|
80
80
|
import { registerActionChatRenderer, type ToolRendererProps,} from "@agent-native/core/client/chat";
|
|
81
81
|
|
|
@@ -32,7 +32,7 @@ El template incluye durable chat threads, auth, live sync, un directorio `action
|
|
|
32
32
|
|
|
33
33
|
Una action es una operación tipada que comparten el agent y la UI. Para este flujo, crea `actions/analyze-responses.ts`: analiza respuestas de formularios y devuelve una forma validada para un gráfico de chat propio.
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
<!-- prettier-ignore -->
|
|
36
36
|
```ts
|
|
37
37
|
// actions/analyze-responses.ts
|
|
38
38
|
import { defineAction } from "@agent-native/core/action";
|
|
@@ -75,7 +75,7 @@ O pídeselo al agent en el navegador:
|
|
|
75
75
|
|
|
76
76
|
Como la action declara `outputSchema` y una `chatUI.renderer` específica del producto, el transcript no convierte los datos en texto plano. Registra un componente React para ese id exacto desde el arranque de la app, por ejemplo importando `app/chat-renderers.tsx` una vez desde `app/root.tsx`:
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
<!-- prettier-ignore -->
|
|
79
79
|
```tsx
|
|
80
80
|
import { registerActionChatRenderer, type ToolRendererProps,} from "@agent-native/core/client/chat";
|
|
81
81
|
|
|
@@ -32,7 +32,7 @@ Le template inclut durable chat threads, auth, live sync, un dossier `actions/`,
|
|
|
32
32
|
|
|
33
33
|
Une action est une opération typée appelée par l'agent et par l'UI. Pour ce guide, créez `actions/analyze-responses.ts` : elle analyse des réponses de formulaire et renvoie une forme validée pour un graphique de chat personnalisé.
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
<!-- prettier-ignore -->
|
|
36
36
|
```ts
|
|
37
37
|
// actions/analyze-responses.ts
|
|
38
38
|
import { defineAction } from "@agent-native/core/action";
|
|
@@ -75,7 +75,7 @@ Ou demandez à l'agent dans le navigateur :
|
|
|
75
75
|
|
|
76
76
|
Comme l'action déclare `outputSchema` et un `chatUI.renderer` propre au produit, le transcript ne transforme pas les données structurées en simple texte. Enregistrez un composant React pour cet id exact au démarrage de l'app, par exemple en important `app/chat-renderers.tsx` une fois depuis `app/root.tsx` :
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
<!-- prettier-ignore -->
|
|
79
79
|
```tsx
|
|
80
80
|
import { registerActionChatRenderer, type ToolRendererProps,} from "@agent-native/core/client/chat";
|
|
81
81
|
|
|
@@ -32,7 +32,7 @@ pnpm dev
|
|
|
32
32
|
|
|
33
33
|
Action वह typed operation है जिसे agent और UI दोनों call करते हैं. इस flow के लिए `actions/analyze-responses.ts` बनाएं: यह form responses analyze करता है और custom chat chart के लिए validated shape लौटाता है.
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
<!-- prettier-ignore -->
|
|
36
36
|
```ts
|
|
37
37
|
// actions/analyze-responses.ts
|
|
38
38
|
import { defineAction } from "@agent-native/core/action";
|
|
@@ -75,7 +75,7 @@ pnpm action analyze-responses --formId demo
|
|
|
75
75
|
|
|
76
76
|
क्योंकि action `outputSchema` और product-specific `chatUI.renderer` declare करता है, transcript structured data को plain text में नहीं बदलता. फिर app startup से उसी exact renderer id के लिए React component register करें, जैसे `app/root.tsx` से `app/chat-renderers.tsx` को एक बार import करके:
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
<!-- prettier-ignore -->
|
|
79
79
|
```tsx
|
|
80
80
|
import { registerActionChatRenderer, type ToolRendererProps,} from "@agent-native/core/client/chat";
|
|
81
81
|
|
|
@@ -32,7 +32,7 @@ pnpm dev
|
|
|
32
32
|
|
|
33
33
|
action は agent と UI が共有する typed operation です。この流れでは `actions/analyze-responses.ts` を作成し、フォーム回答を分析してカスタムチャットグラフ用の検証済み形状を返します。
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
<!-- prettier-ignore -->
|
|
36
36
|
```ts
|
|
37
37
|
// actions/analyze-responses.ts
|
|
38
38
|
import { defineAction } from "@agent-native/core/action";
|
|
@@ -75,7 +75,7 @@ pnpm action analyze-responses --formId demo
|
|
|
75
75
|
|
|
76
76
|
action が `outputSchema` とプロダクト固有の `chatUI.renderer` を宣言しているため、チャットは構造化データを長い文章に潰しません。次に、app の起動時にその正確な renderer id に対応する React コンポーネントを登録します。たとえば `app/root.tsx` から `app/chat-renderers.tsx` を一度 import します。
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
<!-- prettier-ignore -->
|
|
79
79
|
```tsx
|
|
80
80
|
import { registerActionChatRenderer, type ToolRendererProps,} from "@agent-native/core/client/chat";
|
|
81
81
|
|
|
@@ -32,7 +32,7 @@ pnpm dev
|
|
|
32
32
|
|
|
33
33
|
action은 agent와 UI가 함께 호출하는 typed operation입니다. 이 흐름에서는 `actions/analyze-responses.ts`를 만들고, 폼 응답을 분석해 custom chat chart를 위한 검증된 형태를 반환합니다.
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
<!-- prettier-ignore -->
|
|
36
36
|
```ts
|
|
37
37
|
// actions/analyze-responses.ts
|
|
38
38
|
import { defineAction } from "@agent-native/core/action";
|
|
@@ -75,7 +75,7 @@ pnpm action analyze-responses --formId demo
|
|
|
75
75
|
|
|
76
76
|
action이 `outputSchema`와 제품별 `chatUI.renderer`를 선언하므로 transcript가 구조화된 데이터를 긴 텍스트로 바꾸지 않습니다. 그런 다음 app startup에서 정확히 같은 renderer id에 대한 React component를 등록합니다. 예를 들어 `app/root.tsx`에서 `app/chat-renderers.tsx`를 한 번 import합니다.
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
<!-- prettier-ignore -->
|
|
79
79
|
```tsx
|
|
80
80
|
import { registerActionChatRenderer, type ToolRendererProps,} from "@agent-native/core/client/chat";
|
|
81
81
|
|
|
@@ -32,7 +32,7 @@ O template inclui durable chat threads, auth, live sync, diretório `actions/`,
|
|
|
32
32
|
|
|
33
33
|
Uma action é uma operação tipada que o agent e a UI chamam juntos. Para este fluxo, crie `actions/analyze-responses.ts`: ela analisa respostas de formulários e retorna um formato validado para um gráfico de chat customizado.
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
<!-- prettier-ignore -->
|
|
36
36
|
```ts
|
|
37
37
|
// actions/analyze-responses.ts
|
|
38
38
|
import { defineAction } from "@agent-native/core/action";
|
|
@@ -75,7 +75,7 @@ Ou peça ao agent no navegador:
|
|
|
75
75
|
|
|
76
76
|
Como a action declara `outputSchema` e uma `chatUI.renderer` específica do produto, o transcript não transforma dados estruturados em texto corrido. Registre um componente React para esse id exato no startup da app, por exemplo importando `app/chat-renderers.tsx` uma vez a partir de `app/root.tsx`:
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
<!-- prettier-ignore -->
|
|
79
79
|
```tsx
|
|
80
80
|
import { registerActionChatRenderer, type ToolRendererProps,} from "@agent-native/core/client/chat";
|
|
81
81
|
|
|
@@ -42,7 +42,7 @@ npx @agent-native/core@latest create my-app
|
|
|
42
42
|
Action 是 agent 和 UI 共同调用的一次 typed operation。可以把入门示例换成
|
|
43
43
|
`actions/analyze-responses.ts`:它分析表单反馈,并返回自定义聊天图表的已验证数据形状。
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
<!-- prettier-ignore -->
|
|
46
46
|
```ts
|
|
47
47
|
// actions/analyze-responses.ts
|
|
48
48
|
import { defineAction } from "@agent-native/core/action";
|
|
@@ -85,7 +85,7 @@ pnpm action analyze-responses --formId demo
|
|
|
85
85
|
|
|
86
86
|
因为 action 声明了 `outputSchema` 和产品专属的 `chatUI.renderer`,聊天记录不需要把结构化数据压成一段文字。然后在 app 启动时为这个完全相同的 renderer id 注册 React 组件,例如从 `app/root.tsx` 导入一次 `app/chat-renderers.tsx`:
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
<!-- prettier-ignore -->
|
|
89
89
|
```tsx
|
|
90
90
|
import { registerActionChatRenderer, type ToolRendererProps,} from "@agent-native/core/client/chat";
|
|
91
91
|
|
|
@@ -40,7 +40,7 @@ npx @agent-native/core@latest create my-app
|
|
|
40
40
|
|
|
41
41
|
Action 是 agent 與 UI 共同呼叫的一個 typed operation。可將入門範例換成 `actions/analyze-responses.ts`:它分析表單回覆並返回自訂聊天圖表的已驗證資料形狀。
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
<!-- prettier-ignore -->
|
|
44
44
|
```ts
|
|
45
45
|
// actions/analyze-responses.ts
|
|
46
46
|
import { defineAction } from "@agent-native/core/action";
|
|
@@ -83,7 +83,7 @@ pnpm action analyze-responses --formId demo
|
|
|
83
83
|
|
|
84
84
|
因為 action 宣告了 `outputSchema` 與產品專屬的 `chatUI.renderer`,聊天紀錄不必把結構化資料壓成文字。然後在 app 啟動時為這個完全相同的 renderer id 註冊 React 元件,例如從 `app/root.tsx` 匯入一次 `app/chat-renderers.tsx`:
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
<!-- prettier-ignore -->
|
|
87
87
|
```tsx
|
|
88
88
|
import { registerActionChatRenderer, type ToolRendererProps,} from "@agent-native/core/client/chat";
|
|
89
89
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.84.
|
|
3
|
+
"version": "0.84.37",
|
|
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": {
|