@agent-native/core 0.99.1 → 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/README.md +1 -1
- package/corpus/core/CHANGELOG.md +19 -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/corpus/core/src/agent/production-agent.ts +12 -38
- package/corpus/core/src/audit/config.ts +0 -1
- package/corpus/core/src/chat-threads/store.ts +57 -41
- package/corpus/core/src/client/AssistantChat.tsx +1 -2
- package/corpus/core/src/client/chat/message-components.tsx +15 -3
- package/corpus/core/src/client/chat/tool-call-display.tsx +18 -1
- package/corpus/core/src/client/extensions/EmbeddedExtension.tsx +5 -9
- package/corpus/core/src/client/extensions/ExtensionViewer.tsx +0 -133
- package/corpus/core/src/client/index.ts +7 -0
- package/corpus/core/src/client/settings/DemoModeSection.tsx +9 -65
- package/corpus/core/src/client/settings/SettingsPanel.tsx +1 -1
- package/corpus/core/src/client/use-db-sync.ts +3 -15
- package/corpus/core/src/client/use-demo-mode-status.ts +16 -30
- package/corpus/core/src/demo/browser-state.ts +47 -0
- package/corpus/core/src/demo/fetch-interceptor.ts +12 -59
- package/corpus/core/src/deploy/workspace-deploy.ts +2 -2
- package/corpus/core/src/server/action-discovery.ts +0 -1
- package/corpus/core/src/server/core-routes-plugin.ts +0 -30
- package/corpus/core/src/templates/workspace-core/.agents/skills/native-navigation/SKILL.md +67 -0
- package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +48 -7
- package/corpus/templates/analytics/AGENTS.md +4 -4
- package/corpus/templates/analytics/actions/compose-dashboard.ts +12 -1
- package/corpus/templates/analytics/actions/dashboard-mutation-api.ts +15 -4
- package/corpus/templates/analytics/actions/mutate-dashboard.ts +2 -1
- package/corpus/templates/analytics/actions/update-dashboard.ts +14 -0
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +21 -27
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +4 -1
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/interpolate.ts +21 -0
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/types.ts +14 -0
- package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +31 -12
- package/corpus/templates/analytics/changelog/2026-07-13-dashboard-charts-now-honor-the-selected-time-range-by-defaul.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-13-keep-real-authorized-identities-in-analytics-incident-lookup.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-13-the-analytics-agents-tab-is-available-again-from-the-main-na.md +6 -0
- package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +3 -3
- package/corpus/templates/analytics/server/lib/agent-readable-resource-context.ts +4 -0
- package/corpus/templates/analytics/server/lib/dashboard-time-scope.ts +170 -0
- package/corpus/templates/analytics/server/lib/error-capture.ts +6 -62
- package/corpus/templates/analytics/server/lib/first-party-metric-catalog.ts +20 -5
- package/corpus/templates/analytics/server/lib/session-replay-agent-context.ts +1 -1
- package/corpus/templates/analytics/server/lib/session-replay.ts +5 -111
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +1 -0
- package/corpus/templates/assets/app/routes/library.tsx +3 -4
- package/corpus/templates/assets/changelog/2026-07-13-internal-library-links-open-in-new-tabs.md +6 -0
- package/corpus/templates/calendar/app/pages/BookingLinksPage.tsx +43 -40
- package/corpus/templates/calendar/app/pages/ManageBookingPage.tsx +6 -8
- package/corpus/templates/calendar/changelog/2026-07-13-booking-links-and-previews-open-in-new-tabs.md +6 -0
- package/corpus/templates/clips/app/components/player/sign-in-prompt-dialog.tsx +4 -7
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +19 -9
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +5 -3
- package/corpus/templates/clips/changelog/2026-07-13-recording-links-open-in-new-tabs.md +6 -0
- package/corpus/templates/content/app/components/editor/ContentReferencePreview.tsx +6 -8
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +5 -3
- package/corpus/templates/content/app/components/editor/database/FormView.tsx +6 -9
- package/corpus/templates/content/changelog/2026-07-13-document-links-open-in-new-tabs.md +6 -0
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +33 -16
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +18 -1
- package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +4 -4
- package/corpus/templates/design/app/pages/DesignSystems.tsx +8 -10
- package/corpus/templates/design/app/pages/Index.tsx +6 -1
- package/corpus/templates/design/app/pages/Present.tsx +12 -6
- package/corpus/templates/design/changelog/2026-07-13-design-navigation-links-open-in-new-tabs.md +6 -0
- package/corpus/templates/design/changelog/2026-07-13-design-session-replays-include-preview-iframes.md +6 -0
- package/corpus/templates/forms/app/pages/FormBuilderPage.tsx +11 -11
- package/corpus/templates/forms/app/pages/FormsListPage.tsx +6 -8
- package/corpus/templates/forms/changelog/2026-07-13-form-navigation-links-open-in-new-tabs.md +6 -0
- package/corpus/templates/mail/app/pages/DraftQueuePage.tsx +3 -8
- package/corpus/templates/mail/changelog/2026-07-13-settings-links-open-in-new-tabs.md +6 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +13 -37
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/audit/config.d.ts.map +1 -1
- package/dist/audit/config.js +0 -1
- package/dist/audit/config.js.map +1 -1
- package/dist/chat-threads/store.d.ts.map +1 -1
- package/dist/chat-threads/store.js +47 -33
- package/dist/chat-threads/store.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +1 -1
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +9 -3
- package/dist/client/chat/message-components.js.map +1 -1
- package/dist/client/chat/tool-call-display.d.ts +3 -1
- package/dist/client/chat/tool-call-display.d.ts.map +1 -1
- package/dist/client/chat/tool-call-display.js +10 -2
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/client/extensions/EmbeddedExtension.js +2 -6
- package/dist/client/extensions/EmbeddedExtension.js.map +1 -1
- package/dist/client/extensions/ExtensionViewer.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionViewer.js +2 -59
- package/dist/client/extensions/ExtensionViewer.js.map +1 -1
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +2 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/settings/DemoModeSection.d.ts +1 -13
- package/dist/client/settings/DemoModeSection.d.ts.map +1 -1
- package/dist/client/settings/DemoModeSection.js +5 -52
- package/dist/client/settings/DemoModeSection.js.map +1 -1
- package/dist/client/settings/SettingsPanel.js +1 -1
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/client/use-db-sync.d.ts.map +1 -1
- package/dist/client/use-db-sync.js +3 -7
- package/dist/client/use-db-sync.js.map +1 -1
- package/dist/client/use-demo-mode-status.d.ts +3 -4
- package/dist/client/use-demo-mode-status.d.ts.map +1 -1
- package/dist/client/use-demo-mode-status.js +8 -23
- package/dist/client/use-demo-mode-status.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 +2 -2
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/demo/browser-state.d.ts +10 -0
- package/dist/demo/browser-state.d.ts.map +1 -0
- package/dist/demo/browser-state.js +49 -0
- package/dist/demo/browser-state.js.map +1 -0
- package/dist/demo/fetch-interceptor.d.ts +2 -7
- package/dist/demo/fetch-interceptor.d.ts.map +1 -1
- package/dist/demo/fetch-interceptor.js +12 -56
- package/dist/demo/fetch-interceptor.js.map +1 -1
- package/dist/deploy/workspace-deploy.js +2 -2
- package/dist/deploy/workspace-deploy.js.map +1 -1
- package/dist/notifications/routes.d.ts +2 -2
- package/dist/observability/routes.d.ts +5 -5
- package/dist/resources/handlers.d.ts +3 -3
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/action-discovery.d.ts.map +1 -1
- package/dist/server/action-discovery.js +0 -1
- package/dist/server/action-discovery.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +0 -27
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/templates/workspace-core/.agents/skills/native-navigation/SKILL.md +67 -0
- 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
- package/src/templates/workspace-core/.agents/skills/native-navigation/SKILL.md +67 -0
- package/corpus/core/src/demo/actions/toggle-demo-mode.ts +0 -23
- package/corpus/core/src/demo/config.ts +0 -57
- package/dist/demo/actions/toggle-demo-mode.d.ts +0 -8
- package/dist/demo/actions/toggle-demo-mode.d.ts.map +0 -1
- package/dist/demo/actions/toggle-demo-mode.js +0 -21
- package/dist/demo/actions/toggle-demo-mode.js.map +0 -1
- package/dist/demo/config.d.ts +0 -9
- package/dist/demo/config.d.ts.map +0 -1
- package/dist/demo/config.js +0 -58
- package/dist/demo/config.js.map +0 -1
package/corpus/README.md
CHANGED
package/corpus/core/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @agent-native/core
|
|
2
2
|
|
|
3
|
+
## 0.99.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 03cd25c: Document the `agent-native invoke` CLI usage and flags on the A2A protocol docs page, across all locales.
|
|
8
|
+
|
|
9
|
+
## 0.99.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 34b4f29: Keep Demo mode browser-local so backend actions and agent/MCP results retain real access-scoped data.
|
|
14
|
+
- 34b4f29: Fix 404s when client-side navigating from the dispatch shell into a mounted workspace sub-app's root route. React Router's `.data` loader-fetch convention (e.g. `/coach.data`) didn't match either deployment platform's per-app routing rules (`basePath` / `basePath/*`), so the request fell through to a bare 404 before reaching the app's own server, leaving the sub-app stuck retrying its own action/agent-chat calls afterward.
|
|
15
|
+
- 34b4f29: Keep the latest reasoning thought expanded until a newer thought arrives, then animate the previous thought closed.
|
|
16
|
+
- 34b4f29: Preserve native browser link behavior when opening embedded extensions in their full view.
|
|
17
|
+
- 34b4f29: Keep chat composers editable while AI provider readiness is loading.
|
|
18
|
+
- 34b4f29: Record framework-owned Design preview iframes in session replays with the same privacy masking as the host page.
|
|
19
|
+
- 34b4f29: Remove the extension viewer's View / edit source button.
|
|
20
|
+
- 34b4f29: Retry transient chat-thread database failures so completed agent responses are not surfaced as unsaved.
|
|
21
|
+
|
|
3
22
|
## 0.99.1
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -392,6 +392,48 @@ app environment and pass the caller identity (`userEmail`) so outbound calls are
|
|
|
392
392
|
signed as JWT bearer tokens. Use `apiKeyEnv` only for legacy external peers that
|
|
393
393
|
expect a static bearer token. Use local actions instead of invoking yourself.
|
|
394
394
|
|
|
395
|
+
## CLI: agent-native invoke {#cli-invoke}
|
|
396
|
+
|
|
397
|
+
`agent-native invoke` is a thin CLI wrapper over the same resolve-and-call primitive as `agentNative.invoke()`. Use it to trigger an app's agent from a shell script, a CI job, a cron entry, or any external system that can shell out — the CLI equivalent of posting to `/_agent-native/a2a` by hand.
|
|
398
|
+
|
|
399
|
+
```bash
|
|
400
|
+
agent-native invoke <app-or-url> "prompt" [options]
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
```bash
|
|
404
|
+
# Resolve "analytics" in the workspace registry and wait for the reply
|
|
405
|
+
agent-native invoke analytics "Summarize signups by source this month"
|
|
406
|
+
|
|
407
|
+
# Call a deployed app directly by URL, reading the bearer token from env
|
|
408
|
+
agent-native invoke https://analytics.example.com "How many signups last week?" \
|
|
409
|
+
--api-key-env ANALYTICS_A2A_KEY
|
|
410
|
+
|
|
411
|
+
# Force one blocking message/send instead of the default async+poll
|
|
412
|
+
agent-native invoke analytics "Quick lookup" --sync
|
|
413
|
+
|
|
414
|
+
# Machine-readable output for scripting
|
|
415
|
+
agent-native invoke analytics "Summarize signups" --json
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
| Option | Description |
|
|
419
|
+
| ------------------------- | ------------------------------------------------------------------------- |
|
|
420
|
+
| `--agent <id\|name\|url>` | Target agent (alias for the positional `<app-or-url>`) |
|
|
421
|
+
| `--message <text>` | Prompt (alias for the positional `"prompt"`) |
|
|
422
|
+
| `--api-key-env <name>` | Read the bearer token from an environment variable |
|
|
423
|
+
| `--api-key <token>` | Bearer token value, passed inline |
|
|
424
|
+
| `--context-id <id>` | A2A `contextId`, to continue an existing task's conversation |
|
|
425
|
+
| `--self-app-id <id>` | Current app id, used for self-call prevention |
|
|
426
|
+
| `--self-url <url>` | Current app URL, used for self-call prevention |
|
|
427
|
+
| `--timeout-ms <n>` | Async polling timeout |
|
|
428
|
+
| `--poll-interval-ms <n>` | Async polling interval |
|
|
429
|
+
| `--sync` | Use one blocking `message/send` request instead of the async+poll default |
|
|
430
|
+
| `--no-hint` | Send the prompt as-is, without the cross-app invocation hint |
|
|
431
|
+
| `--json` | Print target metadata and response text as JSON |
|
|
432
|
+
|
|
433
|
+
Like `callAgent()`, the CLI defaults to async + poll (`invokeAgent` → `callAgent` under the hood), which is the safe choice against hosted/serverless targets — see [Serverless webhook and gateway timeouts](#json-rpc-methods) above. Pass `--sync` only when you know the target isn't behind a gateway with a short execution limit.
|
|
434
|
+
|
|
435
|
+
The target resolves the same way as `agentNative.invoke()`: by workspace app id, by app name, or by a full URL — so the same command works against a sibling app in a multi-app workspace or an arbitrary A2A peer elsewhere.
|
|
436
|
+
|
|
395
437
|
## Task lifecycle {#task-lifecycle}
|
|
396
438
|
|
|
397
439
|
Each message creates a task that moves through these states:
|
|
@@ -384,6 +384,48 @@ console.log(`Called ${result.target.name}: ${result.responseText}`);
|
|
|
384
384
|
تم التوقيع عليها كرموز حاملة JWT. استخدم `apiKeyEnv` فقط للأقران الخارجيين القدامى الذين
|
|
385
385
|
توقع رمزًا مميزًا لحامل ثابت. استخدم actions المحلي بدلاً من استدعاء نفسك.
|
|
386
386
|
|
|
387
|
+
## واجهة سطر الأوامر: agent-native invoke {#cli-invoke}
|
|
388
|
+
|
|
389
|
+
`agent-native invoke` عبارة عن غلاف رفيع لواجهة سطر الأوامر فوق نفس بدائية الحل والاستدعاء التي تستخدمها `agentNative.invoke()`. استخدمه لتشغيل وكيل أحد التطبيقات من نص برمجي في shell، أو مهمة CI، أو إدخال cron، أو أي نظام خارجي يمكنه تنفيذ أوامر shell — وهو المكافئ عبر سطر الأوامر لإرسال طلب POST يدويًا إلى `/_agent-native/a2a`.
|
|
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 حاجز واحد بدلاً من الوضع الافتراضي async+poll
|
|
404
|
+
agent-native invoke analytics "Quick lookup" --sync
|
|
405
|
+
|
|
406
|
+
# إخراج قابل للقراءة الآلية للبرمجة النصية
|
|
407
|
+
agent-native invoke analytics "Summarize signups" --json
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
| Option | الوصف |
|
|
411
|
+
| ------------------------- | ------------------------------------------------------------------------ |
|
|
412
|
+
| `--agent <id\|name\|url>` | الوكيل المستهدف (اسم بديل للوسيطة الموضعية `<app-or-url>`) |
|
|
413
|
+
| `--message <text>` | الطلب النصي (اسم بديل للوسيطة الموضعية `"prompt"`) |
|
|
414
|
+
| `--api-key-env <name>` | قراءة رمز الحامل (bearer token) من متغير بيئة |
|
|
415
|
+
| `--api-key <token>` | قيمة رمز الحامل، مُمرَّرة مباشرة |
|
|
416
|
+
| `--context-id <id>` | `contextId` الخاص بـ A2A، لمتابعة محادثة مهمة موجودة بالفعل |
|
|
417
|
+
| `--self-app-id <id>` | معرف التطبيق الحالي، يُستخدم لمنع الاستدعاء الذاتي |
|
|
418
|
+
| `--self-url <url>` | عنوان URL للتطبيق الحالي، يُستخدم لمنع الاستدعاء الذاتي |
|
|
419
|
+
| `--timeout-ms <n>` | مهلة الاستطلاع (polling) غير المتزامن |
|
|
420
|
+
| `--poll-interval-ms <n>` | فاصل الاستطلاع غير المتزامن |
|
|
421
|
+
| `--sync` | استخدام طلب `message/send` حاجب واحد بدلاً من الوضع الافتراضي async+poll |
|
|
422
|
+
| `--no-hint` | إرسال الطلب النصي كما هو، دون تلميح الاستدعاء بين التطبيقات |
|
|
423
|
+
| `--json` | طباعة بيانات الهدف الوصفية ونص الاستجابة بصيغة JSON |
|
|
424
|
+
|
|
425
|
+
مثل `callAgent()`، تعتمد واجهة سطر الأوامر افتراضيًا على async + poll (`invokeAgent` ← `callAgent` تحت الغطاء)، وهو الخيار الآمن عند استهداف بيئات مستضافة/serverless — انظر [مهلات بوابة الويب هوك وبوابة العبور بلا خادم](#json-rpc-methods) أعلاه. استخدم `--sync` فقط عندما تكون متأكدًا أن الهدف ليس خلف بوابة ذات مهلة تنفيذ قصيرة.
|
|
426
|
+
|
|
427
|
+
يتم حل الهدف بنفس طريقة `agentNative.invoke()`: عبر معرف تطبيق مساحة العمل، أو اسم التطبيق، أو عنوان URL كامل — لذا يعمل نفس الأمر مع تطبيق شقيق في مساحة عمل متعددة التطبيقات أو مع أي نظير A2A تعسفي في مكان آخر.
|
|
428
|
+
|
|
387
429
|
## دورة حياة المهمة {#task-lifecycle}
|
|
388
430
|
|
|
389
431
|
تنشئ كل رسالة مهمة تنتقل عبر هذه الحالات:
|
|
@@ -386,6 +386,48 @@ App-Umgebung und übergeben Sie die Anruferidentität (`userEmail`), sodass ausg
|
|
|
386
386
|
signiert als JWT-Inhaber-Token. Verwenden Sie `apiKeyEnv` nur für ältere externe Peers, die
|
|
387
387
|
erwarten Sie ein statisches Inhabertoken. Verwenden Sie lokales actions, anstatt sich selbst aufzurufen.
|
|
388
388
|
|
|
389
|
+
## CLI: agent-native invoke {#cli-invoke}
|
|
390
|
+
|
|
391
|
+
`agent-native invoke` ist ein schlanker CLI-Wrapper über dieselbe Resolve-and-Call-Primitive wie `agentNative.invoke()`. Verwenden Sie es, um den Agenten einer App aus einem Shell-Skript, einem CI-Job, einem Cron-Eintrag oder einem beliebigen externen System auszulösen, das Befehle ausführen kann — das CLI-Äquivalent zum manuellen Posten an `/_agent-native/a2a`.
|
|
392
|
+
|
|
393
|
+
```bash
|
|
394
|
+
agent-native invoke <app-or-url> "prompt" [options]
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
```bash
|
|
398
|
+
# "analytics" in der Workspace-Registry auflösen und auf die Antwort warten
|
|
399
|
+
agent-native invoke analytics "Summarize signups by source this month"
|
|
400
|
+
|
|
401
|
+
# Eine bereitgestellte App direkt per URL aufrufen und das Bearer-Token aus der Umgebung lesen
|
|
402
|
+
agent-native invoke https://analytics.example.com "How many signups last week?" \
|
|
403
|
+
--api-key-env ANALYTICS_A2A_KEY
|
|
404
|
+
|
|
405
|
+
# Eine einzelne blockierende message/send-Anfrage erzwingen statt des standardmäßigen Async+Poll
|
|
406
|
+
agent-native invoke analytics "Quick lookup" --sync
|
|
407
|
+
|
|
408
|
+
# Maschinenlesbare Ausgabe für Skripting
|
|
409
|
+
agent-native invoke analytics "Summarize signups" --json
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
| Option | Beschreibung |
|
|
413
|
+
| ------------------------- | ------------------------------------------------------------------------------------ |
|
|
414
|
+
| `--agent <id\|name\|url>` | Ziel-Agent (Alias für das positionelle `<app-or-url>`) |
|
|
415
|
+
| `--message <text>` | Prompt (Alias für das positionelle `"prompt"`) |
|
|
416
|
+
| `--api-key-env <name>` | Liest das Bearer-Token aus einer Umgebungsvariable |
|
|
417
|
+
| `--api-key <token>` | Bearer-Token-Wert, inline übergeben |
|
|
418
|
+
| `--context-id <id>` | A2A-`contextId`, um die Konversation einer bestehenden Aufgabe fortzusetzen |
|
|
419
|
+
| `--self-app-id <id>` | Aktuelle App-ID, verwendet zur Selbstaufruf-Vermeidung |
|
|
420
|
+
| `--self-url <url>` | Aktuelle App-URL, verwendet zur Selbstaufruf-Vermeidung |
|
|
421
|
+
| `--timeout-ms <n>` | Timeout für Async-Polling |
|
|
422
|
+
| `--poll-interval-ms <n>` | Intervall für Async-Polling |
|
|
423
|
+
| `--sync` | Eine blockierende `message/send`-Anfrage anstelle des Async+Poll-Standards verwenden |
|
|
424
|
+
| `--no-hint` | Den Prompt unverändert senden, ohne den App-übergreifenden Aufruf-Hinweis |
|
|
425
|
+
| `--json` | Zielmetadaten und Antworttext als JSON ausgeben |
|
|
426
|
+
|
|
427
|
+
Wie `callAgent()` verwendet die CLI standardmäßig Async + Poll (`invokeAgent` → `callAgent` unter der Haube), was die sichere Wahl gegenüber gehosteten/serverlosen Zielen ist — siehe [Serverless-Webhook- und Gateway-Timeouts](#json-rpc-methods) oben. Übergeben Sie `--sync` nur, wenn Sie wissen, dass sich das Ziel nicht hinter einem Gateway mit kurzem Ausführungslimit befindet.
|
|
428
|
+
|
|
429
|
+
Das Ziel wird auf die gleiche Weise aufgelöst wie bei `agentNative.invoke()`: über die Workspace-App-ID, den App-Namen oder eine vollständige URL — sodass derselbe Befehl sowohl gegen eine Geschwister-App in einem Multi-App-Workspace als auch gegen einen beliebigen A2A-Peer anderswo funktioniert.
|
|
430
|
+
|
|
389
431
|
## Aufgabenlebenszyklus {#task-lifecycle}
|
|
390
432
|
|
|
391
433
|
Jede Nachricht erstellt eine Aufgabe, die diese Zustände durchläuft:
|
|
@@ -386,6 +386,48 @@ entorno de la aplicación y pasar la identidad de la persona que llama (`userEma
|
|
|
386
386
|
firmado como tokens al portador JWT. Utilice `apiKeyEnv` solo para pares externos heredados que
|
|
387
387
|
espera un token de portador estático. Utilice actions local en lugar de invocarse a sí mismo.
|
|
388
388
|
|
|
389
|
+
## CLI: agent-native invoke {#cli-invoke}
|
|
390
|
+
|
|
391
|
+
`agent-native invoke` es un envoltorio de CLI ligero sobre la misma primitiva de resolución e invocación que `agentNative.invoke()`. Úselo para activar el agente de una aplicación desde un script de shell, un job de CI, una entrada de cron, o cualquier sistema externo que pueda ejecutar comandos — el equivalente en CLI de hacer un POST manual a `/_agent-native/a2a`.
|
|
392
|
+
|
|
393
|
+
```bash
|
|
394
|
+
agent-native invoke <app-or-url> "prompt" [options]
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
```bash
|
|
398
|
+
# Resuelve "analytics" en el registro del espacio de trabajo y espera la respuesta
|
|
399
|
+
agent-native invoke analytics "Summarize signups by source this month"
|
|
400
|
+
|
|
401
|
+
# Llama directamente a una aplicación desplegada por URL, leyendo el token de portador desde una variable de entorno
|
|
402
|
+
agent-native invoke https://analytics.example.com "How many signups last week?" \
|
|
403
|
+
--api-key-env ANALYTICS_A2A_KEY
|
|
404
|
+
|
|
405
|
+
# Fuerza un único message/send bloqueante en lugar del valor predeterminado async+poll
|
|
406
|
+
agent-native invoke analytics "Quick lookup" --sync
|
|
407
|
+
|
|
408
|
+
# Salida legible por máquina para scripting
|
|
409
|
+
agent-native invoke analytics "Summarize signups" --json
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
| Option | Description |
|
|
413
|
+
| ------------------------- | ---------------------------------------------------------------------------------------------- |
|
|
414
|
+
| `--agent <id\|name\|url>` | Agente de destino (alias del argumento posicional `<app-or-url>`) |
|
|
415
|
+
| `--message <text>` | Prompt (alias del argumento posicional `"prompt"`) |
|
|
416
|
+
| `--api-key-env <name>` | Lee el token de portador desde una variable de entorno |
|
|
417
|
+
| `--api-key <token>` | Valor del token de portador, pasado en línea |
|
|
418
|
+
| `--context-id <id>` | `contextId` de A2A, para continuar la conversación de una tarea existente |
|
|
419
|
+
| `--self-app-id <id>` | ID de la aplicación actual, usado para prevenir autoinvocación |
|
|
420
|
+
| `--self-url <url>` | URL de la aplicación actual, usada para prevenir autoinvocación |
|
|
421
|
+
| `--timeout-ms <n>` | Tiempo de espera del sondeo asíncrono |
|
|
422
|
+
| `--poll-interval-ms <n>` | Intervalo de sondeo asíncrono |
|
|
423
|
+
| `--sync` | Usa una única solicitud `message/send` bloqueante en lugar del valor predeterminado async+poll |
|
|
424
|
+
| `--no-hint` | Envía el prompt tal cual, sin la sugerencia de invocación entre aplicaciones |
|
|
425
|
+
| `--json` | Imprime los metadatos del destino y el texto de respuesta como JSON |
|
|
426
|
+
|
|
427
|
+
Al igual que `callAgent()`, la CLI usa de forma predeterminada async + poll (`invokeAgent` → `callAgent` internamente), que es la opción segura frente a destinos alojados/serverless — vea [Tiempos de espera de webhooks y gateways serverless](#json-rpc-methods) más arriba. Pase `--sync` solo cuando sepa que el destino no está detrás de un gateway con un límite de ejecución corto.
|
|
428
|
+
|
|
429
|
+
El destino se resuelve de la misma manera que `agentNative.invoke()`: por ID de aplicación del espacio de trabajo, por nombre de aplicación, o por una URL completa — así que el mismo comando funciona contra una aplicación hermana en un espacio de trabajo multiaplicación o contra un par A2A arbitrario en otro lugar.
|
|
430
|
+
|
|
389
431
|
## Ciclo de vida de la tarea {#task-lifecycle}
|
|
390
432
|
|
|
391
433
|
Cada mensaje crea una tarea que pasa por estos estados:
|
|
@@ -384,6 +384,48 @@ environnement d'application et transmettre l'identité de l'appelant (`userEmail
|
|
|
384
384
|
signé en tant que jetons au porteur JWT. Utilisez `apiKeyEnv` uniquement pour les anciens homologues externes qui
|
|
385
385
|
attendez-vous à un jeton de porteur statique. Utilisez actions local au lieu de vous invoquer.
|
|
386
386
|
|
|
387
|
+
## CLI : agent-native invoke {#cli-invoke}
|
|
388
|
+
|
|
389
|
+
`agent-native invoke` est un mince wrapper CLI au-dessus de la même primitive de résolution et d'appel que `agentNative.invoke()`. Utilisez-la pour déclencher l'agent d'une application depuis un script shell, un job CI, une entrée cron, ou tout système externe capable de lancer une commande shell — l'équivalent CLI d'un POST manuel vers `/_agent-native/a2a`.
|
|
390
|
+
|
|
391
|
+
```bash
|
|
392
|
+
agent-native invoke <app-or-url> "prompt" [options]
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
```bash
|
|
396
|
+
# Résoudre "analytics" dans le registre de l'espace de travail et attendre la réponse
|
|
397
|
+
agent-native invoke analytics "Summarize signups by source this month"
|
|
398
|
+
|
|
399
|
+
# Appeler une application déployée directement par URL, en lisant le jeton au porteur depuis l'environnement
|
|
400
|
+
agent-native invoke https://analytics.example.com "How many signups last week?" \
|
|
401
|
+
--api-key-env ANALYTICS_A2A_KEY
|
|
402
|
+
|
|
403
|
+
# Forcer un seul message/send bloquant au lieu du mode async+poll par défaut
|
|
404
|
+
agent-native invoke analytics "Quick lookup" --sync
|
|
405
|
+
|
|
406
|
+
# Sortie exploitable par machine pour le scripting
|
|
407
|
+
agent-native invoke analytics "Summarize signups" --json
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
| Option | Description |
|
|
411
|
+
| ------------------------- | ---------------------------------------------------------------------------------------- |
|
|
412
|
+
| `--agent <id\|name\|url>` | Agent cible (alias de l'argument positionnel `<app-or-url>`) |
|
|
413
|
+
| `--message <text>` | Prompt (alias de l'argument positionnel `"prompt"`) |
|
|
414
|
+
| `--api-key-env <name>` | Lit le jeton au porteur depuis une variable d'environnement |
|
|
415
|
+
| `--api-key <token>` | Valeur du jeton au porteur, passée directement |
|
|
416
|
+
| `--context-id <id>` | `contextId` A2A, pour poursuivre la conversation d'une tâche existante |
|
|
417
|
+
| `--self-app-id <id>` | Identifiant de l'application courante, utilisé pour éviter les auto-appels |
|
|
418
|
+
| `--self-url <url>` | URL de l'application courante, utilisée pour éviter les auto-appels |
|
|
419
|
+
| `--timeout-ms <n>` | Délai d'expiration du polling asynchrone |
|
|
420
|
+
| `--poll-interval-ms <n>` | Intervalle de polling asynchrone |
|
|
421
|
+
| `--sync` | Utilise une seule requête `message/send` bloquante au lieu du mode async+poll par défaut |
|
|
422
|
+
| `--no-hint` | Envoie le prompt tel quel, sans l'indice d'invocation inter-application |
|
|
423
|
+
| `--json` | Affiche les métadonnées de la cible et le texte de la réponse au format JSON |
|
|
424
|
+
|
|
425
|
+
Comme `callAgent()`, la CLI utilise par défaut le mode async + poll (`invokeAgent` → `callAgent` en interne), ce qui est le choix sûr face à des cibles hébergées/serverless — voir [Délais d'expiration des webhooks et passerelles serverless](#json-rpc-methods) ci-dessus. Ne passez `--sync` que lorsque vous savez que la cible n'est pas derrière une passerelle avec une limite d'exécution courte.
|
|
426
|
+
|
|
427
|
+
La cible se résout de la même manière que `agentNative.invoke()` : par identifiant d'application de l'espace de travail, par nom d'application, ou par une URL complète — la même commande fonctionne donc aussi bien contre une application sœur dans un espace de travail multi-applications que contre un pair A2A arbitraire ailleurs.
|
|
428
|
+
|
|
387
429
|
## Cycle de vie des tâches {#task-lifecycle}
|
|
388
430
|
|
|
389
431
|
Chaque message crée une tâche qui passe par ces états :
|
|
@@ -384,6 +384,48 @@ dataset, or workflow. In production agent-native apps, set `A2A_SECRET` in each
|
|
|
384
384
|
JWT वाहक टोकन के रूप में हस्ताक्षरित। `apiKeyEnv` का उपयोग केवल विरासती बाहरी समकक्षों के लिए करें
|
|
385
385
|
एक स्थिर वाहक टोकन की अपेक्षा करें। स्वयं का आह्वान करने के बजाय स्थानीय actions का उपयोग करें।
|
|
386
386
|
|
|
387
|
+
## सीएलआई: agent-native invoke {#cli-invoke}
|
|
388
|
+
|
|
389
|
+
`agent-native invoke`, `agentNative.invoke()` के समान resolve-and-call primitive पर एक हल्का CLI wrapper है। इसका उपयोग किसी शेल स्क्रिप्ट, CI job, cron entry, या किसी भी बाहरी सिस्टम से किसी ऐप के एजेंट को ट्रिगर करने के लिए करें जो shell out कर सकता है — यह हाथ से `/_agent-native/a2a` पर पोस्ट करने के बराबर है।
|
|
390
|
+
|
|
391
|
+
```bash
|
|
392
|
+
agent-native invoke <app-or-url> "prompt" [options]
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
```bash
|
|
396
|
+
# वर्कस्पेस रजिस्ट्री में "analytics" को resolve करें और जवाब की प्रतीक्षा करें
|
|
397
|
+
agent-native invoke analytics "Summarize signups by source this month"
|
|
398
|
+
|
|
399
|
+
# किसी डिप्लॉय किए गए ऐप को सीधे URL से कॉल करें, bearer token env से पढ़ते हुए
|
|
400
|
+
agent-native invoke https://analytics.example.com "How many signups last week?" \
|
|
401
|
+
--api-key-env ANALYTICS_A2A_KEY
|
|
402
|
+
|
|
403
|
+
# डिफ़ॉल्ट async+poll के बजाय एक ब्लॉकिंग message/send को बाध्य करें
|
|
404
|
+
agent-native invoke analytics "Quick lookup" --sync
|
|
405
|
+
|
|
406
|
+
# स्क्रिप्टिंग के लिए मशीन-रीडेबल आउटपुट
|
|
407
|
+
agent-native invoke analytics "Summarize signups" --json
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
| Option | विवरण |
|
|
411
|
+
| ------------------------- | ---------------------------------------------------------------------------- |
|
|
412
|
+
| `--agent <id\|name\|url>` | लक्ष्य एजेंट (positional `<app-or-url>` का alias) |
|
|
413
|
+
| `--message <text>` | प्रॉम्प्ट (positional `"prompt"` का alias) |
|
|
414
|
+
| `--api-key-env <name>` | एक environment variable से bearer token पढ़ें |
|
|
415
|
+
| `--api-key <token>` | Bearer token मान, inline पास किया गया |
|
|
416
|
+
| `--context-id <id>` | A2A `contextId`, किसी मौजूदा task की बातचीत जारी रखने के लिए |
|
|
417
|
+
| `--self-app-id <id>` | वर्तमान app id, self-call रोकथाम के लिए उपयोग की जाती है |
|
|
418
|
+
| `--self-url <url>` | वर्तमान app URL, self-call रोकथाम के लिए उपयोग की जाती है |
|
|
419
|
+
| `--timeout-ms <n>` | Async polling timeout |
|
|
420
|
+
| `--poll-interval-ms <n>` | Async polling interval |
|
|
421
|
+
| `--sync` | डिफ़ॉल्ट async+poll के बजाय एक blocking `message/send` request का उपयोग करें |
|
|
422
|
+
| `--no-hint` | प्रॉम्प्ट को cross-app invocation hint के बिना, ज्यों का त्यों भेजें |
|
|
423
|
+
| `--json` | Target metadata और response text को JSON के रूप में प्रिंट करें |
|
|
424
|
+
|
|
425
|
+
`callAgent()` की तरह, CLI डिफ़ॉल्ट रूप से async + poll (`invokeAgent` → अंदरूनी रूप से `callAgent`) का उपयोग करती है, जो hosted/serverless targets के विरुद्ध सुरक्षित विकल्प है — ऊपर [Serverless webhook and gateway timeouts](#json-rpc-methods) देखें। `--sync` का उपयोग तभी करें जब आप जानते हों कि लक्ष्य किसी छोटी execution limit वाले gateway के पीछे नहीं है।
|
|
426
|
+
|
|
427
|
+
लक्ष्य वैसे ही resolve होता है जैसे `agentNative.invoke()` में होता है: workspace app id से, app name से, या पूरे URL से — इसलिए यही कमांड एक multi-app workspace में किसी sibling app के विरुद्ध या कहीं और किसी मनमाने A2A peer के विरुद्ध भी काम करता है।
|
|
428
|
+
|
|
387
429
|
## कार्य जीवनचक्र {#task-lifecycle}
|
|
388
430
|
|
|
389
431
|
प्रत्येक संदेश एक कार्य बनाता है जो इन स्थितियों से होकर गुजरता है:
|
|
@@ -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` は、`agentNative.invoke()` と同じ解決・呼び出しプリミティブを薄くラップした CLI です。シェル スクリプト、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
|
+
# デフォルトの async+poll の代わりに、ブロッキングの message/send を1回だけ強制する
|
|
404
|
+
agent-native invoke analytics "Quick lookup" --sync
|
|
405
|
+
|
|
406
|
+
# スクリプト用の機械可読な出力
|
|
407
|
+
agent-native invoke analytics "Summarize signups" --json
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
| Option | Description |
|
|
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` | デフォルトの async+poll の代わりに、ブロッキングの `message/send` を1回だけ使用する |
|
|
422
|
+
| `--no-hint` | クロスアプリ呼び出しのヒントを付けずに、プロンプトをそのまま送信する |
|
|
423
|
+
| `--json` | ターゲットのメタデータと応答テキストを JSON として出力する |
|
|
424
|
+
|
|
425
|
+
`callAgent()` と同様に、この CLI もデフォルトで async + poll を使用します(内部的には `invokeAgent` → `callAgent`)。これはホスト型/サーバーレスのターゲットに対して安全な選択です。上記の [サーバーレスの Webhook とゲートウェイのタイムアウト](#json-rpc-methods) を参照してください。ターゲットが短い実行時間制限のあるゲートウェイの背後にないとわかっている場合にのみ `--sync` を渡してください。
|
|
426
|
+
|
|
427
|
+
ターゲットは `agentNative.invoke()` と同じ方法で解決されます: ワークスペースのアプリ id、アプリ名、または完全な URL のいずれかです。そのため、同じコマンドがマルチアプリ ワークスペース内の兄弟アプリに対しても、どこか別の場所にある任意の A2A ピアに対しても機能します。
|
|
428
|
+
|
|
387
429
|
## タスクのライフサイクル {#task-lifecycle}
|
|
388
430
|
|
|
389
431
|
各メッセージは、次の状態を通過するタスクを作成します。
|
|
@@ -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`는 `agentNative.invoke()`와 동일한 확인 후 호출(resolve-and-call) 기본 로직을 감싼 얇은 CLI 래퍼입니다. 셸 스크립트, 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
|
+
# 기본값인 async+poll 대신 블로킹 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` | 기본값인 async+poll 대신 블로킹 `message/send` 요청 하나를 사용합니다 |
|
|
422
|
+
| `--no-hint` | 크로스 앱 호출 힌트 없이 프롬프트를 그대로 전송합니다 |
|
|
423
|
+
| `--json` | 대상 메타데이터와 응답 텍스트를 JSON으로 출력합니다 |
|
|
424
|
+
|
|
425
|
+
`callAgent()`와 마찬가지로 CLI는 기본적으로 async + poll을 사용하며(내부적으로 `invokeAgent` → `callAgent`), 이는 호스팅/서버리스 대상에 대한 안전한 선택입니다 — 위의 [서버리스 웹훅 및 게이트웨이 타임아웃](#json-rpc-methods)을 참조하세요. 대상이 짧은 실행 제한이 있는 게이트웨이 뒤에 있지 않다는 것을 알 때만 `--sync`를 전달하세요.
|
|
426
|
+
|
|
427
|
+
대상은 `agentNative.invoke()`와 동일한 방식으로 확인됩니다. 작업공간 앱 id, 앱 이름, 또는 전체 URL로 확인되므로 동일한 명령이 멀티 앱 작업공간의 형제 앱이나 다른 곳의 임의의 A2A 피어 모두에 대해 작동합니다.
|
|
428
|
+
|
|
387
429
|
## 작업 수명 주기 {#task-lifecycle}
|
|
388
430
|
|
|
389
431
|
각 메시지는 다음 상태를 거쳐 이동하는 작업을 생성합니다.
|
|
@@ -386,6 +386,48 @@ ambiente do aplicativo e passe a identidade do chamador (`userEmail`) para que a
|
|
|
386
386
|
assinado como tokens ao portador JWT. Use `apiKeyEnv` apenas para pares externos legados que
|
|
387
387
|
espera um token de portador estático. Use actions local em vez de invocar você mesmo.
|
|
388
388
|
|
|
389
|
+
## CLI: agent-native invoke {#cli-invoke}
|
|
390
|
+
|
|
391
|
+
`agent-native invoke` é um wrapper de CLI simples sobre a mesma primitiva de resolver-e-chamar usada por `agentNative.invoke()`. Use-o para acionar o agente de um aplicativo a partir de um script de shell, um job de CI, uma entrada de cron ou qualquer sistema externo que possa executar comandos de shell — o equivalente em CLI de postar manualmente em `/_agent-native/a2a`.
|
|
392
|
+
|
|
393
|
+
```bash
|
|
394
|
+
agent-native invoke <app-or-url> "prompt" [options]
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
```bash
|
|
398
|
+
# Resolve "analytics" no registro do espaço de trabalho e aguarda a resposta
|
|
399
|
+
agent-native invoke analytics "Summarize signups by source this month"
|
|
400
|
+
|
|
401
|
+
# Chama um aplicativo implantado diretamente por URL, lendo o token de portador a partir de uma variável de ambiente
|
|
402
|
+
agent-native invoke https://analytics.example.com "How many signups last week?" \
|
|
403
|
+
--api-key-env ANALYTICS_A2A_KEY
|
|
404
|
+
|
|
405
|
+
# Força uma única mensagem/envio bloqueante em vez do padrão assíncrono+polling
|
|
406
|
+
agent-native invoke analytics "Quick lookup" --sync
|
|
407
|
+
|
|
408
|
+
# Saída legível por máquina para uso em scripts
|
|
409
|
+
agent-native invoke analytics "Summarize signups" --json
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
| Option | Description |
|
|
413
|
+
| ------------------------- | -------------------------------------------------------------------------------------- |
|
|
414
|
+
| `--agent <id\|name\|url>` | Agente de destino (alias para o argumento posicional `<app-or-url>`) |
|
|
415
|
+
| `--message <text>` | Prompt (alias para o argumento posicional `"prompt"`) |
|
|
416
|
+
| `--api-key-env <name>` | Lê o token de portador a partir de uma variável de ambiente |
|
|
417
|
+
| `--api-key <token>` | Valor do token de portador, passado diretamente |
|
|
418
|
+
| `--context-id <id>` | `contextId` do A2A, para continuar a conversa de uma tarefa existente |
|
|
419
|
+
| `--self-app-id <id>` | ID do aplicativo atual, usado para evitar autochamadas |
|
|
420
|
+
| `--self-url <url>` | URL do aplicativo atual, usada para evitar autochamadas |
|
|
421
|
+
| `--timeout-ms <n>` | Tempo limite do polling assíncrono |
|
|
422
|
+
| `--poll-interval-ms <n>` | Intervalo do polling assíncrono |
|
|
423
|
+
| `--sync` | Usa uma única requisição `message/send` bloqueante em vez do padrão assíncrono+polling |
|
|
424
|
+
| `--no-hint` | Envia o prompt como está, sem a dica de invocação entre aplicativos |
|
|
425
|
+
| `--json` | Imprime os metadados do destino e o texto da resposta como JSON |
|
|
426
|
+
|
|
427
|
+
Assim como `callAgent()`, a CLI usa por padrão o modo assíncrono + polling (`invokeAgent` → `callAgent` internamente), que é a escolha segura contra destinos hospedados/serverless — veja [Tempos limite de webhook e gateway serverless](#json-rpc-methods) acima. Passe `--sync` somente quando você souber que o destino não está atrás de um gateway com um limite de execução curto.
|
|
428
|
+
|
|
429
|
+
O destino é resolvido da mesma forma que em `agentNative.invoke()`: pelo ID do aplicativo no espaço de trabalho, pelo nome do aplicativo ou por uma URL completa — assim, o mesmo comando funciona tanto contra um aplicativo irmão em um espaço de trabalho com múltiplos aplicativos quanto contra um par A2A arbitrário em outro lugar.
|
|
430
|
+
|
|
389
431
|
## Ciclo de vida da tarefa {#task-lifecycle}
|
|
390
432
|
|
|
391
433
|
Cada mensagem cria uma tarefa que passa por estes estados:
|
|
@@ -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` 是对与 `agentNative.invoke()` 相同的解析并调用原语的一层轻量 CLI 包装。用它可以从 shell 脚本、CI 任务、cron 条目或任何能够执行 shell 命令的外部系统触发某个应用的代理——相当于手动向 `/_agent-native/a2a` 发送 POST 请求的命令行等价形式。
|
|
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 直接调用一个已部署的应用,从环境变量中读取 bearer token
|
|
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
|
+
| Option | Description |
|
|
411
|
+
| ------------------------- | ----------------------------------------------------------- |
|
|
412
|
+
| `--agent <id\|name\|url>` | 目标代理(是位置参数 `<app-or-url>` 的别名) |
|
|
413
|
+
| `--message <text>` | 提示词(是位置参数 `"prompt"` 的别名) |
|
|
414
|
+
| `--api-key-env <name>` | 从环境变量中读取 bearer token |
|
|
415
|
+
| `--api-key <token>` | 直接内联传入的 bearer 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
|
每条消息都会创建一个在以下状态之间移动的任务:
|
|
@@ -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/corpus/core/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": {
|