@agent-native/core 0.101.14 → 0.102.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 +12 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/cli/templates-meta.ts +13 -0
- package/corpus/core/src/client/agent-page/AgentTabsPage.tsx +1 -1
- package/corpus/core/src/client/org/OrgSwitcher.tsx +2 -0
- package/corpus/templates/analytics/changelog/2026-07-15-fixed-the-agent-discarding-a-successful-dashboard-edit-and-r.md +6 -0
- package/corpus/templates/analytics/server/lib/real-data-actions.ts +30 -1
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +15 -0
- package/corpus/templates/content/actions/_database-source-utils.ts +59 -4
- package/corpus/templates/content/actions/prepare-builder-source-review.ts +9 -0
- package/corpus/templates/content/actions/preview-builder-source-review.ts +6 -4
- package/corpus/templates/content/app/components/editor/DescriptionField.tsx +10 -2
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +4 -0
- package/corpus/templates/content/changelog/2026-07-15-page-and-database-descriptions-now-use-a-clean-single-line-f.md +6 -0
- package/corpus/templates/content/changelog/2026-07-15-selected-builder-reviews-now-load-only-the-chosen-rows-avoid.md +6 -0
- package/corpus/templates/content/shared/api.ts +1 -0
- package/corpus/templates/tasks/.agents/commands/visual-plan.md +9 -0
- package/corpus/templates/tasks/.agents/commands/visual-recap.md +8 -0
- package/corpus/templates/tasks/.agents/skills/actions/SKILL.md +492 -0
- package/corpus/templates/tasks/.agents/skills/adding-a-feature/SKILL.md +189 -0
- package/corpus/templates/tasks/.agents/skills/agent-native-docs/SKILL.md +76 -0
- package/corpus/templates/tasks/.agents/skills/agent-watchdog/README.md +43 -0
- package/corpus/templates/tasks/.agents/skills/agent-watchdog/SKILL.md +110 -0
- package/corpus/templates/tasks/.agents/skills/agent-watchdog/agents/openai.yaml +4 -0
- package/corpus/templates/tasks/.agents/skills/capture-learnings/SKILL.md +89 -0
- package/corpus/templates/tasks/.agents/skills/change-summary/SKILL.md +83 -0
- package/corpus/templates/tasks/.agents/skills/create-skill/SKILL.md +221 -0
- package/corpus/templates/tasks/.agents/skills/delegate-to-agent/SKILL.md +263 -0
- package/corpus/templates/tasks/.agents/skills/efficient-fable/README.md +75 -0
- package/corpus/templates/tasks/.agents/skills/efficient-fable/SKILL.md +95 -0
- package/corpus/templates/tasks/.agents/skills/efficient-frontier/README.md +53 -0
- package/corpus/templates/tasks/.agents/skills/efficient-frontier/SKILL.md +73 -0
- package/corpus/templates/tasks/.agents/skills/frontend-design/SKILL.md +112 -0
- package/corpus/templates/tasks/.agents/skills/plan-arbiter/README.md +41 -0
- package/corpus/templates/tasks/.agents/skills/plan-arbiter/SKILL.md +114 -0
- package/corpus/templates/tasks/.agents/skills/plan-arbiter/agents/openai.yaml +4 -0
- package/corpus/templates/tasks/.agents/skills/plow-ahead/README.md +42 -0
- package/corpus/templates/tasks/.agents/skills/plow-ahead/SKILL.md +104 -0
- package/corpus/templates/tasks/.agents/skills/plow-ahead/agents/openai.yaml +4 -0
- package/corpus/templates/tasks/.agents/skills/quick-recap/README.md +55 -0
- package/corpus/templates/tasks/.agents/skills/quick-recap/SKILL.md +54 -0
- package/corpus/templates/tasks/.agents/skills/read-the-damn-docs/README.md +54 -0
- package/corpus/templates/tasks/.agents/skills/read-the-damn-docs/SKILL.md +126 -0
- package/corpus/templates/tasks/.agents/skills/read-the-damn-docs/agents/openai.yaml +4 -0
- package/corpus/templates/tasks/.agents/skills/real-time-sync/SKILL.md +232 -0
- package/corpus/templates/tasks/.agents/skills/security/SKILL.md +280 -0
- package/corpus/templates/tasks/.agents/skills/self-modifying-code/SKILL.md +106 -0
- package/corpus/templates/tasks/.agents/skills/shadcn-ui/SKILL.md +95 -0
- package/corpus/templates/tasks/.agents/skills/stay-within-limits/README.md +61 -0
- package/corpus/templates/tasks/.agents/skills/stay-within-limits/SKILL.md +83 -0
- package/corpus/templates/tasks/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/corpus/templates/tasks/.agents/skills/visual-plan/SKILL.md +547 -0
- package/corpus/templates/tasks/.agents/skills/visual-plan/agent-native-skill.json +12 -0
- package/corpus/templates/tasks/.agents/skills/visual-plan/references/canvas.md +121 -0
- package/corpus/templates/tasks/.agents/skills/visual-plan/references/document-quality.md +178 -0
- package/corpus/templates/tasks/.agents/skills/visual-plan/references/exemplar.md +62 -0
- package/corpus/templates/tasks/.agents/skills/visual-plan/references/wireframe.md +264 -0
- package/corpus/templates/tasks/.agents/skills/visual-recap/SKILL.md +634 -0
- package/corpus/templates/tasks/.agents/skills/visual-recap/agent-native-skill.json +12 -0
- package/corpus/templates/tasks/.agents/skills/visual-recap/references/wireframe.md +264 -0
- package/corpus/templates/tasks/.claude/commands/visual-plan.md +9 -0
- package/corpus/templates/tasks/.claude/commands/visual-recap.md +8 -0
- package/corpus/templates/tasks/.env.example +5 -0
- package/corpus/templates/tasks/.ignore +0 -0
- package/corpus/templates/tasks/.prettierrc +5 -0
- package/corpus/templates/tasks/AGENTS.md +158 -0
- package/corpus/templates/tasks/DEVELOPING.md +185 -0
- package/corpus/templates/tasks/README.md +16 -0
- package/corpus/templates/tasks/actions/bulk-delete-inbox-items.ts +24 -0
- package/corpus/templates/tasks/actions/bulk-delete-tasks.ts +21 -0
- package/corpus/templates/tasks/actions/bulk-mark-inbox-items-ready.ts +27 -0
- package/corpus/templates/tasks/actions/bulk-update-tasks.ts +35 -0
- package/corpus/templates/tasks/actions/create-custom-field.ts +22 -0
- package/corpus/templates/tasks/actions/create-inbox-item.ts +30 -0
- package/corpus/templates/tasks/actions/create-task.ts +33 -0
- package/corpus/templates/tasks/actions/delete-custom-field.ts +19 -0
- package/corpus/templates/tasks/actions/delete-inbox-item.ts +17 -0
- package/corpus/templates/tasks/actions/delete-task.ts +17 -0
- package/corpus/templates/tasks/actions/lib/boolean-query-param.ts +30 -0
- package/corpus/templates/tasks/actions/list-custom-fields.ts +18 -0
- package/corpus/templates/tasks/actions/list-inbox-items.ts +16 -0
- package/corpus/templates/tasks/actions/list-tasks.ts +52 -0
- package/corpus/templates/tasks/actions/list-visible-task-fields.ts +18 -0
- package/corpus/templates/tasks/actions/mark-inbox-item-ready.ts +31 -0
- package/corpus/templates/tasks/actions/navigate.ts +51 -0
- package/corpus/templates/tasks/actions/reorder-custom-fields.ts +27 -0
- package/corpus/templates/tasks/actions/reorder-inbox-items.ts +24 -0
- package/corpus/templates/tasks/actions/reorder-tasks.ts +29 -0
- package/corpus/templates/tasks/actions/run.ts +2 -0
- package/corpus/templates/tasks/actions/update-custom-field.ts +33 -0
- package/corpus/templates/tasks/actions/update-inbox-item.ts +24 -0
- package/corpus/templates/tasks/actions/update-task.ts +68 -0
- package/corpus/templates/tasks/actions/update-visible-task-fields.ts +27 -0
- package/corpus/templates/tasks/actions/view-screen-helpers.ts +68 -0
- package/corpus/templates/tasks/actions/view-screen.ts +207 -0
- package/corpus/templates/tasks/app/components/custom-fields/FieldCreateBar.tsx +121 -0
- package/corpus/templates/tasks/app/components/custom-fields/FieldListRow.tsx +116 -0
- package/corpus/templates/tasks/app/components/custom-fields/FieldsList.tsx +225 -0
- package/corpus/templates/tasks/app/components/custom-fields/FieldsListSkeleton.tsx +18 -0
- package/corpus/templates/tasks/app/components/custom-fields/FieldsPage.tsx +42 -0
- package/corpus/templates/tasks/app/components/custom-fields/editor/FieldEditorSidebar.tsx +69 -0
- package/corpus/templates/tasks/app/components/custom-fields/editor/FieldTitleSection.tsx +32 -0
- package/corpus/templates/tasks/app/components/custom-fields/editor/config/CurrencyConfigControl.tsx +49 -0
- package/corpus/templates/tasks/app/components/custom-fields/editor/config/FieldConfigControl.tsx +56 -0
- package/corpus/templates/tasks/app/components/custom-fields/editor/config/NumberConfigControl.tsx +52 -0
- package/corpus/templates/tasks/app/components/custom-fields/editor/config/PercentConfigControl.tsx +30 -0
- package/corpus/templates/tasks/app/components/custom-fields/editor/config/SelectConfigControl.tsx +135 -0
- package/corpus/templates/tasks/app/components/custom-fields/editor/config/select-colors.ts +23 -0
- package/corpus/templates/tasks/app/components/custom-fields/editor/config/utils.ts +52 -0
- package/corpus/templates/tasks/app/components/custom-fields/editor/types.ts +7 -0
- package/corpus/templates/tasks/app/components/dnd/SortableItem.tsx +72 -0
- package/corpus/templates/tasks/app/components/dnd/SortableList.tsx +136 -0
- package/corpus/templates/tasks/app/components/dnd/reorder-moving-items.ts +160 -0
- package/corpus/templates/tasks/app/components/dnd/sortable-drag-props.ts +60 -0
- package/corpus/templates/tasks/app/components/inbox/InboxList.tsx +222 -0
- package/corpus/templates/tasks/app/components/inbox/InboxListPage.tsx +39 -0
- package/corpus/templates/tasks/app/components/inbox/InboxListRow.tsx +122 -0
- package/corpus/templates/tasks/app/components/layout/Header.tsx +55 -0
- package/corpus/templates/tasks/app/components/layout/HeaderActions.tsx +84 -0
- package/corpus/templates/tasks/app/components/layout/Layout.tsx +134 -0
- package/corpus/templates/tasks/app/components/layout/Sidebar.tsx +211 -0
- package/corpus/templates/tasks/app/components/shared/AddListItemInput.tsx +57 -0
- package/corpus/templates/tasks/app/components/shared/AlertDialog.tsx +53 -0
- package/corpus/templates/tasks/app/components/shared/BulkDeleteDialog.tsx +76 -0
- package/corpus/templates/tasks/app/components/shared/ChipSelect.tsx +240 -0
- package/corpus/templates/tasks/app/components/shared/DeleteItemDialog.tsx +40 -0
- package/corpus/templates/tasks/app/components/shared/InlineEditable.tsx +166 -0
- package/corpus/templates/tasks/app/components/shared/ListEmptyState.tsx +13 -0
- package/corpus/templates/tasks/app/components/shared/ListErrorMessage.tsx +15 -0
- package/corpus/templates/tasks/app/components/shared/ListViewHeader.tsx +75 -0
- package/corpus/templates/tasks/app/components/shared/PageHeader.tsx +25 -0
- package/corpus/templates/tasks/app/components/shared/RowActionsMenu.tsx +42 -0
- package/corpus/templates/tasks/app/components/shared/SidePanel.tsx +99 -0
- package/corpus/templates/tasks/app/components/shared/dnd/ListRowPreview.tsx +37 -0
- package/corpus/templates/tasks/app/components/shared/list/List.tsx +63 -0
- package/corpus/templates/tasks/app/components/shared/list/ListRow.tsx +159 -0
- package/corpus/templates/tasks/app/components/shared/list/ListRowDragHandle.tsx +52 -0
- package/corpus/templates/tasks/app/components/shared/list/ListSkeletonRows.tsx +11 -0
- package/corpus/templates/tasks/app/components/shared/list/SortableListItemShell.tsx +32 -0
- package/corpus/templates/tasks/app/components/shared/list/types.ts +1 -0
- package/corpus/templates/tasks/app/components/shared/selection/ListSelectionBar.tsx +158 -0
- package/corpus/templates/tasks/app/components/shared/selection/ListSelectionHeaderToggle.tsx +28 -0
- package/corpus/templates/tasks/app/components/shared/selection/ListSelectionToolbar.tsx +81 -0
- package/corpus/templates/tasks/app/components/shared/selection/get-list-row-selection-ui.ts +41 -0
- package/corpus/templates/tasks/app/components/shared/selection/use-list-selection.ts +196 -0
- package/corpus/templates/tasks/app/components/tasks/TaskList.tsx +333 -0
- package/corpus/templates/tasks/app/components/tasks/TaskListHeaderRow.tsx +46 -0
- package/corpus/templates/tasks/app/components/tasks/TaskListPage.tsx +115 -0
- package/corpus/templates/tasks/app/components/tasks/TaskListRow.css +49 -0
- package/corpus/templates/tasks/app/components/tasks/TaskListRow.tsx +307 -0
- package/corpus/templates/tasks/app/components/tasks/fields/TaskFieldsSidebar.tsx +102 -0
- package/corpus/templates/tasks/app/components/tasks/fields/TaskTitleSection.tsx +27 -0
- package/corpus/templates/tasks/app/components/tasks/fields/controls/DateValueControl.tsx +21 -0
- package/corpus/templates/tasks/app/components/tasks/fields/controls/FieldValueControl.tsx +76 -0
- package/corpus/templates/tasks/app/components/tasks/fields/controls/MultiSelectValueControl.tsx +52 -0
- package/corpus/templates/tasks/app/components/tasks/fields/controls/NumberValueControl.tsx +56 -0
- package/corpus/templates/tasks/app/components/tasks/fields/controls/RichTextValueControl.tsx +115 -0
- package/corpus/templates/tasks/app/components/tasks/fields/controls/SingleSelectValueControl.tsx +61 -0
- package/corpus/templates/tasks/app/components/tasks/fields/controls/TextValueControl.tsx +20 -0
- package/corpus/templates/tasks/app/components/tasks/use-task-row-completion-animation.ts +181 -0
- package/corpus/templates/tasks/app/components/ui/accordion.tsx +56 -0
- package/corpus/templates/tasks/app/components/ui/alert-dialog.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/alert.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/aspect-ratio.tsx +5 -0
- package/corpus/templates/tasks/app/components/ui/avatar.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/badge.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/breadcrumb.tsx +115 -0
- package/corpus/templates/tasks/app/components/ui/button.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/calendar.tsx +70 -0
- package/corpus/templates/tasks/app/components/ui/card.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/carousel.tsx +260 -0
- package/corpus/templates/tasks/app/components/ui/chart.tsx +379 -0
- package/corpus/templates/tasks/app/components/ui/checkbox.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/collapsible.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/command.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/context-menu.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/dialog.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/drawer.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/dropdown-menu.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/form.tsx +177 -0
- package/corpus/templates/tasks/app/components/ui/hover-card.tsx +27 -0
- package/corpus/templates/tasks/app/components/ui/input-otp.tsx +69 -0
- package/corpus/templates/tasks/app/components/ui/input.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/label.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/menubar.tsx +254 -0
- package/corpus/templates/tasks/app/components/ui/navigation-menu.tsx +128 -0
- package/corpus/templates/tasks/app/components/ui/pagination.tsx +121 -0
- package/corpus/templates/tasks/app/components/ui/popover.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/progress.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/radio-group.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/resizable.tsx +43 -0
- package/corpus/templates/tasks/app/components/ui/scroll-area.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/select.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/separator.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/sheet.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/sidebar.tsx +782 -0
- package/corpus/templates/tasks/app/components/ui/skeleton.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/slider.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/sonner.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/spinner.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/switch.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/table.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/tabs.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/textarea.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/toast.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/toaster.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/toggle-group.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/toggle.tsx +43 -0
- package/corpus/templates/tasks/app/components/ui/tooltip.tsx +1 -0
- package/corpus/templates/tasks/app/components/ui/use-toast.ts +3 -0
- package/corpus/templates/tasks/app/entry.client.tsx +19 -0
- package/corpus/templates/tasks/app/entry.server.tsx +10 -0
- package/corpus/templates/tasks/app/global.css +93 -0
- package/corpus/templates/tasks/app/hooks/cache.ts +31 -0
- package/corpus/templates/tasks/app/hooks/use-custom-fields.ts +93 -0
- package/corpus/templates/tasks/app/hooks/use-inbox-items.ts +196 -0
- package/corpus/templates/tasks/app/hooks/use-mobile.tsx +21 -0
- package/corpus/templates/tasks/app/hooks/use-navigation-state.ts +40 -0
- package/corpus/templates/tasks/app/hooks/use-tasks.ts +276 -0
- package/corpus/templates/tasks/app/hooks/use-toast.ts +188 -0
- package/corpus/templates/tasks/app/hooks/use-visible-task-fields.ts +140 -0
- package/corpus/templates/tasks/app/lib/app-config.ts +11 -0
- package/corpus/templates/tasks/app/lib/tab-id.ts +1 -0
- package/corpus/templates/tasks/app/lib/utils.ts +1 -0
- package/corpus/templates/tasks/app/root.tsx +130 -0
- package/corpus/templates/tasks/app/routes/_index.tsx +22 -0
- package/corpus/templates/tasks/app/routes/extensions.$id.$slug.tsx +2 -0
- package/corpus/templates/tasks/app/routes/extensions.$id.tsx +11 -0
- package/corpus/templates/tasks/app/routes/extensions._index.tsx +11 -0
- package/corpus/templates/tasks/app/routes/extensions.tsx +5 -0
- package/corpus/templates/tasks/app/routes/fields.tsx +16 -0
- package/corpus/templates/tasks/app/routes/inbox.tsx +16 -0
- package/corpus/templates/tasks/app/routes/tasks.tsx +17 -0
- package/corpus/templates/tasks/app/routes/team.tsx +17 -0
- package/corpus/templates/tasks/app/routes.ts +4 -0
- package/corpus/templates/tasks/app/vite-env.d.ts +6 -0
- package/corpus/templates/tasks/components.json +20 -0
- package/corpus/templates/tasks/data/sync-config.json +1 -0
- package/corpus/templates/tasks/docs/features/README.md +81 -0
- package/corpus/templates/tasks/docs/features/f1-tasks.mdx +67 -0
- package/corpus/templates/tasks/docs/features/f2-custom-fields.mdx +68 -0
- package/corpus/templates/tasks/docs/features/f3-projects.mdx +33 -0
- package/corpus/templates/tasks/docs/features/f4-inbox.mdx +55 -0
- package/corpus/templates/tasks/docs/features/f5-views.mdx +65 -0
- package/corpus/templates/tasks/docs/features/f6-search.mdx +43 -0
- package/corpus/templates/tasks/docs/features/f7-first-run.mdx +66 -0
- package/corpus/templates/tasks/docs/features/f8-chat.mdx +120 -0
- package/corpus/templates/tasks/e2e/global-setup.ts +42 -0
- package/corpus/templates/tasks/e2e/helpers/inbox.ts +71 -0
- package/corpus/templates/tasks/e2e/helpers/tasks.ts +99 -0
- package/corpus/templates/tasks/learnings.defaults.md +5 -0
- package/corpus/templates/tasks/netlify.toml +10 -0
- package/corpus/templates/tasks/package.json +104 -0
- package/corpus/templates/tasks/playwright.config.ts +34 -0
- package/corpus/templates/tasks/public/agent-native-icon-dark.svg +10 -0
- package/corpus/templates/tasks/public/agent-native-icon-light.svg +10 -0
- package/corpus/templates/tasks/public/agent-native-logo-dark.svg +21 -0
- package/corpus/templates/tasks/public/agent-native-logo-light.svg +21 -0
- package/corpus/templates/tasks/public/favicon.svg +1 -0
- package/corpus/templates/tasks/public/icon-180.svg +1 -0
- package/corpus/templates/tasks/public/icon-192.svg +1 -0
- package/corpus/templates/tasks/public/icon-512.svg +1 -0
- package/corpus/templates/tasks/public/manifest.json +21 -0
- package/corpus/templates/tasks/react-router.config.ts +7 -0
- package/corpus/templates/tasks/server/custom-fields/normalize.ts +163 -0
- package/corpus/templates/tasks/server/custom-fields/parse.ts +146 -0
- package/corpus/templates/tasks/server/custom-fields/schema.ts +147 -0
- package/corpus/templates/tasks/server/custom-fields/store.ts +425 -0
- package/corpus/templates/tasks/server/custom-fields/task-fields.ts +104 -0
- package/corpus/templates/tasks/server/custom-fields/types.ts +98 -0
- package/corpus/templates/tasks/server/custom-fields/validate.ts +210 -0
- package/corpus/templates/tasks/server/custom-fields/values/store.ts +386 -0
- package/corpus/templates/tasks/server/db/bulk-write.ts +30 -0
- package/corpus/templates/tasks/server/db/index.ts +5 -0
- package/corpus/templates/tasks/server/db/record-utils.ts +7 -0
- package/corpus/templates/tasks/server/db/schema.ts +67 -0
- package/corpus/templates/tasks/server/db/test-tasks-table.ts +76 -0
- package/corpus/templates/tasks/server/db/transaction.ts +6 -0
- package/corpus/templates/tasks/server/errors.ts +31 -0
- package/corpus/templates/tasks/server/inbox/store.ts +216 -0
- package/corpus/templates/tasks/server/middleware/auth.ts +15 -0
- package/corpus/templates/tasks/server/plugins/agent-chat.ts +46 -0
- package/corpus/templates/tasks/server/plugins/auth.ts +15 -0
- package/corpus/templates/tasks/server/plugins/db.ts +90 -0
- package/corpus/templates/tasks/server/routes/[...page].get.ts +5 -0
- package/corpus/templates/tasks/server/stored-items/store.ts +548 -0
- package/corpus/templates/tasks/server/tasks/store.ts +306 -0
- package/corpus/templates/tasks/server/user-config/store.ts +138 -0
- package/corpus/templates/tasks/shared/app-state-tabs.ts +15 -0
- package/corpus/templates/tasks/shared/boolean-param.ts +22 -0
- package/corpus/templates/tasks/shared/bulk-limits.ts +7 -0
- package/corpus/templates/tasks/shared/list-screen-snapshot.ts +90 -0
- package/corpus/templates/tasks/shared/navigation.ts +104 -0
- package/corpus/templates/tasks/shared/visible-task-fields.ts +2 -0
- package/corpus/templates/tasks/ssr-entry.ts +15 -0
- package/corpus/templates/tasks/tsconfig.json +24 -0
- package/corpus/templates/tasks/vite.config.ts +19 -0
- package/corpus/templates/tasks/vitest.config.ts +8 -0
- package/dist/cli/templates-meta.d.ts.map +1 -1
- package/dist/cli/templates-meta.js +13 -0
- package/dist/cli/templates-meta.js.map +1 -1
- package/dist/client/agent-page/AgentTabsPage.js +1 -1
- package/dist/client/agent-page/AgentTabsPage.js.map +1 -1
- package/dist/client/org/OrgSwitcher.d.ts.map +1 -1
- package/dist/client/org/OrgSwitcher.js +2 -1
- package/dist/client/org/OrgSwitcher.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +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/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@agent-native/toolkit/ui/skeleton";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@agent-native/toolkit/ui/slider";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@agent-native/toolkit/ui/sonner";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@agent-native/toolkit/ui/spinner";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@agent-native/toolkit/ui/switch";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@agent-native/toolkit/ui/table";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@agent-native/toolkit/ui/tabs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@agent-native/toolkit/ui/textarea";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@agent-native/toolkit/ui/toast";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@agent-native/toolkit/ui/toaster";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@agent-native/toolkit/ui/toggle-group";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils";
|
|
6
|
+
|
|
7
|
+
const toggleVariants = cva(
|
|
8
|
+
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: "bg-transparent",
|
|
13
|
+
outline:
|
|
14
|
+
"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground",
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
default: "h-10 px-3 min-w-10",
|
|
18
|
+
sm: "h-9 px-2.5 min-w-9",
|
|
19
|
+
lg: "h-11 px-5 min-w-11",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
variant: "default",
|
|
24
|
+
size: "default",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const Toggle = React.forwardRef<
|
|
30
|
+
React.ElementRef<typeof TogglePrimitive.Root>,
|
|
31
|
+
React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &
|
|
32
|
+
VariantProps<typeof toggleVariants>
|
|
33
|
+
>(({ className, variant, size, ...props }, ref) => (
|
|
34
|
+
<TogglePrimitive.Root
|
|
35
|
+
ref={ref}
|
|
36
|
+
className={cn(toggleVariants({ variant, size, className }))}
|
|
37
|
+
{...props}
|
|
38
|
+
/>
|
|
39
|
+
));
|
|
40
|
+
|
|
41
|
+
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
42
|
+
|
|
43
|
+
export { Toggle, toggleVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@agent-native/toolkit/ui/tooltip";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Import only the tiny URL-helper module, not the full client barrel.
|
|
2
|
+
// This keeps the ~650-700 KB gzip chat stack off the static import closure
|
|
3
|
+
// of the client entry point so it can't block the first page parse.
|
|
4
|
+
import { appBasePath } from "@agent-native/core/client/api-path";
|
|
5
|
+
import { hydrateRoot } from "react-dom/client";
|
|
6
|
+
import { HydratedRouter } from "react-router/dom";
|
|
7
|
+
|
|
8
|
+
const basePath = appBasePath();
|
|
9
|
+
const pathname = window.location.pathname;
|
|
10
|
+
const routerBasePath =
|
|
11
|
+
basePath && (pathname === basePath || pathname.startsWith(`${basePath}/`))
|
|
12
|
+
? basePath
|
|
13
|
+
: "";
|
|
14
|
+
const context = (
|
|
15
|
+
window as Window & { __reactRouterContext?: { basename?: string } }
|
|
16
|
+
).__reactRouterContext;
|
|
17
|
+
if (context) context.basename = routerBasePath;
|
|
18
|
+
|
|
19
|
+
hydrateRoot(document, <HydratedRouter />);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createDocumentRequestHandler,
|
|
3
|
+
streamTimeout,
|
|
4
|
+
} from "@agent-native/core/server/entry-server";
|
|
5
|
+
import { ServerRouter } from "react-router";
|
|
6
|
+
|
|
7
|
+
const handleDocumentRequest = createDocumentRequestHandler(ServerRouter);
|
|
8
|
+
|
|
9
|
+
export { streamTimeout };
|
|
10
|
+
export default handleDocumentRequest;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/* Self-hosted via @fontsource-variable/inter — no render-blocking Google Fonts request */
|
|
2
|
+
@import "@fontsource-variable/inter";
|
|
3
|
+
|
|
4
|
+
@import "tailwindcss";
|
|
5
|
+
@import "@agent-native/core/styles/agent-native.css";
|
|
6
|
+
@import "@agent-native/toolkit/styles.css";
|
|
7
|
+
|
|
8
|
+
@source "./**/*.{ts,tsx}";
|
|
9
|
+
|
|
10
|
+
:root {
|
|
11
|
+
--background: 0 0% 100%;
|
|
12
|
+
--foreground: 220 10% 10%;
|
|
13
|
+
--card: 0 0% 100%;
|
|
14
|
+
--card-foreground: 220 10% 10%;
|
|
15
|
+
--popover: 0 0% 100%;
|
|
16
|
+
--popover-foreground: 220 10% 10%;
|
|
17
|
+
--primary: 220 10% 15%;
|
|
18
|
+
--primary-foreground: 0 0% 100%;
|
|
19
|
+
--secondary: 220 10% 95%;
|
|
20
|
+
--secondary-foreground: 220 10% 15%;
|
|
21
|
+
--muted: 220 10% 95%;
|
|
22
|
+
--muted-foreground: 220 5% 45%;
|
|
23
|
+
--accent: 220 10% 95%;
|
|
24
|
+
--accent-foreground: 220 10% 15%;
|
|
25
|
+
--destructive: 0 84% 60%;
|
|
26
|
+
--destructive-foreground: 0 0% 98%;
|
|
27
|
+
--border: 220 10% 90%;
|
|
28
|
+
--input: 220 10% 90%;
|
|
29
|
+
--ring: 220 10% 40%;
|
|
30
|
+
--radius: 0.5rem;
|
|
31
|
+
--sidebar-background: 220 10% 97%;
|
|
32
|
+
--sidebar-foreground: 220 5% 45%;
|
|
33
|
+
--sidebar-primary: 220 10% 15%;
|
|
34
|
+
--sidebar-primary-foreground: 0 0% 100%;
|
|
35
|
+
--sidebar-accent: 220 10% 95%;
|
|
36
|
+
--sidebar-accent-foreground: 220 10% 15%;
|
|
37
|
+
--sidebar-border: 220 10% 90%;
|
|
38
|
+
--sidebar-ring: 220 10% 40%;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.dark {
|
|
42
|
+
--background: 220 6% 6%;
|
|
43
|
+
--foreground: 0 0% 90%;
|
|
44
|
+
--card: 220 5% 6%;
|
|
45
|
+
--card-foreground: 0 0% 90%;
|
|
46
|
+
--popover: 220 5% 6%;
|
|
47
|
+
--popover-foreground: 0 0% 90%;
|
|
48
|
+
--primary: 0 0% 75%;
|
|
49
|
+
--primary-foreground: 220 6% 6%;
|
|
50
|
+
--secondary: 220 4% 12%;
|
|
51
|
+
--secondary-foreground: 0 0% 90%;
|
|
52
|
+
--muted: 220 4% 10%;
|
|
53
|
+
--muted-foreground: 220 4% 60%;
|
|
54
|
+
--accent: 220 4% 13%;
|
|
55
|
+
--accent-foreground: 0 0% 90%;
|
|
56
|
+
--destructive: 0 63% 51%;
|
|
57
|
+
--destructive-foreground: 0 0% 98%;
|
|
58
|
+
--border: 220 4% 14%;
|
|
59
|
+
--input: 220 4% 14%;
|
|
60
|
+
--ring: 0 0% 60%;
|
|
61
|
+
--radius: 0.5rem;
|
|
62
|
+
--sidebar-background: 220 6% 4%;
|
|
63
|
+
--sidebar-foreground: 220 4% 60%;
|
|
64
|
+
--sidebar-primary: 0 0% 75%;
|
|
65
|
+
--sidebar-primary-foreground: 220 6% 6%;
|
|
66
|
+
--sidebar-accent: 220 4% 10%;
|
|
67
|
+
--sidebar-accent-foreground: 0 0% 90%;
|
|
68
|
+
--sidebar-border: 220 4% 10%;
|
|
69
|
+
--sidebar-ring: 0 0% 60%;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@layer base {
|
|
73
|
+
body {
|
|
74
|
+
@apply bg-background text-foreground;
|
|
75
|
+
font-family: "Inter Variable", "Inter", sans-serif;
|
|
76
|
+
font-feature-settings: "cv02", "cv03", "cv04", "cv11";
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
::-webkit-scrollbar {
|
|
81
|
+
width: 5px;
|
|
82
|
+
height: 5px;
|
|
83
|
+
}
|
|
84
|
+
::-webkit-scrollbar-track {
|
|
85
|
+
background: transparent;
|
|
86
|
+
}
|
|
87
|
+
::-webkit-scrollbar-thumb {
|
|
88
|
+
background: hsl(var(--border));
|
|
89
|
+
border-radius: 3px;
|
|
90
|
+
}
|
|
91
|
+
::-webkit-scrollbar-thumb:hover {
|
|
92
|
+
background: hsl(var(--muted-foreground) / 0.4);
|
|
93
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { QueryClient } from "@tanstack/react-query";
|
|
2
|
+
|
|
3
|
+
export const LIST_INBOX_ITEMS_QUERY_KEY = [
|
|
4
|
+
"action",
|
|
5
|
+
"list-inbox-items",
|
|
6
|
+
] as const;
|
|
7
|
+
export const LIST_TASKS_QUERY_KEY = ["action", "list-tasks"] as const;
|
|
8
|
+
export const LIST_CUSTOM_FIELDS_QUERY_KEY = [
|
|
9
|
+
"action",
|
|
10
|
+
"list-custom-fields",
|
|
11
|
+
] as const;
|
|
12
|
+
export const LIST_VISIBLE_TASK_FIELDS_QUERY_KEY = [
|
|
13
|
+
"action",
|
|
14
|
+
"list-visible-task-fields",
|
|
15
|
+
] as const;
|
|
16
|
+
|
|
17
|
+
export function invalidateInboxItems(qc: QueryClient) {
|
|
18
|
+
return qc.invalidateQueries({ queryKey: LIST_INBOX_ITEMS_QUERY_KEY });
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function invalidateTasks(qc: QueryClient) {
|
|
22
|
+
return qc.invalidateQueries({ queryKey: LIST_TASKS_QUERY_KEY });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function invalidateCustomFields(qc: QueryClient) {
|
|
26
|
+
return qc.invalidateQueries({ queryKey: LIST_CUSTOM_FIELDS_QUERY_KEY });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function invalidateVisibleTaskFields(qc: QueryClient) {
|
|
30
|
+
return qc.invalidateQueries({ queryKey: LIST_VISIBLE_TASK_FIELDS_QUERY_KEY });
|
|
31
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { useActionMutation, useActionQuery } from "@agent-native/core/client";
|
|
2
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
3
|
+
|
|
4
|
+
import type {
|
|
5
|
+
FieldDefinition,
|
|
6
|
+
FieldType,
|
|
7
|
+
} from "../../server/custom-fields/types.js";
|
|
8
|
+
import {
|
|
9
|
+
invalidateCustomFields,
|
|
10
|
+
invalidateTasks,
|
|
11
|
+
invalidateVisibleTaskFields,
|
|
12
|
+
} from "./cache";
|
|
13
|
+
|
|
14
|
+
export type {
|
|
15
|
+
FieldConfig,
|
|
16
|
+
FieldDefinition,
|
|
17
|
+
FieldType,
|
|
18
|
+
SelectColorToken,
|
|
19
|
+
SelectOption,
|
|
20
|
+
} from "../../server/custom-fields/types.js";
|
|
21
|
+
export type {
|
|
22
|
+
FieldValue,
|
|
23
|
+
FieldValueInput,
|
|
24
|
+
} from "../../server/custom-fields/values/store.js";
|
|
25
|
+
export type { TaskFieldValue } from "../../server/custom-fields/task-fields.js";
|
|
26
|
+
|
|
27
|
+
type ListCustomFieldsData = { fields: FieldDefinition[] };
|
|
28
|
+
|
|
29
|
+
export function useCustomFields() {
|
|
30
|
+
const query = useActionQuery("list-custom-fields", {});
|
|
31
|
+
const listData = query.data as ListCustomFieldsData | undefined;
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
...query,
|
|
35
|
+
fields: listData?.fields ?? [],
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function useCreateCustomField() {
|
|
40
|
+
const queryClient = useQueryClient();
|
|
41
|
+
return useActionMutation<
|
|
42
|
+
FieldDefinition,
|
|
43
|
+
{ title: string; type: FieldType; config?: unknown }
|
|
44
|
+
>("create-custom-field", {
|
|
45
|
+
onSettled: () => {
|
|
46
|
+
invalidateCustomFields(queryClient);
|
|
47
|
+
invalidateTasks(queryClient);
|
|
48
|
+
invalidateVisibleTaskFields(queryClient);
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function useUpdateCustomField() {
|
|
54
|
+
const queryClient = useQueryClient();
|
|
55
|
+
return useActionMutation<
|
|
56
|
+
FieldDefinition,
|
|
57
|
+
{ fieldId: string; title?: string; config?: unknown }
|
|
58
|
+
>("update-custom-field", {
|
|
59
|
+
onSettled: () => {
|
|
60
|
+
invalidateCustomFields(queryClient);
|
|
61
|
+
invalidateTasks(queryClient);
|
|
62
|
+
invalidateVisibleTaskFields(queryClient);
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function useDeleteCustomField() {
|
|
68
|
+
const queryClient = useQueryClient();
|
|
69
|
+
return useActionMutation<
|
|
70
|
+
{ ok: true; deletedValues: number },
|
|
71
|
+
{ fieldId: string }
|
|
72
|
+
>("delete-custom-field", {
|
|
73
|
+
onSettled: () => {
|
|
74
|
+
invalidateCustomFields(queryClient);
|
|
75
|
+
invalidateTasks(queryClient);
|
|
76
|
+
invalidateVisibleTaskFields(queryClient);
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function useReorderCustomFields() {
|
|
82
|
+
const queryClient = useQueryClient();
|
|
83
|
+
return useActionMutation<
|
|
84
|
+
{ fields: FieldDefinition[] },
|
|
85
|
+
{ fieldIds: string[] }
|
|
86
|
+
>("reorder-custom-fields", {
|
|
87
|
+
onSettled: () => {
|
|
88
|
+
invalidateCustomFields(queryClient);
|
|
89
|
+
invalidateTasks(queryClient);
|
|
90
|
+
invalidateVisibleTaskFields(queryClient);
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { useActionMutation, useActionQuery } from "@agent-native/core/client";
|
|
2
|
+
import { useQueryClient, type QueryClient } from "@tanstack/react-query";
|
|
3
|
+
|
|
4
|
+
import type { InboxItem } from "../../server/inbox/store.js";
|
|
5
|
+
import type { Task } from "../../server/tasks/store.js";
|
|
6
|
+
import {
|
|
7
|
+
invalidateInboxItems,
|
|
8
|
+
invalidateTasks,
|
|
9
|
+
LIST_INBOX_ITEMS_QUERY_KEY,
|
|
10
|
+
} from "./cache";
|
|
11
|
+
|
|
12
|
+
export type { InboxItem } from "../../server/inbox/store.js";
|
|
13
|
+
|
|
14
|
+
type ListInboxItemsData = { items: InboxItem[] };
|
|
15
|
+
|
|
16
|
+
type InboxMutationContext = {
|
|
17
|
+
previous: [readonly unknown[], ListInboxItemsData | undefined][];
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
function patchListInboxItemsCache(
|
|
21
|
+
queryClient: QueryClient,
|
|
22
|
+
patch: (items: InboxItem[]) => InboxItem[],
|
|
23
|
+
) {
|
|
24
|
+
queryClient.setQueriesData<ListInboxItemsData>(
|
|
25
|
+
{ queryKey: LIST_INBOX_ITEMS_QUERY_KEY },
|
|
26
|
+
(old) => {
|
|
27
|
+
if (!old?.items) return old;
|
|
28
|
+
return { items: patch(old.items) };
|
|
29
|
+
},
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function snapshotListInboxItemsQueries(queryClient: QueryClient) {
|
|
34
|
+
return queryClient.getQueriesData<ListInboxItemsData>({
|
|
35
|
+
queryKey: LIST_INBOX_ITEMS_QUERY_KEY,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function restoreListInboxItemsQueries(
|
|
40
|
+
queryClient: QueryClient,
|
|
41
|
+
previous: InboxMutationContext["previous"],
|
|
42
|
+
) {
|
|
43
|
+
for (const [key, data] of previous) {
|
|
44
|
+
queryClient.setQueryData(key, data);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function runMarkInboxItemReadyInvalidation(queryClient: QueryClient) {
|
|
49
|
+
invalidateInboxItems(queryClient);
|
|
50
|
+
invalidateTasks(queryClient);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function useInboxItems() {
|
|
54
|
+
const query = useActionQuery("list-inbox-items", {});
|
|
55
|
+
const listData = query.data as ListInboxItemsData | undefined;
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
...query,
|
|
59
|
+
items: listData?.items ?? [],
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function useCreateInboxItem() {
|
|
64
|
+
const queryClient = useQueryClient();
|
|
65
|
+
return useActionMutation<InboxItem, { title: string }>("create-inbox-item", {
|
|
66
|
+
onSettled: () => {
|
|
67
|
+
invalidateInboxItems(queryClient);
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function useUpdateInboxItem() {
|
|
73
|
+
const queryClient = useQueryClient();
|
|
74
|
+
return useActionMutation<InboxItem, { inboxItemId: string; title?: string }>(
|
|
75
|
+
"update-inbox-item",
|
|
76
|
+
{
|
|
77
|
+
onSettled: () => {
|
|
78
|
+
invalidateInboxItems(queryClient);
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function useDeleteInboxItem() {
|
|
85
|
+
const queryClient = useQueryClient();
|
|
86
|
+
return useActionMutation<{ ok: true }, { inboxItemId: string }>(
|
|
87
|
+
"delete-inbox-item",
|
|
88
|
+
{
|
|
89
|
+
onSettled: () => {
|
|
90
|
+
invalidateInboxItems(queryClient);
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function useMarkInboxItemReady() {
|
|
97
|
+
const queryClient = useQueryClient();
|
|
98
|
+
return useActionMutation<{ task: Task }, { inboxItemId: string }>(
|
|
99
|
+
"mark-inbox-item-ready",
|
|
100
|
+
{
|
|
101
|
+
onMutate: async ({ inboxItemId }) => {
|
|
102
|
+
await queryClient.cancelQueries({
|
|
103
|
+
queryKey: LIST_INBOX_ITEMS_QUERY_KEY,
|
|
104
|
+
});
|
|
105
|
+
const previous = snapshotListInboxItemsQueries(queryClient);
|
|
106
|
+
|
|
107
|
+
patchListInboxItemsCache(queryClient, (items) =>
|
|
108
|
+
items.filter((item) => item.id !== inboxItemId),
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
return { previous };
|
|
112
|
+
},
|
|
113
|
+
onError: (_error, _variables, context) => {
|
|
114
|
+
restoreListInboxItemsQueries(
|
|
115
|
+
queryClient,
|
|
116
|
+
(context as InboxMutationContext | undefined)?.previous ?? [],
|
|
117
|
+
);
|
|
118
|
+
},
|
|
119
|
+
onSettled: () => {
|
|
120
|
+
runMarkInboxItemReadyInvalidation(queryClient);
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export function useBulkMarkInboxItemsReady() {
|
|
127
|
+
const queryClient = useQueryClient();
|
|
128
|
+
return useActionMutation<{ tasks: Task[] }, { inboxItemIds: string[] }>(
|
|
129
|
+
"bulk-mark-inbox-items-ready",
|
|
130
|
+
{
|
|
131
|
+
onMutate: async ({ inboxItemIds }) => {
|
|
132
|
+
await queryClient.cancelQueries({
|
|
133
|
+
queryKey: LIST_INBOX_ITEMS_QUERY_KEY,
|
|
134
|
+
});
|
|
135
|
+
const previous = snapshotListInboxItemsQueries(queryClient);
|
|
136
|
+
const selected = new Set(inboxItemIds);
|
|
137
|
+
|
|
138
|
+
patchListInboxItemsCache(queryClient, (items) =>
|
|
139
|
+
items.filter((item) => !selected.has(item.id)),
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
return { previous };
|
|
143
|
+
},
|
|
144
|
+
onError: (_error, _variables, context) => {
|
|
145
|
+
restoreListInboxItemsQueries(
|
|
146
|
+
queryClient,
|
|
147
|
+
(context as InboxMutationContext | undefined)?.previous ?? [],
|
|
148
|
+
);
|
|
149
|
+
},
|
|
150
|
+
onSettled: () => {
|
|
151
|
+
runMarkInboxItemReadyInvalidation(queryClient);
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export function useBulkDeleteInboxItems() {
|
|
158
|
+
const queryClient = useQueryClient();
|
|
159
|
+
return useActionMutation<
|
|
160
|
+
{ ok: true; deleted: number },
|
|
161
|
+
{ inboxItemIds: string[] }
|
|
162
|
+
>("bulk-delete-inbox-items", {
|
|
163
|
+
onMutate: async ({ inboxItemIds }) => {
|
|
164
|
+
await queryClient.cancelQueries({ queryKey: LIST_INBOX_ITEMS_QUERY_KEY });
|
|
165
|
+
const previous = snapshotListInboxItemsQueries(queryClient);
|
|
166
|
+
const selected = new Set(inboxItemIds);
|
|
167
|
+
|
|
168
|
+
patchListInboxItemsCache(queryClient, (items) =>
|
|
169
|
+
items.filter((item) => !selected.has(item.id)),
|
|
170
|
+
);
|
|
171
|
+
|
|
172
|
+
return { previous };
|
|
173
|
+
},
|
|
174
|
+
onError: (_error, _variables, context) => {
|
|
175
|
+
restoreListInboxItemsQueries(
|
|
176
|
+
queryClient,
|
|
177
|
+
(context as InboxMutationContext | undefined)?.previous ?? [],
|
|
178
|
+
);
|
|
179
|
+
},
|
|
180
|
+
onSettled: () => {
|
|
181
|
+
invalidateInboxItems(queryClient);
|
|
182
|
+
},
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export function useReorderInboxItems() {
|
|
187
|
+
const queryClient = useQueryClient();
|
|
188
|
+
return useActionMutation<{ items: InboxItem[] }, { inboxItemIds: string[] }>(
|
|
189
|
+
"reorder-inbox-items",
|
|
190
|
+
{
|
|
191
|
+
onSettled: () => {
|
|
192
|
+
invalidateInboxItems(queryClient);
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
);
|
|
196
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
const MOBILE_BREAKPOINT = 768;
|
|
4
|
+
|
|
5
|
+
export function useIsMobile() {
|
|
6
|
+
const [isMobile, setIsMobile] = React.useState<boolean | undefined>(
|
|
7
|
+
undefined,
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
React.useEffect(() => {
|
|
11
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
12
|
+
const onChange = () => {
|
|
13
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
14
|
+
};
|
|
15
|
+
mql.addEventListener("change", onChange);
|
|
16
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
17
|
+
return () => mql.removeEventListener("change", onChange);
|
|
18
|
+
}, []);
|
|
19
|
+
|
|
20
|
+
return !!isMobile;
|
|
21
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { appPath, useAgentRouteState } from "@agent-native/core/client";
|
|
2
|
+
import { parseIncludeDoneParam } from "@shared/boolean-param";
|
|
3
|
+
import {
|
|
4
|
+
type NavigateCommand,
|
|
5
|
+
type NavigationState,
|
|
6
|
+
buildNavigatePath,
|
|
7
|
+
pathForView,
|
|
8
|
+
viewForPath,
|
|
9
|
+
} from "@shared/navigation";
|
|
10
|
+
import { useLocation } from "react-router";
|
|
11
|
+
|
|
12
|
+
import { TAB_ID } from "@/lib/tab-id";
|
|
13
|
+
|
|
14
|
+
export type { NavigateCommand, NavigationState };
|
|
15
|
+
|
|
16
|
+
export function useNavigationState() {
|
|
17
|
+
const location = useLocation();
|
|
18
|
+
|
|
19
|
+
useAgentRouteState<NavigationState, NavigateCommand & { _writeId?: string }>({
|
|
20
|
+
browserTabId: TAB_ID,
|
|
21
|
+
requestSource: TAB_ID,
|
|
22
|
+
getNavigationState: ({ pathname, search }) => {
|
|
23
|
+
const params = new URLSearchParams(search);
|
|
24
|
+
return {
|
|
25
|
+
view: viewForPath(pathname),
|
|
26
|
+
path: appPath(pathname),
|
|
27
|
+
includeDone: parseIncludeDoneParam(params.get("includeDone")),
|
|
28
|
+
taskId: params.get("task") ?? undefined,
|
|
29
|
+
inboxItemId: params.get("inboxItem") ?? undefined,
|
|
30
|
+
fieldId: params.get("field") ?? undefined,
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
getCommandPath: (command) => {
|
|
34
|
+
const currentParams = new URLSearchParams(location.search);
|
|
35
|
+
return buildNavigatePath(pathForView(command.view), command, {
|
|
36
|
+
includeDone: parseIncludeDoneParam(currentParams.get("includeDone")),
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
}
|