@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,16 @@
|
|
|
1
|
+
# agent-native-tasks
|
|
2
|
+
|
|
3
|
+
Task-list-first agent-native app. Default home is `/tasks`; chat handles capture and agent operations.
|
|
4
|
+
|
|
5
|
+
## TODO
|
|
6
|
+
|
|
7
|
+
- [ ] **i18n** — Add `app/i18n/` catalogs (`en-US` + locale mirrors) and migrate UI copy from raw literals to `useT()`. Remove tasks strings from `scripts/i18n-raw-literal-baseline.txt` once migrated.
|
|
8
|
+
- [ ] **Delete dialog wiring** — `TaskList` and `InboxList` duplicate single/bulk delete dialog state (`pendingDeleteId`, `bulkDeleteOpen`, confirm handlers, toast on bulk success). Extract a shared hook or composer helper (e.g. `useDeleteDialogs`) that owns pending id, open state, and confirm wiring while composers pass entity labels and delete mutations.
|
|
9
|
+
- [ ] Extract shared action schema helpers (e.g. `taskId` field, title patch) once the action surface grows beyond MVP.
|
|
10
|
+
- [ ] Add route-level `ErrorBoundary` and `Suspense` around task list loading (align with other agent-native templates).
|
|
11
|
+
- [ ] **`view-screen` agent snapshot** — Revisit `AGENT_TASKS_LIST_CAP` in `actions/view-screen.ts`: it caps the agent tool payload (token budget), not the UI list. Confirm whether `list` / `selectedItem` / `inListSnapshot` correctly represent what the user sees, tune or document the cap, and align with UI limits if needed. Also review Zod parsing of `navigation` / app-state selection keys for strictness vs backward compatibility.
|
|
12
|
+
- [ ] **Selection context** — Revisit prop drilling through `TaskList` → header/bar/rows once the composer stabilizes; a narrow context for `{ state, actions }` would trim wiring but must not blur the `dnd/` ↔ `selection/` boundary.
|
|
13
|
+
- [ ] **`TaskList` optimistic state** — Refactor manual `allTasks` buffer in `app/components/tasks/TaskList.tsx` to TanStack Query `onMutate` once exit animations and reorder rollback can share one cache strategy.
|
|
14
|
+
- [ ] **Exit-animation list reconcile** — Move exit-animation reconcile / `exitingIdsRef` out of `app/components/tasks/TaskList.tsx` into a neutral list helper (e.g. `use-ordered-tasks-with-exit-animation.ts`). That logic keeps completed rows visible during CSS exit when Show all is off; it is not DnD. `TaskList` should pass an ordered list into generic `SortableList`.
|
|
15
|
+
- Shared `ListRowPreview` (`app/components/shared/dnd/ListRowPreview.tsx`) still duplicates row chrome; render the live row in the overlay when `SortableList` can mount previews safely (see TODO in that file).
|
|
16
|
+
- [ ] **`move-tasks` / relative reorder (try on a separate branch)** — Today DnD persistence is FE-heavy: `SortableList` runs `reorderMovingItems` (`app/components/dnd/reorder-moving-items.ts`) to compute the **full visible id list**, then `TaskList` calls `reorder-tasks` with every id top-to-bottom. The BE already persists order via `server/tasks/store.ts` `reorderTasks` — no separate `bulkReorder` needed, but the **drop → order** translation is brittle (multi-select before/after/top/bottom edge cases). **Proposal:** add a relative move action, e.g. `move-tasks` with `{ taskIds, beforeId? | afterId?, includeDone? }` (or extend `reorder-tasks` with a relative mode). BE applies the block move, validates visible list / ownership, rewrites `sortOrder`, returns updated tasks. Keep **absolute** full-list `taskIds[]` as an escape hatch for agent/import flows. **FE after refactor:** dnd-kit still handles overlay/collision/optimistic UI, but on drop only derives `{ selected ids, anchor id, before | after }` from `over` + drag direction — delete most of `computeBlockInsertIndex`. **Prefer `beforeId`/`afterId` over `toIndex`** — matches user/agent language (“put these after task Z”) and avoids index ambiguity with `includeDone` / hidden rows. **Touch:** new `actions/move-tasks.ts`, `server/tasks/store.ts`, `use-tasks.ts`, `TaskList.tsx` / `InboxList.tsx`, agent prompt in `server/plugins/agent-chat.ts`, unit tests on store + thin FE mapping tests; keep `reorder-tasks` until callers migrate.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core/action";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
import { deleteInboxItems, requireUserEmail } from "../server/inbox/store.js";
|
|
5
|
+
import { BULK_ID_LIMIT } from "../shared/bulk-limits.js";
|
|
6
|
+
|
|
7
|
+
export default defineAction({
|
|
8
|
+
description:
|
|
9
|
+
"Delete multiple inbox items permanently. Ask the user to confirm before calling.",
|
|
10
|
+
schema: z.object({
|
|
11
|
+
inboxItemIds: z
|
|
12
|
+
.array(z.string())
|
|
13
|
+
.min(1)
|
|
14
|
+
.max(BULK_ID_LIMIT)
|
|
15
|
+
.describe("Inbox item ids to delete"),
|
|
16
|
+
}),
|
|
17
|
+
run: async (args, ctx) => {
|
|
18
|
+
const ownerEmail = requireUserEmail(ctx?.userEmail);
|
|
19
|
+
return deleteInboxItems({
|
|
20
|
+
ownerEmail,
|
|
21
|
+
ids: args.inboxItemIds,
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core/action";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
import { deleteTasks, requireUserEmail } from "../server/tasks/store.js";
|
|
5
|
+
import { BULK_ID_LIMIT } from "../shared/bulk-limits.js";
|
|
6
|
+
|
|
7
|
+
export default defineAction({
|
|
8
|
+
description:
|
|
9
|
+
"Delete multiple tasks permanently. Ask the user to confirm before calling.",
|
|
10
|
+
schema: z.object({
|
|
11
|
+
taskIds: z
|
|
12
|
+
.array(z.string())
|
|
13
|
+
.min(1)
|
|
14
|
+
.max(BULK_ID_LIMIT)
|
|
15
|
+
.describe("Task ids to delete"),
|
|
16
|
+
}),
|
|
17
|
+
run: async (args, ctx) => {
|
|
18
|
+
const ownerEmail = requireUserEmail(ctx?.userEmail);
|
|
19
|
+
return deleteTasks({ ownerEmail, ids: args.taskIds });
|
|
20
|
+
},
|
|
21
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core/action";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
markInboxItemsReady,
|
|
6
|
+
requireUserEmail,
|
|
7
|
+
} from "../server/inbox/store.js";
|
|
8
|
+
import { BULK_ID_LIMIT } from "../shared/bulk-limits.js";
|
|
9
|
+
|
|
10
|
+
export default defineAction({
|
|
11
|
+
description:
|
|
12
|
+
"Promote multiple inbox items to incomplete tasks in one atomic batch.",
|
|
13
|
+
schema: z.object({
|
|
14
|
+
inboxItemIds: z
|
|
15
|
+
.array(z.string())
|
|
16
|
+
.min(1)
|
|
17
|
+
.max(BULK_ID_LIMIT)
|
|
18
|
+
.describe("Inbox item ids to mark ready"),
|
|
19
|
+
}),
|
|
20
|
+
run: async (args, ctx) => {
|
|
21
|
+
const ownerEmail = requireUserEmail(ctx?.userEmail);
|
|
22
|
+
return markInboxItemsReady({
|
|
23
|
+
ownerEmail,
|
|
24
|
+
ids: args.inboxItemIds,
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core/action";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
import { UserInputError } from "../server/errors.js";
|
|
5
|
+
import { requireUserEmail, updateTasks } from "../server/tasks/store.js";
|
|
6
|
+
import { BULK_ID_LIMIT } from "../shared/bulk-limits.js";
|
|
7
|
+
|
|
8
|
+
export default defineAction({
|
|
9
|
+
description:
|
|
10
|
+
"Update multiple tasks with the same title and/or completion patch.",
|
|
11
|
+
schema: z.object({
|
|
12
|
+
taskIds: z
|
|
13
|
+
.array(z.string())
|
|
14
|
+
.min(1)
|
|
15
|
+
.max(BULK_ID_LIMIT)
|
|
16
|
+
.describe("Task ids to update"),
|
|
17
|
+
title: z.string().min(1).optional().describe("New title for every task"),
|
|
18
|
+
done: z.boolean().optional().describe("Completion state for every task"),
|
|
19
|
+
}),
|
|
20
|
+
run: async (args, ctx) => {
|
|
21
|
+
const ownerEmail = requireUserEmail(ctx?.userEmail);
|
|
22
|
+
if (args.title === undefined && args.done === undefined) {
|
|
23
|
+
throw new UserInputError("Provide at least one of title or done.");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const tasks = await updateTasks({
|
|
27
|
+
ownerEmail,
|
|
28
|
+
ids: args.taskIds,
|
|
29
|
+
title: args.title,
|
|
30
|
+
done: args.done,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
return { tasks };
|
|
34
|
+
},
|
|
35
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core/action";
|
|
2
|
+
|
|
3
|
+
import { createCustomFieldActionSchema } from "../server/custom-fields/schema.js";
|
|
4
|
+
import {
|
|
5
|
+
createCustomField,
|
|
6
|
+
requireUserEmail,
|
|
7
|
+
} from "../server/custom-fields/store.js";
|
|
8
|
+
|
|
9
|
+
export default defineAction({
|
|
10
|
+
description:
|
|
11
|
+
"Create a custom field definition. Field type is immutable after creation.",
|
|
12
|
+
schema: createCustomFieldActionSchema,
|
|
13
|
+
run: async (args, ctx) => {
|
|
14
|
+
const ownerEmail = requireUserEmail(ctx?.userEmail);
|
|
15
|
+
return createCustomField({
|
|
16
|
+
ownerEmail,
|
|
17
|
+
title: args.title,
|
|
18
|
+
type: args.type,
|
|
19
|
+
config: args.config,
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core/action";
|
|
2
|
+
import { buildDeepLink } from "@agent-native/core/server";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
|
|
5
|
+
import { createInboxItem, requireUserEmail } from "../server/inbox/store.js";
|
|
6
|
+
import type { InboxItem } from "../server/inbox/store.js";
|
|
7
|
+
|
|
8
|
+
export default defineAction({
|
|
9
|
+
description: "Create a not-ready inbox item with a title.",
|
|
10
|
+
schema: z.object({
|
|
11
|
+
title: z.string().min(1).describe("Inbox item title"),
|
|
12
|
+
}),
|
|
13
|
+
run: async (args, ctx) => {
|
|
14
|
+
const ownerEmail = requireUserEmail(ctx?.userEmail);
|
|
15
|
+
const item = await createInboxItem({ ownerEmail, title: args.title });
|
|
16
|
+
return item;
|
|
17
|
+
},
|
|
18
|
+
link: ({ result }) => {
|
|
19
|
+
if (!result || typeof result !== "object") return null;
|
|
20
|
+
const item = result as InboxItem;
|
|
21
|
+
if (!item.id || !item.title) return null;
|
|
22
|
+
return {
|
|
23
|
+
url: buildDeepLink({
|
|
24
|
+
view: "inbox",
|
|
25
|
+
params: { inboxItemId: item.id },
|
|
26
|
+
}),
|
|
27
|
+
label: item.title,
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core/action";
|
|
2
|
+
import { buildDeepLink } from "@agent-native/core/server";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
createTask,
|
|
7
|
+
requireUserEmail,
|
|
8
|
+
type Task,
|
|
9
|
+
} from "../server/tasks/store.js";
|
|
10
|
+
|
|
11
|
+
export default defineAction({
|
|
12
|
+
description: "Create a new task with a title.",
|
|
13
|
+
schema: z.object({
|
|
14
|
+
title: z.string().min(1).describe("Task title"),
|
|
15
|
+
}),
|
|
16
|
+
run: async (args, ctx) => {
|
|
17
|
+
const ownerEmail = requireUserEmail(ctx?.userEmail);
|
|
18
|
+
const task = await createTask({ ownerEmail, title: args.title });
|
|
19
|
+
return task;
|
|
20
|
+
},
|
|
21
|
+
link: ({ result }) => {
|
|
22
|
+
if (!result || typeof result !== "object") return null;
|
|
23
|
+
const task = result as Task;
|
|
24
|
+
if (!task.id || !task.title) return null;
|
|
25
|
+
return {
|
|
26
|
+
url: buildDeepLink({
|
|
27
|
+
view: "tasks",
|
|
28
|
+
params: { taskId: task.id },
|
|
29
|
+
}),
|
|
30
|
+
label: task.title,
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core/action";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
deleteCustomField,
|
|
6
|
+
requireUserEmail,
|
|
7
|
+
} from "../server/custom-fields/store.js";
|
|
8
|
+
|
|
9
|
+
export default defineAction({
|
|
10
|
+
description:
|
|
11
|
+
"Delete a custom field definition and all of its values on every task. Ask the user to confirm before calling.",
|
|
12
|
+
schema: z.object({
|
|
13
|
+
fieldId: z.string().describe("Custom field id"),
|
|
14
|
+
}),
|
|
15
|
+
run: async (args, ctx) => {
|
|
16
|
+
const ownerEmail = requireUserEmail(ctx?.userEmail);
|
|
17
|
+
return deleteCustomField({ ownerEmail, fieldId: args.fieldId });
|
|
18
|
+
},
|
|
19
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core/action";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
import { deleteInboxItem, requireUserEmail } from "../server/inbox/store.js";
|
|
5
|
+
|
|
6
|
+
export default defineAction({
|
|
7
|
+
description:
|
|
8
|
+
"Delete an inbox item permanently. Ask the user to confirm before calling.",
|
|
9
|
+
schema: z.object({
|
|
10
|
+
inboxItemId: z.string().describe("Inbox item id"),
|
|
11
|
+
}),
|
|
12
|
+
run: async (args, ctx) => {
|
|
13
|
+
const ownerEmail = requireUserEmail(ctx?.userEmail);
|
|
14
|
+
await deleteInboxItem({ ownerEmail, id: args.inboxItemId });
|
|
15
|
+
return { ok: true as const };
|
|
16
|
+
},
|
|
17
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core/action";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
import { deleteTask, requireUserEmail } from "../server/tasks/store.js";
|
|
5
|
+
|
|
6
|
+
export default defineAction({
|
|
7
|
+
description:
|
|
8
|
+
"Delete a task permanently. Ask the user to confirm before calling.",
|
|
9
|
+
schema: z.object({
|
|
10
|
+
taskId: z.string().describe("Task id"),
|
|
11
|
+
}),
|
|
12
|
+
run: async (args, ctx) => {
|
|
13
|
+
const ownerEmail = requireUserEmail(ctx?.userEmail);
|
|
14
|
+
await deleteTask({ ownerEmail, id: args.taskId });
|
|
15
|
+
return { ok: true as const };
|
|
16
|
+
},
|
|
17
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP GET actions and CLI flags pass booleans as strings ("true"/"false"),
|
|
3
|
+
* not JSON booleans. Plain z.boolean() rejects those values before run().
|
|
4
|
+
*/
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
|
|
7
|
+
import { coerceBooleanParam } from "../../shared/boolean-param.js";
|
|
8
|
+
|
|
9
|
+
const booleanQueryValue = z.union([
|
|
10
|
+
z.boolean(),
|
|
11
|
+
z.enum(["true", "false", "1", "0"]),
|
|
12
|
+
]);
|
|
13
|
+
|
|
14
|
+
/** Required boolean query param with a default when omitted. */
|
|
15
|
+
export function booleanQueryParam(defaultValue = false) {
|
|
16
|
+
return booleanQueryValue
|
|
17
|
+
.optional()
|
|
18
|
+
.transform((value) => coerceBooleanParam(value) ?? defaultValue)
|
|
19
|
+
.default(defaultValue);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Optional boolean query param that stays undefined when omitted.
|
|
24
|
+
* Used by navigate when includeDone should not be patched unless provided.
|
|
25
|
+
*/
|
|
26
|
+
export function optionalBooleanQueryParam() {
|
|
27
|
+
return booleanQueryValue
|
|
28
|
+
.optional()
|
|
29
|
+
.transform((value) => coerceBooleanParam(value));
|
|
30
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core/action";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
listCustomFields,
|
|
6
|
+
requireUserEmail,
|
|
7
|
+
} from "../server/custom-fields/store.js";
|
|
8
|
+
|
|
9
|
+
export default defineAction({
|
|
10
|
+
description: "List custom field definitions for the current user.",
|
|
11
|
+
schema: z.object({}),
|
|
12
|
+
http: { method: "GET" },
|
|
13
|
+
readOnly: true,
|
|
14
|
+
run: async (_args, ctx) => {
|
|
15
|
+
const ownerEmail = requireUserEmail(ctx?.userEmail);
|
|
16
|
+
return listCustomFields({ ownerEmail });
|
|
17
|
+
},
|
|
18
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core/action";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
import { listInboxItems, requireUserEmail } from "../server/inbox/store.js";
|
|
5
|
+
|
|
6
|
+
export default defineAction({
|
|
7
|
+
description: "List inbox items for the current user (not-ready capture).",
|
|
8
|
+
schema: z.object({}),
|
|
9
|
+
http: { method: "GET" },
|
|
10
|
+
readOnly: true,
|
|
11
|
+
run: async (_args, ctx) => {
|
|
12
|
+
const ownerEmail = requireUserEmail(ctx?.userEmail);
|
|
13
|
+
const items = await listInboxItems({ ownerEmail });
|
|
14
|
+
return { items };
|
|
15
|
+
},
|
|
16
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core/action";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
import { attachFieldsToTasks } from "../server/custom-fields/task-fields.js";
|
|
5
|
+
import {
|
|
6
|
+
hasCompletedTasks,
|
|
7
|
+
listTasks,
|
|
8
|
+
requireUserEmail,
|
|
9
|
+
} from "../server/tasks/store.js";
|
|
10
|
+
import { booleanQueryParam } from "./lib/boolean-query-param.js";
|
|
11
|
+
|
|
12
|
+
export default defineAction({
|
|
13
|
+
description:
|
|
14
|
+
"List tasks for the current user. By default returns incomplete tasks only.",
|
|
15
|
+
schema: z.object({
|
|
16
|
+
includeDone: booleanQueryParam(false).describe(
|
|
17
|
+
"When true, include completed tasks in the result.",
|
|
18
|
+
),
|
|
19
|
+
includeFields: booleanQueryParam(false).describe(
|
|
20
|
+
"When true, include each task's custom field values.",
|
|
21
|
+
),
|
|
22
|
+
}),
|
|
23
|
+
http: { method: "GET" },
|
|
24
|
+
readOnly: true,
|
|
25
|
+
run: async (args, ctx) => {
|
|
26
|
+
const ownerEmail = requireUserEmail(ctx?.userEmail);
|
|
27
|
+
const tasks = await listTasks({
|
|
28
|
+
ownerEmail,
|
|
29
|
+
includeDone: args.includeDone,
|
|
30
|
+
});
|
|
31
|
+
const hasCompleted =
|
|
32
|
+
args.includeDone === true
|
|
33
|
+
? undefined
|
|
34
|
+
: tasks.length === 0
|
|
35
|
+
? await hasCompletedTasks({ ownerEmail })
|
|
36
|
+
: false;
|
|
37
|
+
if (args.includeFields) {
|
|
38
|
+
return {
|
|
39
|
+
tasks: await attachFieldsToTasks(ownerEmail, tasks),
|
|
40
|
+
...(hasCompleted !== undefined
|
|
41
|
+
? { hasCompletedTasks: hasCompleted }
|
|
42
|
+
: {}),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
tasks,
|
|
47
|
+
...(hasCompleted !== undefined
|
|
48
|
+
? { hasCompletedTasks: hasCompleted }
|
|
49
|
+
: {}),
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core/action";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
import { requireUserEmail } from "../server/custom-fields/store.js";
|
|
5
|
+
import { getTaskCardFieldIds } from "../server/user-config/store.js";
|
|
6
|
+
|
|
7
|
+
export default defineAction({
|
|
8
|
+
description:
|
|
9
|
+
"List custom field ids currently shown on task cards for the current user.",
|
|
10
|
+
schema: z.object({}),
|
|
11
|
+
http: { method: "GET" },
|
|
12
|
+
readOnly: true,
|
|
13
|
+
run: async (_args, ctx) => {
|
|
14
|
+
const ownerEmail = requireUserEmail(ctx?.userEmail);
|
|
15
|
+
const fieldIds = await getTaskCardFieldIds({ ownerEmail });
|
|
16
|
+
return { fieldIds };
|
|
17
|
+
},
|
|
18
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core/action";
|
|
2
|
+
import { buildDeepLink } from "@agent-native/core/server";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
|
|
5
|
+
import { markInboxItemReady, requireUserEmail } from "../server/inbox/store.js";
|
|
6
|
+
import type { Task } from "../server/tasks/store.js";
|
|
7
|
+
|
|
8
|
+
export default defineAction({
|
|
9
|
+
description:
|
|
10
|
+
"Mark an inbox item ready: promotes the inbox item to an incomplete task (same id).",
|
|
11
|
+
schema: z.object({
|
|
12
|
+
inboxItemId: z.string().describe("Inbox item id"),
|
|
13
|
+
}),
|
|
14
|
+
run: async (args, ctx) => {
|
|
15
|
+
const ownerEmail = requireUserEmail(ctx?.userEmail);
|
|
16
|
+
return markInboxItemReady({ ownerEmail, id: args.inboxItemId });
|
|
17
|
+
},
|
|
18
|
+
link: ({ result }) => {
|
|
19
|
+
if (!result || typeof result !== "object") return null;
|
|
20
|
+
const payload = result as { task?: Task };
|
|
21
|
+
const task = payload.task;
|
|
22
|
+
if (!task?.id || !task.title) return null;
|
|
23
|
+
return {
|
|
24
|
+
url: buildDeepLink({
|
|
25
|
+
view: "tasks",
|
|
26
|
+
params: { taskId: task.id },
|
|
27
|
+
}),
|
|
28
|
+
label: task.title,
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navigate the UI to a view.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* pnpm action navigate --view=tasks
|
|
6
|
+
* pnpm action navigate --view=tasks --includeDone=true
|
|
7
|
+
* pnpm action navigate --view=tasks --taskId=<id>
|
|
8
|
+
* pnpm action navigate --view=fields
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { defineAction } from "@agent-native/core/action";
|
|
12
|
+
import { writeAppStateForCurrentTab } from "@agent-native/core/application-state";
|
|
13
|
+
import { z } from "zod";
|
|
14
|
+
|
|
15
|
+
import {
|
|
16
|
+
NAV_VIEW_INPUTS,
|
|
17
|
+
pathForView,
|
|
18
|
+
resolveNavView,
|
|
19
|
+
} from "../shared/navigation.js";
|
|
20
|
+
import { optionalBooleanQueryParam } from "./lib/boolean-query-param.js";
|
|
21
|
+
|
|
22
|
+
const viewSchema = z.enum(NAV_VIEW_INPUTS);
|
|
23
|
+
|
|
24
|
+
export default defineAction({
|
|
25
|
+
description:
|
|
26
|
+
"Navigate the UI to a specific view. Writes a navigate command to application state which the UI reads and auto-deletes.",
|
|
27
|
+
schema: z.object({
|
|
28
|
+
view: viewSchema.describe(
|
|
29
|
+
"View name to navigate to; home and ask are aliases for tasks",
|
|
30
|
+
),
|
|
31
|
+
taskId: z.string().optional().describe("Selected task id on /tasks"),
|
|
32
|
+
fieldId: z
|
|
33
|
+
.string()
|
|
34
|
+
.optional()
|
|
35
|
+
.describe("Selected custom field id on /fields"),
|
|
36
|
+
includeDone: optionalBooleanQueryParam().describe(
|
|
37
|
+
"When true, show completed tasks on /tasks",
|
|
38
|
+
),
|
|
39
|
+
}),
|
|
40
|
+
http: false,
|
|
41
|
+
run: async (args) => {
|
|
42
|
+
const view = resolveNavView(args.view);
|
|
43
|
+
const nav: Record<string, string | boolean> = { view };
|
|
44
|
+
if (args.taskId) nav.taskId = args.taskId;
|
|
45
|
+
if (args.fieldId) nav.fieldId = args.fieldId;
|
|
46
|
+
if (args.includeDone !== undefined) nav.includeDone = args.includeDone;
|
|
47
|
+
nav._writeId = `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
48
|
+
await writeAppStateForCurrentTab("navigate", nav);
|
|
49
|
+
return `Navigating to ${pathForView(view)}`;
|
|
50
|
+
},
|
|
51
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core/action";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
reorderCustomFields,
|
|
6
|
+
requireUserEmail,
|
|
7
|
+
} from "../server/custom-fields/store.js";
|
|
8
|
+
import { BULK_ID_LIMIT } from "../shared/bulk-limits.js";
|
|
9
|
+
|
|
10
|
+
export default defineAction({
|
|
11
|
+
description:
|
|
12
|
+
"Reorder custom field definitions by passing field ids top-to-bottom.",
|
|
13
|
+
schema: z.object({
|
|
14
|
+
fieldIds: z
|
|
15
|
+
.array(z.string())
|
|
16
|
+
.min(1)
|
|
17
|
+
.max(BULK_ID_LIMIT)
|
|
18
|
+
.describe("Field ids in the desired order from top to bottom."),
|
|
19
|
+
}),
|
|
20
|
+
run: async (args, ctx) => {
|
|
21
|
+
const ownerEmail = requireUserEmail(ctx?.userEmail);
|
|
22
|
+
return reorderCustomFields({
|
|
23
|
+
ownerEmail,
|
|
24
|
+
fieldIds: args.fieldIds,
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core/action";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
import { reorderInboxItems, requireUserEmail } from "../server/inbox/store.js";
|
|
5
|
+
import { BULK_ID_LIMIT } from "../shared/bulk-limits.js";
|
|
6
|
+
|
|
7
|
+
export default defineAction({
|
|
8
|
+
description:
|
|
9
|
+
"Reorder the inbox list by passing inbox item ids top-to-bottom.",
|
|
10
|
+
schema: z.object({
|
|
11
|
+
inboxItemIds: z
|
|
12
|
+
.array(z.string())
|
|
13
|
+
.min(1)
|
|
14
|
+
.max(BULK_ID_LIMIT)
|
|
15
|
+
.describe("Inbox item ids in the desired order from top to bottom."),
|
|
16
|
+
}),
|
|
17
|
+
run: async (args, ctx) => {
|
|
18
|
+
const ownerEmail = requireUserEmail(ctx?.userEmail);
|
|
19
|
+
return reorderInboxItems({
|
|
20
|
+
ownerEmail,
|
|
21
|
+
inboxItemIds: args.inboxItemIds,
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core/action";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
import { reorderTasks, requireUserEmail } from "../server/tasks/store.js";
|
|
5
|
+
import { BULK_ID_LIMIT } from "../shared/bulk-limits.js";
|
|
6
|
+
import { booleanQueryParam } from "./lib/boolean-query-param.js";
|
|
7
|
+
|
|
8
|
+
export default defineAction({
|
|
9
|
+
description:
|
|
10
|
+
"Reorder the visible task list by passing task ids top-to-bottom. Use the same includeDone flag as the current list filter.",
|
|
11
|
+
schema: z.object({
|
|
12
|
+
taskIds: z
|
|
13
|
+
.array(z.string())
|
|
14
|
+
.min(1)
|
|
15
|
+
.max(BULK_ID_LIMIT)
|
|
16
|
+
.describe("Task ids in the desired order from top to bottom."),
|
|
17
|
+
includeDone: booleanQueryParam(false).describe(
|
|
18
|
+
"When true, reorder the show-all list including completed tasks.",
|
|
19
|
+
),
|
|
20
|
+
}),
|
|
21
|
+
run: async (args, ctx) => {
|
|
22
|
+
const ownerEmail = requireUserEmail(ctx?.userEmail);
|
|
23
|
+
return reorderTasks({
|
|
24
|
+
ownerEmail,
|
|
25
|
+
taskIds: args.taskIds,
|
|
26
|
+
includeDone: args.includeDone,
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core/action";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
import { updateCustomFieldConfigActionSchema } from "../server/custom-fields/schema.js";
|
|
5
|
+
import {
|
|
6
|
+
requireUserEmail,
|
|
7
|
+
updateCustomField,
|
|
8
|
+
} from "../server/custom-fields/store.js";
|
|
9
|
+
import { UserInputError } from "../server/errors.js";
|
|
10
|
+
|
|
11
|
+
export default defineAction({
|
|
12
|
+
description:
|
|
13
|
+
"Rename or reconfigure a custom field definition. The field type cannot change.",
|
|
14
|
+
schema: z.object({
|
|
15
|
+
fieldId: z.string().describe("Custom field id"),
|
|
16
|
+
title: z.string().min(1).optional().describe("New field title"),
|
|
17
|
+
config: updateCustomFieldConfigActionSchema
|
|
18
|
+
.optional()
|
|
19
|
+
.describe("Type-compatible field configuration"),
|
|
20
|
+
}),
|
|
21
|
+
run: async (args, ctx) => {
|
|
22
|
+
const ownerEmail = requireUserEmail(ctx?.userEmail);
|
|
23
|
+
if (args.title === undefined && args.config === undefined) {
|
|
24
|
+
throw new UserInputError("Provide title or config.");
|
|
25
|
+
}
|
|
26
|
+
return updateCustomField({
|
|
27
|
+
ownerEmail,
|
|
28
|
+
fieldId: args.fieldId,
|
|
29
|
+
title: args.title,
|
|
30
|
+
config: args.config,
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core/action";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
import { UserInputError } from "../server/errors.js";
|
|
5
|
+
import { requireUserEmail, updateInboxItem } from "../server/inbox/store.js";
|
|
6
|
+
|
|
7
|
+
export default defineAction({
|
|
8
|
+
description: "Update an inbox item title.",
|
|
9
|
+
schema: z.object({
|
|
10
|
+
inboxItemId: z.string().describe("Inbox item id"),
|
|
11
|
+
title: z.string().min(1).optional().describe("New inbox item title"),
|
|
12
|
+
}),
|
|
13
|
+
run: async (args, ctx) => {
|
|
14
|
+
const ownerEmail = requireUserEmail(ctx?.userEmail);
|
|
15
|
+
if (args.title === undefined) {
|
|
16
|
+
throw new UserInputError("Provide title to update.");
|
|
17
|
+
}
|
|
18
|
+
return updateInboxItem({
|
|
19
|
+
ownerEmail,
|
|
20
|
+
id: args.inboxItemId,
|
|
21
|
+
title: args.title,
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
});
|