@notis_ai/cli 0.2.18 → 0.2.20
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 +279 -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
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import Ajv from 'ajv';
|
|
2
|
+
import addFormats from 'ajv-formats';
|
|
1
3
|
import { randomUUID } from 'node:crypto';
|
|
2
4
|
import { CliError, EXIT_CODES, usageError } from '../runtime/errors.js';
|
|
3
5
|
import { callTool, httpRequest } from '../runtime/transport.js';
|
|
@@ -12,6 +14,8 @@ const NOTIS_DATABASE_CORE_NAMES = new Set([
|
|
|
12
14
|
'get_document',
|
|
13
15
|
'list_databases',
|
|
14
16
|
'upsert_database',
|
|
17
|
+
'upload_file',
|
|
18
|
+
'delete_database',
|
|
15
19
|
]);
|
|
16
20
|
|
|
17
21
|
function isNotisDatabaseCoreName(coreName) {
|
|
@@ -74,19 +78,35 @@ export async function runToolCommand({
|
|
|
74
78
|
}
|
|
75
79
|
|
|
76
80
|
export async function fetchToolkits(runtime) {
|
|
77
|
-
const payload = await
|
|
78
|
-
|
|
81
|
+
const payload = await probeAuth(runtime);
|
|
82
|
+
const toolkits = payload.toolkit_connection_statuses.map((entry) => ({
|
|
79
83
|
id: entry.toolkit,
|
|
80
|
-
provider:
|
|
84
|
+
provider: entry.provider,
|
|
81
85
|
description: entry.description || entry.status_message || entry.toolkit,
|
|
82
86
|
has_active_connection: Boolean(entry.has_active_connection),
|
|
83
87
|
status_message: entry.status_message || '',
|
|
84
|
-
|
|
88
|
+
availability: entry.availability,
|
|
85
89
|
}));
|
|
90
|
+
return { toolkits, coverage: payload.coverage, warnings: payload.warnings };
|
|
86
91
|
}
|
|
87
92
|
|
|
88
93
|
export async function probeAuth(runtime) {
|
|
89
|
-
|
|
94
|
+
const result = await httpRequest({ runtime, path: '/cli_tools', body: { operation: 'toolkit_inventory' } });
|
|
95
|
+
const payload = result.payload;
|
|
96
|
+
if (payload?.success !== true || !Array.isArray(payload.toolkit_connection_statuses)
|
|
97
|
+
|| typeof payload.coverage?.complete !== 'boolean'
|
|
98
|
+
|| !payload.coverage.families || typeof payload.coverage.families !== 'object'
|
|
99
|
+
|| Array.isArray(payload.coverage.families)
|
|
100
|
+
|| payload.toolkit_connection_statuses.some((row) => !row || typeof row.toolkit !== 'string' || !row.toolkit
|
|
101
|
+
|| typeof row.provider !== 'string' || !row.provider)) {
|
|
102
|
+
throw new CliError({ code: 'invalid_toolkit_inventory', message: 'The server did not return a valid toolkit inventory.', exitCode: EXIT_CODES.backend });
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
...payload,
|
|
106
|
+
toolkit_connection_statuses: [...payload.toolkit_connection_statuses].sort((a, b) => a.toolkit.localeCompare(b.toolkit)),
|
|
107
|
+
warnings: [...(Array.isArray(payload.warnings) ? payload.warnings.filter((v) => typeof v === 'string') : []),
|
|
108
|
+
...(!payload.coverage.complete ? ['Toolkit inventory is incomplete; some connections could not be checked.'] : [])],
|
|
109
|
+
};
|
|
90
110
|
}
|
|
91
111
|
|
|
92
112
|
export async function healthCheck(runtime) {
|
|
@@ -143,45 +163,35 @@ export async function fetchToolDiscovery(runtime, useCase, knownFields = '') {
|
|
|
143
163
|
return result.payload || {};
|
|
144
164
|
}
|
|
145
165
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
166
|
+
// Tool schemas are the dry-run contract, including nested branches and constraints.
|
|
167
|
+
const toolArgumentsAjv = new Ajv({
|
|
168
|
+
allErrors: true, strict: false, strictSchema: true, strictNumbers: true, logger: false,
|
|
169
|
+
coerceTypes: false, useDefaults: false, removeAdditional: false,
|
|
170
|
+
});
|
|
171
|
+
addFormats(toolArgumentsAjv);
|
|
172
|
+
// Native tool schemas mark uploadable fields with this annotation.
|
|
173
|
+
toolArgumentsAjv.addKeyword({ keyword: 'file_uploadable', schemaType: 'boolean', valid: true });
|
|
152
174
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
if (!(key in properties)) {
|
|
162
|
-
errors.push(`Unknown field: "${key}"`);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
175
|
+
export function validateArguments(schema, args) {
|
|
176
|
+
if (schema == null) return [];
|
|
177
|
+
let validate;
|
|
178
|
+
try {
|
|
179
|
+
validate = toolArgumentsAjv.compile(schema);
|
|
180
|
+
} catch {
|
|
181
|
+
// A malformed or unsupported schema cannot establish a valid dry run.
|
|
182
|
+
return ['Tool schema could not be validated; inspect the current schema.'];
|
|
165
183
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
if (
|
|
170
|
-
|
|
171
|
-
errors.push(`Field "${key}" should be a string, got ${typeof value}`);
|
|
172
|
-
}
|
|
173
|
-
if (prop.type === 'integer' && !Number.isInteger(value)) {
|
|
174
|
-
errors.push(`Field "${key}" should be an integer, got ${typeof value}`);
|
|
184
|
+
if (validate(args)) return [];
|
|
185
|
+
return (validate.errors || []).map((error) => {
|
|
186
|
+
const path = error.instancePath ? ` at "${error.instancePath}"` : '';
|
|
187
|
+
if (error.keyword === 'required') {
|
|
188
|
+
return `Missing required field: "${error.params.missingProperty}"${path}`;
|
|
175
189
|
}
|
|
176
|
-
if (
|
|
177
|
-
|
|
190
|
+
if (error.keyword === 'additionalProperties') {
|
|
191
|
+
return `Unknown field: "${error.params.additionalProperty}"${path}`;
|
|
178
192
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
return errors;
|
|
193
|
+
return `Invalid arguments${path}: ${error.message || error.keyword}`;
|
|
194
|
+
});
|
|
185
195
|
}
|
|
186
196
|
|
|
187
197
|
export function toolConflictToError(payload, defaultMessage) {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { appsCommandSpecs } from './apps.js';
|
|
2
1
|
import { toolsCommandSpecs } from './tools.js';
|
|
3
2
|
import { metaCommandSpecs } from './meta.js';
|
|
4
3
|
import { onboardingCommandSpecs } from './onboarding.js';
|
|
@@ -9,13 +8,20 @@ import { profileCommandSpecs } from './profile.js';
|
|
|
9
8
|
import { handoverCommandSpecs } from './handover.js';
|
|
10
9
|
import { agentsCommandSpecs } from './agents.js';
|
|
11
10
|
import { skillsCommandSpecs } from './skills.js';
|
|
11
|
+
import { spacesCommandSpecs } from './spaces.js';
|
|
12
|
+
import { documentsCommandSpecs } from './documents.js';
|
|
13
|
+
import { viewsCommandSpecs } from './views.js';
|
|
14
|
+
import { filesCommandSpecs } from './files.js';
|
|
12
15
|
|
|
13
16
|
export const GROUP_SUMMARIES = {
|
|
14
|
-
|
|
17
|
+
files: 'Upload local files for native records with verified byte receipts.',
|
|
18
|
+
views: 'Discover and render the views you can open.',
|
|
19
|
+
spaces: 'Build independent Spaces and their declared capabilities.',
|
|
20
|
+
documents: 'Read, compare and restore saved document versions, and manage the documents Bin.',
|
|
15
21
|
agents: 'Install Notis context into local coding agents.',
|
|
16
|
-
handover: 'Hand the branch you are on to a Notis agent, hosted or
|
|
22
|
+
handover: 'Hand the branch you are on to a Notis agent, hosted or Codex/Claude in the cloud.',
|
|
17
23
|
tools: 'Discover and execute generic tools exposed through Notis.',
|
|
18
|
-
skills: '
|
|
24
|
+
skills: 'List, edit and link Notis Skills, and keep local-agent skills synchronized.',
|
|
19
25
|
profile: 'Switch between signed-in accounts and their API endpoints.',
|
|
20
26
|
debug: 'Inspect effective runtime context, worker identity, and trace costs.',
|
|
21
27
|
smoke: 'Run deterministic connected-service smoke tests with guaranteed cleanup.',
|
|
@@ -27,7 +33,10 @@ export const COMMAND_SPECS = [
|
|
|
27
33
|
...onboardingCommandSpecs,
|
|
28
34
|
...agentsCommandSpecs,
|
|
29
35
|
...skillsCommandSpecs,
|
|
30
|
-
...
|
|
36
|
+
...spacesCommandSpecs,
|
|
37
|
+
...documentsCommandSpecs,
|
|
38
|
+
...viewsCommandSpecs,
|
|
39
|
+
...filesCommandSpecs,
|
|
31
40
|
...handoverCommandSpecs,
|
|
32
41
|
...toolsCommandSpecs,
|
|
33
42
|
...diagnosticCommandSpecs,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { dirname } from 'node:path';
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { healthCheck, probeAuth } from './helpers.js';
|
|
5
5
|
import { findCommandSpec, formatDescribe } from '../runtime/help.js';
|
|
6
6
|
import { createExpiredAuthError, getAuthRecovery } from '../runtime/auth-recovery.js';
|
|
7
7
|
import { cliCommandForChannel, resolveChannelSwitch } from '../runtime/channel.js';
|
|
@@ -51,6 +51,9 @@ export function doctorChannelSummary(
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
async function doctorHandler(ctx) {
|
|
54
|
+
let toolkitCoverage = null;
|
|
55
|
+
let toolkitWarnings = [];
|
|
56
|
+
let authenticatedUserId = null;
|
|
54
57
|
const checks = {
|
|
55
58
|
config: 'ok',
|
|
56
59
|
auth: 'missing',
|
|
@@ -58,6 +61,7 @@ async function doctorHandler(ctx) {
|
|
|
58
61
|
routing: 'ok',
|
|
59
62
|
health: 'unknown',
|
|
60
63
|
tool_roundtrip: 'unknown',
|
|
64
|
+
identity: 'unknown',
|
|
61
65
|
};
|
|
62
66
|
|
|
63
67
|
if (ctx.runtime.credentialKind === 'oauth') {
|
|
@@ -100,7 +104,12 @@ async function doctorHandler(ctx) {
|
|
|
100
104
|
// cold local backend. A diagnostic must not report a false failure just
|
|
101
105
|
// because that legitimate roundtrip exceeds the general 30s default.
|
|
102
106
|
const payload = await probeAuth(doctorToolRoundtripRuntime(ctx.runtime));
|
|
103
|
-
|
|
107
|
+
toolkitCoverage = payload.coverage;
|
|
108
|
+
const identity = serverAccountIdentity(ctx.runtime, payload);
|
|
109
|
+
authenticatedUserId = identity.verified ? identity.userId : null;
|
|
110
|
+
checks.identity = identity.verified ? (identity.mismatch ? 'mismatch' : 'ok') : 'unverified';
|
|
111
|
+
toolkitWarnings = [...payload.warnings, ...identity.warnings];
|
|
112
|
+
checks.tool_roundtrip = payload.coverage.complete ? 'ok' : 'partial';
|
|
104
113
|
profile = getProfile(loadConfig(), ctx.runtime.profileName);
|
|
105
114
|
checks.auth = ctx.runtime.jwt
|
|
106
115
|
? (credentialIsExpired(ctx.runtime, profile) ? 'expired' : 'configured')
|
|
@@ -158,6 +167,7 @@ async function doctorHandler(ctx) {
|
|
|
158
167
|
release_channel: releaseChannel || null,
|
|
159
168
|
cli_version: ctx.runtime.cliVersion || null,
|
|
160
169
|
credential_source: ctx.runtime.credentialKind || null,
|
|
170
|
+
user_id: authenticatedUserId,
|
|
161
171
|
...(ctx.runtime.credentialKind === 'oauth'
|
|
162
172
|
? {
|
|
163
173
|
oauth_client_id: profile.oauth_client_id || null,
|
|
@@ -167,7 +177,9 @@ async function doctorHandler(ctx) {
|
|
|
167
177
|
}
|
|
168
178
|
: {}),
|
|
169
179
|
checks,
|
|
180
|
+
toolkit_coverage: toolkitCoverage,
|
|
170
181
|
},
|
|
182
|
+
warnings: toolkitWarnings,
|
|
171
183
|
humanSummary: `Doctor checks completed for profile ${ctx.runtime.profileName}`,
|
|
172
184
|
hints,
|
|
173
185
|
renderHuman: () =>
|
|
@@ -195,10 +207,22 @@ export function activeRuntimeUserId(runtime) {
|
|
|
195
207
|
: decodeJwtUserId(runtime.jwt);
|
|
196
208
|
}
|
|
197
209
|
|
|
210
|
+
function serverAccountIdentity(runtime, payload) {
|
|
211
|
+
const canonical = typeof payload.user_id === 'string' && payload.user_id.trim() ? payload.user_id : null;
|
|
212
|
+
const cached = activeRuntimeUserId(runtime);
|
|
213
|
+
// Portal JWT subjects can be linked Auth IDs rather than canonical Notis IDs.
|
|
214
|
+
const mismatch = Boolean(canonical && runtime.credentialKind === 'oauth' && cached && cached !== canonical);
|
|
215
|
+
return { userId: canonical || cached, verified: Boolean(canonical), mismatch,
|
|
216
|
+
warnings: canonical
|
|
217
|
+
? (mismatch ? ['The saved OAuth account differs from the account authenticated by the server.'] : [])
|
|
218
|
+
: ['Account identity is not verified by this server; the displayed identity comes from this profile.'] };
|
|
219
|
+
}
|
|
220
|
+
|
|
198
221
|
async function whoamiHandler(ctx) {
|
|
199
222
|
const payload = await probeAuth(ctx.runtime);
|
|
200
223
|
const toolkits = payload.toolkit_connection_statuses || [];
|
|
201
|
-
const
|
|
224
|
+
const identity = serverAccountIdentity(ctx.runtime, payload);
|
|
225
|
+
const userId = identity.userId;
|
|
202
226
|
|
|
203
227
|
return ctx.output.emitSuccess({
|
|
204
228
|
command: ctx.spec.command_path.join(' '),
|
|
@@ -208,17 +232,22 @@ async function whoamiHandler(ctx) {
|
|
|
208
232
|
api_base: ctx.runtime.apiBase,
|
|
209
233
|
credential_source: ctx.runtime.credentialKind || null,
|
|
210
234
|
user_id: userId,
|
|
211
|
-
|
|
235
|
+
identity_source: identity.verified ? 'server' : 'profile_unverified',
|
|
236
|
+
toolkit_count: payload.coverage.complete ? toolkits.length : null,
|
|
237
|
+
observed_toolkit_count: toolkits.length,
|
|
238
|
+
coverage: payload.coverage,
|
|
212
239
|
toolkits: toolkits.map((t) => t.toolkit),
|
|
213
240
|
cli_version: ctx.runtime.cliVersion,
|
|
214
241
|
},
|
|
215
|
-
humanSummary:
|
|
242
|
+
humanSummary: `${identity.verified ? 'Logged in as' : 'Unverified saved identity'} ${userId || 'unknown'} via profile "${ctx.runtime.profileName}"`,
|
|
243
|
+
warnings: [...payload.warnings, ...identity.warnings],
|
|
216
244
|
renderHuman: () =>
|
|
217
245
|
[
|
|
218
246
|
`Profile: ${ctx.runtime.profileName}`,
|
|
219
247
|
`API: ${ctx.runtime.apiBase}`,
|
|
220
248
|
`User: ${userId || 'unknown'}`,
|
|
221
|
-
`
|
|
249
|
+
`Identity: ${identity.verified ? 'verified by server' : 'unverified saved profile'}`,
|
|
250
|
+
`Toolkits: ${toolkits.length}${payload.coverage.complete ? '' : ' observed (inventory incomplete)'}`,
|
|
222
251
|
`Version: ${ctx.runtime.cliVersion}`,
|
|
223
252
|
].join('\n'),
|
|
224
253
|
hints: [
|
|
@@ -249,7 +278,7 @@ export const metaCommandSpecs = [
|
|
|
249
278
|
mutates: false,
|
|
250
279
|
idempotent: true,
|
|
251
280
|
related_commands: ['notis doctor'],
|
|
252
|
-
backend_call: { type: '
|
|
281
|
+
backend_call: { type: 'toolkit_inventory', method: 'POST', path: '/cli_tools' },
|
|
253
282
|
handler: whoamiHandler,
|
|
254
283
|
},
|
|
255
284
|
{
|
|
@@ -271,10 +300,10 @@ export const metaCommandSpecs = [
|
|
|
271
300
|
summary: 'Describe a first-class CLI command in detail.',
|
|
272
301
|
when_to_use: 'Use this when an agent or human needs the exact shape, examples, and semantics of a command.',
|
|
273
302
|
args_schema: {
|
|
274
|
-
arguments: [{ token: '<command...>', key: 'commandPath', description: 'Command path to describe, such as "
|
|
303
|
+
arguments: [{ token: '<command...>', key: 'commandPath', description: 'Command path to describe, such as "spaces deploy".' }],
|
|
275
304
|
options: [],
|
|
276
305
|
},
|
|
277
|
-
examples: ['notis describe
|
|
306
|
+
examples: ['notis describe spaces deploy', 'notis describe tools exec'],
|
|
278
307
|
output_schema: 'Returns the command spec metadata for the requested command.',
|
|
279
308
|
mutates: false,
|
|
280
309
|
idempotent: true,
|
|
@@ -157,7 +157,7 @@ async function authenticatedResult(ctx) {
|
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
if (onboardingComplete) {
|
|
160
|
-
const name = state?.settings?.
|
|
160
|
+
const name = state?.settings?.first_name;
|
|
161
161
|
const setupSummary = renderAgentSetup(base.agent_setup);
|
|
162
162
|
return ctx.output.emitSuccess({
|
|
163
163
|
command: 'start',
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { CHANNEL_SWITCH_ENV } from '../runtime/channel.js';
|
|
1
3
|
import { CliError, EXIT_CODES } from '../runtime/errors.js';
|
|
2
4
|
import { quoteShellArgument } from '../runtime/auth-recovery.js';
|
|
3
5
|
import {
|
|
@@ -114,6 +116,44 @@ async function listHandler(ctx) {
|
|
|
114
116
|
});
|
|
115
117
|
}
|
|
116
118
|
|
|
119
|
+
const SKILL_SYNC_API_BASE_PATTERN = /^https:\/\/api(?:-beta)?\.notis\.ai\/?$/;
|
|
120
|
+
|
|
121
|
+
// Overrides that belong to this `profile use` run. Inherited, a NOTIS_JWT would
|
|
122
|
+
// sync its own account into the agent folders under the named profile.
|
|
123
|
+
const RELINK_DROPPED_ENV = ['NOTIS_JWT', 'NOTIS_API_BASE', 'NOTIS_PROFILE', CHANNEL_SWITCH_ENV];
|
|
124
|
+
|
|
125
|
+
// The new default's skills take over the agent folders (Claude Code, Codex,
|
|
126
|
+
// Cursor) now rather than at the next automatic sync. Detached, so the switch
|
|
127
|
+
// itself stays instant; a failure waits for that next sync.
|
|
128
|
+
export function relinkSkillsInBackground(name, profile, {
|
|
129
|
+
env = process.env,
|
|
130
|
+
argv = process.argv,
|
|
131
|
+
execPath = process.execPath,
|
|
132
|
+
spawnImpl = spawn,
|
|
133
|
+
} = {}) {
|
|
134
|
+
// Never from a test run: a detached sync would outlive it and reach the real API.
|
|
135
|
+
if (env.NODE_ENV === 'test' || env.NODE_TEST_CONTEXT || !argv[1]) return false;
|
|
136
|
+
if (!profile?.oauth_access_token && !profile?.oauth_refresh_token) return false;
|
|
137
|
+
if (!SKILL_SYNC_API_BASE_PATTERN.test(String(profile.api_base || ''))) return false;
|
|
138
|
+
// Like the automatic sync, the relink runs as the named profile alone: its
|
|
139
|
+
// credential, its endpoint and the CLI build for its channel.
|
|
140
|
+
const childEnv = { ...env };
|
|
141
|
+
for (const key of RELINK_DROPPED_ENV) delete childEnv[key];
|
|
142
|
+
try {
|
|
143
|
+
const child = spawnImpl(
|
|
144
|
+
execPath,
|
|
145
|
+
[argv[1], 'skills', 'sync', '--json', '--profile', name],
|
|
146
|
+
{ detached: true, stdio: 'ignore', env: childEnv },
|
|
147
|
+
);
|
|
148
|
+
child.on('error', () => {});
|
|
149
|
+
child.unref();
|
|
150
|
+
return true;
|
|
151
|
+
} catch {
|
|
152
|
+
// The next automatic sync relinks.
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
117
157
|
async function useHandler(ctx) {
|
|
118
158
|
const requested = ctx.args.name;
|
|
119
159
|
const config = loadConfig();
|
|
@@ -132,6 +172,7 @@ async function useHandler(ctx) {
|
|
|
132
172
|
const worktreeOverride = Boolean(worktreeRuntime);
|
|
133
173
|
const worktreeBlocked = Boolean(worktreeUnavailable);
|
|
134
174
|
const authenticated = profileHasCredential(profile);
|
|
175
|
+
if (authenticated) relinkSkillsInBackground(requested, profile);
|
|
135
176
|
|
|
136
177
|
return ctx.output.emitSuccess({
|
|
137
178
|
command: ctx.spec.command_path.join(' '),
|
|
@@ -298,7 +339,7 @@ export const profileCommandSpecs = [
|
|
|
298
339
|
command_path: ['profile', 'use'],
|
|
299
340
|
summary: 'Switch the default profile without signing any profile out.',
|
|
300
341
|
when_to_use:
|
|
301
|
-
'Use this to change which account and API subsequent commands target. Every other profile keeps its credential.',
|
|
342
|
+
'Use this to change which account and API subsequent commands target. Every other profile keeps its credential. Its skills replace the previous default\'s in the agent folders (Claude Code, Codex, Cursor) straight away.',
|
|
302
343
|
args_schema: {
|
|
303
344
|
arguments: [{ token: '<name>', key: 'name', description: 'Profile to make active.' }],
|
|
304
345
|
options: [],
|