@agent-native/core 0.160.1 → 0.161.0
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/templates/analytics/actions/bigquery.ts +57 -0
- package/corpus/templates/analytics/actions/restore-analysis-revision.ts +5 -2
- package/corpus/templates/analytics/actions/restore-dashboard-revision.ts +5 -2
- package/corpus/templates/analytics/app/components/analysis/AnalysisHistoryPanel.tsx +14 -3
- package/corpus/templates/analytics/app/components/dashboard/DashboardHistoryPanel.tsx +14 -3
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +3 -0
- package/corpus/templates/analytics/app/hooks/use-analysis-revisions.ts +1 -0
- package/corpus/templates/analytics/app/hooks/use-dashboard-revisions.ts +16 -1
- package/corpus/templates/analytics/app/lib/use-auto-focus-select.ts +19 -0
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/PanelEditorDialog.tsx +0 -1
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/dashboard-sync.ts +14 -0
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +19 -0
- package/corpus/templates/analytics/changelog/2026-08-17-fixed-dashboard-editing-focus-history-recovery-panel-setup-f.md +6 -0
- package/corpus/templates/calendar/actions/create-event.ts +7 -3
- package/corpus/templates/calendar/actions/manage-event-draft.ts +8 -0
- package/corpus/templates/calendar/app/components/calendar/CreateEventDialog.tsx +64 -0
- package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +5 -1
- package/corpus/templates/calendar/app/hooks/use-events.ts +1 -0
- package/corpus/templates/calendar/changelog/2026-08-17-booking-links-now-respect-each-required-host-s-saved-availab.md +6 -0
- package/corpus/templates/calendar/server/lib/booking-host-availability.ts +76 -0
- package/corpus/templates/calendar/server/lib/google-calendar.ts +2 -0
- package/corpus/templates/calendar/shared/api.ts +1 -1
- package/corpus/templates/clips/app/components/player/signed-out-share-actions.tsx +47 -0
- package/corpus/templates/clips/app/components/player/transcript-panel.tsx +3 -1
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +27 -19
- package/corpus/templates/clips/changelog/2026-08-17-shared-clips-sign-in-comment-no-audio.md +6 -0
- package/corpus/templates/clips/server/routes/api/public-recording.get.ts +6 -5
- package/corpus/templates/content/.agents/skills/document-editing/references/databases.md +13 -0
- package/corpus/templates/content/AGENTS.md +2 -0
- package/corpus/templates/content/actions/_blocks-field-identity.ts +17 -0
- package/corpus/templates/content/actions/_database-block-actions.ts +958 -0
- package/corpus/templates/content/actions/_database-row-mutation.ts +7 -7
- package/corpus/templates/content/actions/list-content-database-blocks.ts +31 -0
- package/corpus/templates/content/actions/mutate-content-database-block.ts +49 -0
- package/corpus/templates/content/changelog/2026-08-10-agents-can-safely-insert-update-upsert-delete-and-reorder-on.md +6 -0
- package/corpus/templates/content/docs/product/capabilities/content.object.block.md +6 -2
- package/corpus/templates/content/docs/product/capabilities/content.object.blocks-field.md +2 -1
- package/corpus/templates/content/parity/matrix.md +30 -30
- package/corpus/templates/content/parity/matrix.ts +4 -1
- package/corpus/templates/content/shared/blocks-field-identity.ts +114 -37
- package/corpus/templates/content/shared/database-block-actions.ts +82 -0
- package/corpus/templates/content/shared/database-block-mutations.ts +366 -0
- package/corpus/templates/content/shared/nfm.ts +3 -2
- package/corpus/templates/mail/.agents/skills/email-drafts/SKILL.md +24 -0
- package/corpus/templates/mail/actions/get-mail-settings.ts +1 -1
- package/corpus/templates/mail/actions/update-mail-settings.ts +7 -3
- package/corpus/templates/mail/app/i18n/en-US.ts +3 -1
- package/corpus/templates/mail/app/pages/SettingsPage.tsx +63 -0
- package/corpus/templates/mail/changelog/2026-08-17-gmail-signatures-now-preserve-images-and-support-paste-or-up.md +6 -0
- package/corpus/templates/mail/changelog/2026-08-17-mail-now-updates-durable-drafting-preferences-without-openin.md +6 -0
- package/corpus/templates/mail/server/plugins/agent-chat.ts +19 -0
- package/corpus/templates/mail/shared/gmail-signature.ts +14 -2
- package/corpus/templates/mail/shared/signature.ts +1 -10
- package/corpus/templates/slides/actions/generate-slides-ai.ts +2 -0
- package/corpus/templates/slides/actions/patch-deck.ts +1 -1
- package/corpus/templates/slides/app/components/ThemeToggle.tsx +1 -0
- package/corpus/templates/slides/app/components/editor/SlideThumbnailContextMenu.tsx +59 -0
- package/corpus/templates/slides/app/global.css +1 -0
- package/corpus/templates/slides/app/lib/normalize-slide-padding.ts +40 -11
- package/corpus/templates/slides/changelog/2026-08-17-stable-layout-and-slide-editing.md +6 -0
- package/corpus/templates/slides/shared/deck-title.ts +12 -4
- package/dist/agent/production-agent.js +17 -4
- package/dist/agent/tool-approval-migrations.d.ts +1 -0
- package/dist/agent/tool-approval-migrations.js +10 -0
- package/dist/agent/tool-approval-store.d.ts +12 -0
- package/dist/agent/tool-approval-store.js +46 -1
- package/dist/agent/types.d.ts +3 -1
- package/dist/client/AssistantChat.js +3 -1
- package/dist/localization/core-messages/ar-SA.js +1 -0
- package/dist/localization/core-messages/de-DE.js +1 -0
- package/dist/localization/core-messages/en-US.d.ts +1 -0
- package/dist/localization/core-messages/en-US.js +1 -0
- package/dist/localization/core-messages/es-ES.js +1 -0
- package/dist/localization/core-messages/fr-FR.js +1 -0
- package/dist/localization/core-messages/hi-IN.js +1 -0
- package/dist/localization/core-messages/ja-JP.js +1 -0
- package/dist/localization/core-messages/ko-KR.js +1 -0
- package/dist/localization/core-messages/pt-BR.js +1 -0
- package/dist/localization/core-messages/zh-CN.js +1 -0
- package/dist/localization/core-messages/zh-TW.js +1 -0
- package/dist/localization/core-messages.d.ts +1 -0
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/scripts/resources/read.js +4 -4
- package/dist/scripts/resources/save-memory.js +15 -2
- package/dist/scripts/resources/write.js +3 -3
- package/dist/server/agent-chat/script-entries.d.ts +1 -0
- package/dist/server/agent-chat/script-entries.js +8 -0
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/docs/content/onboarding.mdx +13 -2
- package/package.json +3 -3
|
@@ -4094,7 +4094,9 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
4094
4094
|
!authError &&
|
|
4095
4095
|
showEmptyState &&
|
|
4096
4096
|
!isRestoring;
|
|
4097
|
-
const threadRestoreErrorSurface = threadRestoreError ? (_jsxs("div", { role: "alert", className: "flex max-w-[320px] flex-col items-center gap-3 rounded-lg border border-border bg-muted/30 px-4 py-3 text-center", children: [_jsx(IconRefresh, { className: "h-5 w-5 text-muted-foreground" }), _jsx("p", { className: "text-sm text-muted-foreground", children:
|
|
4097
|
+
const threadRestoreErrorSurface = threadRestoreError ? (_jsxs("div", { role: "alert", className: "flex max-w-[320px] flex-col items-center gap-3 rounded-lg border border-border bg-muted/30 px-4 py-3 text-center", children: [_jsx(IconRefresh, { className: "h-5 w-5 text-muted-foreground" }), _jsx("p", { className: "text-sm text-muted-foreground", children: threadRestoreError === "not-found"
|
|
4098
|
+
? t("agentChat.message.threadNotFound")
|
|
4099
|
+
: t("agentChat.message.restoreRequestFailed") }), _jsx("button", { type: "button", onClick: retryThreadRestore, className: "rounded-md border border-border px-3 py-1.5 text-xs font-medium text-foreground hover:bg-accent", children: t("agentChat.common.retry") })] })) : null;
|
|
4098
4100
|
// Clarifying-question surface: the `ask-question` action writes a
|
|
4099
4101
|
// GuidedQuestionPayload to application_state under "guided-questions". The
|
|
4100
4102
|
// hook polls that key, and on submit/skip composes the answer as a normal
|
|
@@ -324,6 +324,7 @@ const messages = {
|
|
|
324
324
|
"message.restoreFailed": "فشلت الاستعادة ({{status}}).",
|
|
325
325
|
"message.restoreQuestion": "هل تريد الاستعادة إلى هنا؟",
|
|
326
326
|
"message.restoreRequestFailed": "فشل طلب الاستعادة.",
|
|
327
|
+
"message.threadNotFound": "لم تعد سلسلة الدردشة هذه متاحة. ابدأ دردشة جديدة أو أعد المحاولة إذا كان ذلك غير متوقع.",
|
|
327
328
|
"message.restoring": "جارٍ الاستعادة...",
|
|
328
329
|
"message.revertHere": "الرجوع إلى هنا",
|
|
329
330
|
"message.sentAt": "أُرسلت في {{time}}",
|
|
@@ -94,6 +94,7 @@ const messages = {
|
|
|
94
94
|
"message.restoreFailed": "Wiederherstellung fehlgeschlagen ({{status}}).",
|
|
95
95
|
"message.restoreQuestion": "Bis hierher wiederherstellen?",
|
|
96
96
|
"message.restoreRequestFailed": "Wiederherstellungsanfrage fehlgeschlagen.",
|
|
97
|
+
"message.threadNotFound": "Dieser Chat-Thread ist nicht mehr verfügbar. Starte einen neuen Chat oder versuche es erneut, falls das unerwartet war.",
|
|
97
98
|
"message.restoring": "Wird wiederhergestellt...",
|
|
98
99
|
"message.revertHere": "Bis hierher zurücksetzen",
|
|
99
100
|
"message.sentAt": "Gesendet {{time}}",
|
|
@@ -312,6 +312,7 @@ declare const messages: {
|
|
|
312
312
|
readonly "message.restoreFailed": "Restore failed ({{status}}).";
|
|
313
313
|
readonly "message.restoreQuestion": "Restore to here?";
|
|
314
314
|
readonly "message.restoreRequestFailed": "Restore request failed.";
|
|
315
|
+
readonly "message.threadNotFound": "This chat thread is no longer available. Start a new chat or retry if this was unexpected.";
|
|
315
316
|
readonly "message.restoring": "Restoring...";
|
|
316
317
|
readonly "message.revertHere": "Revert to here";
|
|
317
318
|
readonly "message.sentAt": "Sent {{time}}";
|
|
@@ -312,6 +312,7 @@ const messages = {
|
|
|
312
312
|
"message.restoreFailed": "Restore failed ({{status}}).",
|
|
313
313
|
"message.restoreQuestion": "Restore to here?",
|
|
314
314
|
"message.restoreRequestFailed": "Restore request failed.",
|
|
315
|
+
"message.threadNotFound": "This chat thread is no longer available. Start a new chat or retry if this was unexpected.",
|
|
315
316
|
"message.restoring": "Restoring...",
|
|
316
317
|
"message.revertHere": "Revert to here",
|
|
317
318
|
"message.sentAt": "Sent {{time}}",
|
|
@@ -94,6 +94,7 @@ const messages = {
|
|
|
94
94
|
"message.restoreFailed": "Error al restaurar ({{status}}).",
|
|
95
95
|
"message.restoreQuestion": "¿Restaurar hasta aquí?",
|
|
96
96
|
"message.restoreRequestFailed": "Error en la solicitud de restauración.",
|
|
97
|
+
"message.threadNotFound": "Este hilo de chat ya no está disponible. Inicia un chat nuevo o inténtalo de nuevo si esto no era esperado.",
|
|
97
98
|
"message.restoring": "Restaurando...",
|
|
98
99
|
"message.revertHere": "Revertir hasta aquí",
|
|
99
100
|
"message.sentAt": "Enviado a las {{time}}",
|
|
@@ -94,6 +94,7 @@ const messages = {
|
|
|
94
94
|
"message.restoreFailed": "Échec de la restauration ({{status}}).",
|
|
95
95
|
"message.restoreQuestion": "Restaurer jusqu’ici ?",
|
|
96
96
|
"message.restoreRequestFailed": "Échec de la demande de restauration.",
|
|
97
|
+
"message.threadNotFound": "Ce fil de discussion n’est plus disponible. Démarrez une nouvelle discussion ou réessayez si cela est inattendu.",
|
|
97
98
|
"message.restoring": "Restauration...",
|
|
98
99
|
"message.revertHere": "Revenir jusqu’ici",
|
|
99
100
|
"message.sentAt": "Envoyé à {{time}}",
|
|
@@ -312,6 +312,7 @@ const messages = {
|
|
|
312
312
|
"message.restoreFailed": "पुनर्स्थापना विफल रही ({{status}})।",
|
|
313
313
|
"message.restoreQuestion": "यहाँ तक पुनर्स्थापित करें?",
|
|
314
314
|
"message.restoreRequestFailed": "पुनर्स्थापना अनुरोध विफल रहा।",
|
|
315
|
+
"message.threadNotFound": "यह चैट थ्रेड अब उपलब्ध नहीं है। नई चैट शुरू करें या यदि यह अप्रत्याशित है तो फिर कोशिश करें।",
|
|
315
316
|
"message.restoring": "पुनर्स्थापित किया जा रहा है...",
|
|
316
317
|
"message.revertHere": "यहाँ तक वापस जाएँ",
|
|
317
318
|
"message.sentAt": "{{time}} पर भेजा गया",
|
|
@@ -309,6 +309,7 @@ const messages = {
|
|
|
309
309
|
"message.restoreFailed": "復元に失敗しました({{status}})。",
|
|
310
310
|
"message.restoreQuestion": "ここまで復元しますか?",
|
|
311
311
|
"message.restoreRequestFailed": "復元リクエストに失敗しました。",
|
|
312
|
+
"message.threadNotFound": "このチャットスレッドは利用できなくなりました。新しいチャットを開始するか、想定外の場合は再試行してください。",
|
|
312
313
|
"message.restoring": "復元中...",
|
|
313
314
|
"message.revertHere": "ここまで戻す",
|
|
314
315
|
"message.sentAt": "{{time}} に送信",
|
|
@@ -309,6 +309,7 @@ const messages = {
|
|
|
309
309
|
"message.restoreFailed": "복원 실패({{status}}).",
|
|
310
310
|
"message.restoreQuestion": "여기로 복원하시겠습니까?",
|
|
311
311
|
"message.restoreRequestFailed": "복원 요청에 실패했습니다.",
|
|
312
|
+
"message.threadNotFound": "이 채팅 스레드는 더 이상 사용할 수 없습니다. 새 채팅을 시작하거나 예상치 못한 문제라면 다시 시도하세요.",
|
|
312
313
|
"message.restoring": "복원 중...",
|
|
313
314
|
"message.revertHere": "여기로 되돌리기",
|
|
314
315
|
"message.sentAt": "{{time}}에 전송",
|
|
@@ -94,6 +94,7 @@ const messages = {
|
|
|
94
94
|
"message.restoreFailed": "Falha ao restaurar ({{status}}).",
|
|
95
95
|
"message.restoreQuestion": "Restaurar até aqui?",
|
|
96
96
|
"message.restoreRequestFailed": "Falha na solicitação de restauração.",
|
|
97
|
+
"message.threadNotFound": "Esta conversa não está mais disponível. Inicie uma nova conversa ou tente novamente se isso for inesperado.",
|
|
97
98
|
"message.restoring": "Restaurando...",
|
|
98
99
|
"message.revertHere": "Reverter até aqui",
|
|
99
100
|
"message.sentAt": "Enviado às {{time}}",
|
|
@@ -309,6 +309,7 @@ const messages = {
|
|
|
309
309
|
"message.restoreFailed": "恢复失败({{status}})。",
|
|
310
310
|
"message.restoreQuestion": "恢复到此处?",
|
|
311
311
|
"message.restoreRequestFailed": "恢复请求失败。",
|
|
312
|
+
"message.threadNotFound": "此聊天线程已不可用。请开始新聊天;如果这是意外情况,也可以重试。",
|
|
312
313
|
"message.restoring": "正在恢复...",
|
|
313
314
|
"message.revertHere": "还原到此处",
|
|
314
315
|
"message.sentAt": "发送于 {{time}}",
|
|
@@ -309,6 +309,7 @@ const messages = {
|
|
|
309
309
|
"message.restoreFailed": "還原失敗({{status}})。",
|
|
310
310
|
"message.restoreQuestion": "要還原到這裡嗎?",
|
|
311
311
|
"message.restoreRequestFailed": "還原要求失敗。",
|
|
312
|
+
"message.threadNotFound": "此聊天串已無法使用。請開始新的聊天;如果這是意外情況,也可以重試。",
|
|
312
313
|
"message.restoring": "正在還原...",
|
|
313
314
|
"message.revertHere": "還原到這裡",
|
|
314
315
|
"message.sentAt": "傳送於 {{time}}",
|
|
@@ -314,6 +314,7 @@ export declare const englishAgentChatMessages: {
|
|
|
314
314
|
readonly "message.restoreFailed": "Restore failed ({{status}}).";
|
|
315
315
|
readonly "message.restoreQuestion": "Restore to here?";
|
|
316
316
|
readonly "message.restoreRequestFailed": "Restore request failed.";
|
|
317
|
+
readonly "message.threadNotFound": "This chat thread is no longer available. Start a new chat or retry if this was unexpected.";
|
|
317
318
|
readonly "message.restoring": "Restoring...";
|
|
318
319
|
readonly "message.revertHere": "Revert to here";
|
|
319
320
|
readonly "message.sentAt": "Sent {{time}}";
|
|
@@ -48,8 +48,8 @@ export declare function handleUpdateResource(event: any): Promise<import("./stor
|
|
|
48
48
|
}>;
|
|
49
49
|
/** DELETE /_agent-native/resources/:id — delete a resource */
|
|
50
50
|
export declare function handleDeleteResource(event: any): Promise<{
|
|
51
|
-
error: string;
|
|
52
51
|
ok?: undefined;
|
|
52
|
+
error: string;
|
|
53
53
|
} | {
|
|
54
54
|
error?: undefined;
|
|
55
55
|
ok: boolean;
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* Usage:
|
|
7
7
|
* pnpm action resource-read --path <path> [--scope personal|shared|workspace]
|
|
8
8
|
*/
|
|
9
|
-
import { resourceGetByPath, ensurePersonalDefaults,
|
|
10
|
-
import { getAmbientUserEmail, getRequestUserEmail, } from "../../server/request-context.js";
|
|
9
|
+
import { resourceGetByPath, ensurePersonalDefaults, sharedResourceOwner, WORKSPACE_OWNER, } from "../../resources/store.js";
|
|
10
|
+
import { getAmbientUserEmail, getRequestOrgId, getRequestUserEmail, } from "../../server/request-context.js";
|
|
11
11
|
import { parseArgs, fail } from "../utils.js";
|
|
12
12
|
export default async function resourceReadScript(args) {
|
|
13
13
|
const parsed = parseArgs(args);
|
|
@@ -44,7 +44,7 @@ Options:
|
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
46
|
if (scope === "shared") {
|
|
47
|
-
const resource = await resourceGetByPath(
|
|
47
|
+
const resource = await resourceGetByPath(sharedResourceOwner(getRequestOrgId()), resourcePath);
|
|
48
48
|
if (!resource) {
|
|
49
49
|
console.log(`Resource not found: ${resourcePath} (scope: shared). You can create it with resource-write.`);
|
|
50
50
|
return;
|
|
@@ -63,7 +63,7 @@ Options:
|
|
|
63
63
|
console.log(`Resource not found: ${resourcePath} (scope: personal). You can create it with resource-write.`);
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
|
-
const shared = await resourceGetByPath(
|
|
66
|
+
const shared = await resourceGetByPath(sharedResourceOwner(getRequestOrgId()), resourcePath);
|
|
67
67
|
if (shared) {
|
|
68
68
|
process.stdout.write(shared.content);
|
|
69
69
|
return;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* and maintains a `memory/MEMORY.md` index.
|
|
7
7
|
*/
|
|
8
8
|
import { resourcePut, resourceGetByPath } from "../../resources/store.js";
|
|
9
|
-
import { getAmbientUserEmail, getRequestUserEmail, } from "../../server/request-context.js";
|
|
9
|
+
import { getAmbientUserEmail, getRequestRunContext, getRequestUserEmail, } from "../../server/request-context.js";
|
|
10
10
|
import { parseArgs, fail } from "../utils.js";
|
|
11
11
|
const VALID_TYPES = ["user", "feedback", "project", "reference"];
|
|
12
12
|
const EMPTY_INDEX = `# Memory Index
|
|
@@ -26,7 +26,9 @@ export default async function saveMemoryScript(args) {
|
|
|
26
26
|
const content = parsed.content;
|
|
27
27
|
if (!content)
|
|
28
28
|
fail("--content is required");
|
|
29
|
-
const owner =
|
|
29
|
+
const owner = getRequestRunContext()?.owner ??
|
|
30
|
+
getRequestUserEmail() ??
|
|
31
|
+
getAmbientUserEmail();
|
|
30
32
|
if (!owner) {
|
|
31
33
|
fail("save-memory requires an authenticated user (request context or AGENT_USER_EMAIL env var).");
|
|
32
34
|
}
|
|
@@ -76,5 +78,16 @@ ${content}`;
|
|
|
76
78
|
console.log(`Warning: Memory index has ${lineCount} lines (recommended: <200). Consider consolidating or removing old memories.`);
|
|
77
79
|
}
|
|
78
80
|
await resourcePut(owner, indexPath, updatedIndex, "text/markdown");
|
|
81
|
+
// Do not report success until both writes are visible through the resource
|
|
82
|
+
// read path. This catches storage or ownership mismatches that would
|
|
83
|
+
// otherwise leave the caller believing a memory was saved.
|
|
84
|
+
const persistedMemory = await resourceGetByPath(owner, memoryPath);
|
|
85
|
+
if (persistedMemory?.content !== fileContent) {
|
|
86
|
+
fail(`save-memory could not verify persisted memory "${name}".`);
|
|
87
|
+
}
|
|
88
|
+
const persistedIndex = await resourceGetByPath(owner, indexPath);
|
|
89
|
+
if (persistedIndex?.content !== updatedIndex) {
|
|
90
|
+
fail("save-memory could not verify persisted memory index.");
|
|
91
|
+
}
|
|
79
92
|
console.log(`Saved memory "${name}" (${type}): ${description}`);
|
|
80
93
|
}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* Usage:
|
|
7
7
|
* pnpm action resource-write --path <path> --content <content> [--scope personal|shared] [--mime <mime-type>] [--visibility workspace|agent_scratch]
|
|
8
8
|
*/
|
|
9
|
-
import { canWriteLocalWorkspaceResourcePath, resourcePut,
|
|
10
|
-
import { getAmbientUserEmail, getRequestUserEmail, } from "../../server/request-context.js";
|
|
9
|
+
import { canWriteLocalWorkspaceResourcePath, resourcePut, sharedResourceOwner, WORKSPACE_OWNER, } from "../../resources/store.js";
|
|
10
|
+
import { getAmbientUserEmail, getRequestOrgId, getRequestUserEmail, } from "../../server/request-context.js";
|
|
11
11
|
import { parseArgs, fail } from "../utils.js";
|
|
12
12
|
const EXTENSION_MIME_MAP = {
|
|
13
13
|
".md": "text/markdown",
|
|
@@ -101,7 +101,7 @@ Options:
|
|
|
101
101
|
const expiresAt = parseOptionalNumber(parsed["expires-at"] ?? parsed.expiresAt, "--expires-at");
|
|
102
102
|
let owner;
|
|
103
103
|
if (scope === "shared") {
|
|
104
|
-
owner =
|
|
104
|
+
owner = sharedResourceOwner(getRequestOrgId());
|
|
105
105
|
}
|
|
106
106
|
else if (scope === "workspace") {
|
|
107
107
|
owner = WORKSPACE_OWNER;
|
|
@@ -23,6 +23,7 @@ export declare function createDocsScriptEntries(): Promise<Record<string, Action
|
|
|
23
23
|
* Creates resource ScriptEntries available in both prod and dev modes.
|
|
24
24
|
*/
|
|
25
25
|
export declare function shouldDefaultResourceWriteToWorkspace(path: string): boolean;
|
|
26
|
+
export declare function shouldDefaultResourceWriteToShared(path: string): boolean;
|
|
26
27
|
export declare function createResourceScriptEntries(): Promise<Record<string, ActionEntry>>;
|
|
27
28
|
/**
|
|
28
29
|
* Creates a unified chat-history ActionEntry that dispatches to search, open,
|
|
@@ -287,6 +287,9 @@ export function shouldDefaultResourceWriteToWorkspace(path) {
|
|
|
287
287
|
normalized.startsWith("agents/") ||
|
|
288
288
|
normalized.startsWith("remote-agents/"));
|
|
289
289
|
}
|
|
290
|
+
export function shouldDefaultResourceWriteToShared(path) {
|
|
291
|
+
return path.replace(/^\/+/, "") === "LEARNINGS.md";
|
|
292
|
+
}
|
|
290
293
|
export async function createResourceScriptEntries() {
|
|
291
294
|
try {
|
|
292
295
|
const [list, read, effective, write, del, saveMem, delMem, store] = await Promise.all([
|
|
@@ -407,6 +410,11 @@ export async function createResourceScriptEntries() {
|
|
|
407
410
|
rest.content === null)
|
|
408
411
|
return "Error: path and content are required for write";
|
|
409
412
|
rest.createdBy = "agent";
|
|
413
|
+
rest.scope =
|
|
414
|
+
rest.scope ??
|
|
415
|
+
(shouldDefaultResourceWriteToShared(String(rest.path))
|
|
416
|
+
? "shared"
|
|
417
|
+
: undefined);
|
|
410
418
|
rest.visibility =
|
|
411
419
|
rest.visibility ??
|
|
412
420
|
(shouldDefaultResourceWriteToWorkspace(String(rest.path))
|
|
@@ -26,8 +26,8 @@ export declare function createRealtimeTokenHandler(): import("h3").EventHandlerW
|
|
|
26
26
|
expiresAt?: undefined;
|
|
27
27
|
ttlSeconds?: undefined;
|
|
28
28
|
} | {
|
|
29
|
+
error?: undefined;
|
|
29
30
|
token: string;
|
|
30
31
|
expiresAt: string;
|
|
31
32
|
ttlSeconds: number;
|
|
32
|
-
error?: undefined;
|
|
33
33
|
}>>;
|
|
@@ -212,6 +212,10 @@ You can check connection readiness in your `isComplete` callback using the conne
|
|
|
212
212
|
|
|
213
213
|
```ts filename="server/plugins/my-onboarding.ts"
|
|
214
214
|
import { listWorkspaceConnectionProviderCatalogForApp } from "@agent-native/core/workspace-connections";
|
|
215
|
+
import {
|
|
216
|
+
getRequestOrgId,
|
|
217
|
+
getRequestUserEmail,
|
|
218
|
+
} from "@agent-native/core/server";
|
|
215
219
|
|
|
216
220
|
// Inside registerOnboardingStep:
|
|
217
221
|
isComplete: async () => {
|
|
@@ -230,8 +234,15 @@ isComplete: async () => {
|
|
|
230
234
|
return true;
|
|
231
235
|
}
|
|
232
236
|
|
|
233
|
-
//
|
|
234
|
-
|
|
237
|
+
// If there is no reusable connection, check the caller-scoped credential
|
|
238
|
+
// store - never a deployment environment variable.
|
|
239
|
+
const { resolveCredential } = await import("@agent-native/core/credentials");
|
|
240
|
+
return Boolean(
|
|
241
|
+
await resolveCredential("GMAIL_REFRESH_TOKEN", {
|
|
242
|
+
userEmail: getRequestUserEmail(),
|
|
243
|
+
orgId: getRequestOrgId(),
|
|
244
|
+
}),
|
|
245
|
+
);
|
|
235
246
|
};
|
|
236
247
|
```
|
|
237
248
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.161.0",
|
|
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": {
|
|
@@ -427,8 +427,8 @@
|
|
|
427
427
|
"y-protocols": "^1.0.7",
|
|
428
428
|
"yjs": "^13.6.31",
|
|
429
429
|
"zod": "^4.3.6",
|
|
430
|
-
"@agent-native/
|
|
431
|
-
"@agent-native/
|
|
430
|
+
"@agent-native/recap-cli": "0.5.4",
|
|
431
|
+
"@agent-native/toolkit": "^0.16.4"
|
|
432
432
|
},
|
|
433
433
|
"devDependencies": {
|
|
434
434
|
"@ai-sdk/anthropic": "^3.0.71",
|