@agent-native/core 0.99.2 → 0.99.3
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/a2a-protocol.mdx +42 -0
- package/corpus/core/docs/content/locales/ar-SA/a2a-protocol.mdx +42 -0
- package/corpus/core/docs/content/locales/de-DE/a2a-protocol.mdx +42 -0
- package/corpus/core/docs/content/locales/es-ES/a2a-protocol.mdx +42 -0
- package/corpus/core/docs/content/locales/fr-FR/a2a-protocol.mdx +42 -0
- package/corpus/core/docs/content/locales/hi-IN/a2a-protocol.mdx +42 -0
- package/corpus/core/docs/content/locales/ja-JP/a2a-protocol.mdx +42 -0
- package/corpus/core/docs/content/locales/ko-KR/a2a-protocol.mdx +42 -0
- package/corpus/core/docs/content/locales/pt-BR/a2a-protocol.mdx +42 -0
- package/corpus/core/docs/content/locales/zh-CN/a2a-protocol.mdx +42 -0
- package/corpus/core/docs/content/locales/zh-TW/a2a-protocol.mdx +42 -0
- package/corpus/core/package.json +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/observability/routes.d.ts +5 -5
- package/dist/progress/routes.d.ts +1 -1
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/docs/content/a2a-protocol.mdx +42 -0
- package/docs/content/locales/ar-SA/a2a-protocol.mdx +42 -0
- package/docs/content/locales/de-DE/a2a-protocol.mdx +42 -0
- package/docs/content/locales/es-ES/a2a-protocol.mdx +42 -0
- package/docs/content/locales/fr-FR/a2a-protocol.mdx +42 -0
- package/docs/content/locales/hi-IN/a2a-protocol.mdx +42 -0
- package/docs/content/locales/ja-JP/a2a-protocol.mdx +42 -0
- package/docs/content/locales/ko-KR/a2a-protocol.mdx +42 -0
- package/docs/content/locales/pt-BR/a2a-protocol.mdx +42 -0
- package/docs/content/locales/zh-CN/a2a-protocol.mdx +42 -0
- package/docs/content/locales/zh-TW/a2a-protocol.mdx +42 -0
- package/package.json +1 -1
|
@@ -384,6 +384,48 @@ console.log(`Called ${result.target.name}: ${result.responseText}`);
|
|
|
384
384
|
簽名為 JWT 不記名代幣。僅將 `apiKeyEnv` 用於舊版外部對等點
|
|
385
385
|
需要靜態不記名權杖。使用本機actions而不是自己呼叫。
|
|
386
386
|
|
|
387
|
+
## CLI:agent-native invoke {#cli-invoke}
|
|
388
|
+
|
|
389
|
+
`agent-native invoke` 是一個薄的 CLI 包裝器,架構在與 `agentNative.invoke()` 相同的解析並呼叫的基本操作之上。使用它可以從 shell 腳本、CI 工作、cron 項目,或任何可以執行外部指令的系統觸發應用程式的代理——相當於手動向 `/_agent-native/a2a` 發送 POST 請求的 CLI 版本。
|
|
390
|
+
|
|
391
|
+
```bash
|
|
392
|
+
agent-native invoke <app-or-url> "prompt" [options]
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
```bash
|
|
396
|
+
# 在工作區註冊表中解析 "analytics" 並等待回覆
|
|
397
|
+
agent-native invoke analytics "Summarize signups by source this month"
|
|
398
|
+
|
|
399
|
+
# 直接透過 URL 呼叫已部署的應用程式,從環境變數讀取不記名權杖
|
|
400
|
+
agent-native invoke https://analytics.example.com "How many signups last week?" \
|
|
401
|
+
--api-key-env ANALYTICS_A2A_KEY
|
|
402
|
+
|
|
403
|
+
# 強制使用一次阻塞式 message/send,而非預設的非同步+輪詢
|
|
404
|
+
agent-native invoke analytics "Quick lookup" --sync
|
|
405
|
+
|
|
406
|
+
# 為腳本編寫提供機器可讀輸出
|
|
407
|
+
agent-native invoke analytics "Summarize signups" --json
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
| 選項 | 描述 |
|
|
411
|
+
| ------------------------- | --------------------------------------------------------- |
|
|
412
|
+
| `--agent <id\|name\|url>` | 目標代理(位置參數 `<app-or-url>` 的別名) |
|
|
413
|
+
| `--message <text>` | 提示(位置參數 `"prompt"` 的別名) |
|
|
414
|
+
| `--api-key-env <name>` | 從環境變數讀取不記名權杖 |
|
|
415
|
+
| `--api-key <token>` | 直接內嵌傳入的不記名權杖值 |
|
|
416
|
+
| `--context-id <id>` | A2A `contextId`,用於延續現有工作的對話 |
|
|
417
|
+
| `--self-app-id <id>` | 目前應用程式 ID,用於防止自我呼叫 |
|
|
418
|
+
| `--self-url <url>` | 目前應用程式 URL,用於防止自我呼叫 |
|
|
419
|
+
| `--timeout-ms <n>` | 非同步輪詢逾時時間 |
|
|
420
|
+
| `--poll-interval-ms <n>` | 非同步輪詢間隔 |
|
|
421
|
+
| `--sync` | 使用一次阻塞式 `message/send` 請求,取代預設的非同步+輪詢 |
|
|
422
|
+
| `--no-hint` | 按原樣傳送提示,不加入跨應用程式呼叫提示 |
|
|
423
|
+
| `--json` | 以 JSON 格式輸出目標中繼資料與回應文字 |
|
|
424
|
+
|
|
425
|
+
與 `callAgent()` 一樣,此 CLI 預設使用非同步+輪詢(底層是 `invokeAgent` → `callAgent`),這是針對託管/無伺服器目標的安全選擇——請參閱上方的[無伺服器 webhook 與閘道逾時](#json-rpc-methods)。只有在確定目標不在具有短執行限制的閘道之後時,才傳入 `--sync`。
|
|
426
|
+
|
|
427
|
+
目標的解析方式與 `agentNative.invoke()` 相同:透過工作區應用程式 ID、應用程式名稱,或完整 URL——因此同一指令在多應用程式工作區中的同級應用程式,或其他地方的任意 A2A 對等點上都能運作。
|
|
428
|
+
|
|
387
429
|
## 工作生命週期 {#task-lifecycle}
|
|
388
430
|
|
|
389
431
|
每條訊息都會建立一個在以下狀態之間移動的工作:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.99.
|
|
3
|
+
"version": "0.99.3",
|
|
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": {
|