@notis_ai/cli 0.2.18 → 0.2.19
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/README.md +542 -146
- package/bin/check-runtime.js +15 -0
- package/bin/notis.js +2 -0
- package/config/notis_app_design_rules.json +320 -0
- package/config/portal-route-roots.json +45 -0
- package/dist/agent-hooks/notis-agent-hook.mjs +42325 -18273
- package/dist/base-skills/notis-cli/.notis-base-skill.json +1 -0
- package/dist/base-skills/notis-cli/SKILL.md +51 -280
- package/dist/base-skills/notis-cli/references/app-delivery.md +17 -0
- package/dist/base-skills/notis-cli/references/intelligence.md +94 -0
- package/dist/base-skills/notis-cli/references/native-databases.md +21 -0
- package/dist/base-skills/notis-cli/references/tool-examples.md +56 -0
- package/dist/base-skills/notis-cli/references/troubleshooting.md +67 -0
- package/dist/base-skills/notis-query/.notis-base-skill.json +1 -0
- package/dist/base-skills/notis-query/SKILL.md +35 -699
- package/dist/base-skills/notis-query/references/database-discovery.md +59 -0
- package/dist/base-skills/notis-query/references/documents.md +74 -0
- package/dist/base-skills/notis-query/references/query.md +76 -0
- package/dist/base-skills/notis-spaces/.notis-base-skill.json +1 -0
- package/dist/base-skills/notis-spaces/SKILL.md +218 -0
- package/dist/base-skills/notis-spaces/references/architecture.md +116 -0
- package/dist/base-skills/notis-spaces/references/context.md +81 -0
- package/dist/base-skills/notis-spaces/references/design.md +141 -0
- package/dist/base-skills/notis-spaces/references/fixtures.md +29 -0
- package/dist/base-skills/notis-spaces/references/memory.md +58 -0
- package/dist/base-skills/notis-spaces/references/reading.md +73 -0
- package/dist/base-skills/notis-spaces/references/release.md +120 -0
- package/dist/base-skills/notis-spaces/references/reports.md +77 -0
- package/dist/base-skills/notis-spaces/references/sdk.md +273 -0
- package/dist/base-skills/notis-spaces/references/store.md +118 -0
- package/dist/base-skills/notis-spaces/references/troubleshooting.md +28 -0
- package/dist/base-skills/notis-spaces/references/views.md +229 -0
- package/{template/packages → dist}/sdk/package.json +9 -10
- package/dist/sdk/src/agentContext.ts +36 -0
- package/dist/sdk/src/bundleModule.ts +175 -0
- package/dist/sdk/src/components/Dialog.tsx +103 -0
- package/dist/sdk/src/components/DocumentEditor.tsx +113 -0
- package/dist/sdk/src/components/DocumentPage.tsx +184 -0
- package/{template/packages → dist}/sdk/src/components/Markdown.tsx +9 -3
- package/{template/packages → dist}/sdk/src/components/MarkdownEditor.tsx +26 -5
- package/{template/packages → dist}/sdk/src/components/MultiSelectActionBar.tsx +95 -12
- package/{template/packages → dist}/sdk/src/components/MultiSelectCheckbox.tsx +4 -2
- package/dist/sdk/src/components/NotisCommentBoundary.tsx +172 -0
- package/{template/packages → dist}/sdk/src/components/NotisSelectionBoundary.tsx +9 -5
- package/dist/sdk/src/components/RecordComponents.tsx +111 -0
- package/dist/sdk/src/components/Skeleton.tsx +38 -0
- package/dist/sdk/src/config.ts +31 -0
- package/{template/packages → dist}/sdk/src/documents.ts +21 -6
- package/dist/sdk/src/hooks/useAction.ts +28 -0
- package/dist/sdk/src/hooks/useAgentContext.ts +23 -0
- package/{template/packages → dist}/sdk/src/hooks/useBackend.ts +3 -2
- package/dist/sdk/src/hooks/useCloudComputer.ts +94 -0
- package/dist/sdk/src/hooks/useCloudComputerShell.ts +114 -0
- package/{template/packages → dist}/sdk/src/hooks/useCollectionInteractions.ts +157 -147
- package/dist/sdk/src/hooks/useDatabaseSchema.ts +50 -0
- package/{template/packages → dist}/sdk/src/hooks/useDatabaseSubscription.ts +2 -2
- package/dist/sdk/src/hooks/useDocument.ts +51 -0
- package/{template/packages → dist}/sdk/src/hooks/useDocuments.ts +25 -59
- package/{template/packages → dist}/sdk/src/hooks/useHandover.ts +7 -7
- package/dist/sdk/src/hooks/useLongPressSelection.ts +79 -0
- package/dist/sdk/src/hooks/useMarqueeSelection.ts +194 -0
- package/{template/packages → dist}/sdk/src/hooks/useMultiSelect.ts +2 -8
- package/dist/sdk/src/hooks/useNativeDocumentBody.ts +50 -0
- package/dist/sdk/src/hooks/useNativeDocuments.ts +143 -0
- package/{template/packages → dist}/sdk/src/hooks/useNotis.ts +6 -1
- package/dist/sdk/src/hooks/useNotisNavigation.ts +70 -0
- package/dist/sdk/src/hooks/useQuery.ts +81 -0
- package/dist/sdk/src/hooks/useToolQuery.ts +12 -0
- package/dist/sdk/src/hooks/useTopBarSearch.ts +102 -0
- package/dist/sdk/src/hooks/useTopBarTitleLeaf.ts +75 -0
- package/{template/packages → dist}/sdk/src/hooks/useUpsertDocument.ts +1 -1
- package/dist/sdk/src/hooks/useViewParams.ts +195 -0
- package/dist/sdk/src/hooks/useViewerReads.ts +129 -0
- package/{template/packages → dist}/sdk/src/index.ts +64 -1
- package/{template/packages → dist}/sdk/src/interactions/actions.ts +14 -1
- package/{template/packages → dist}/sdk/src/interactions/shortcuts.tsx +129 -23
- package/dist/sdk/src/interactions/visibility.ts +13 -0
- package/{template/packages → dist}/sdk/src/interactions.ts +5 -1
- package/dist/sdk/src/nativeData.ts +39 -0
- package/{template/packages → dist}/sdk/src/provider.tsx +9 -4
- package/dist/sdk/src/queryCache.ts +292 -0
- package/dist/sdk/src/queryErrors.ts +51 -0
- package/dist/sdk/src/runtime.ts +675 -0
- package/dist/sdk/src/runtimeModules.ts +33 -0
- package/dist/sdk/src/space.ts +442 -0
- package/dist/sdk/src/standardViewParams.ts +36 -0
- package/{template/packages → dist}/sdk/src/styles.css +81 -16
- package/dist/sdk/src/tailwind.ts +66 -0
- package/dist/sdk/src/ui/charts/RenderChartData.tsx +25 -0
- package/dist/sdk/src/ui/engine/core.ts +392 -0
- package/dist/sdk/src/ui/engine/dom.ts +183 -0
- package/dist/sdk/src/ui/engine/hooks.ts +195 -0
- package/dist/sdk/src/ui/engine/instance.ts +63 -0
- package/dist/sdk/src/ui/engine/keycapContext.ts +2 -0
- package/dist/sdk/src/ui/engine/registry.ts +262 -0
- package/dist/sdk/src/ui/engine/types.ts +62 -0
- package/dist/sdk/src/ui/icons.tsx +91 -0
- package/dist/sdk/src/ui/util.ts +83 -0
- package/dist/sdk/src/viewPeriod.ts +26 -0
- package/dist/sdk/src/vite.ts +92 -0
- package/dist/sdk/src/words/actions.ts +295 -0
- package/dist/sdk/src/words/clashes.ts +158 -0
- package/dist/sdk/src/words/format.ts +136 -0
- package/dist/sdk/src/words/index.ts +13 -0
- package/dist/sdk/src/words/keymap.ts +72 -0
- package/dist/sdk/src/words/keys.ts +297 -0
- package/dist/sdk/src/words/shell.ts +46 -0
- package/dist/sdk/src/words/types.ts +65 -0
- package/dist/skill-sync/index.js +832 -151
- package/dist/skill-sync/index.js.map +4 -4
- package/dist/skill-sync-worker.mjs +3941 -0
- package/dist/space-harness/host.js +1460 -0
- package/dist/space-sdk/dist/chunk-ZSN57ATH.js +5 -0
- package/dist/space-sdk/dist/index.js +15 -0
- package/dist/space-sdk/dist/ui.js +18 -0
- package/dist/space-sdk/package.json +33 -0
- package/dist/space-sdk/src/agentContext.d.ts +36 -0
- package/dist/space-sdk/src/components/Dialog.d.ts +20 -0
- package/dist/space-sdk/src/components/DocumentEditor.d.ts +46 -0
- package/dist/space-sdk/src/components/DocumentPage.d.ts +53 -0
- package/dist/space-sdk/src/components/Markdown.d.ts +18 -0
- package/dist/space-sdk/src/components/MarkdownEditor.d.ts +11 -0
- package/dist/space-sdk/src/components/MultiSelectActionBar.d.ts +31 -0
- package/dist/space-sdk/src/components/MultiSelectCheckbox.d.ts +14 -0
- package/dist/space-sdk/src/components/MultiSelectDragOverlay.d.ts +8 -0
- package/dist/space-sdk/src/components/NotisCommentBoundary.d.ts +36 -0
- package/dist/space-sdk/src/components/NotisSelectionBoundary.d.ts +16 -0
- package/dist/space-sdk/src/components/RecordComponents.d.ts +64 -0
- package/dist/space-sdk/src/components/ShortcutHints.d.ts +12 -0
- package/dist/space-sdk/src/components/Skeleton.d.ts +23 -0
- package/dist/space-sdk/src/config.ts +31 -0
- package/dist/space-sdk/src/documents.d.ts +59 -0
- package/dist/space-sdk/src/hooks/useAction.d.ts +8 -0
- package/dist/space-sdk/src/hooks/useActiveResource.d.ts +3 -0
- package/dist/space-sdk/src/hooks/useAgentContext.d.ts +7 -0
- package/dist/space-sdk/src/hooks/useBackend.d.ts +23 -0
- package/dist/space-sdk/src/hooks/useCloudComputer.d.ts +45 -0
- package/dist/space-sdk/src/hooks/useCloudComputerShell.d.ts +49 -0
- package/dist/space-sdk/src/hooks/useCollectionInteractions.d.ts +118 -0
- package/dist/space-sdk/src/hooks/useDatabaseSchema.d.ts +14 -0
- package/dist/space-sdk/src/hooks/useDatabaseSubscription.d.ts +26 -0
- package/dist/space-sdk/src/hooks/useDocument.d.ts +22 -0
- package/dist/space-sdk/src/hooks/useDocuments.d.ts +31 -0
- package/dist/space-sdk/src/hooks/useHandover.d.ts +43 -0
- package/dist/space-sdk/src/hooks/useLongPressSelection.d.ts +9 -0
- package/dist/space-sdk/src/hooks/useMarqueeSelection.d.ts +57 -0
- package/dist/space-sdk/src/hooks/useMultiSelect.d.ts +51 -0
- package/dist/space-sdk/src/hooks/useNativeDocumentBody.d.ts +24 -0
- package/dist/space-sdk/src/hooks/useNativeDocuments.d.ts +55 -0
- package/dist/space-sdk/src/hooks/useNotis.d.ts +25 -0
- package/dist/space-sdk/src/hooks/useNotisNavigation.d.ts +33 -0
- package/dist/space-sdk/src/hooks/useQuery.d.ts +22 -0
- package/dist/space-sdk/src/hooks/useTool.d.ts +20 -0
- package/dist/space-sdk/src/hooks/useToolQuery.d.ts +3 -0
- package/dist/space-sdk/src/hooks/useTools.d.ts +15 -0
- package/dist/space-sdk/src/hooks/useTopBarSearch.d.ts +48 -0
- package/dist/space-sdk/src/hooks/useTopBarTitleLeaf.d.ts +24 -0
- package/dist/space-sdk/src/hooks/useUpsertDocument.d.ts +27 -0
- package/dist/space-sdk/src/hooks/useViewParams.d.ts +76 -0
- package/dist/space-sdk/src/hooks/useViewerReads.d.ts +38 -0
- package/dist/space-sdk/src/index.d.ts +98 -0
- package/dist/space-sdk/src/interactions/actions.d.ts +33 -0
- package/dist/space-sdk/src/interactions/shortcuts.d.ts +42 -0
- package/dist/space-sdk/src/interactions/visibility.d.ts +2 -0
- package/dist/space-sdk/src/nativeData.d.ts +66 -0
- package/dist/space-sdk/src/provider.d.ts +17 -0
- package/dist/space-sdk/src/queryCache.d.ts +45 -0
- package/dist/space-sdk/src/queryErrors.ts +51 -0
- package/dist/space-sdk/src/runtime.d.ts +615 -0
- package/dist/space-sdk/src/runtimeModules.ts +33 -0
- package/dist/space-sdk/src/space.ts +442 -0
- package/dist/space-sdk/src/standardViewParams.d.ts +15 -0
- package/dist/space-sdk/src/tailwind-candidates.d.ts +3418 -0
- package/dist/space-sdk/src/tailwind.ts +66 -0
- package/dist/space-sdk/src/ui/actions/ActionToast.d.ts +15 -0
- package/dist/space-sdk/src/ui/actions/actionWords.d.ts +16 -0
- package/dist/space-sdk/src/ui/actions/index.d.ts +7 -0
- package/dist/space-sdk/src/ui/actions/useActions.d.ts +69 -0
- package/dist/space-sdk/src/ui/actions/useToast.d.ts +41 -0
- package/dist/space-sdk/src/ui/blocks/Tabs.d.ts +139 -0
- package/dist/space-sdk/src/ui/blocks/blocks.d.ts +217 -0
- package/dist/space-sdk/src/ui/blocks/index.d.ts +4 -0
- package/dist/space-sdk/src/ui/board/BoardView.d.ts +36 -0
- package/dist/space-sdk/src/ui/board/boardModel.d.ts +46 -0
- package/dist/space-sdk/src/ui/board/boardWords.d.ts +9 -0
- package/dist/space-sdk/src/ui/board/index.d.ts +5 -0
- package/dist/space-sdk/src/ui/calendar/CalendarView.d.ts +49 -0
- package/dist/space-sdk/src/ui/calendar/DayPicker.d.ts +23 -0
- package/dist/space-sdk/src/ui/calendar/calendarMath.d.ts +81 -0
- package/dist/space-sdk/src/ui/charts/Chart.d.ts +203 -0
- package/dist/space-sdk/src/ui/charts/ChartTable.d.ts +37 -0
- package/dist/space-sdk/src/ui/charts/RenderChartData.d.ts +16 -0
- package/dist/space-sdk/src/ui/charts/StatRow.d.ts +59 -0
- package/dist/space-sdk/src/ui/charts/chartData.d.ts +84 -0
- package/dist/space-sdk/src/ui/comments/CommentPane.d.ts +58 -0
- package/dist/space-sdk/src/ui/comments/commentModel.d.ts +157 -0
- package/dist/space-sdk/src/ui/comments/commentWords.d.ts +60 -0
- package/dist/space-sdk/src/ui/comments/index.d.ts +4 -0
- package/dist/space-sdk/src/ui/comments/useComments.d.ts +146 -0
- package/dist/space-sdk/src/ui/engine/HelpSheet.d.ts +12 -0
- package/dist/space-sdk/src/ui/engine/KeyboardEngine.d.ts +27 -0
- package/dist/space-sdk/src/ui/engine/core.d.ts +73 -0
- package/dist/space-sdk/src/ui/engine/hooks.d.ts +64 -0
- package/dist/space-sdk/src/ui/engine/index.d.ts +14 -0
- package/dist/space-sdk/src/ui/engine/instance.d.ts +21 -0
- package/dist/space-sdk/src/ui/engine/keycapContext.d.ts +2 -0
- package/dist/space-sdk/src/ui/engine/registry.d.ts +77 -0
- package/dist/space-sdk/src/ui/engine/step.d.ts +11 -0
- package/dist/space-sdk/src/ui/engine/types.d.ts +54 -0
- package/dist/space-sdk/src/ui/fields/fieldWords.d.ts +56 -0
- package/dist/space-sdk/src/ui/fields/fields.d.ts +162 -0
- package/dist/space-sdk/src/ui/fields/index.d.ts +5 -0
- package/dist/space-sdk/src/ui/fields/useFieldDraft.d.ts +22 -0
- package/dist/space-sdk/src/ui/gallery/AttachmentGallery.d.ts +53 -0
- package/dist/space-sdk/src/ui/gallery/ImageViewer.d.ts +27 -0
- package/dist/space-sdk/src/ui/gallery/galleryWords.d.ts +95 -0
- package/dist/space-sdk/src/ui/gallery/index.d.ts +5 -0
- package/dist/space-sdk/src/ui/icons.d.ts +13 -0
- package/dist/space-sdk/src/ui/index.d.ts +54 -0
- package/dist/space-sdk/src/ui/keycap/Keycap.d.ts +22 -0
- package/dist/space-sdk/src/ui/keycap/index.d.ts +2 -0
- package/dist/space-sdk/src/ui/layout/Panels.d.ts +50 -0
- package/dist/space-sdk/src/ui/layout/chatPanelEdge.d.ts +77 -0
- package/dist/space-sdk/src/ui/layout/index.d.ts +5 -0
- package/dist/space-sdk/src/ui/layout/panelMath.d.ts +91 -0
- package/dist/space-sdk/src/ui/list/ListReader.d.ts +380 -0
- package/dist/space-sdk/src/ui/list/Row.d.ts +145 -0
- package/dist/space-sdk/src/ui/list/SelectionBar.d.ts +65 -0
- package/dist/space-sdk/src/ui/list/index.d.ts +14 -0
- package/dist/space-sdk/src/ui/list/rowState.d.ts +22 -0
- package/dist/space-sdk/src/ui/list/useListKeys.d.ts +89 -0
- package/dist/space-sdk/src/ui/list/useReorder.d.ts +86 -0
- package/dist/space-sdk/src/ui/list/useSelection.d.ts +90 -0
- package/dist/space-sdk/src/ui/open/OpenAsMenu.d.ts +15 -0
- package/dist/space-sdk/src/ui/open/index.d.ts +6 -0
- package/dist/space-sdk/src/ui/open/openModeStore.d.ts +39 -0
- package/dist/space-sdk/src/ui/open/useOpenMode.d.ts +17 -0
- package/dist/space-sdk/src/ui/overlay/Menu.d.ts +88 -0
- package/dist/space-sdk/src/ui/overlay/Popover.d.ts +28 -0
- package/dist/space-sdk/src/ui/overlay/Tooltip.d.ts +19 -0
- package/dist/space-sdk/src/ui/overlay/index.d.ts +9 -0
- package/dist/space-sdk/src/ui/overlay/layerRoot.d.ts +24 -0
- package/dist/space-sdk/src/ui/overlay/position.d.ts +31 -0
- package/dist/space-sdk/src/ui/period/PeriodPicker.d.ts +30 -0
- package/dist/space-sdk/src/ui/period/dateFormat.d.ts +50 -0
- package/dist/space-sdk/src/ui/period/dateWords.d.ts +88 -0
- package/dist/space-sdk/src/ui/period/periods.d.ts +70 -0
- package/dist/space-sdk/src/ui/period/usePeriod.d.ts +23 -0
- package/dist/space-sdk/src/ui/present/index.d.ts +3 -0
- package/dist/space-sdk/src/ui/present/presentWords.d.ts +27 -0
- package/dist/space-sdk/src/ui/present/screens.d.ts +36 -0
- package/dist/space-sdk/src/ui/present/useAudienceScreen.d.ts +38 -0
- package/dist/space-sdk/src/ui/styles.d.ts +21 -0
- package/dist/space-sdk/src/ui/timeline/TimelineView.d.ts +44 -0
- package/dist/space-sdk/src/ui/timeline/timelineMath.d.ts +123 -0
- package/dist/space-sdk/src/viewPeriod.d.ts +8 -0
- package/dist/space-sdk/src/vite.ts +92 -0
- package/dist/space-sdk/src/words/actions.ts +295 -0
- package/dist/space-sdk/src/words/clashes.ts +158 -0
- package/dist/space-sdk/src/words/format.ts +136 -0
- package/dist/space-sdk/src/words/index.ts +13 -0
- package/dist/space-sdk/src/words/keymap.ts +72 -0
- package/dist/space-sdk/src/words/keys.ts +297 -0
- package/dist/space-sdk/src/words/shell.ts +46 -0
- package/dist/space-sdk/src/words/types.ts +65 -0
- package/dist/view-renderer/dist/host.css +1 -0
- package/dist/view-renderer/dist/host.js +2374 -0
- package/dist/view-renderer/dist/theme.css +73 -0
- package/dist/view-renderer/src/dom.js +212 -0
- package/dist/view-renderer/src/errors.js +8 -0
- package/dist/view-renderer/src/host.tsx +250 -0
- package/dist/view-renderer/src/index.js +4 -0
- package/dist/view-renderer/src/png.js +213 -0
- package/dist/view-renderer/src/pool.js +110 -0
- package/dist/view-renderer/src/remote-broker.js +59 -0
- package/dist/view-renderer/src/renderer.js +271 -0
- package/package.json +21 -11
- package/skills/notis-cli/AGENT_INSTRUCTIONS.md +63 -12
- package/skills/notis-onboarding/BRIEF.md +14 -9
- package/skills/notis-query/cli.md +1 -1
- package/skills/notis-spaces/cli.md +540 -0
- package/src/cli.js +8 -8
- package/src/command-specs/agents.js +121 -8
- package/src/command-specs/auth.js +3 -3
- package/src/command-specs/diagnostics.js +97 -20
- package/src/command-specs/documents.js +158 -0
- package/src/command-specs/files.js +29 -0
- package/src/command-specs/handover.js +331 -79
- package/src/command-specs/helpers.js +50 -40
- package/src/command-specs/index.js +14 -5
- package/src/command-specs/meta.js +38 -9
- package/src/command-specs/onboarding.js +1 -1
- package/src/command-specs/profile.js +42 -1
- package/src/command-specs/skills.js +314 -9
- package/src/command-specs/smoke.js +16 -4
- package/src/command-specs/spaces.js +783 -0
- package/src/command-specs/tools.js +118 -21
- package/src/command-specs/version-history.js +20 -0
- package/src/command-specs/views.js +69 -0
- package/src/runtime/agent-browser.js +178 -267
- package/src/runtime/agent-setup.js +172 -13
- package/src/runtime/app-boundary-validator.js +338 -2
- package/src/runtime/app-data-literals.js +82 -0
- package/src/runtime/app-platform.js +750 -1570
- package/src/runtime/auth-recovery.js +17 -0
- package/src/runtime/base-skills.d.ts +11 -0
- package/src/runtime/base-skills.js +100 -3
- package/src/runtime/computer-identity.d.ts +30 -0
- package/src/runtime/computer-identity.js +151 -0
- package/src/runtime/config-lock.js +135 -0
- package/src/runtime/confined-space-build.js +74 -0
- package/src/runtime/confined-space-verify.js +49 -0
- package/src/runtime/delegated-context.js +5 -21
- package/src/runtime/native-record-files.js +47 -0
- package/src/runtime/oauth.js +342 -31
- package/src/runtime/profiles.js +19 -112
- package/src/runtime/retired-sdk-files.js +24 -0
- package/src/runtime/retry.js +150 -0
- package/src/runtime/skill-sync/cloud-client.ts +33 -8
- package/src/runtime/skill-sync/index.ts +443 -106
- package/src/runtime/skill-sync/local-scanner.ts +248 -32
- package/src/runtime/skill-sync/native-identity.ts +102 -0
- package/src/runtime/skill-sync/native-plan.ts +70 -0
- package/src/runtime/skill-sync/symlink-manager.ts +66 -16
- package/src/runtime/skill-sync/sync-plan.ts +34 -2
- package/src/runtime/skill-sync/types.ts +54 -0
- package/src/runtime/skill-sync/write-cloud-skill.ts +4 -4
- package/src/runtime/skill-sync-service.js +109 -0
- package/src/runtime/source-root.js +32 -0
- package/src/runtime/space-collection-scaffold.js +107 -0
- package/src/runtime/space-database-structures.js +229 -0
- package/src/runtime/space-fixture-broker.js +68 -0
- package/src/runtime/space-lock.js +337 -0
- package/src/runtime/space-platform.js +133 -0
- package/src/runtime/space-source.js +290 -0
- package/src/runtime/space-test-server.js +354 -0
- package/src/runtime/space-verification.js +94 -0
- package/src/runtime/space-verify-browser-worker.js +51 -0
- package/src/runtime/space-view-manifest.js +368 -0
- package/src/runtime/sync-skills.d.ts +5 -1
- package/src/runtime/sync-skills.js +11 -2
- package/src/runtime/tool-confirmation.js +138 -0
- package/src/runtime/transport.js +118 -24
- package/src/runtime/upsell.js +219 -0
- package/src/runtime/view-render.js +49 -0
- package/src/skill-sync-worker-entry.js +2 -0
- package/src/skill-sync-worker.js +114 -0
- package/src/space-harness-host.ts +122 -0
- package/template/.harness/index.html.tmpl +9 -352
- package/template/app/globals.css +29 -3
- package/template/app/layout.tsx +2 -6
- package/template/components/ui/badge.tsx +7 -4
- package/template/components/ui/button.tsx +1 -1
- package/template/components/ui/native-select.tsx +24 -0
- package/template/notis.config.ts +4 -36
- package/template/package-lock.json +1800 -1867
- package/template/package.json +16 -14
- package/template/postcss.config.mjs +1 -1
- package/template/tailwind.config.ts +1 -6
- package/template/tsconfig.json +1 -0
- package/template/vite.config.ts +2 -2
- package/dist/base-skills/notis-apps/SKILL.md +0 -613
- package/skills/notis-apps/cli.md +0 -285
- package/src/command-specs/apps.js +0 -3011
- package/src/runtime/app-changelog.js +0 -79
- package/src/runtime/app-dev-consumers.js +0 -154
- package/src/runtime/app-dev-host-lock.js +0 -80
- package/src/runtime/app-dev-process-identity.js +0 -111
- package/src/runtime/app-dev-roots.js +0 -284
- package/src/runtime/app-dev-server.js +0 -1140
- package/src/runtime/app-dev-sessions.js +0 -185
- package/src/runtime/app-registry-scaffolds.js +0 -367
- package/src/runtime/assets/store-screenshot-dark.png +0 -0
- package/src/runtime/cli-mode.generated.js +0 -5
- package/src/runtime/cli-mode.js +0 -34
- package/src/runtime/store-screenshot.js +0 -143
- package/template/CHANGELOG.md +0 -5
- package/template/app/page.tsx +0 -60
- package/template/components/ui/card.tsx +0 -56
- package/template/packages/sdk/src/components/DocumentEditor.tsx +0 -103
- package/template/packages/sdk/src/config.ts +0 -259
- package/template/packages/sdk/src/hooks/useCloudComputer.ts +0 -97
- package/template/packages/sdk/src/hooks/useDatabaseSchema.ts +0 -85
- package/template/packages/sdk/src/hooks/useDocument.ts +0 -78
- package/template/packages/sdk/src/hooks/useNotisNavigation.ts +0 -52
- package/template/packages/sdk/src/hooks/useTopBarSearch.ts +0 -73
- package/template/packages/sdk/src/runtime.ts +0 -439
- package/template/packages/sdk/src/vite.ts +0 -56
- package/template/packages/sdk/tsconfig.json +0 -15
- /package/{template/packages → dist}/sdk/src/components/MultiSelectDragOverlay.tsx +0 -0
- /package/{template/packages → dist}/sdk/src/components/ShortcutHints.tsx +0 -0
- /package/{template/packages → dist}/sdk/src/hooks/useActiveResource.ts +0 -0
- /package/{template/packages → dist}/sdk/src/hooks/useTool.ts +0 -0
- /package/{template/packages → dist}/sdk/src/hooks/useTools.ts +0 -0
- /package/{template/packages → dist}/sdk/src/ui.ts +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
interface TopBarSearchOptions {
|
|
2
|
+
/** Current value shown in the top bar search input. */
|
|
3
|
+
value: string;
|
|
4
|
+
/** Called when the user types in the top bar. */
|
|
5
|
+
onChange: (value: string) => void;
|
|
6
|
+
/** Placeholder text for the input. Defaults to 'Search…'. */
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
/** Called when the user presses Enter. May return a Promise. */
|
|
9
|
+
onSubmit?: () => void | Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
interface TopBarSearchActions {
|
|
12
|
+
/** Toggle the loader that replaces the search icon in the top bar. */
|
|
13
|
+
setLoading: (loading: boolean) => void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Registers this view's search binding with the portal's top bar search input.
|
|
17
|
+
* While the component is mounted, typing in the top bar calls `onChange`,
|
|
18
|
+
* pressing Enter calls `onSubmit`, and the `value` prop drives the input.
|
|
19
|
+
*
|
|
20
|
+
* Use `setLoading(true)` only for an explicitly submitted search action, then
|
|
21
|
+
* restore the icon with `setLoading(false)`. Automatic reads use content
|
|
22
|
+
* skeletons initially and refresh populated content silently.
|
|
23
|
+
*
|
|
24
|
+
* Without a portal runtime, this hook is a safe no-op.
|
|
25
|
+
*
|
|
26
|
+
* ```tsx
|
|
27
|
+
* const [q, setQ] = useState('');
|
|
28
|
+
* const { setLoading } = useTopBarSearch({
|
|
29
|
+
* value: q,
|
|
30
|
+
* onChange: setQ,
|
|
31
|
+
* placeholder: 'Search notes…',
|
|
32
|
+
* onSubmit: async () => {
|
|
33
|
+
* setLoading(true);
|
|
34
|
+
* try { await runSearch(q); } finally { setLoading(false); }
|
|
35
|
+
* },
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* Callback refs retain the latest committed handlers without re-registering
|
|
40
|
+
* search on every app render. Inline callbacks are safe.
|
|
41
|
+
*
|
|
42
|
+
* The top bar owns what is typed in it. A `value` that came from the bar is
|
|
43
|
+
* not sent back: the view's answer can arrive after the next key, and sending
|
|
44
|
+
* it back would undo that key. A value the view sets itself (a clear button,
|
|
45
|
+
* a link, a value it trims) is sent to the bar.
|
|
46
|
+
*/
|
|
47
|
+
export declare function useTopBarSearch(opts: TopBarSearchOptions): TopBarSearchActions;
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adds the open record's label as the last crumb of the Portal top bar title
|
|
3
|
+
* ("Product / Tickets / PRO-002") while the component is mounted. Pass `null`
|
|
4
|
+
* when no record is open: the component then owns no leaf and leaves another
|
|
5
|
+
* component's leaf alone. With several owners, the most recently opened one
|
|
6
|
+
* names the leaf; closing it gives the leaf back to the one before.
|
|
7
|
+
*
|
|
8
|
+
* `onBack` closes the record: the crumb before the leaf (the view) then calls it,
|
|
9
|
+
* so the top bar is the page's way back and the page draws no breadcrumb of its own.
|
|
10
|
+
*
|
|
11
|
+
* `recordKey` names the record the leaf shows, when it is a record of the Space's own
|
|
12
|
+
* collection (its `collection` database): its Editors can then rename that record from
|
|
13
|
+
* the leaf in the top bar, and the view shows the new name once its data refreshes.
|
|
14
|
+
*
|
|
15
|
+
* Without a portal runtime, this hook is a safe no-op.
|
|
16
|
+
*
|
|
17
|
+
* ```tsx
|
|
18
|
+
* useTopBarTitleLeaf(openTicket ? openTicket.key : null, () => setParams({ ticket: null }));
|
|
19
|
+
* useTopBarTitleLeaf(deck ? deck.name : null, undefined, { recordKey: deck?.recordKey });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function useTopBarTitleLeaf(label: string | null, onBack?: () => void, options?: {
|
|
23
|
+
recordKey?: string | null;
|
|
24
|
+
}): void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { DocumentRecord } from '../runtime';
|
|
2
|
+
export interface UpsertDocumentArgs {
|
|
3
|
+
documentId?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
/** Property values keyed by property name (already-plain values). */
|
|
6
|
+
properties?: Record<string, unknown>;
|
|
7
|
+
/** Markdown content; converted server-side to BlockNote. Exclusive with contentBlocknote. */
|
|
8
|
+
contentMarkdown?: string | null;
|
|
9
|
+
/** BlockNote block JSON. Exclusive with contentMarkdown. */
|
|
10
|
+
contentBlocknote?: Array<Record<string, unknown>> | null;
|
|
11
|
+
/** 'archive' soft-deletes the document (sets archived_at); 'restore' undoes it. */
|
|
12
|
+
operation?: 'create' | 'update' | 'archive' | 'restore';
|
|
13
|
+
}
|
|
14
|
+
export interface UseUpsertDocumentResult {
|
|
15
|
+
upsert: (args: UpsertDocumentArgs) => Promise<DocumentRecord>;
|
|
16
|
+
loading: boolean;
|
|
17
|
+
error: Error | null;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Create/update/archive documents in a Notis database.
|
|
21
|
+
*
|
|
22
|
+
* ```tsx
|
|
23
|
+
* const { upsert } = useUpsertDocument('journal_entries');
|
|
24
|
+
* await upsert({ documentId, properties: { Mood: 'Great' }, contentMarkdown: reflection });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function useUpsertDocument(databaseSlug: string): UseUpsertDocumentResult;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { NotisRuntime } from '../runtime';
|
|
2
|
+
import { type UseQueryResult } from './useQuery';
|
|
3
|
+
import type { SpaceDefinition, SpaceShownOptions, SpaceShownResult, SpaceViewParam } from '../space';
|
|
4
|
+
type ParamValue<P> = P extends {
|
|
5
|
+
type: 'enum';
|
|
6
|
+
values: readonly (infer V)[];
|
|
7
|
+
} ? V : P extends {
|
|
8
|
+
type: 'number';
|
|
9
|
+
} ? number : P extends {
|
|
10
|
+
type: 'boolean';
|
|
11
|
+
} ? boolean : string;
|
|
12
|
+
/** Typed params of a definition: `useViewParams<typeof definition>()`. */
|
|
13
|
+
export type ViewParamsOf<D extends Pick<SpaceDefinition, 'params'>> = D['params'] extends Record<string, SpaceViewParam> ? {
|
|
14
|
+
[K in keyof D['params']]?: ParamValue<D['params'][K]>;
|
|
15
|
+
} : Record<string, string | number | boolean | undefined>;
|
|
16
|
+
/** A change to the view's URL params: a value sets that param, null or undefined removes it. */
|
|
17
|
+
export type ViewParamChanges<T> = {
|
|
18
|
+
[K in keyof T]?: T[K] | null;
|
|
19
|
+
};
|
|
20
|
+
export interface SetViewParamsOptions {
|
|
21
|
+
/** Replace the current history entry instead of adding one, so Back skips this change. Default false. */
|
|
22
|
+
replace?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface ViewParams<T> {
|
|
25
|
+
/** Declared params only, typed; invalid URL values are left out (their default applies). */
|
|
26
|
+
params: T;
|
|
27
|
+
/** Declared params whose URL value was invalid and ignored. */
|
|
28
|
+
invalid: string[];
|
|
29
|
+
/** Required params without a value. */
|
|
30
|
+
missing: string[];
|
|
31
|
+
declared: Record<string, SpaceViewParam>;
|
|
32
|
+
ready: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Change this view's own URL params; the same Space and record stay open. Names left out of `changes` keep their
|
|
35
|
+
* value. No destination lookup and no alias to declare: use `useNotisNavigation().toNamedSpace` for another Space.
|
|
36
|
+
* Undeclared names are dropped by the host. Rejects outside a Space.
|
|
37
|
+
*/
|
|
38
|
+
setParams: (changes: ViewParamChanges<T>, options?: SetViewParamsOptions) => Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
/** Keep declared, valid values only; unknown params are dropped and defaults applied. */
|
|
41
|
+
export declare function parseViewParams(declared: Record<string, SpaceViewParam> | undefined, raw: Record<string, string> | null | undefined): Pick<ViewParams<Record<string, string | number | boolean>>, 'params' | 'invalid' | 'missing'>;
|
|
42
|
+
/**
|
|
43
|
+
* Write the open Space's own URL params (`setParams` of useViewParams; the toolkit's open item and period use it).
|
|
44
|
+
* The host keeps the Space and record, checks no destination, and adds a history entry unless `replace` is set.
|
|
45
|
+
*/
|
|
46
|
+
export declare function writeViewParams(runtime: NotisRuntime | null | undefined, changes: Record<string, unknown>, options?: SetViewParamsOptions): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* The view's declared URL params, typed and validated, and `setParams` to change them. Unknown params (such as
|
|
49
|
+
* `?foo=`) never reach the view. Record params are record keys; the server authorizes them where it uses them.
|
|
50
|
+
*/
|
|
51
|
+
export declare function useViewParams<D extends Pick<SpaceDefinition, 'params'> = SpaceDefinition>(): ViewParams<ViewParamsOf<D>>;
|
|
52
|
+
export interface UseShownOptions extends SpaceShownOptions {
|
|
53
|
+
enabled?: boolean;
|
|
54
|
+
staleTimeMs?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Read every page and answer with all rows: pages of `pageSize` (default 200) are read from `offset` until one
|
|
57
|
+
* comes back short, up to `SHOWN_ALL_PAGES_MAX` pages.
|
|
58
|
+
*/
|
|
59
|
+
allPages?: boolean;
|
|
60
|
+
}
|
|
61
|
+
/** The most pages `useShown({ allPages: true })` reads. */
|
|
62
|
+
export declare const SHOWN_ALL_PAGES_MAX = 50;
|
|
63
|
+
/** True when a declared list has an authorized host reader (Editor or exact record Site). */
|
|
64
|
+
export declare function useShownAvailable(name: string): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Runs exactly the list this view declares in `shows` with the current params, so the declaration
|
|
67
|
+
* is the list the view displays. Only sorting and paging are chosen here.
|
|
68
|
+
*
|
|
69
|
+
* A list this view context cannot read (undeclared, described only, or no host reader) answers
|
|
70
|
+
* with `error` instead of a query that never starts, so the view can show an error state. Missing
|
|
71
|
+
* required params are not an error: they are listed by `useViewParams().missing`.
|
|
72
|
+
*/
|
|
73
|
+
export declare function useShown<TRow = Record<string, unknown>>(name: string, options?: UseShownOptions): UseQueryResult<SpaceShownResult & {
|
|
74
|
+
rows: TRow[];
|
|
75
|
+
}>;
|
|
76
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type UseQueryResult } from './useQuery';
|
|
2
|
+
import { type SpaceViewerDatabase, type SpaceViewerReadFamily, type SpaceViewerReadInput, type SpaceViewerReadOperation, type SpaceViewerReadResult, type SpaceViewerSkill } from '../space';
|
|
3
|
+
export interface UseViewerReadOptions {
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
staleTimeMs?: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* True when this page may read what the signed-in viewer can open: the Space declares
|
|
9
|
+
* `viewerReads` for this family and the host offers it (never on a Site or anonymous link).
|
|
10
|
+
* Render a fallback when false.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useViewerReadAvailable(family: SpaceViewerReadFamily): boolean;
|
|
13
|
+
/** One cached, read-only viewer read. Results are scoped to the current viewer by the host cache scope. */
|
|
14
|
+
export declare function useViewerRead<TOperation extends SpaceViewerReadOperation>(operation: TOperation, input: SpaceViewerReadInput[TOperation], options?: UseViewerReadOptions): UseQueryResult<SpaceViewerReadResult[TOperation]>;
|
|
15
|
+
/** Every database the signed-in viewer can open, with its available links and read target. */
|
|
16
|
+
export declare function useViewerDatabases(options?: UseViewerReadOptions): UseQueryResult<SpaceViewerDatabase[]>;
|
|
17
|
+
type ListSkillsRead = (input: SpaceViewerReadInput['list_skills']) => Promise<SpaceViewerReadResult['list_skills']>;
|
|
18
|
+
export declare const SKILL_CONTENT_PAGES_AT_ONCE = 2;
|
|
19
|
+
/**
|
|
20
|
+
* Every Skill page, in order. Pages with instructions are slow (each reads its snapshots), so the next
|
|
21
|
+
* page's cursor comes from a quick read without them and that page starts while the previous one is
|
|
22
|
+
* still read, at most SKILL_CONTENT_PAGES_AT_ONCE content pages at a time. A cursor that no longer
|
|
23
|
+
* matches (the list changed meanwhile) drops the pages started from it, waits for them to end and
|
|
24
|
+
* continues from the real cursor.
|
|
25
|
+
*/
|
|
26
|
+
export declare function readAllViewerSkills(read: ListSkillsRead, { includeContent, includeDisabled }: {
|
|
27
|
+
includeContent: boolean;
|
|
28
|
+
includeDisabled: boolean;
|
|
29
|
+
}): Promise<SpaceViewerSkill[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Every Skill the signed-in viewer can see, all pages. With `includeContent`, `skill_md`
|
|
32
|
+
* is present where the viewer holds content access and null elsewhere (curated, legacy).
|
|
33
|
+
*/
|
|
34
|
+
export declare function useViewerSkills(options?: UseViewerReadOptions & {
|
|
35
|
+
includeContent?: boolean;
|
|
36
|
+
includeDisabled?: boolean;
|
|
37
|
+
}): UseQueryResult<SpaceViewerSkill[]>;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/// <reference path="./tailwind-candidates.d.ts" />
|
|
2
|
+
/**
|
|
3
|
+
* @notis/sdk - The Notis App SDK
|
|
4
|
+
*
|
|
5
|
+
* Public API for building Notis apps. Import hooks and the provider from
|
|
6
|
+
* this entrypoint. For configuration, use `@notis/sdk/config`. For the
|
|
7
|
+
* Vite config builder, use `@notis/sdk/vite`.
|
|
8
|
+
*/
|
|
9
|
+
export { NotisProvider, useNotisRuntime } from './provider';
|
|
10
|
+
export { useAction, useActionQuery } from './hooks/useAction';
|
|
11
|
+
export { useNativeDocuments, useNativeMutation, useNativeDelete, type NativeDeleteManyResult } from './hooks/useNativeDocuments';
|
|
12
|
+
export type { NativeField, NativeFilter, NativeQuery, NativeInsert, NativeUpdate, NativeDelete, NativeMutationReceipt } from './nativeData';
|
|
13
|
+
export type { SpaceDatabaseCreate, SpaceResourceReference } from './space';
|
|
14
|
+
export type { SpaceActionTemplate, SpaceActionDescriptor, SpaceRuntimeDescriptor, SpaceActionOptions } from './space';
|
|
15
|
+
export type { SpaceDocumentBodyRequest, SpaceDocumentBodyRead, SpaceDocumentBodySave, SpaceDocumentBodyResult } from './space';
|
|
16
|
+
export { useNativeDocumentBody } from './hooks/useNativeDocumentBody';
|
|
17
|
+
export { useViewerRead, useViewerReadAvailable, useViewerDatabases, useViewerSkills } from './hooks/useViewerReads';
|
|
18
|
+
export type { UseViewerReadOptions } from './hooks/useViewerReads';
|
|
19
|
+
export { useViewParams, useShown, useShownAvailable, parseViewParams } from './hooks/useViewParams';
|
|
20
|
+
export type { ViewParams, ViewParamsOf, ViewParamChanges, SetViewParamsOptions, UseShownOptions } from './hooks/useViewParams';
|
|
21
|
+
export { SPACE_VIEW_SPEC_VERSION } from './space';
|
|
22
|
+
export type { SpaceViewParam, SpaceViewParamType, SpaceViewFilter, SpaceShows, SpaceShownDescriptor, SpaceShownOptions, SpaceShownResult, SpaceMemoryPolicy, SpaceMemorySnapshot, SpaceChrome, SpaceMarkdownInput } from './space';
|
|
23
|
+
export { SPACE_VIEWER_READ_OPERATIONS } from './space';
|
|
24
|
+
export { SPACE_CLOUD_COMPUTER_OPERATIONS, spaceCloudComputerAllows } from './space';
|
|
25
|
+
export type { SpaceCloudComputerLevel, SpaceCloudComputerOperation, SpaceCloudComputerStatus, SpaceCloudComputerRelease, SpaceCloudComputerRunInput, SpaceCloudComputerRunResult, SpaceCloudComputerUploadInput, SpaceCloudComputerUploadResult, SpaceCloudComputerTransport } from './space';
|
|
26
|
+
export type { SpaceViewerReadFamily, SpaceViewerReadOperation, SpaceViewerReadInput, SpaceViewerReadResult, SpaceViewerLink, SpaceViewerDatabase, SpaceViewerDatabaseSchema, SpaceViewerSkill, SpaceViewerSkillPage } from './space';
|
|
27
|
+
export { SpaceActionError, SpaceNavigationCancelled, isSpaceNavigationCancelled } from './space';
|
|
28
|
+
export type { SpaceActionFailureDetails } from './space';
|
|
29
|
+
export { useQuery, useQueryClient } from './hooks/useQuery';
|
|
30
|
+
export type { UseQueryOptions, UseQueryResult } from './hooks/useQuery';
|
|
31
|
+
export { createQueryClient, createPrefetchQueue, queryKey } from './queryCache';
|
|
32
|
+
export type { NotisQueryClient, QuerySnapshot, QueryFetchOptions, HiddenRecords } from './queryCache';
|
|
33
|
+
export { useNotis } from './hooks/useNotis';
|
|
34
|
+
export { useDocuments } from './hooks/useDocuments';
|
|
35
|
+
export type { UseDocumentsOptions, UseDocumentsResult } from './hooks/useDocuments';
|
|
36
|
+
export { useDatabaseSubscription } from './hooks/useDatabaseSubscription';
|
|
37
|
+
export type { UseDatabaseSubscriptionOptions, UseDatabaseSubscriptionResult, } from './hooks/useDatabaseSubscription';
|
|
38
|
+
export { useDocument } from './hooks/useDocument';
|
|
39
|
+
export type { UseDocumentOptions, UseDocumentResult } from './hooks/useDocument';
|
|
40
|
+
export { useUpsertDocument } from './hooks/useUpsertDocument';
|
|
41
|
+
export type { UpsertDocumentArgs, UseUpsertDocumentResult } from './hooks/useUpsertDocument';
|
|
42
|
+
export { useDatabaseSchema } from './hooks/useDatabaseSchema';
|
|
43
|
+
export type { UseDatabaseSchemaResult } from './hooks/useDatabaseSchema';
|
|
44
|
+
export { useTool } from './hooks/useTool';
|
|
45
|
+
export type { ToolCallState, UseToolResult } from './hooks/useTool';
|
|
46
|
+
export { useTools } from './hooks/useTools';
|
|
47
|
+
export { useHandover } from './hooks/useHandover';
|
|
48
|
+
export type { UseHandoverResult } from './hooks/useHandover';
|
|
49
|
+
export { useCloudComputer } from './hooks/useCloudComputer';
|
|
50
|
+
export type { UseCloudComputerResult } from './hooks/useCloudComputer';
|
|
51
|
+
export { useCloudComputerShell } from './hooks/useCloudComputerShell';
|
|
52
|
+
export type { UseCloudComputerShellResult } from './hooks/useCloudComputerShell';
|
|
53
|
+
export { useNotisNavigation } from './hooks/useNotisNavigation';
|
|
54
|
+
export { useTopBarSearch } from './hooks/useTopBarSearch';
|
|
55
|
+
export { useTopBarTitleLeaf } from './hooks/useTopBarTitleLeaf';
|
|
56
|
+
export { useBackend } from './hooks/useBackend';
|
|
57
|
+
export { useMultiSelect } from './hooks/useMultiSelect';
|
|
58
|
+
export { useCollectionInteractions, COLLECTION_ITEM_ATTRIBUTE } from './hooks/useCollectionInteractions';
|
|
59
|
+
export { useActiveResource } from './hooks/useActiveResource';
|
|
60
|
+
export { SHORTCUT_SCOPE_PRIORITY, isEditableShortcutEvent, shortcutDisplay, useShortcuts, } from './interactions/shortcuts';
|
|
61
|
+
export { Markdown } from './components/Markdown';
|
|
62
|
+
export type { MarkdownProps } from './components/Markdown';
|
|
63
|
+
export { DocumentEditor } from './components/DocumentEditor';
|
|
64
|
+
export { DocumentPage, DocumentPageSkeleton, usePrefetchRecord } from './components/DocumentPage';
|
|
65
|
+
export { RecordProperties, HtmlFrame, ReportFrame, ShareControl, SpacePageFrame } from './components/RecordComponents';
|
|
66
|
+
export { RenderChartData } from './ui/charts/RenderChartData';
|
|
67
|
+
export { MarkdownEditor } from './components/MarkdownEditor';
|
|
68
|
+
export { NotisSelectionBoundary, NOTIS_CONTEXT_CLIPBOARD_TYPE } from './components/NotisSelectionBoundary';
|
|
69
|
+
export type { NotisSelectionBoundaryProps } from './components/NotisSelectionBoundary';
|
|
70
|
+
export { asRecord, blockNoteToPlainText, DOCUMENT_WORDS, extractRichText, getDocumentPreview, getRelationIds, getSecretValue, isPresentString, markdownToPlainText, normalizeDatabaseProperty, normalizeDocumentRecord, normalizePropertyValue, optionalString, } from './documents';
|
|
71
|
+
export type { DocumentWordsOptions } from './documents';
|
|
72
|
+
export { Dialog } from './components/Dialog';
|
|
73
|
+
export type { DialogProps } from './components/Dialog';
|
|
74
|
+
export { MultiSelectActionBar } from './components/MultiSelectActionBar';
|
|
75
|
+
export { MultiSelectCheckbox, MultiSelectCheckbox as SelectionCheckbox } from './components/MultiSelectCheckbox';
|
|
76
|
+
export { MultiSelectDragOverlay, MultiSelectDragOverlay as SelectionMarquee } from './components/MultiSelectDragOverlay';
|
|
77
|
+
export { ShortcutHints } from './components/ShortcutHints';
|
|
78
|
+
export type { DragRect, MultiSelectController, UseMultiSelectOptions, } from './hooks/useMultiSelect';
|
|
79
|
+
export type { MultiSelectAction, MultiSelectActionBarProps, } from './components/MultiSelectActionBar';
|
|
80
|
+
export type { MultiSelectCheckboxProps } from './components/MultiSelectCheckbox';
|
|
81
|
+
export type { MultiSelectDragOverlayProps } from './components/MultiSelectDragOverlay';
|
|
82
|
+
export type { MultiSelectCheckboxProps as SelectionCheckboxProps } from './components/MultiSelectCheckbox';
|
|
83
|
+
export type { MultiSelectDragOverlayProps as SelectionMarqueeProps } from './components/MultiSelectDragOverlay';
|
|
84
|
+
export type { ShortcutHint, ShortcutHintsProps } from './components/ShortcutHints';
|
|
85
|
+
export type { CollectionInteractionController, CollectionInteractionReason, CollectionKeyboardShortcuts, CollectionNavigationContext, CollectionNavigationDirection, CollectionSelectionChange, SelectionMarqueeRect, UseCollectionInteractionsOptions, } from './hooks/useCollectionInteractions';
|
|
86
|
+
export type { ShortcutDefinition, ShortcutHelpEntry, ShortcutScope, UseShortcutsOptions, } from './interactions/shortcuts';
|
|
87
|
+
export type { CollectionAction, CollectionActionContext, CollectionActionIntent, ResolvedCollectionAction, } from './interactions/actions';
|
|
88
|
+
export type { AppDescriptor, CloudComputerCliAuthFacts, CloudComputerFacts, CloudComputerSandboxFacts, ContextAttributeValue, ContextResource, ContextSelection, CollectionItem, CollectionItemDetail, DatabaseDescriptor, DatabaseProperty, DatabasePropertyOption, DatabasePropertyType, DocumentContentType, DocumentRecord, HandoverPayload, HandoverResult, NotisDocumentEditorProps, NotisDocumentPageProps, NotisDocumentPageCrumb, NotisDocumentPageMenuItem, NotisDocumentPageParts, NotisRecordProps, NotisRecordPropertiesProps, NotisHtmlFrameProps, NotisHtmlFramePresentAction, NotisReportFrameProps, NotisShareControlProps, NotisSpacePageFrameProps, NotisMarkdownEditorProps, NotisMarkdownEditorSavePayload, NotisMarkdownEditorSaveResult, NotisRuntime, RuntimeResource, NotisRuntimeContext, NotisRuntimeUI, QueryFilter, RouteDescriptor, SecretPropertyValue, SubscribeDatabaseOptions, ToolDescriptor, ToolCallOptions, ToolInputSchema, } from './runtime';
|
|
89
|
+
export { useToolQuery } from './hooks/useToolQuery';
|
|
90
|
+
export { Skeleton, SKELETON_WORDS, ViewSkeleton } from './components/Skeleton';
|
|
91
|
+
export { useLongPressSelection } from './hooks/useLongPressSelection';
|
|
92
|
+
export { isInteractionElementVisible } from './interactions/visibility';
|
|
93
|
+
export type { AgentContextContent, AgentContextItem, ContextAttachment } from './agentContext';
|
|
94
|
+
export { useAgentContext } from './hooks/useAgentContext';
|
|
95
|
+
export { NotisCommentBoundary, NotisCommentBox } from './components/NotisCommentBoundary';
|
|
96
|
+
export type { NotisCommentBoundaryProps, NotisCommentBoxProps } from './components/NotisCommentBoundary';
|
|
97
|
+
export { VIEW_PERIODS, isViewDate, isViewPeriod, resolveViewPeriod } from './viewPeriod';
|
|
98
|
+
export { journalViewParams, tasksViewParams, tasksViewFilter } from './standardViewParams';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type CollectionActionIntent = 'archive' | 'star' | 'delete' | 'enable' | 'disable' | 'pause' | 'resume' | 'move' | 'add-to-folder' | 'complete' | 'start-progress' | 'custom';
|
|
3
|
+
export interface CollectionActionContext<T> {
|
|
4
|
+
selectedIds: string[];
|
|
5
|
+
selectedItems: T[];
|
|
6
|
+
clearSelection: () => void;
|
|
7
|
+
}
|
|
8
|
+
export interface CollectionAction<T> {
|
|
9
|
+
id: string;
|
|
10
|
+
intent?: CollectionActionIntent;
|
|
11
|
+
label?: string;
|
|
12
|
+
icon?: ReactNode;
|
|
13
|
+
/** Omit to use the intent default, supply a key to override, or false to remove it. */
|
|
14
|
+
shortcut?: string | false;
|
|
15
|
+
destructive?: boolean;
|
|
16
|
+
disabled?: boolean | ((context: CollectionActionContext<T>) => boolean);
|
|
17
|
+
pending?: boolean;
|
|
18
|
+
onRun: (context: CollectionActionContext<T>) => void | Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
export interface ResolvedCollectionAction {
|
|
21
|
+
id: string;
|
|
22
|
+
label: string;
|
|
23
|
+
icon?: ReactNode;
|
|
24
|
+
shortcut?: string;
|
|
25
|
+
destructive?: boolean;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
pending?: boolean;
|
|
28
|
+
onRun: () => void | Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
export declare function collectionActionDefaults(intent: CollectionActionIntent | undefined): {
|
|
31
|
+
label?: string;
|
|
32
|
+
shortcut?: string;
|
|
33
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
export type ShortcutScope = 'app' | 'route' | 'collection' | 'detail' | 'modal';
|
|
3
|
+
export declare const SHORTCUT_SCOPE_PRIORITY: Record<ShortcutScope, number>;
|
|
4
|
+
export interface ShortcutDefinition {
|
|
5
|
+
id: string;
|
|
6
|
+
/** A chord (`Mod+A`) or timed sequence (`G I`). */
|
|
7
|
+
keys: string | string[];
|
|
8
|
+
label?: string;
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
allowInEditable?: boolean;
|
|
11
|
+
allowRepeat?: boolean;
|
|
12
|
+
preventDefault?: boolean;
|
|
13
|
+
stopPropagation?: boolean;
|
|
14
|
+
onTrigger: (event: KeyboardEvent) => void | Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export interface UseShortcutsOptions {
|
|
17
|
+
enabled?: boolean;
|
|
18
|
+
scope?: ShortcutScope;
|
|
19
|
+
/** Added to the scope priority for local precedence within a scope. */
|
|
20
|
+
priority?: number;
|
|
21
|
+
sequenceTimeoutMs?: number;
|
|
22
|
+
/** Internal owner used to route collection shortcuts to the last interacted collection. */
|
|
23
|
+
collectionOwnerId?: string;
|
|
24
|
+
/** Evaluated at dispatch time, including for retained hidden app views. */
|
|
25
|
+
isAvailable?: () => boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare function createShortcutCollectionOwner(): string;
|
|
28
|
+
export declare function releaseShortcutCollection(ownerId: string): void;
|
|
29
|
+
export declare function activateShortcutCollection(ownerId: string): void;
|
|
30
|
+
export declare function isEditableShortcutEvent(event: Event): boolean;
|
|
31
|
+
export declare function ShortcutProvider({ children, isAvailable }: {
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
isAvailable?: () => boolean;
|
|
34
|
+
}): React.JSX.Element;
|
|
35
|
+
export interface ShortcutHelpEntry {
|
|
36
|
+
id: string;
|
|
37
|
+
keys: string[];
|
|
38
|
+
label: string;
|
|
39
|
+
scope: ShortcutScope;
|
|
40
|
+
}
|
|
41
|
+
export declare function useShortcuts(shortcuts: ShortcutDefinition[], options?: UseShortcutsOptions): void;
|
|
42
|
+
export declare function shortcutDisplay(raw: string): string;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/** The native row contract, shared by direct tools and scoped Space actions. */
|
|
2
|
+
export type NativeField = {
|
|
3
|
+
property_id: string;
|
|
4
|
+
} | {
|
|
5
|
+
property: string;
|
|
6
|
+
} | {
|
|
7
|
+
column: 'record_key' | 'id' | 'title' | 'created_at' | 'updated_at' | 'last_edited_time' | 'content_type' | 'file_type';
|
|
8
|
+
};
|
|
9
|
+
export type NativeFilter = {
|
|
10
|
+
and: NativeFilter[];
|
|
11
|
+
} | {
|
|
12
|
+
or: NativeFilter[];
|
|
13
|
+
} | {
|
|
14
|
+
field: NativeField;
|
|
15
|
+
op: 'equals' | 'not_equals' | 'in' | 'contains' | 'not_contains' | 'does_not_contain' | 'starts_with' | 'ends_with' | 'is_empty' | 'is_not_empty' | 'greater_than' | 'less_than' | 'greater_than_or_equal_to' | 'less_than_or_equal_to' | 'before' | 'after' | 'on_or_before' | 'on_or_after';
|
|
16
|
+
value?: unknown;
|
|
17
|
+
};
|
|
18
|
+
export interface NativeQuery {
|
|
19
|
+
include_content?: boolean;
|
|
20
|
+
include_archived?: boolean;
|
|
21
|
+
mode?: 'rows' | 'search' | 'count' | 'aggregate';
|
|
22
|
+
filter?: NativeFilter;
|
|
23
|
+
sorts?: Array<{
|
|
24
|
+
field: NativeField;
|
|
25
|
+
direction: 'asc' | 'desc';
|
|
26
|
+
}>;
|
|
27
|
+
search?: {
|
|
28
|
+
text: string;
|
|
29
|
+
fields: NativeField[];
|
|
30
|
+
};
|
|
31
|
+
aggregate?: {
|
|
32
|
+
op: 'sum' | 'avg' | 'min' | 'max';
|
|
33
|
+
field: NativeField;
|
|
34
|
+
};
|
|
35
|
+
page_size?: number;
|
|
36
|
+
offset?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface NativeInsert {
|
|
39
|
+
columns?: {
|
|
40
|
+
title?: string | null;
|
|
41
|
+
icon?: string | null;
|
|
42
|
+
cover?: string | null;
|
|
43
|
+
};
|
|
44
|
+
properties?: Record<string, unknown>;
|
|
45
|
+
body?: {
|
|
46
|
+
blocks: Array<Record<string, unknown>>;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export interface NativeUpdate extends NativeInsert {
|
|
50
|
+
record_key: string;
|
|
51
|
+
expected_revision: number;
|
|
52
|
+
}
|
|
53
|
+
export interface NativeDelete {
|
|
54
|
+
record_key: string;
|
|
55
|
+
expected_revision: number;
|
|
56
|
+
}
|
|
57
|
+
export interface NativeMutationReceipt {
|
|
58
|
+
record_key: string;
|
|
59
|
+
id: string;
|
|
60
|
+
database_id: string;
|
|
61
|
+
revision: number;
|
|
62
|
+
schema_revision: number;
|
|
63
|
+
receipt_id: string;
|
|
64
|
+
operation: 'insert' | 'update' | 'delete';
|
|
65
|
+
replayed?: boolean;
|
|
66
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
import type { NotisRuntime } from './runtime';
|
|
3
|
+
/**
|
|
4
|
+
* Provides the Notis runtime context to all child components. The portal owns
|
|
5
|
+
* the runtime and injects it into the rendered app tree.
|
|
6
|
+
*/
|
|
7
|
+
export declare function NotisProvider({ children, runtime, onProtocolError, shortcutsAvailable }: {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
runtime: NotisRuntime | null;
|
|
10
|
+
onProtocolError?: (error: Error) => void;
|
|
11
|
+
shortcutsAvailable?: () => boolean;
|
|
12
|
+
}): React.JSX.Element;
|
|
13
|
+
/**
|
|
14
|
+
* Returns the raw NotisRuntime or null if not yet available.
|
|
15
|
+
* Prefer the typed hooks (useTool, useNotis, etc.) over this.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useNotisRuntime(): NotisRuntime | null;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** In-memory read snapshots. The host owns the lifetime and authorization scope. */
|
|
2
|
+
export interface QuerySnapshot<T = unknown> {
|
|
3
|
+
data: T | undefined;
|
|
4
|
+
hasData: boolean;
|
|
5
|
+
isFetching: boolean;
|
|
6
|
+
error: Error | null;
|
|
7
|
+
updatedAt: number;
|
|
8
|
+
invalidation: number;
|
|
9
|
+
}
|
|
10
|
+
export interface QueryFetchOptions {
|
|
11
|
+
staleTimeMs?: number;
|
|
12
|
+
force?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface NotisQueryClient {
|
|
15
|
+
getSnapshot<T>(key: string): QuerySnapshot<T>;
|
|
16
|
+
subscribe(key: string, listener: () => void): () => void;
|
|
17
|
+
fetch<T>(key: string, read: () => Promise<T>, options?: QueryFetchOptions): Promise<T>;
|
|
18
|
+
prefetch<T>(key: string, read: () => Promise<T>, options?: QueryFetchOptions): Promise<T>;
|
|
19
|
+
invalidate(key?: string): void;
|
|
20
|
+
clear(): void;
|
|
21
|
+
/** Host-only: permanently retire a revoked security scope. */
|
|
22
|
+
dispose?(): void;
|
|
23
|
+
getRevision?(): number;
|
|
24
|
+
/**
|
|
25
|
+
* Hides records (by `record_key` / `recordKey`) from every cached read at once, so a delete
|
|
26
|
+
* looks done before the server answers. `commit` keeps them hidden until each read that still
|
|
27
|
+
* holds them is read again; `restore` shows them again (a failed or undone delete).
|
|
28
|
+
*/
|
|
29
|
+
hideRecords?(recordKeys: readonly string[]): HiddenRecords;
|
|
30
|
+
}
|
|
31
|
+
export interface HiddenRecords {
|
|
32
|
+
commit(recordKeys?: readonly string[]): void;
|
|
33
|
+
restore(recordKeys?: readonly string[]): void;
|
|
34
|
+
}
|
|
35
|
+
/** Stable keys distinguish filters, pagination, and resource identities. */
|
|
36
|
+
export declare function queryKey(value: unknown): string;
|
|
37
|
+
/** One shared queue can bound descriptor and data speculation together. */
|
|
38
|
+
export declare function createPrefetchQueue(concurrency?: number): <T>(read: () => Promise<T>) => Promise<T>;
|
|
39
|
+
export declare function createQueryClient(options?: {
|
|
40
|
+
maxEntries?: number;
|
|
41
|
+
now?: () => number;
|
|
42
|
+
schedule?: ReturnType<typeof createPrefetchQueue>;
|
|
43
|
+
/** Bounds idempotent reads only; never retries the underlying callback. */
|
|
44
|
+
readTimeoutMs?: number;
|
|
45
|
+
}): NotisQueryClient;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** SDK-owned read failures. The host still owns messages for server/action refusals. */
|
|
2
|
+
const copy = {
|
|
3
|
+
en: {
|
|
4
|
+
bindingUnavailable: 'This Space cannot read this database yet.',
|
|
5
|
+
actionUnavailable: 'This action is unavailable in this Space.',
|
|
6
|
+
readUnavailable: 'These data cannot be read in this Space.',
|
|
7
|
+
schemaChanged: 'This database changed. Refresh the page and try again.',
|
|
8
|
+
responseIncomplete: 'This database could not be loaded. Refresh the page and try again.',
|
|
9
|
+
listUnavailable: 'This list is unavailable in this view.',
|
|
10
|
+
timedOut: 'This read took too long. Please retry.',
|
|
11
|
+
scopeUnavailable: 'App query scope is no longer available.',
|
|
12
|
+
scopeCleared: 'App query scope was cleared.',
|
|
13
|
+
},
|
|
14
|
+
fr: {
|
|
15
|
+
bindingUnavailable: 'Ce Space ne peut pas encore lire cette base de données.',
|
|
16
|
+
actionUnavailable: 'Cette action n’est pas disponible dans ce Space.',
|
|
17
|
+
readUnavailable: 'Ces données ne sont pas accessibles dans ce Space.',
|
|
18
|
+
schemaChanged: 'Cette base de données a changé. Actualise la page et réessaie.',
|
|
19
|
+
responseIncomplete: 'Cette base de données n’a pas pu être chargée. Actualise la page et réessaie.',
|
|
20
|
+
listUnavailable: 'Cette liste n’est pas disponible dans cette vue.',
|
|
21
|
+
timedOut: 'Cette lecture a pris trop de temps. Réessaie.',
|
|
22
|
+
scopeUnavailable: 'Les données de cette vue ne sont plus accessibles.',
|
|
23
|
+
scopeCleared: 'Les données de cette vue ont été réinitialisées.',
|
|
24
|
+
},
|
|
25
|
+
} as const;
|
|
26
|
+
|
|
27
|
+
export type QueryErrorKey = keyof typeof copy.en;
|
|
28
|
+
const PREFIX = 'notis_sdk_query:';
|
|
29
|
+
|
|
30
|
+
/** Code and diagnostic survive localisation; only SDK-owned messages are translated. */
|
|
31
|
+
export class SdkQueryError extends Error {
|
|
32
|
+
readonly code: string;
|
|
33
|
+
readonly diagnostic?: string;
|
|
34
|
+
constructor(key: QueryErrorKey, diagnostic?: string, locale?: string, cause?: Error) {
|
|
35
|
+
super(copy[locale === 'fr' ? 'fr' : 'en'][key], cause ? { cause } : undefined);
|
|
36
|
+
this.name = 'SdkQueryError';
|
|
37
|
+
this.code = PREFIX + key;
|
|
38
|
+
this.diagnostic = diagnostic;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Called at render time, so a cached failure changes language without replaying its read. */
|
|
43
|
+
export function localizeQueryError(error: Error | null, locale?: string): Error | null {
|
|
44
|
+
const failure = error as (Error & { code?: unknown; diagnostic?: unknown }) | null;
|
|
45
|
+
if (!failure || typeof failure.code !== 'string' || !failure.code.startsWith(PREFIX)) return error;
|
|
46
|
+
const key = failure.code.slice(PREFIX.length);
|
|
47
|
+
if (!Object.hasOwn(copy.en, key)) return error;
|
|
48
|
+
const message = copy[locale === 'fr' ? 'fr' : 'en'][key as QueryErrorKey];
|
|
49
|
+
if (failure.message === message) return error;
|
|
50
|
+
return new SdkQueryError(key as QueryErrorKey, typeof failure.diagnostic === 'string' ? failure.diagnostic : undefined, locale, failure);
|
|
51
|
+
}
|