@notis_ai/cli 0.2.0-beta.19.1 → 0.2.0-beta.196.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +822 -135
- package/bin/check-runtime.js +15 -0
- package/bin/notis.js +2 -0
- package/config/notis_app_boundary_rules.json +50 -0
- package/config/notis_app_design_rules.json +135 -0
- package/config/portal-route-roots.json +48 -0
- package/dist/agent-hooks/notis-agent-hook.mjs +45587 -0
- package/dist/base-skills/notis-apps/SKILL.md +93 -0
- package/dist/base-skills/notis-apps/references/architecture.md +114 -0
- package/dist/base-skills/notis-apps/references/context.md +81 -0
- package/dist/base-skills/notis-apps/references/design.md +97 -0
- package/dist/base-skills/notis-apps/references/memory.md +58 -0
- package/dist/base-skills/notis-apps/references/reading.md +67 -0
- package/dist/base-skills/notis-apps/references/release.md +107 -0
- package/dist/base-skills/notis-apps/references/sdk.md +116 -0
- package/dist/base-skills/notis-apps/references/troubleshooting.md +24 -0
- package/dist/base-skills/notis-apps/references/views.md +142 -0
- package/dist/base-skills/notis-cli/SKILL.md +154 -0
- package/dist/base-skills/notis-cli/references/app-delivery.md +19 -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 +39 -0
- package/dist/base-skills/notis-query/SKILL.md +41 -0
- package/dist/base-skills/notis-query/references/database-discovery.md +60 -0
- package/dist/base-skills/notis-query/references/documents.md +63 -0
- package/dist/base-skills/notis-query/references/query.md +76 -0
- package/{template/packages/notis-sdk → dist/sdk}/package.json +14 -4
- package/dist/sdk/src/agentContext.ts +36 -0
- package/dist/sdk/src/bundleModule.ts +79 -0
- package/dist/sdk/src/components/Dialog.tsx +46 -0
- package/dist/sdk/src/components/DocumentEditor.tsx +106 -0
- package/dist/sdk/src/components/DocumentPage.tsx +141 -0
- package/dist/sdk/src/components/Markdown.tsx +60 -0
- package/dist/sdk/src/components/MarkdownEditor.tsx +121 -0
- package/dist/sdk/src/components/MultiSelectActionBar.tsx +285 -0
- package/dist/sdk/src/components/MultiSelectCheckbox.tsx +97 -0
- package/dist/sdk/src/components/MultiSelectDragOverlay.tsx +39 -0
- package/dist/sdk/src/components/NotisCommentBoundary.tsx +172 -0
- package/dist/sdk/src/components/NotisSelectionBoundary.tsx +59 -0
- package/dist/sdk/src/components/RecordComponents.tsx +33 -0
- package/dist/sdk/src/components/RenderChartData.tsx +19 -0
- package/dist/sdk/src/components/ShortcutHints.tsx +56 -0
- package/dist/sdk/src/components/Skeleton.tsx +24 -0
- package/dist/sdk/src/config.ts +239 -0
- package/dist/sdk/src/documents.ts +258 -0
- package/dist/sdk/src/hooks/useAction.ts +28 -0
- package/dist/sdk/src/hooks/useActiveResource.ts +19 -0
- package/dist/sdk/src/hooks/useAgentContext.ts +23 -0
- package/dist/sdk/src/hooks/useCloudComputer.ts +95 -0
- package/dist/sdk/src/hooks/useCloudComputerShell.ts +114 -0
- package/dist/sdk/src/hooks/useCollectionInteractions.ts +838 -0
- package/dist/sdk/src/hooks/useDatabaseSchema.ts +49 -0
- package/dist/sdk/src/hooks/useDatabaseSubscription.ts +76 -0
- package/dist/sdk/src/hooks/useDocument.ts +43 -0
- package/dist/sdk/src/hooks/useDocuments.ts +84 -0
- package/dist/sdk/src/hooks/useHandover.ts +78 -0
- package/dist/sdk/src/hooks/useLongPressSelection.ts +79 -0
- package/dist/sdk/src/hooks/useMultiSelect.ts +95 -0
- package/dist/sdk/src/hooks/useNativeDocumentBody.ts +50 -0
- package/dist/sdk/src/hooks/useNativeDocuments.ts +83 -0
- package/dist/sdk/src/hooks/useNotis.ts +42 -0
- package/dist/sdk/src/hooks/useNotisNavigation.ts +67 -0
- package/dist/sdk/src/hooks/useQuery.ts +74 -0
- package/dist/sdk/src/hooks/useTool.ts +65 -0
- package/dist/sdk/src/hooks/useToolQuery.ts +12 -0
- package/dist/sdk/src/hooks/useTopBarSearch.ts +81 -0
- package/dist/sdk/src/hooks/useUpsertDocument.ts +95 -0
- package/dist/sdk/src/hooks/useViewParams.ts +121 -0
- package/dist/sdk/src/hooks/useViewerReads.ts +129 -0
- package/dist/sdk/src/index.ts +200 -0
- package/dist/sdk/src/interactions/actions.ts +59 -0
- package/dist/sdk/src/interactions/shortcuts.tsx +740 -0
- package/dist/sdk/src/interactions/visibility.ts +13 -0
- package/dist/sdk/src/interactions.ts +45 -0
- package/dist/sdk/src/nativeData.ts +39 -0
- package/dist/sdk/src/presentation.tsx +82 -0
- package/dist/sdk/src/provider.tsx +49 -0
- package/dist/sdk/src/queryCache.ts +172 -0
- package/dist/sdk/src/queryErrors.ts +51 -0
- package/dist/sdk/src/runtime.ts +603 -0
- package/dist/sdk/src/space.ts +425 -0
- package/dist/sdk/src/styles.css +290 -0
- package/dist/sdk/src/tailwind.ts +66 -0
- package/dist/sdk/src/vite.ts +83 -0
- package/dist/skill-sync/index.js +2143 -0
- package/dist/skill-sync/index.js.map +7 -0
- package/dist/skill-sync-worker.mjs +3487 -0
- package/dist/space-harness/host.js +66 -0
- package/dist/view-renderer/dist/host.css +1 -0
- package/dist/view-renderer/dist/host.js +1042 -0
- package/dist/view-renderer/dist/theme.css +73 -0
- package/dist/view-renderer/src/dom.js +180 -0
- package/dist/view-renderer/src/errors.js +8 -0
- package/dist/view-renderer/src/host.tsx +173 -0
- package/dist/view-renderer/src/index.js +4 -0
- package/dist/view-renderer/src/pool.js +76 -0
- package/dist/view-renderer/src/remote-broker.js +59 -0
- package/dist/view-renderer/src/renderer.js +201 -0
- package/package.json +25 -8
- package/skills/notis-apps/cli.md +406 -0
- package/skills/notis-cli/AGENT_INSTRUCTIONS.md +39 -0
- package/skills/notis-onboarding/BRIEF.md +133 -0
- package/skills/notis-query/cli.md +39 -0
- package/src/agent-hook-entry.js +5 -0
- package/src/cli.js +294 -25
- package/src/command-specs/agents.js +392 -0
- package/src/command-specs/apps.js +1476 -203
- package/src/command-specs/auth.js +114 -137
- package/src/command-specs/diagnostics.js +730 -0
- package/src/command-specs/files.js +29 -0
- package/src/command-specs/handover.js +374 -0
- package/src/command-specs/helpers.js +86 -82
- package/src/command-specs/index.js +31 -6
- package/src/command-specs/meta.js +150 -18
- package/src/command-specs/onboarding.js +290 -0
- package/src/command-specs/profile.js +358 -0
- package/src/command-specs/skills.js +304 -0
- package/src/command-specs/smoke.js +386 -0
- package/src/command-specs/spaces.js +572 -0
- package/src/command-specs/tools.js +455 -139
- package/src/command-specs/views.js +69 -0
- package/src/runtime/agent-browser.js +700 -0
- package/src/runtime/agent-memory-state.js +126 -0
- package/src/runtime/agent-setup.js +383 -0
- package/src/runtime/app-boundary-validator.js +407 -0
- package/src/runtime/app-changelog.js +79 -0
- package/src/runtime/app-data-literals.js +82 -0
- package/src/runtime/app-platform.js +2752 -237
- package/src/runtime/app-registry-scaffolds.js +367 -0
- package/src/runtime/app-test-server.js +293 -0
- package/src/runtime/assets/store-screenshot-dark.png +0 -0
- package/src/runtime/auth-recovery.js +110 -0
- package/src/runtime/base-skills.d.ts +20 -0
- package/src/runtime/base-skills.js +167 -0
- package/src/runtime/channel.js +133 -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 +68 -0
- package/src/runtime/errors.js +1 -0
- package/src/runtime/git.js +233 -0
- package/src/runtime/login-listener.js +15 -0
- package/src/runtime/native-record-files.js +47 -0
- package/src/runtime/oauth.js +2622 -0
- package/src/runtime/output.js +37 -5
- package/src/runtime/ports.js +31 -0
- package/src/runtime/profiles.js +906 -55
- package/src/runtime/retired-sdk-files.js +20 -0
- package/src/runtime/screenshot-framing.js +85 -0
- package/src/runtime/skill-sync/cloud-client.ts +121 -0
- package/src/runtime/skill-sync/index.ts +905 -0
- package/src/runtime/skill-sync/local-scanner.ts +1259 -0
- package/src/runtime/skill-sync/native-identity.ts +102 -0
- package/src/runtime/skill-sync/native-plan.ts +59 -0
- package/src/runtime/skill-sync/symlink-manager.ts +433 -0
- package/src/runtime/skill-sync/sync-plan.ts +54 -0
- package/src/runtime/skill-sync/types.ts +157 -0
- package/src/runtime/skill-sync/write-cloud-skill.ts +50 -0
- package/src/runtime/skill-sync-service.js +109 -0
- package/src/runtime/source-root.js +32 -0
- package/src/runtime/space-collection-scaffold.js +66 -0
- package/src/runtime/space-database-structures.js +229 -0
- package/src/runtime/space-fixture-broker.js +50 -0
- package/src/runtime/space-lock.js +337 -0
- package/src/runtime/space-platform.js +105 -0
- package/src/runtime/space-source.js +281 -0
- package/src/runtime/space-test-server.js +327 -0
- package/src/runtime/space-verification.js +89 -0
- package/src/runtime/space-verify-browser-worker.js +51 -0
- package/src/runtime/space-view-manifest.js +254 -0
- package/src/runtime/store-screenshot.js +146 -0
- package/src/runtime/sync-skills.d.ts +37 -0
- package/src/runtime/sync-skills.js +231 -0
- package/src/runtime/telemetry.js +92 -0
- package/src/runtime/transport.js +331 -45
- package/src/runtime/view-render.js +49 -0
- package/src/skill-sync-worker-entry.js +2 -0
- package/src/skill-sync-worker.js +50 -0
- package/src/space-harness-host.ts +103 -0
- package/template/.harness/index.html.tmpl +435 -0
- package/template/CHANGELOG.md +5 -0
- package/template/app/globals.css +29 -3
- package/template/app/layout.tsx +6 -3
- package/template/app/page.tsx +49 -42
- package/template/components/page-heading.tsx +23 -0
- package/template/components/ui/badge.tsx +7 -4
- package/template/components/ui/button.tsx +1 -1
- package/template/components/ui/card.tsx +24 -11
- package/template/components/ui/native-select.tsx +24 -0
- package/template/notis.config.ts +24 -6
- package/template/package-lock.json +3642 -0
- package/template/package.json +19 -16
- package/template/postcss.config.mjs +1 -1
- package/template/tailwind.config.ts +1 -6
- package/template/tsconfig.json +1 -0
- package/src/command-specs/db.js +0 -163
- package/src/runtime/app-preview-server.js +0 -312
- package/template/packages/notis-sdk/src/config.ts +0 -48
- package/template/packages/notis-sdk/src/helpers.ts +0 -131
- package/template/packages/notis-sdk/src/hooks/useAppState.ts +0 -50
- package/template/packages/notis-sdk/src/hooks/useCollectionItem.ts +0 -58
- package/template/packages/notis-sdk/src/hooks/useDatabase.ts +0 -87
- package/template/packages/notis-sdk/src/hooks/useDocument.ts +0 -61
- package/template/packages/notis-sdk/src/hooks/useNotis.ts +0 -31
- package/template/packages/notis-sdk/src/hooks/useNotisNavigation.ts +0 -49
- package/template/packages/notis-sdk/src/hooks/useTool.ts +0 -49
- package/template/packages/notis-sdk/src/hooks/useUpsertDocument.ts +0 -57
- package/template/packages/notis-sdk/src/index.ts +0 -47
- package/template/packages/notis-sdk/src/provider.tsx +0 -44
- package/template/packages/notis-sdk/src/runtime.ts +0 -159
- package/template/packages/notis-sdk/src/styles.css +0 -123
- package/template/packages/notis-sdk/src/vite.ts +0 -54
- package/template/packages/notis-sdk/tsconfig.json +0 -15
- /package/{template/packages/notis-sdk → dist/sdk}/src/hooks/useBackend.ts +0 -0
- /package/{template/packages/notis-sdk → dist/sdk}/src/hooks/useTools.ts +0 -0
- /package/{template/packages/notis-sdk → dist/sdk}/src/ui.ts +0 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useNotisRuntime } from '../provider';
|
|
4
|
+
import { useQuery, type UseQueryResult } from './useQuery';
|
|
5
|
+
import {
|
|
6
|
+
SPACE_VIEWER_READ_OPERATIONS,
|
|
7
|
+
type SpaceViewerDatabase,
|
|
8
|
+
type SpaceViewerReadFamily,
|
|
9
|
+
type SpaceViewerReadInput,
|
|
10
|
+
type SpaceViewerReadOperation,
|
|
11
|
+
type SpaceViewerReadResult,
|
|
12
|
+
type SpaceViewerSkill,
|
|
13
|
+
} from '../space';
|
|
14
|
+
|
|
15
|
+
export interface UseViewerReadOptions {
|
|
16
|
+
enabled?: boolean;
|
|
17
|
+
staleTimeMs?: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Bounded crawl of the viewer's Skill inventory: 50 pages of 100.
|
|
21
|
+
const MAX_SKILL_PAGES = 50;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* True when this page may read what the signed-in viewer can open: the Space declares
|
|
25
|
+
* `viewerReads` for this family and the host offers it (never on a Site or anonymous link).
|
|
26
|
+
* Render a fallback when false.
|
|
27
|
+
*/
|
|
28
|
+
export function useViewerReadAvailable(family: SpaceViewerReadFamily): boolean {
|
|
29
|
+
const runtime = useNotisRuntime();
|
|
30
|
+
return runtime?.resource?.kind === 'space' && typeof runtime.viewerRead === 'function'
|
|
31
|
+
&& Boolean(runtime.space?.viewerReads?.includes(family));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** One cached, read-only viewer read. Results are scoped to the current viewer by the host cache scope. */
|
|
35
|
+
export function useViewerRead<TOperation extends SpaceViewerReadOperation>(operation: TOperation,
|
|
36
|
+
input: SpaceViewerReadInput[TOperation], options: UseViewerReadOptions = {}): UseQueryResult<SpaceViewerReadResult[TOperation]> {
|
|
37
|
+
const runtime = useNotisRuntime();
|
|
38
|
+
const available = useViewerReadAvailable(SPACE_VIEWER_READ_OPERATIONS[operation]);
|
|
39
|
+
return useQuery(['viewer-read', operation, input], async () => {
|
|
40
|
+
if (!runtime?.viewerRead) throw new Error('Viewer reads are unavailable here.');
|
|
41
|
+
return runtime.viewerRead<SpaceViewerReadResult[TOperation]>(operation, input as Record<string, unknown>);
|
|
42
|
+
}, { readOnly: true, enabled: available && options.enabled !== false, staleTimeMs: options.staleTimeMs });
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Every database the signed-in viewer can open, with its available links and read target. */
|
|
46
|
+
export function useViewerDatabases(options: UseViewerReadOptions = {}): UseQueryResult<SpaceViewerDatabase[]> {
|
|
47
|
+
const runtime = useNotisRuntime();
|
|
48
|
+
const available = useViewerReadAvailable('databases');
|
|
49
|
+
return useQuery(['viewer-databases'], async () => {
|
|
50
|
+
if (!runtime?.viewerRead) throw new Error('Viewer reads are unavailable here.');
|
|
51
|
+
const result = await runtime.viewerRead<SpaceViewerReadResult['list_databases']>('list_databases', {});
|
|
52
|
+
if (!Array.isArray(result?.databases)) throw new Error('The database list is incomplete.');
|
|
53
|
+
return result.databases;
|
|
54
|
+
}, { readOnly: true, enabled: available && options.enabled !== false, staleTimeMs: options.staleTimeMs });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
type ListSkillsRead = (input: SpaceViewerReadInput['list_skills']) => Promise<SpaceViewerReadResult['list_skills']>;
|
|
58
|
+
|
|
59
|
+
// Content pages read at once. Each one holds an API worker while its snapshots are read, and the API
|
|
60
|
+
// has only a few, so a large inventory never takes them all: two pages, plus one quick cursor read.
|
|
61
|
+
export const SKILL_CONTENT_PAGES_AT_ONCE = 2;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Every Skill page, in order. Pages with instructions are slow (each reads its snapshots), so the next
|
|
65
|
+
* page's cursor comes from a quick read without them and that page starts while the previous one is
|
|
66
|
+
* still read, at most SKILL_CONTENT_PAGES_AT_ONCE content pages at a time. A cursor that no longer
|
|
67
|
+
* matches (the list changed meanwhile) drops the pages started from it, waits for them to end and
|
|
68
|
+
* continues from the real cursor.
|
|
69
|
+
*/
|
|
70
|
+
export async function readAllViewerSkills(read: ListSkillsRead,
|
|
71
|
+
{ includeContent, includeDisabled }: { includeContent: boolean; includeDisabled: boolean }): Promise<SpaceViewerSkill[]> {
|
|
72
|
+
const page = (after: string | null, content: boolean) => read({ limit: 100, include_content: content,
|
|
73
|
+
include_disabled: includeDisabled, ...(after ? { after } : {}) }).then(result => {
|
|
74
|
+
if (!Array.isArray(result?.skills)) throw new Error('The Skill list is incomplete.');
|
|
75
|
+
return result;
|
|
76
|
+
});
|
|
77
|
+
const skills: SpaceViewerSkill[] = [];
|
|
78
|
+
// The pages started and not read yet, in order, each with the cursor it started from.
|
|
79
|
+
const started: { after: string | null; result: Promise<SpaceViewerReadResult['list_skills']> }[] = [];
|
|
80
|
+
// Where the next page to start begins, and whether a quick read (or the last page read) says it exists.
|
|
81
|
+
let cursor: string | null = null;
|
|
82
|
+
let known = true;
|
|
83
|
+
let pages = 0;
|
|
84
|
+
for (;;) {
|
|
85
|
+
if (known && started.length < (includeContent ? SKILL_CONTENT_PAGES_AT_ONCE : 1) && pages + started.length < MAX_SKILL_PAGES) {
|
|
86
|
+
const current = { after: cursor, result: page(cursor, includeContent) };
|
|
87
|
+
void current.result.catch(() => {});
|
|
88
|
+
started.push(current);
|
|
89
|
+
known = false;
|
|
90
|
+
if (includeContent) {
|
|
91
|
+
const probe = await page(cursor, false);
|
|
92
|
+
known = Boolean(probe.has_more && probe.next);
|
|
93
|
+
cursor = probe.next ?? null;
|
|
94
|
+
}
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
const head = started.shift();
|
|
98
|
+
if (!head) break;
|
|
99
|
+
const result = await head.result;
|
|
100
|
+
skills.push(...result.skills);
|
|
101
|
+
pages += 1;
|
|
102
|
+
if (!result.has_more || !result.next) return skills;
|
|
103
|
+
// A page started ahead is kept only when it continues exactly where this one ended; otherwise (and
|
|
104
|
+
// when none was started) the next page starts from this page's own cursor.
|
|
105
|
+
if (started[0]?.after !== result.next) {
|
|
106
|
+
const dropped = started.splice(0);
|
|
107
|
+
await Promise.allSettled(dropped.map(entry => entry.result));
|
|
108
|
+
cursor = result.next;
|
|
109
|
+
known = true;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
throw new Error('This account has more Skills than a page can read at once.');
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Every Skill the signed-in viewer can see, all pages. With `includeContent`, `skill_md`
|
|
117
|
+
* is present where the viewer holds content access and null elsewhere (curated, legacy).
|
|
118
|
+
*/
|
|
119
|
+
export function useViewerSkills(options: UseViewerReadOptions & { includeContent?: boolean; includeDisabled?: boolean } = {}):
|
|
120
|
+
UseQueryResult<SpaceViewerSkill[]> {
|
|
121
|
+
const runtime = useNotisRuntime();
|
|
122
|
+
const available = useViewerReadAvailable('skills');
|
|
123
|
+
const includeContent = options.includeContent === true, includeDisabled = options.includeDisabled === true;
|
|
124
|
+
return useQuery(['viewer-skills', includeContent, includeDisabled], async () => {
|
|
125
|
+
if (!runtime?.viewerRead) throw new Error('Viewer reads are unavailable here.');
|
|
126
|
+
return readAllViewerSkills((input: SpaceViewerReadInput['list_skills']) => runtime.viewerRead!('list_skills', input),
|
|
127
|
+
{ includeContent, includeDisabled });
|
|
128
|
+
}, { readOnly: true, enabled: available && options.enabled !== false, staleTimeMs: options.staleTimeMs });
|
|
129
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @notis/sdk - The Notis App SDK
|
|
3
|
+
*
|
|
4
|
+
* Public API for building Notis apps. Import hooks and the provider from
|
|
5
|
+
* this entrypoint. For configuration, use `@notis/sdk/config`. For the
|
|
6
|
+
* Vite config builder, use `@notis/sdk/vite`.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
// Provider
|
|
10
|
+
export { NotisProvider, useNotisRuntime } from './provider';
|
|
11
|
+
|
|
12
|
+
// Hooks
|
|
13
|
+
export { useAction, useActionQuery } from './hooks/useAction';
|
|
14
|
+
export { useNativeDocuments, useNativeMutation } from './hooks/useNativeDocuments';
|
|
15
|
+
export type { NativeField, NativeFilter, NativeQuery, NativeInsert, NativeUpdate, NativeDelete, NativeMutationReceipt } from './nativeData';
|
|
16
|
+
export type { SpaceDatabaseCreate, SpaceResourceReference } from './space';
|
|
17
|
+
export type { SpaceActionTemplate, SpaceActionDescriptor, SpaceRuntimeDescriptor, SpaceActionOptions } from './space';
|
|
18
|
+
export type { SpaceDocumentBodyRequest, SpaceDocumentBodyRead, SpaceDocumentBodySave, SpaceDocumentBodyResult } from './space';
|
|
19
|
+
export { useNativeDocumentBody } from './hooks/useNativeDocumentBody';
|
|
20
|
+
export { useViewerRead, useViewerReadAvailable, useViewerDatabases, useViewerSkills } from './hooks/useViewerReads';
|
|
21
|
+
export type { UseViewerReadOptions } from './hooks/useViewerReads';
|
|
22
|
+
export { useViewParams, useShown, useShownAvailable, parseViewParams } from './hooks/useViewParams';
|
|
23
|
+
export type { ViewParams, ViewParamsOf, UseShownOptions } from './hooks/useViewParams';
|
|
24
|
+
export { SPACE_VIEW_SPEC_VERSION } from './space';
|
|
25
|
+
export type { SpaceViewParam, SpaceViewParamType, SpaceShows, SpaceShownDescriptor, SpaceShownOptions, SpaceShownResult,
|
|
26
|
+
SpaceMemoryPolicy, SpaceMemorySnapshot, SpaceChrome, SpaceMarkdownInput } from './space';
|
|
27
|
+
export { SPACE_VIEWER_READ_OPERATIONS } from './space';
|
|
28
|
+
export { SPACE_CLOUD_COMPUTER_OPERATIONS, spaceCloudComputerAllows } from './space';
|
|
29
|
+
export type { SpaceCloudComputerLevel, SpaceCloudComputerOperation, SpaceCloudComputerStatus, SpaceCloudComputerRelease, SpaceCloudComputerRunInput,
|
|
30
|
+
SpaceCloudComputerRunResult, SpaceCloudComputerUploadInput, SpaceCloudComputerUploadResult, SpaceCloudComputerTransport } from './space';
|
|
31
|
+
export type { SpaceViewerReadFamily, SpaceViewerReadOperation, SpaceViewerReadInput, SpaceViewerReadResult, SpaceViewerLink,
|
|
32
|
+
SpaceViewerDatabase, SpaceViewerDatabaseSchema, SpaceViewerSkill, SpaceViewerSkillPage } from './space';
|
|
33
|
+
export { SpaceActionError, SpaceNavigationCancelled, isSpaceNavigationCancelled } from './space';
|
|
34
|
+
export type { SpaceActionFailureDetails } from './space';
|
|
35
|
+
export { useQuery, useQueryClient } from './hooks/useQuery';
|
|
36
|
+
export type { UseQueryOptions, UseQueryResult } from './hooks/useQuery';
|
|
37
|
+
export { createQueryClient, createPrefetchQueue, queryKey } from './queryCache';
|
|
38
|
+
export type { NotisQueryClient, QuerySnapshot, QueryFetchOptions } from './queryCache';
|
|
39
|
+
export { useNotis } from './hooks/useNotis';
|
|
40
|
+
export { useDocuments } from './hooks/useDocuments';
|
|
41
|
+
export type { UseDocumentsOptions, UseDocumentsResult } from './hooks/useDocuments';
|
|
42
|
+
export { useDatabaseSubscription } from './hooks/useDatabaseSubscription';
|
|
43
|
+
export type {
|
|
44
|
+
UseDatabaseSubscriptionOptions,
|
|
45
|
+
UseDatabaseSubscriptionResult,
|
|
46
|
+
} from './hooks/useDatabaseSubscription';
|
|
47
|
+
export { useDocument } from './hooks/useDocument';
|
|
48
|
+
export type { UseDocumentOptions, UseDocumentResult } from './hooks/useDocument';
|
|
49
|
+
export { useUpsertDocument } from './hooks/useUpsertDocument';
|
|
50
|
+
export type { UpsertDocumentArgs, UseUpsertDocumentResult } from './hooks/useUpsertDocument';
|
|
51
|
+
export { useDatabaseSchema } from './hooks/useDatabaseSchema';
|
|
52
|
+
export type { UseDatabaseSchemaResult } from './hooks/useDatabaseSchema';
|
|
53
|
+
export { useTool } from './hooks/useTool';
|
|
54
|
+
export type { ToolCallState, UseToolResult } from './hooks/useTool';
|
|
55
|
+
export { useTools } from './hooks/useTools';
|
|
56
|
+
export { useHandover } from './hooks/useHandover';
|
|
57
|
+
export type { UseHandoverResult } from './hooks/useHandover';
|
|
58
|
+
export { useCloudComputer } from './hooks/useCloudComputer';
|
|
59
|
+
export type { UseCloudComputerResult } from './hooks/useCloudComputer';
|
|
60
|
+
export { useCloudComputerShell } from './hooks/useCloudComputerShell';
|
|
61
|
+
export type { UseCloudComputerShellResult } from './hooks/useCloudComputerShell';
|
|
62
|
+
export { useNotisNavigation } from './hooks/useNotisNavigation';
|
|
63
|
+
export { useTopBarSearch } from './hooks/useTopBarSearch';
|
|
64
|
+
export { useBackend } from './hooks/useBackend';
|
|
65
|
+
export { useMultiSelect } from './hooks/useMultiSelect';
|
|
66
|
+
export { useCollectionInteractions, COLLECTION_ITEM_ATTRIBUTE } from './hooks/useCollectionInteractions';
|
|
67
|
+
export { useActiveResource } from './hooks/useActiveResource';
|
|
68
|
+
export {
|
|
69
|
+
ShortcutProvider,
|
|
70
|
+
SHORTCUT_SCOPE_PRIORITY,
|
|
71
|
+
isEditableShortcutEvent,
|
|
72
|
+
shortcutDisplay,
|
|
73
|
+
useShortcuts,
|
|
74
|
+
} from './interactions/shortcuts';
|
|
75
|
+
|
|
76
|
+
// Documents & markdown
|
|
77
|
+
export { Markdown } from './components/Markdown';
|
|
78
|
+
export type { MarkdownProps } from './components/Markdown';
|
|
79
|
+
export { DocumentEditor } from './components/DocumentEditor';
|
|
80
|
+
export { DocumentPage, DocumentPageSkeleton, usePrefetchRecord } from './components/DocumentPage';
|
|
81
|
+
export { RecordProperties, HtmlFrame, ReportFrame, ShareControl } from './components/RecordComponents';
|
|
82
|
+
export { RenderChartData } from './components/RenderChartData';
|
|
83
|
+
export { MarkdownEditor } from './components/MarkdownEditor';
|
|
84
|
+
export { NotisSelectionBoundary, NOTIS_CONTEXT_CLIPBOARD_TYPE } from './components/NotisSelectionBoundary';
|
|
85
|
+
export type { NotisSelectionBoundaryProps } from './components/NotisSelectionBoundary';
|
|
86
|
+
export {
|
|
87
|
+
asRecord,
|
|
88
|
+
blockNoteToPlainText,
|
|
89
|
+
extractRichText,
|
|
90
|
+
getDocumentPreview,
|
|
91
|
+
getRelationIds,
|
|
92
|
+
getSecretValue,
|
|
93
|
+
isPresentString,
|
|
94
|
+
markdownToPlainText,
|
|
95
|
+
normalizeDatabaseProperty,
|
|
96
|
+
normalizeDocumentRecord,
|
|
97
|
+
normalizePropertyValue,
|
|
98
|
+
optionalString,
|
|
99
|
+
} from './documents';
|
|
100
|
+
|
|
101
|
+
// Multi-select components
|
|
102
|
+
export { Dialog } from './components/Dialog';
|
|
103
|
+
export type { DialogProps } from './components/Dialog';
|
|
104
|
+
export { MultiSelectActionBar } from './components/MultiSelectActionBar';
|
|
105
|
+
export { MultiSelectCheckbox, MultiSelectCheckbox as SelectionCheckbox } from './components/MultiSelectCheckbox';
|
|
106
|
+
export { MultiSelectDragOverlay, MultiSelectDragOverlay as SelectionMarquee } from './components/MultiSelectDragOverlay';
|
|
107
|
+
export { ShortcutHints } from './components/ShortcutHints';
|
|
108
|
+
export type {
|
|
109
|
+
DragRect,
|
|
110
|
+
MultiSelectController,
|
|
111
|
+
UseMultiSelectOptions,
|
|
112
|
+
} from './hooks/useMultiSelect';
|
|
113
|
+
export type {
|
|
114
|
+
MultiSelectAction,
|
|
115
|
+
MultiSelectActionBarProps,
|
|
116
|
+
} from './components/MultiSelectActionBar';
|
|
117
|
+
export type { MultiSelectCheckboxProps } from './components/MultiSelectCheckbox';
|
|
118
|
+
export type { MultiSelectDragOverlayProps } from './components/MultiSelectDragOverlay';
|
|
119
|
+
export type { MultiSelectCheckboxProps as SelectionCheckboxProps } from './components/MultiSelectCheckbox';
|
|
120
|
+
export type { MultiSelectDragOverlayProps as SelectionMarqueeProps } from './components/MultiSelectDragOverlay';
|
|
121
|
+
export type { ShortcutHint, ShortcutHintsProps } from './components/ShortcutHints';
|
|
122
|
+
export type {
|
|
123
|
+
CollectionInteractionController,
|
|
124
|
+
CollectionInteractionReason,
|
|
125
|
+
CollectionKeyboardShortcuts,
|
|
126
|
+
CollectionNavigationContext,
|
|
127
|
+
CollectionNavigationDirection,
|
|
128
|
+
CollectionSelectionChange,
|
|
129
|
+
SelectionMarqueeRect,
|
|
130
|
+
UseCollectionInteractionsOptions,
|
|
131
|
+
} from './hooks/useCollectionInteractions';
|
|
132
|
+
export type {
|
|
133
|
+
ShortcutDefinition,
|
|
134
|
+
ShortcutHelpEntry,
|
|
135
|
+
ShortcutScope,
|
|
136
|
+
UseShortcutsOptions,
|
|
137
|
+
} from './interactions/shortcuts';
|
|
138
|
+
export type {
|
|
139
|
+
CollectionAction,
|
|
140
|
+
CollectionActionContext,
|
|
141
|
+
CollectionActionIntent,
|
|
142
|
+
ResolvedCollectionAction,
|
|
143
|
+
} from './interactions/actions';
|
|
144
|
+
|
|
145
|
+
// Types (re-exported for convenience)
|
|
146
|
+
export type {
|
|
147
|
+
AppDescriptor,
|
|
148
|
+
CloudComputerCliAuthFacts,
|
|
149
|
+
CloudComputerFacts,
|
|
150
|
+
CloudComputerSandboxFacts,
|
|
151
|
+
ContextAttributeValue,
|
|
152
|
+
ContextResource,
|
|
153
|
+
ContextSelection,
|
|
154
|
+
CollectionItem,
|
|
155
|
+
CollectionItemDetail,
|
|
156
|
+
DatabaseDescriptor,
|
|
157
|
+
DatabaseProperty,
|
|
158
|
+
DatabasePropertyOption,
|
|
159
|
+
DatabasePropertyType,
|
|
160
|
+
DocumentContentType,
|
|
161
|
+
DocumentRecord,
|
|
162
|
+
HandoverPayload,
|
|
163
|
+
HandoverResult,
|
|
164
|
+
NotisDocumentEditorProps,
|
|
165
|
+
NotisDocumentPageProps,
|
|
166
|
+
NotisDocumentPageCrumb,
|
|
167
|
+
NotisDocumentPageMenuItem,
|
|
168
|
+
NotisDocumentPageParts,
|
|
169
|
+
NotisRecordProps,
|
|
170
|
+
NotisRecordPropertiesProps,
|
|
171
|
+
NotisHtmlFrameProps,
|
|
172
|
+
NotisReportFrameProps,
|
|
173
|
+
NotisShareControlProps,
|
|
174
|
+
NotisMarkdownEditorProps,
|
|
175
|
+
NotisMarkdownEditorSavePayload,
|
|
176
|
+
NotisMarkdownEditorSaveResult,
|
|
177
|
+
NotisRuntime,
|
|
178
|
+
RuntimeResource,
|
|
179
|
+
NotisRuntimeContext,
|
|
180
|
+
NotisRuntimeUI,
|
|
181
|
+
QueryFilter,
|
|
182
|
+
RouteDescriptor,
|
|
183
|
+
SecretPropertyValue,
|
|
184
|
+
SubscribeDatabaseOptions,
|
|
185
|
+
ToolDescriptor,
|
|
186
|
+
ToolCallOptions,
|
|
187
|
+
ToolInputSchema,
|
|
188
|
+
} from './runtime';
|
|
189
|
+
|
|
190
|
+
export { useToolQuery } from './hooks/useToolQuery';
|
|
191
|
+
|
|
192
|
+
export { Skeleton, ViewSkeleton } from './components/Skeleton';
|
|
193
|
+
|
|
194
|
+
export { useLongPressSelection } from './hooks/useLongPressSelection';
|
|
195
|
+
export { isInteractionElementVisible } from './interactions/visibility';
|
|
196
|
+
|
|
197
|
+
export type { AgentContextContent, AgentContextItem, ContextAttachment } from './agentContext';
|
|
198
|
+
export { useAgentContext } from './hooks/useAgentContext';
|
|
199
|
+
export { NotisCommentBoundary, NotisCommentBox } from './components/NotisCommentBoundary';
|
|
200
|
+
export type { NotisCommentBoundaryProps, NotisCommentBoxProps } from './components/NotisCommentBoundary';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export type CollectionActionIntent =
|
|
4
|
+
| 'archive' | 'star' | 'delete'
|
|
5
|
+
| 'enable' | 'disable' | 'pause' | 'resume'
|
|
6
|
+
| 'move' | 'add-to-folder' | 'complete' | 'start-progress'
|
|
7
|
+
| 'custom';
|
|
8
|
+
|
|
9
|
+
export interface CollectionActionContext<T> {
|
|
10
|
+
selectedIds: string[];
|
|
11
|
+
selectedItems: T[];
|
|
12
|
+
clearSelection: () => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface CollectionAction<T> {
|
|
16
|
+
id: string;
|
|
17
|
+
intent?: CollectionActionIntent;
|
|
18
|
+
label?: string;
|
|
19
|
+
icon?: ReactNode;
|
|
20
|
+
/** Omit to use the intent default, supply a key to override, or false to remove it. */
|
|
21
|
+
shortcut?: string | false;
|
|
22
|
+
destructive?: boolean;
|
|
23
|
+
disabled?: boolean | ((context: CollectionActionContext<T>) => boolean);
|
|
24
|
+
pending?: boolean;
|
|
25
|
+
onRun: (context: CollectionActionContext<T>) => void | Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface ResolvedCollectionAction {
|
|
29
|
+
id: string;
|
|
30
|
+
label: string;
|
|
31
|
+
icon?: ReactNode;
|
|
32
|
+
shortcut?: string;
|
|
33
|
+
destructive?: boolean;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
pending?: boolean;
|
|
36
|
+
onRun: () => void | Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const ACTION_DEFAULTS: Record<Exclude<CollectionActionIntent, 'custom'>, { label: string; shortcut: string }> = {
|
|
40
|
+
archive: { label: 'Archive', shortcut: 'E' },
|
|
41
|
+
star: { label: 'Star', shortcut: 'S' },
|
|
42
|
+
delete: { label: 'Delete', shortcut: '#' },
|
|
43
|
+
enable: { label: 'Enable', shortcut: 'E' },
|
|
44
|
+
disable: { label: 'Disable', shortcut: 'D' },
|
|
45
|
+
pause: { label: 'Pause', shortcut: 'P' },
|
|
46
|
+
resume: { label: 'Resume', shortcut: 'R' },
|
|
47
|
+
move: { label: 'Move', shortcut: 'M' },
|
|
48
|
+
'add-to-folder': { label: 'Add to folder', shortcut: 'F' },
|
|
49
|
+
complete: { label: 'Mark complete', shortcut: 'C' },
|
|
50
|
+
'start-progress': { label: 'Start progress', shortcut: 'P' },
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export function collectionActionDefaults(intent: CollectionActionIntent | undefined): {
|
|
54
|
+
label?: string;
|
|
55
|
+
shortcut?: string;
|
|
56
|
+
} {
|
|
57
|
+
if (!intent || intent === 'custom') return {};
|
|
58
|
+
return ACTION_DEFAULTS[intent];
|
|
59
|
+
}
|