@agent-native/core 0.119.6 → 0.120.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 +19 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/cli/index.ts +64 -3
- package/corpus/core/src/client/MultiTabAssistantChat.tsx +45 -0
- package/corpus/core/src/client/use-chat-models.ts +45 -0
- package/corpus/core/src/server/analytics.ts +15 -0
- package/corpus/core/src/server/auth.ts +17 -13
- package/corpus/core/src/server/better-auth-instance.ts +13 -1
- package/corpus/core/src/templates/default/package.json +1 -1
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +1 -1
- package/corpus/templates/assets/changelog/2026-07-23-new-chat-aligns-with-sidebar-controls.md +6 -0
- package/corpus/templates/assets/package.json +1 -1
- package/corpus/templates/brain/package.json +1 -1
- package/corpus/templates/calendar/package.json +1 -1
- package/corpus/templates/clips/package.json +1 -1
- package/corpus/templates/content/actions/add-database-item.ts +1 -0
- package/corpus/templates/content/actions/set-document-property.ts +0 -4
- package/corpus/templates/content/app/components/editor/DocumentBlockFields.tsx +10 -1
- package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +10 -4
- package/corpus/templates/content/app/components/editor/DocumentInfoPanel.tsx +5 -1
- package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +6 -0
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +52 -33
- package/corpus/templates/content/app/components/editor/previewDocumentSaveController.ts +16 -4
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +16 -7
- package/corpus/templates/content/app/hooks/use-create-page.ts +8 -3
- package/corpus/templates/content/app/hooks/use-document-properties.ts +1 -0
- package/corpus/templates/content/app/hooks/use-documents.ts +3 -1
- package/corpus/templates/content/app/lib/optimistic-document.ts +29 -0
- package/corpus/templates/content/changelog/2026-07-21-editing-a-database-property-no-longer-refreshes-unrelated-co.md +6 -0
- package/corpus/templates/content/changelog/2026-07-23-new-database-ready.md +6 -0
- package/corpus/templates/content/package.json +1 -1
- package/corpus/templates/content/shared/api.ts +1 -0
- package/corpus/templates/design/package.json +1 -1
- package/corpus/templates/dispatch/package.json +1 -1
- package/corpus/templates/forms/.agents/skills/form-publishing/SKILL.md +9 -3
- package/corpus/templates/forms/AGENTS.md +11 -1
- package/corpus/templates/forms/README.md +24 -1
- package/corpus/templates/forms/actions/update-form.ts +12 -5
- package/corpus/templates/forms/app/components/builder/FieldPropertiesPanel.tsx +199 -1
- package/corpus/templates/forms/app/i18n/en-US.ts +13 -1
- package/corpus/templates/forms/app/pages/FormBuilderPage.tsx +35 -4
- package/corpus/templates/forms/app/pages/FormFillPage.tsx +7 -16
- package/corpus/templates/forms/changelog/2026-07-23-forms-can-branch-into-follow-up-questions-and-route-response.md +6 -0
- package/corpus/templates/forms/package.json +1 -1
- package/corpus/templates/forms/server/handlers/submissions.ts +22 -31
- package/corpus/templates/forms/server/lib/integrations.ts +11 -2
- package/corpus/templates/forms/server/lib/public-form-ssr.ts +26 -5
- package/corpus/templates/forms/server/lib/validate-fields.ts +48 -11
- package/corpus/templates/forms/server/plugins/agent-chat.ts +1 -0
- package/corpus/templates/forms/shared/conditional.ts +67 -0
- package/corpus/templates/macros/package.json +1 -1
- package/corpus/templates/mail/package.json +1 -1
- package/corpus/templates/slides/package.json +1 -1
- package/dist/cli/index.js +53 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +35 -0
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/use-chat-models.d.ts +1 -0
- package/dist/client/use-chat-models.d.ts.map +1 -1
- package/dist/client/use-chat-models.js +33 -0
- package/dist/client/use-chat-models.js.map +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/provider-api/actions/custom-provider-registration.d.ts +6 -6
- package/dist/provider-api/actions/provider-api.d.ts +9 -9
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/secrets/routes.d.ts +3 -3
- package/dist/server/analytics.d.ts +8 -0
- package/dist/server/analytics.d.ts.map +1 -1
- package/dist/server/analytics.js +16 -0
- package/dist/server/analytics.js.map +1 -1
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +5 -4
- package/dist/server/auth.js.map +1 -1
- package/dist/server/better-auth-instance.d.ts +8 -0
- package/dist/server/better-auth-instance.d.ts.map +1 -1
- package/dist/server/better-auth-instance.js +10 -1
- package/dist/server/better-auth-instance.js.map +1 -1
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/templates/default/package.json +1 -1
- package/package.json +1 -1
- package/src/cli/index.ts +64 -3
- package/src/client/MultiTabAssistantChat.tsx +45 -0
- package/src/client/use-chat-models.ts +45 -0
- package/src/server/analytics.ts +15 -0
- package/src/server/auth.ts +17 -13
- package/src/server/better-auth-instance.ts +13 -1
- package/src/templates/default/package.json +1 -1
|
@@ -14,6 +14,7 @@ import { isTrustedFrameMessage } from "./frame.js";
|
|
|
14
14
|
import { RunStuckBanner } from "./RunStuckBanner.js";
|
|
15
15
|
import { callAction } from "./use-action.js";
|
|
16
16
|
import { useChangeVersion } from "./use-change-version.js";
|
|
17
|
+
import { CHAT_MODEL_SELECTION_CHANGED_EVENT } from "./use-chat-models.js";
|
|
17
18
|
import { useChatThreads, } from "./use-chat-threads.js";
|
|
18
19
|
import { cn } from "./utils.js";
|
|
19
20
|
/** The single path that hands a queued send to a mounted chat ref. */
|
|
@@ -66,6 +67,11 @@ function writeStoredModelSelection(key, selection) {
|
|
|
66
67
|
return;
|
|
67
68
|
try {
|
|
68
69
|
window.localStorage.setItem(key, JSON.stringify(selection));
|
|
70
|
+
queueMicrotask(() => {
|
|
71
|
+
window.dispatchEvent(new CustomEvent(CHAT_MODEL_SELECTION_CHANGED_EVENT, {
|
|
72
|
+
detail: { key },
|
|
73
|
+
}));
|
|
74
|
+
});
|
|
69
75
|
}
|
|
70
76
|
catch { }
|
|
71
77
|
}
|
|
@@ -520,6 +526,35 @@ export function MultiTabAssistantChat({ showTabBar = true, renderHeader, renderO
|
|
|
520
526
|
const bumpModelSelectionVersion = useCallback(() => {
|
|
521
527
|
setModelSelectionVersion((version) => version + 1);
|
|
522
528
|
}, []);
|
|
529
|
+
useEffect(() => {
|
|
530
|
+
if (typeof window === "undefined")
|
|
531
|
+
return;
|
|
532
|
+
const syncPersistedSelection = (event) => {
|
|
533
|
+
const detail = event
|
|
534
|
+
?.detail;
|
|
535
|
+
if (detail?.key && detail.key !== modelSelectionKey)
|
|
536
|
+
return;
|
|
537
|
+
const next = readStoredModelSelection(modelSelectionKey);
|
|
538
|
+
if (!next)
|
|
539
|
+
return;
|
|
540
|
+
const activeThreadId = activeThreadIdRef.current;
|
|
541
|
+
if (activeThreadId) {
|
|
542
|
+
threadModelRef.current.set(activeThreadId, next);
|
|
543
|
+
}
|
|
544
|
+
setPersistedModelSelection(next);
|
|
545
|
+
bumpModelSelectionVersion();
|
|
546
|
+
};
|
|
547
|
+
const handleStorage = (event) => {
|
|
548
|
+
if (event.key === modelSelectionKey)
|
|
549
|
+
syncPersistedSelection();
|
|
550
|
+
};
|
|
551
|
+
window.addEventListener(CHAT_MODEL_SELECTION_CHANGED_EVENT, syncPersistedSelection);
|
|
552
|
+
window.addEventListener("storage", handleStorage);
|
|
553
|
+
return () => {
|
|
554
|
+
window.removeEventListener(CHAT_MODEL_SELECTION_CHANGED_EVENT, syncPersistedSelection);
|
|
555
|
+
window.removeEventListener("storage", handleStorage);
|
|
556
|
+
};
|
|
557
|
+
}, [bumpModelSelectionVersion, modelSelectionKey]);
|
|
523
558
|
const postMessageSubmissionsDisabled = props.composerDisabled === true;
|
|
524
559
|
const setContextInTab = useCallback((threadId, item, options) => {
|
|
525
560
|
const ref = chatRefs.current.get(threadId);
|