@agent-native/core 0.84.0 → 0.84.1
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/README.md +1 -1
- package/corpus/core/CHANGELOG.md +6 -0
- package/corpus/core/docs/content/evals.mdx +34 -12
- package/corpus/core/docs/content/locales/ar-SA/evals.mdx +7 -0
- package/corpus/core/docs/content/locales/de-DE/evals.mdx +8 -0
- package/corpus/core/docs/content/locales/es-ES/evals.mdx +8 -0
- package/corpus/core/docs/content/locales/fr-FR/evals.mdx +8 -0
- package/corpus/core/docs/content/locales/hi-IN/evals.mdx +8 -0
- package/corpus/core/docs/content/locales/ja-JP/evals.mdx +7 -0
- package/corpus/core/docs/content/locales/ko-KR/evals.mdx +7 -0
- package/corpus/core/docs/content/locales/pt-BR/evals.mdx +8 -0
- package/corpus/core/docs/content/locales/zh-CN/evals.mdx +7 -0
- package/corpus/core/docs/content/locales/zh-TW/evals.mdx +7 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/eval/define-eval.ts +4 -1
- package/corpus/core/src/eval/report.ts +23 -8
- package/corpus/core/src/eval/runner.ts +41 -6
- package/corpus/core/src/eval/types.ts +11 -0
- package/corpus/templates/content/AGENTS.md +9 -2
- package/corpus/templates/content/actions/_database-row-batch.ts +230 -0
- package/corpus/templates/content/actions/_database-utils.ts +17 -9
- package/corpus/templates/content/actions/_notion-action-utils.ts +26 -0
- package/corpus/templates/content/actions/connect-notion-status.ts +13 -4
- package/corpus/templates/content/actions/create-and-link-notion-page.ts +23 -0
- package/corpus/templates/content/actions/delete-database-items.ts +55 -0
- package/corpus/templates/content/actions/delete-document.ts +4 -4
- package/corpus/templates/content/actions/disconnect-notion.ts +16 -0
- package/corpus/templates/content/actions/duplicate-database-item.ts +1 -1
- package/corpus/templates/content/actions/duplicate-database-items.ts +191 -0
- package/corpus/templates/content/actions/link-notion-page.ts +10 -7
- package/corpus/templates/content/actions/list-notion-links.ts +3 -4
- package/corpus/templates/content/actions/pull-notion-page.ts +7 -9
- package/corpus/templates/content/actions/push-notion-page.ts +7 -9
- package/corpus/templates/content/actions/refresh-notion-sync-status.ts +24 -0
- package/corpus/templates/content/actions/resolve-notion-sync-conflict.ts +23 -0
- package/corpus/templates/content/actions/search-notion-pages.ts +67 -0
- package/corpus/templates/content/actions/unlink-notion-page.ts +23 -0
- package/corpus/templates/content/app/components/editor/DocumentDatabase.tsx +27 -34
- package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +16 -13
- package/corpus/templates/content/app/components/editor/DocumentToolbar.tsx +10 -10
- package/corpus/templates/content/app/components/editor/NotionConflictBanner.tsx +1 -1
- package/corpus/templates/content/app/components/editor/NotionSyncBar.tsx +18 -9
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +27 -34
- package/corpus/templates/content/app/components/editor/database/navigation-state.ts +10 -4
- package/corpus/templates/content/app/components/sidebar/NotionButton.tsx +32 -17
- package/corpus/templates/content/app/hooks/use-content-database.ts +35 -0
- package/corpus/templates/content/app/hooks/use-notion.ts +108 -99
- package/corpus/templates/content/package.json +3 -0
- package/corpus/templates/content/parity/README.md +69 -0
- package/corpus/templates/content/parity/eval-scenarios.ts +118 -0
- package/corpus/templates/content/parity/exceptions.allowlist.ts +17 -0
- package/corpus/templates/content/parity/matrix.md +28 -0
- package/corpus/templates/content/parity/matrix.ts +606 -0
- package/corpus/templates/content/parity/matrix.types.ts +42 -0
- package/corpus/templates/content/parity/parity-evals.eval.ts +4 -0
- package/corpus/templates/content/parity/render-matrix.ts +90 -0
- package/corpus/templates/content/parity/scenario-to-eval.ts +57 -0
- package/corpus/templates/content/shared/api.ts +11 -0
- 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/eval/define-eval.d.ts.map +1 -1
- package/dist/eval/define-eval.js +2 -1
- package/dist/eval/define-eval.js.map +1 -1
- package/dist/eval/report.d.ts.map +1 -1
- package/dist/eval/report.js +19 -4
- package/dist/eval/report.js.map +1 -1
- package/dist/eval/runner.d.ts.map +1 -1
- package/dist/eval/runner.js +38 -6
- package/dist/eval/runner.js.map +1 -1
- package/dist/eval/types.d.ts +11 -0
- package/dist/eval/types.d.ts.map +1 -1
- package/dist/eval/types.js.map +1 -1
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/progress/routes.d.ts +1 -1
- package/dist/resources/handlers.d.ts +1 -1
- package/docs/content/evals.mdx +34 -12
- package/docs/content/locales/ar-SA/evals.mdx +7 -0
- package/docs/content/locales/de-DE/evals.mdx +8 -0
- package/docs/content/locales/es-ES/evals.mdx +8 -0
- package/docs/content/locales/fr-FR/evals.mdx +8 -0
- package/docs/content/locales/hi-IN/evals.mdx +8 -0
- package/docs/content/locales/ja-JP/evals.mdx +7 -0
- package/docs/content/locales/ko-KR/evals.mdx +7 -0
- package/docs/content/locales/pt-BR/evals.mdx +8 -0
- package/docs/content/locales/zh-CN/evals.mdx +7 -0
- package/docs/content/locales/zh-TW/evals.mdx +7 -0
- package/package.json +1 -1
- package/corpus/templates/content/server/routes/api/notion/disconnect.post.ts +0 -12
|
@@ -49,8 +49,8 @@ export declare function handleUpdateResource(event: any): Promise<import("./stor
|
|
|
49
49
|
}>;
|
|
50
50
|
/** DELETE /_agent-native/resources/:id — delete a resource */
|
|
51
51
|
export declare function handleDeleteResource(event: any): Promise<{
|
|
52
|
-
ok?: undefined;
|
|
53
52
|
error: string;
|
|
53
|
+
ok?: undefined;
|
|
54
54
|
} | {
|
|
55
55
|
error?: undefined;
|
|
56
56
|
ok: boolean;
|
package/docs/content/evals.mdx
CHANGED
|
@@ -90,13 +90,14 @@ export default defineEval({
|
|
|
90
90
|
|
|
91
91
|
An eval passes only when **every** scorer meets the threshold. Key `defineEval` fields:
|
|
92
92
|
|
|
93
|
-
| Field
|
|
94
|
-
|
|
|
95
|
-
| `name`
|
|
96
|
-
| `input`
|
|
97
|
-
| `scorers`
|
|
98
|
-
| `threshold`
|
|
99
|
-
| `run`
|
|
93
|
+
| Field | Type | Notes |
|
|
94
|
+
| ------------ | --------------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
95
|
+
| `name` | string | Required. Shown in the report. |
|
|
96
|
+
| `input` | `{ prompt, history }` | Required `prompt`; optional prior `{ role, text }` turns. |
|
|
97
|
+
| `scorers` | `Scorer[]` | Required, at least one, unless `skipReason` is set. |
|
|
98
|
+
| `threshold` | number `0..1` | Per-scorer pass bar. Default `0.5`; overridable from the CLI. |
|
|
99
|
+
| `run` | function | Optional override for custom setup (seed data, multi-turn). |
|
|
100
|
+
| `skipReason` | string | Optional reason to skip this eval without running the agent; useful for manual/nightly gates that need secrets. |
|
|
100
101
|
|
|
101
102
|
The agent run handed to scorers is small and transport-agnostic:
|
|
102
103
|
|
|
@@ -225,11 +226,32 @@ The command discovers `**/*.eval.ts` and `evals/*.ts` under the current app, run
|
|
|
225
226
|
|
|
226
227
|
Exit codes:
|
|
227
228
|
|
|
228
|
-
| Code | Meaning
|
|
229
|
-
| ---- |
|
|
230
|
-
| `0` | All evals passed
|
|
231
|
-
| `1` | At least one eval scored below threshold, or the suite errored.
|
|
232
|
-
| `2` | Bad arguments (e.g. `--threshold` outside `[0, 1]`).
|
|
229
|
+
| Code | Meaning |
|
|
230
|
+
| ---- | -------------------------------------------------------------------------------- |
|
|
231
|
+
| `0` | All evals passed, evals were skipped, or no eval files were found (CI-friendly). |
|
|
232
|
+
| `1` | At least one eval scored below threshold, or the suite errored. |
|
|
233
|
+
| `2` | Bad arguments (e.g. `--threshold` outside `[0, 1]`). |
|
|
234
|
+
|
|
235
|
+
### Skipping gated evals {#skipping}
|
|
236
|
+
|
|
237
|
+
Use `skipReason` when an eval suite is intentionally gated behind manual,
|
|
238
|
+
nightly, or secret-backed execution:
|
|
239
|
+
|
|
240
|
+
```ts
|
|
241
|
+
export default defineEval({
|
|
242
|
+
name: "provider-backed source sync",
|
|
243
|
+
input: { prompt: "Refresh the source and summarize the changes." },
|
|
244
|
+
skipReason: process.env.SOURCE_SYNC_EVALS
|
|
245
|
+
? undefined
|
|
246
|
+
: "Skipped because SOURCE_SYNC_EVALS is unset",
|
|
247
|
+
scorers: process.env.SOURCE_SYNC_EVALS ? [contains("updated")] : [],
|
|
248
|
+
});
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
Skipped evals do not run the agent or scorers, do not fail the suite, and are
|
|
252
|
+
reported distinctly with `status: "skipped"` and `skipReason` in JSON output.
|
|
253
|
+
Use this for expensive or credential-dependent evals; keep cheap deterministic
|
|
254
|
+
coverage in normal PR CI.
|
|
233
255
|
|
|
234
256
|
### As a CI deploy gate {#ci}
|
|
235
257
|
|
|
@@ -231,6 +231,13 @@ agent-native eval --threshold 0.8 # override every eval's pass threshold (0..
|
|
|
231
231
|
| `1` | تم تسجيل تقييم واحد على الأقل أقل من الحد الأدنى، أو حدث خطأ في المجموعة. |
|
|
232
232
|
| `2` | وسيطات غير صالحة (على سبيل المثال، `--threshold` خارج `[0, 1]`). |
|
|
233
233
|
|
|
234
|
+
### تخطي التقييمات المحكومة {#skipping}
|
|
235
|
+
|
|
236
|
+
استخدم `skipReason` عندما تكون مجموعة التقييمات مخصصة عمدا للتشغيل اليدوي أو
|
|
237
|
+
الليلي أو المعتمد على الأسرار. لا تشغل التقييمات المتخطاة الوكيل أو أدوات
|
|
238
|
+
التسجيل، ولا تفشل المجموعة، وتظهر في JSON مع `status: "skipped"` و
|
|
239
|
+
`skipReason`. أبق التغطية الحتمية الرخيصة في CI العادي لطلبات السحب.
|
|
240
|
+
|
|
234
241
|
### كبوابة نشر CI {#ci}
|
|
235
242
|
|
|
236
243
|
قم بإضافته إلى المسار الذي يتم تشغيله قبل النشر:
|
|
@@ -231,6 +231,14 @@ Exit-Codes:
|
|
|
231
231
|
| `1` | Mindestens eine Bewertung lag unter dem Schwellenwert oder die Suite ist fehlerhaft. |
|
|
232
232
|
| `2` | Ungültige Argumente (z. B. `--threshold` außerhalb von `[0, 1]`). |
|
|
233
233
|
|
|
234
|
+
### Gated Evals überspringen {#skipping}
|
|
235
|
+
|
|
236
|
+
Verwenden Sie `skipReason`, wenn eine Eval-Suite absichtlich nur manuell,
|
|
237
|
+
nachts oder mit Secrets ausgeführt werden soll. Übersprungene Evals führen
|
|
238
|
+
weder Agent noch Scorer aus, lassen die Suite nicht fehlschlagen und erscheinen
|
|
239
|
+
in der JSON-Ausgabe mit `status: "skipped"` und `skipReason`. Günstige
|
|
240
|
+
deterministische Abdeckung bleibt im normalen PR-CI.
|
|
241
|
+
|
|
234
242
|
### Als CI-Deploy-Gate {#ci}
|
|
235
243
|
|
|
236
244
|
Fügen Sie es der Pipeline hinzu, die vor einer Bereitstellung ausgeführt wird:
|
|
@@ -231,6 +231,14 @@ Códigos de salida:
|
|
|
231
231
|
| `1` | Al menos una evaluación obtuvo una puntuación inferior al umbral o la suite tuvo un error. |
|
|
232
232
|
| `2` | Malos argumentos (por ejemplo, `--threshold` fuera de `[0, 1]`). |
|
|
233
233
|
|
|
234
|
+
### Omitir evaluaciones gated {#skipping}
|
|
235
|
+
|
|
236
|
+
Use `skipReason` cuando una suite de evaluaciones esté reservada
|
|
237
|
+
intencionalmente para ejecución manual, nocturna o con secretos. Las
|
|
238
|
+
evaluaciones omitidas no ejecutan el agente ni los scorers, no hacen fallar la
|
|
239
|
+
suite y aparecen en JSON con `status: "skipped"` y `skipReason`. Mantenga la
|
|
240
|
+
cobertura determinista barata en el CI normal de PR.
|
|
241
|
+
|
|
234
242
|
### Como puerta de implementación de CI {#ci}
|
|
235
243
|
|
|
236
244
|
Agréguelo al proceso que se ejecuta antes de una implementación:
|
|
@@ -231,6 +231,14 @@ Codes de sortie :
|
|
|
231
231
|
| `1` | Au moins une évaluation a obtenu un score inférieur au seuil, ou la suite a commis une erreur. |
|
|
232
232
|
| `2` | Mauvais arguments (par exemple `--threshold` en dehors de `[0, 1]`). |
|
|
233
233
|
|
|
234
|
+
### Ignorer les évaluations gated {#skipping}
|
|
235
|
+
|
|
236
|
+
Utilisez `skipReason` lorsqu'une suite d'évaluations est volontairement réservée
|
|
237
|
+
à une exécution manuelle, nocturne ou dépendante de secrets. Les évaluations
|
|
238
|
+
ignorées n'exécutent ni l'agent ni les scorers, ne font pas échouer la suite, et
|
|
239
|
+
apparaissent dans la sortie JSON avec `status: "skipped"` et `skipReason`.
|
|
240
|
+
Gardez la couverture déterministe peu coûteuse dans le CI normal des PR.
|
|
241
|
+
|
|
234
242
|
### En tant que porte de déploiement CI {#ci}
|
|
235
243
|
|
|
236
244
|
Ajoutez-le au pipeline qui s'exécute avant un déploiement :
|
|
@@ -229,6 +229,14 @@ agent-native eval --threshold 0.8 # override every eval's pass threshold (0..
|
|
|
229
229
|
| `1` | कम से कम एक ईवल ने सीमा से नीचे स्कोर किया, या सुइट में त्रुटि हुई। |
|
|
230
230
|
| `2` | खराब तर्क (उदाहरण के लिए `[0, 1]` के बाहर `--threshold`)। |
|
|
231
231
|
|
|
232
|
+
### gated evals छोड़ना {#skipping}
|
|
233
|
+
|
|
234
|
+
जब कोई eval suite केवल manual, nightly, या secret-backed execution के लिए हो,
|
|
235
|
+
तो `skipReason` का उपयोग करें। छोड़े गए evals agent या scorers नहीं चलाते,
|
|
236
|
+
suite को fail नहीं करते, और JSON output में `status: "skipped"` और
|
|
237
|
+
`skipReason` के साथ दिखते हैं। सस्ती deterministic coverage को सामान्य PR CI
|
|
238
|
+
में रखें।
|
|
239
|
+
|
|
232
240
|
### सीआई परिनियोजन गेट के रूप में {#ci}
|
|
233
241
|
|
|
234
242
|
इसे उस पाइपलाइन में जोड़ें जो परिनियोजन से पहले चलती है:
|
|
@@ -231,6 +231,13 @@ agent-native eval --threshold 0.8 # override every eval's pass threshold (0..
|
|
|
231
231
|
| `1` | 少なくとも 1 つの評価スコアがしきい値を下回ったか、スイートでエラーが発生しました。 |
|
|
232
232
|
| `2` | 不正な引数 (例: `[0, 1]` の外の `--threshold`)。 |
|
|
233
233
|
|
|
234
|
+
### gated eval をスキップする {#skipping}
|
|
235
|
+
|
|
236
|
+
手動、夜間、または secret が必要な eval スイートには `skipReason` を使い
|
|
237
|
+
ます。スキップされた eval はエージェントや scorer を実行せず、スイート
|
|
238
|
+
を失敗させず、JSON 出力では `status: "skipped"` と `skipReason` とし
|
|
239
|
+
て表示されます。安価で決定的なカバレッジは通常の PR CI に残します。
|
|
240
|
+
|
|
234
241
|
### CI デプロイゲートとして {#ci}
|
|
235
242
|
|
|
236
243
|
デプロイ前に実行されるパイプラインに追加します。
|
|
@@ -231,6 +231,13 @@ agent-native eval --threshold 0.8 # override every eval's pass threshold (0..
|
|
|
231
231
|
| `1` | 최소 하나의 평가가 임계값 미만의 점수를 얻었거나 제품군에 오류가 발생했습니다. |
|
|
232
232
|
| `2` | 잘못된 인수(예: `[0, 1]` 외부의 `--threshold`). |
|
|
233
233
|
|
|
234
|
+
### 게이트된 평가 건너뛰기 {#skipping}
|
|
235
|
+
|
|
236
|
+
수동, 야간 또는 시크릿이 필요한 평가 스위트에는 `skipReason`를 사용하세요.
|
|
237
|
+
건너뛴 평가는 에이전트나 scorer를 실행하지 않고, 스위트를 실패시키지
|
|
238
|
+
않으며, JSON 출력에 `status: "skipped"` 및 `skipReason`로 표시됩니다.
|
|
239
|
+
저렴한 결정적 커버리지는 일반 PR CI에 유지하세요.
|
|
240
|
+
|
|
234
241
|
### CI 배포 게이트로 {#ci}
|
|
235
242
|
|
|
236
243
|
배포 전에 실행되는 파이프라인에 추가하세요:
|
|
@@ -231,6 +231,14 @@ Códigos de saída:
|
|
|
231
231
|
| `1` | Pelo menos uma avaliação com pontuação abaixo do limite ou o conjunto apresentou erro. |
|
|
232
232
|
| `2` | Argumentos incorretos (por exemplo, `--threshold` fora de `[0, 1]`). |
|
|
233
233
|
|
|
234
|
+
### Ignorar evals gated {#skipping}
|
|
235
|
+
|
|
236
|
+
Use `skipReason` quando uma suíte de evals for intencionalmente reservada para
|
|
237
|
+
execução manual, noturna ou dependente de secrets. Evals ignorados não executam
|
|
238
|
+
o agente nem os scorers, não fazem a suíte falhar e aparecem no JSON com
|
|
239
|
+
`status: "skipped"` e `skipReason`. Mantenha cobertura determinística barata no
|
|
240
|
+
CI normal de PR.
|
|
241
|
+
|
|
234
242
|
### Como porta de implantação de CI {#ci}
|
|
235
243
|
|
|
236
244
|
Adicione-o ao pipeline executado antes da implantação:
|
|
@@ -229,6 +229,13 @@ agent-native eval --threshold 0.8 # override every eval's pass threshold (0..
|
|
|
229
229
|
| `1` | 至少有一项评估得分低于阈值,或者套件出错。 |
|
|
230
230
|
| `2` | 错误的参数(例如 `--threshold` 位于 `[0, 1]` 之外)。 |
|
|
231
231
|
|
|
232
|
+
### 跳过受控评估 {#skipping}
|
|
233
|
+
|
|
234
|
+
当某个评估套件只应在手动、夜间或具备密钥的环境中运行时,请使用
|
|
235
|
+
`skipReason`。被跳过的评估不会运行代理或 scorer,不会让套件失败,并会
|
|
236
|
+
在 JSON 输出中显示 `status: "skipped"` 和 `skipReason`。廉价的确定性覆
|
|
237
|
+
盖应保留在普通 PR CI 中。
|
|
238
|
+
|
|
232
239
|
### 作为 CI 部署门 {#ci}
|
|
233
240
|
|
|
234
241
|
将其添加到部署之前运行的管道:
|
|
@@ -229,6 +229,13 @@ agent-native eval --threshold 0.8 # override every eval's pass threshold (0..
|
|
|
229
229
|
| `1` | 至少有一項評估得分低於閾值,或者套件出錯。 |
|
|
230
230
|
| `2` | 錯誤的參數(例如 `--threshold` 位於 `[0, 1]` 之外)。 |
|
|
231
231
|
|
|
232
|
+
### 跳過受控評估 {#skipping}
|
|
233
|
+
|
|
234
|
+
當某個評估套件只應在手動、夜間或具備密鑰的環境中執行時,請使用
|
|
235
|
+
`skipReason`。被跳過的評估不會執行代理或 scorer,不會讓套件失敗,並會
|
|
236
|
+
在 JSON 輸出中顯示 `status: "skipped"` 和 `skipReason`。廉價的確定性覆
|
|
237
|
+
蓋應保留在普通 PR CI 中。
|
|
238
|
+
|
|
232
239
|
### 作為 CI 部署門 {#ci}
|
|
233
240
|
|
|
234
241
|
將其新增到部署之前執行的管道:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.84.
|
|
3
|
+
"version": "0.84.1",
|
|
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": {
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { defineEventHandler } from "h3";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
disconnectNotionForOwner,
|
|
5
|
-
getDocumentOwnerEmail,
|
|
6
|
-
} from "../../../lib/notion.js";
|
|
7
|
-
|
|
8
|
-
export default defineEventHandler(async (event) => {
|
|
9
|
-
const owner = await getDocumentOwnerEmail(event);
|
|
10
|
-
const deleted = await disconnectNotionForOwner(owner);
|
|
11
|
-
return { success: true, deleted };
|
|
12
|
-
});
|