@notis_ai/cli 0.2.31 → 0.2.33
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 +88 -9
- package/config/notis_app_design_rules.json +22 -0
- package/dist/agent-hooks/notis-agent-hook.mjs +4677 -913
- package/dist/base-skills/notis-cli/.notis-base-skill.json +1 -1
- package/dist/base-skills/notis-cli/SKILL.md +7 -3
- package/dist/base-skills/notis-spaces/.notis-base-skill.json +1 -1
- package/dist/base-skills/notis-spaces/SKILL.md +9 -4
- package/dist/base-skills/notis-spaces/references/comments.md +94 -0
- package/dist/base-skills/notis-spaces/references/context.md +20 -19
- package/dist/base-skills/notis-spaces/references/design.md +3 -2
- package/dist/base-skills/notis-spaces/references/fixtures.md +4 -2
- package/dist/base-skills/notis-spaces/references/reading.md +3 -1
- package/dist/base-skills/notis-spaces/references/release.md +3 -1
- package/dist/base-skills/notis-spaces/references/sdk.md +160 -88
- package/dist/base-skills/notis-spaces/references/store.md +24 -1
- package/dist/sdk/src/components/SelectionActionBar.tsx +42 -7
- package/dist/sdk/src/components/SpaceTextComments.tsx +284 -0
- package/dist/sdk/src/config.ts +3 -1
- package/dist/sdk/src/functions.ts +203 -0
- package/dist/sdk/src/hooks/useAgentQueue.ts +17 -28
- package/dist/sdk/src/hooks/useCollectionInteractions.ts +7 -2
- package/dist/sdk/src/hooks/useConnection.ts +102 -0
- package/dist/sdk/src/hooks/useFunction.ts +42 -0
- package/dist/sdk/src/hooks/useNotisSettings.ts +101 -0
- package/dist/sdk/src/index.ts +15 -4
- package/dist/sdk/src/runtime.ts +16 -1
- package/dist/sdk/src/space.ts +333 -33
- package/dist/sdk/src/ui/comments/passageModel.ts +99 -0
- package/dist/sdk/src/ui/comments/textHighlights.ts +33 -0
- package/dist/sdk/src/ui/icons.tsx +17 -1
- package/dist/skill-sync/index.js +239 -30
- package/dist/skill-sync-worker.mjs +453 -124
- package/dist/space-harness/host.js +218 -93
- package/dist/space-sdk/dist/chunk-4GWS2IFO.js +3 -0
- package/dist/space-sdk/dist/index.js +3 -3
- package/dist/space-sdk/dist/ui.js +9 -8
- package/dist/space-sdk/src/config.ts +3 -1
- package/dist/space-sdk/src/functions.ts +203 -0
- package/dist/space-sdk/src/hooks/useAgentQueue.d.ts +2 -13
- package/dist/space-sdk/src/hooks/useCollectionInteractions.d.ts +2 -0
- package/dist/space-sdk/src/hooks/useConnection.d.ts +42 -0
- package/dist/space-sdk/src/hooks/useFunction.d.ts +20 -0
- package/dist/space-sdk/src/hooks/useNotisSettings.d.ts +48 -0
- package/dist/space-sdk/src/index.d.ts +10 -4
- package/dist/space-sdk/src/runtime.d.ts +14 -1
- package/dist/space-sdk/src/space.ts +333 -33
- package/dist/space-sdk/src/tailwind-candidates.d.ts +227 -152
- package/dist/space-sdk/src/ui/blocks/blocks.d.ts +18 -0
- package/dist/space-sdk/src/ui/blocks/index.d.ts +2 -2
- package/dist/space-sdk/src/ui/comments/CommentPane.d.ts +7 -4
- package/dist/space-sdk/src/ui/comments/agentRuntime.d.ts +10 -2
- package/dist/space-sdk/src/ui/comments/commentModel.d.ts +55 -88
- package/dist/space-sdk/src/ui/comments/commentWords.d.ts +9 -0
- package/dist/space-sdk/src/ui/comments/hostComments.d.ts +13 -9
- package/dist/space-sdk/src/ui/comments/index.d.ts +1 -1
- package/dist/space-sdk/src/ui/comments/paneParts.d.ts +27 -5
- package/dist/space-sdk/src/ui/comments/passageModel.d.ts +12 -36
- package/dist/space-sdk/src/ui/comments/useCommentRouting.d.ts +26 -4
- package/dist/space-sdk/src/ui/comments/useComments.d.ts +64 -74
- package/dist/space-sdk/src/ui/comments/usePassageComments.d.ts +8 -4
- package/dist/space-sdk/src/ui/icons.d.ts +6 -0
- package/dist/space-sdk/src/ui/index.d.ts +2 -2
- package/dist/space-sdk/src/ui/layout/SidePane.d.ts +3 -4
- package/dist/space-sdk/src/ui/list/ListReader.d.ts +8 -0
- package/dist/space-sdk/src/ui/period/dateFormat.d.ts +27 -8
- package/dist/view-renderer/dist/host.js +285 -160
- package/package.json +3 -3
- package/skills/notis-cli/AGENT_INSTRUCTIONS.md +2 -2
- package/skills/notis-spaces/cli.md +17 -3
- package/src/cli.js +2 -1
- package/src/command-specs/index.js +3 -0
- package/src/command-specs/repository-secrets.js +171 -0
- package/src/command-specs/spaces.js +70 -3
- package/src/runtime/agent-credential.js +175 -0
- package/src/runtime/agent-identity.js +92 -15
- package/src/runtime/app-boundary-validator.js +248 -3
- package/src/runtime/app-data-literals.js +32 -23
- package/src/runtime/app-platform.js +8 -0
- package/src/runtime/auth-recovery.js +14 -0
- package/src/runtime/profiles.js +15 -0
- package/src/runtime/skill-sync/index.ts +3 -2
- package/src/runtime/skill-sync/symlink-manager.ts +354 -35
- package/src/runtime/skill-sync/types.ts +10 -1
- package/src/runtime/space-functions.js +211 -0
- package/src/runtime/space-platform.js +12 -3
- package/src/runtime/space-source.js +116 -13
- package/src/runtime/space-test-server.js +44 -7
- package/src/runtime/space-verification.js +3 -1
- package/src/runtime/transport.js +15 -0
- package/dist/sdk/src/components/NotisCommentBoundary.tsx +0 -132
- package/dist/space-sdk/dist/chunk-3DFOGU26.js +0 -3
- package/dist/space-sdk/src/components/NotisCommentBoundary.d.ts +0 -26
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useCallback, useState } from 'react';
|
|
4
|
+
import { useQuery } from './useQuery';
|
|
5
|
+
import { useNotisRuntime } from '../provider';
|
|
6
|
+
import { queryKey } from '../queryCache';
|
|
7
|
+
import { SPACE_TOOLKIT_SLUG, spaceQueryKey, type SpaceConnection } from '../space';
|
|
8
|
+
import type { NotisRuntime } from '../runtime';
|
|
9
|
+
|
|
10
|
+
/** Cache key of one toolkit's read; every mounted `useConnection(toolkit)` reads again after a connect. */
|
|
11
|
+
export function connectionQueryKey(toolkit: string) {
|
|
12
|
+
return ['connection', toolkit] as const;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Marks a toolkit's read stale in the host cache, so every mounted `useConnection` of it reads again. */
|
|
16
|
+
export function invalidateConnection(runtime: NotisRuntime | null, toolkit: string): void {
|
|
17
|
+
try {
|
|
18
|
+
runtime?.queryClient?.invalidate(queryKey(spaceQueryKey(runtime, connectionQueryKey(toolkit))));
|
|
19
|
+
} catch {
|
|
20
|
+
// A host without a Space access context has no shared cache to refresh.
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface UseConnectionResult {
|
|
25
|
+
/** False where the host cannot answer (Sites, shared links, verification, previews offline, older hosts). */
|
|
26
|
+
available: boolean;
|
|
27
|
+
/** The viewer's own account in this app works now. */
|
|
28
|
+
connected: boolean;
|
|
29
|
+
/** The GitHub login for GitHub, else the name the person gave the account, else null. */
|
|
30
|
+
account: string | null;
|
|
31
|
+
/** The newest account's state (`ACTIVE`, `EXPIRED`, `FAILED`...), null when there is none or while loading. */
|
|
32
|
+
status: string | null;
|
|
33
|
+
loading: boolean;
|
|
34
|
+
/** The connect window is open and the host is waiting for the account to work. */
|
|
35
|
+
connecting: boolean;
|
|
36
|
+
error: Error | null;
|
|
37
|
+
/**
|
|
38
|
+
* Opens the Portal's connect flow for this app (a sign-in window on the web, the browser in Desktop). Call it from
|
|
39
|
+
* the person's own click: the host refuses a call no click started. Resolves true once the account works, false
|
|
40
|
+
* when the person closed the window or it timed out, and rejects with a message to show when the host refused.
|
|
41
|
+
*/
|
|
42
|
+
connect: () => Promise<boolean>;
|
|
43
|
+
/** Read again. */
|
|
44
|
+
refresh: () => Promise<void>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const unavailable = (toolkit: string): SpaceConnection =>
|
|
48
|
+
({ toolkit, available: false, connected: false, account: null, status: null });
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The signed-in viewer's own account in one connected app, and a button's way to connect it.
|
|
52
|
+
*
|
|
53
|
+
* ```tsx
|
|
54
|
+
* const github = useConnection('github');
|
|
55
|
+
* if (!github.available) return <OpenInNotis />;
|
|
56
|
+
* return github.connected
|
|
57
|
+
* ? <p>GitHub: {github.account}</p>
|
|
58
|
+
* : <Button onClick={() => github.connect()} disabled={github.connecting}>Connect GitHub</Button>;
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* Needs no declaration: it reads only the viewer's own account and never a credential. On a Site, a shared link, in
|
|
62
|
+
* verification and in the vite preview it answers `available: false`; keep a fallback (a link to Integrations).
|
|
63
|
+
*/
|
|
64
|
+
export function useConnection(toolkit: string): UseConnectionResult {
|
|
65
|
+
const runtime = useNotisRuntime();
|
|
66
|
+
const slug = typeof toolkit === 'string' ? toolkit.trim().toLowerCase() : '';
|
|
67
|
+
const valid = SPACE_TOOLKIT_SLUG.test(slug);
|
|
68
|
+
const transport = valid ? runtime?.spaceConnections : undefined;
|
|
69
|
+
const [connecting, setConnecting] = useState(false);
|
|
70
|
+
const query = useQuery<SpaceConnection>(connectionQueryKey(slug), async () => (
|
|
71
|
+
transport ? transport.read(slug) : unavailable(slug)
|
|
72
|
+
), { readOnly: true, staleTimeMs: 30_000 });
|
|
73
|
+
|
|
74
|
+
const connect = useCallback(async () => {
|
|
75
|
+
if (!transport) throw new Error('Connect this app from the Space in Notis.');
|
|
76
|
+
setConnecting(true);
|
|
77
|
+
try {
|
|
78
|
+
// Called before anything awaits: the host opens its window inside the person's click.
|
|
79
|
+
const after = await transport.connect(slug);
|
|
80
|
+
invalidateConnection(runtime, slug);
|
|
81
|
+
await query.refetch();
|
|
82
|
+
return after.connected;
|
|
83
|
+
} finally {
|
|
84
|
+
setConnecting(false);
|
|
85
|
+
}
|
|
86
|
+
}, [query.refetch, runtime, slug, transport]);
|
|
87
|
+
|
|
88
|
+
const refresh = useCallback(async () => { await query.refetch(); }, [query.refetch]);
|
|
89
|
+
const data = query.data ?? (!transport ? unavailable(slug) : null);
|
|
90
|
+
return {
|
|
91
|
+
// A read that failed keeps the hook available: `error` says why, and `refresh` or `connect` still work.
|
|
92
|
+
available: Boolean(transport) && data?.available !== false,
|
|
93
|
+
connected: data?.connected === true,
|
|
94
|
+
account: data?.account ?? null,
|
|
95
|
+
status: data?.status ?? null,
|
|
96
|
+
loading: query.loading,
|
|
97
|
+
connecting,
|
|
98
|
+
error: query.error,
|
|
99
|
+
connect,
|
|
100
|
+
refresh,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useCallback, useState } from 'react';
|
|
4
|
+
import { useNotisRuntime } from '../provider';
|
|
5
|
+
import { useQuery, type UseQueryOptions, type UseQueryResult } from './useQuery';
|
|
6
|
+
import type { SpaceFunctionCallOptions } from '../functions';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Call one of this Space's functions exposed to its views (`expose: ['page']`). The handler runs on Notis's side;
|
|
10
|
+
* the page only gets its result.
|
|
11
|
+
*
|
|
12
|
+
* ```tsx
|
|
13
|
+
* const settle = useFunction<{ thread: string }, { settled: boolean }>('settle_thread');
|
|
14
|
+
* <Button disabled={settle.loading} onClick={() => void settle.call({ thread: id })}>Settle</Button>
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export function useFunction<TInput extends Record<string, unknown> = Record<string, unknown>, TResult = unknown>(name: string): {
|
|
18
|
+
call: (input: TInput, options?: SpaceFunctionCallOptions) => Promise<TResult>; loading: boolean; error: Error | null;
|
|
19
|
+
/** False on hosts that cannot run functions, or when this view may not call this one. */
|
|
20
|
+
available: boolean;
|
|
21
|
+
} {
|
|
22
|
+
const runtime = useNotisRuntime();
|
|
23
|
+
const [pending, setPending] = useState(0);
|
|
24
|
+
const [error, setError] = useState<Error | null>(null);
|
|
25
|
+
const available = runtime?.resource?.kind === 'space' && Boolean(runtime.callFunction)
|
|
26
|
+
&& Boolean(runtime.space?.functions && Object.hasOwn(runtime.space.functions, name));
|
|
27
|
+
const call = useCallback(async (input: TInput, options?: SpaceFunctionCallOptions) => {
|
|
28
|
+
if (runtime?.resource?.kind !== 'space' || !runtime.callFunction) throw new Error('A Space function runtime is required.');
|
|
29
|
+
setPending((value) => value + 1); setError(null);
|
|
30
|
+
try { return await runtime.callFunction<TResult>(name, input, options); }
|
|
31
|
+
catch (cause) { const failure = cause instanceof Error ? cause : new Error(String(cause)); setError(failure); throw failure; }
|
|
32
|
+
finally { setPending((value) => value - 1); }
|
|
33
|
+
}, [runtime, name]);
|
|
34
|
+
return { call, loading: pending > 0, error, available };
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** A `read` function as a cached query: it runs again when `input` changes. */
|
|
38
|
+
export function useFunctionQuery<TResult = unknown>(name: string, input: Record<string, unknown>,
|
|
39
|
+
options: UseQueryOptions = { readOnly: true }): UseQueryResult<TResult> {
|
|
40
|
+
const { call } = useFunction<Record<string, unknown>, TResult>(name);
|
|
41
|
+
return useQuery(['function', name, input], () => call(input), options);
|
|
42
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useCallback } from 'react';
|
|
4
|
+
import { useNotisRuntime } from '../provider';
|
|
5
|
+
import { settledNavigation } from './useNotisNavigation';
|
|
6
|
+
|
|
7
|
+
/** A Settings place a Space may open. Only the Cloud Computer's repository secrets for now. */
|
|
8
|
+
export interface NotisSettingsTarget {
|
|
9
|
+
page: 'cloud-computer';
|
|
10
|
+
section: 'repository-secrets';
|
|
11
|
+
/**
|
|
12
|
+
* The repository the form is prefilled with: its short name (`naturalisation-switzerland`) or `owner/name`, whose
|
|
13
|
+
* short name is kept. Repository secrets are keyed by the short name, in lower case.
|
|
14
|
+
*/
|
|
15
|
+
repository?: string;
|
|
16
|
+
/** Open the Add env file (`env_file`) or Add variable (`variable`) form. Without it the section is only shown. */
|
|
17
|
+
add?: 'env_file' | 'variable';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface UseNotisSettingsResult {
|
|
21
|
+
/** False on a Site, a link, a release preview, a page framed inside another, verify and the vite preview: offer your
|
|
22
|
+
* own fallback there. */
|
|
23
|
+
available: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Opens Settings on the target, above the Space. Resolves once the host has taken it; rejects on a host that cannot
|
|
26
|
+
* open Settings, on a target it does not know, or when the view is no longer the one on screen. Values are never
|
|
27
|
+
* prefilled: the person types or chooses them in Settings.
|
|
28
|
+
*/
|
|
29
|
+
openSettings: (target: NotisSettingsTarget) => Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type NotisSettingsNavigation = {
|
|
33
|
+
kind: 'settings'; page: 'cloud-computer'; section: 'repository-secrets';
|
|
34
|
+
repository?: string; add?: 'env_file' | 'variable';
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** The repository-secrets store's rule for a repository (server/lib/database_schema.py SECRET_REPOSITORY_SLUG). */
|
|
38
|
+
const REPOSITORY = /^[a-z0-9](?:[a-z0-9._-]{0,62}[a-z0-9])?$/;
|
|
39
|
+
/** A GitHub owner: letters, digits and dashes. */
|
|
40
|
+
const OWNER = /^[A-Za-z0-9][A-Za-z0-9-]{0,38}$/;
|
|
41
|
+
|
|
42
|
+
/** The short name a repository is kept under (`owner/name` keeps `name`, lower case), or null when it is not one. */
|
|
43
|
+
export function settingsRepositoryName(value: unknown): string | null {
|
|
44
|
+
if (typeof value !== 'string') return null;
|
|
45
|
+
const parts = value.trim().split('/');
|
|
46
|
+
if (parts.length > 2 || (parts.length === 2 && !OWNER.test(parts[0]))) return null;
|
|
47
|
+
const name = parts[parts.length - 1].toLowerCase();
|
|
48
|
+
return REPOSITORY.test(name) ? name : null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const TARGET_KEYS = ['page', 'section', 'repository', 'add'];
|
|
52
|
+
|
|
53
|
+
/** The payload `openSettings` sends the host, or an Error naming what is wrong. Hosts check it again with this. */
|
|
54
|
+
export function settingsNavigation(target: unknown): NotisSettingsNavigation | Error {
|
|
55
|
+
if (!target || typeof target !== 'object' || Array.isArray(target)) return new Error('Name the Settings page to open.');
|
|
56
|
+
const fields = target as Record<string, unknown>;
|
|
57
|
+
if (Object.keys(fields).some(key => fields[key] !== undefined && !TARGET_KEYS.includes(key))) {
|
|
58
|
+
return new Error('openSettings takes page, section, repository and add.');
|
|
59
|
+
}
|
|
60
|
+
if (fields.page !== 'cloud-computer' || fields.section !== 'repository-secrets') {
|
|
61
|
+
return new Error("Spaces open Settings on { page: 'cloud-computer', section: 'repository-secrets' }.");
|
|
62
|
+
}
|
|
63
|
+
if (fields.add !== undefined && fields.add !== 'env_file' && fields.add !== 'variable') {
|
|
64
|
+
return new Error("add is 'env_file' or 'variable'.");
|
|
65
|
+
}
|
|
66
|
+
let repository: string | undefined;
|
|
67
|
+
if (fields.repository !== undefined) {
|
|
68
|
+
const name = settingsRepositoryName(fields.repository);
|
|
69
|
+
if (!name) return new Error('Name the repository by its short name or owner/name.');
|
|
70
|
+
repository = name;
|
|
71
|
+
}
|
|
72
|
+
return { kind: 'settings', page: 'cloud-computer', section: 'repository-secrets',
|
|
73
|
+
...(repository ? { repository } : {}), ...(fields.add ? { add: fields.add as 'env_file' | 'variable' } : {}) };
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Opens the host's Settings from a Space view, such as the repository secrets form for one repository.
|
|
78
|
+
*
|
|
79
|
+
* ```tsx
|
|
80
|
+
* const settings = useNotisSettings();
|
|
81
|
+
* <button disabled={!settings.available}
|
|
82
|
+
* onClick={() => settings.openSettings({ page: 'cloud-computer', section: 'repository-secrets',
|
|
83
|
+
* repository: 'naturalisation-switzerland', add: 'env_file' })}>Add .env file</button>
|
|
84
|
+
* ```
|
|
85
|
+
*
|
|
86
|
+
* The same place has a plain address a Space or an email can link to:
|
|
87
|
+
* `/manage?settings=cloud&settings_section=repository-secrets&settings_repository=<name>&settings_add=env_file`.
|
|
88
|
+
*/
|
|
89
|
+
export function useNotisSettings(): UseNotisSettingsResult {
|
|
90
|
+
const runtime = useNotisRuntime();
|
|
91
|
+
const available = Boolean(runtime?.settingsAvailable && runtime.navigate);
|
|
92
|
+
const openSettings = useCallback(async (target: NotisSettingsTarget) => {
|
|
93
|
+
if (!runtime?.settingsAvailable || !runtime.navigate) {
|
|
94
|
+
throw new Error('Settings open only from a Space page in Notis, signed in.');
|
|
95
|
+
}
|
|
96
|
+
const payload = settingsNavigation(target);
|
|
97
|
+
if (payload instanceof Error) throw payload;
|
|
98
|
+
await settledNavigation(() => runtime.navigate!(payload));
|
|
99
|
+
}, [runtime]);
|
|
100
|
+
return { available, openSettings };
|
|
101
|
+
}
|
package/dist/sdk/src/index.ts
CHANGED
|
@@ -28,7 +28,7 @@ export type { SpaceViewParam, SpaceViewParamType, SpaceViewFilter, SpaceShows, S
|
|
|
28
28
|
export { SPACE_VIEWER_READ_OPERATIONS } from './space';
|
|
29
29
|
export { SPACE_CLOUD_COMPUTER_OPERATIONS, spaceCloudComputerAllows } from './space';
|
|
30
30
|
export { spaceCloudComputerAccess } from './space';
|
|
31
|
-
export type { SpaceCloudComputerLevel, SpaceCloudComputerOperation, SpaceCloudComputerStatus, SpaceCloudComputerRelease, SpaceCloudComputerRunInput,
|
|
31
|
+
export type { SpaceCloudComputerLevel, SpaceCloudComputerOperation, SpaceCloudComputerStatus, SpaceCloudComputerRelease, SpaceCloudComputerCopy, SpaceCloudComputerRunInput,
|
|
32
32
|
SpaceCloudComputerRunResult, SpaceCloudComputerUploadInput, SpaceCloudComputerUploadResult, SpaceCloudComputerTransport,
|
|
33
33
|
SpaceCloudComputerDeclaration, SpaceCloudComputerService, SpaceCloudComputerJobOperation, SpaceCloudComputerJobInput,
|
|
34
34
|
SpaceCloudComputerJobStatus, SpaceCloudComputerJobLogs, SpaceCloudComputerJobResult, SpaceCloudComputerLeaseInput,
|
|
@@ -41,7 +41,9 @@ export type { SpaceViewerReadFamily, SpaceViewerReadOperation, SpaceViewerReadIn
|
|
|
41
41
|
export type { SpaceAgentDeclaration, SpaceItemThread, SpaceAgentQueue, SpaceAgentsStatus, SpaceThreadsTransport,
|
|
42
42
|
SpaceThreadItemText, SpaceThreadItemCondition, SpaceThreadItemState, SpaceThreadItemConfirm, SpaceThreadItemAction,
|
|
43
43
|
SpaceThreadItemKind, SpaceThreadItem, SpaceThreadItemRun, SpaceThreadItemTransport,
|
|
44
|
-
SpaceCommentSource, SpaceCommentsTransport, SpaceCommentViewer, SpaceCommentThreadRef, SpaceCommentThreadPick
|
|
44
|
+
SpaceCommentSource, SpaceCommentsTransport, SpaceCommentViewer, SpaceCommentThreadRef, SpaceCommentThreadPick,
|
|
45
|
+
SpaceCommentAnchor, SpaceCommentAttachment, SpaceCommentChange, SpaceCommentFile, SpaceCommentInsert, SpaceCommentMode,
|
|
46
|
+
SpaceCommentNeeds, SpaceCommentPage, SpaceCommentPageKey, SpaceCommentReply, SpaceCommentRow, SpaceCommentStatus } from './space';
|
|
45
47
|
export { SpaceActionError, SpaceNavigationCancelled, isSpaceNavigationCancelled } from './space';
|
|
46
48
|
export { spaceAudience, spaceMarksEditorsOnly, publicSpaceDescriptor, withoutEditorColumns } from './space';
|
|
47
49
|
export type { SpaceAudience, SpaceEditorsOnly, SpaceResourceColumns, EditorOnlyColumns, AudienceRow } from './space';
|
|
@@ -76,9 +78,18 @@ export { useHandover } from './hooks/useHandover';
|
|
|
76
78
|
export type { UseHandoverResult } from './hooks/useHandover';
|
|
77
79
|
export { useCloudComputer } from './hooks/useCloudComputer';
|
|
78
80
|
export type { UseCloudComputerResult } from './hooks/useCloudComputer';
|
|
81
|
+
export { useConnection } from './hooks/useConnection';
|
|
82
|
+
export type { UseConnectionResult } from './hooks/useConnection';
|
|
83
|
+
export type { SpaceConnection, SpaceConnectionsTransport } from './space';
|
|
79
84
|
export { useItemThread } from './hooks/useItemThread';
|
|
80
85
|
export type { UseItemThreadResult } from './hooks/useItemThread';
|
|
81
86
|
export { useThreadItem } from './hooks/useThreadItem';
|
|
87
|
+
export { useFunction, useFunctionQuery } from './hooks/useFunction';
|
|
88
|
+
export { threadHookInput, threadSettleInput, commentOptionInput } from './functions';
|
|
89
|
+
export type { SpaceFunctionDeclaration, SpaceFunctionHandler, SpaceFunctionContext, SpaceFunctionKind, SpaceFunctionExposure,
|
|
90
|
+
SpaceFunctionRole, SpaceFunctionUses, SpaceThreadOperation, SpaceThreadHookEvent, SpaceThreadHookInput, SpaceThreadSettleInput,
|
|
91
|
+
SpaceCommentOption, SpaceCommentOptionInput, SpaceFunctionThread, SpaceFunctionThreadItem, SpaceFunctionCloudComputer, SpaceFunctionDescriptor,
|
|
92
|
+
SpaceFunctionCallOptions } from './functions';
|
|
82
93
|
export type { UseThreadItemResult } from './hooks/useThreadItem';
|
|
83
94
|
export { useAgentQueue, AGENT_QUEUE_WORDS } from './hooks/useAgentQueue';
|
|
84
95
|
export type { UseAgentQueueResult, AgentQueueStatus } from './hooks/useAgentQueue';
|
|
@@ -90,6 +101,8 @@ export { useCloudComputerJob } from './hooks/useCloudComputerJob';
|
|
|
90
101
|
export type { UseCloudComputerJobOptions, UseCloudComputerJobResult } from './hooks/useCloudComputerJob';
|
|
91
102
|
export { CLOUD_COMPUTER_WORDS, cloudComputerPriceWords, formatHourlyPrice } from './cloudComputerWords';
|
|
92
103
|
export { useNotisNavigation } from './hooks/useNotisNavigation';
|
|
104
|
+
export { useNotisSettings } from './hooks/useNotisSettings';
|
|
105
|
+
export type { NotisSettingsTarget, UseNotisSettingsResult } from './hooks/useNotisSettings';
|
|
93
106
|
export { useTopBarSearch } from './hooks/useTopBarSearch';
|
|
94
107
|
export { useTopBarTitleLeaf } from './hooks/useTopBarTitleLeaf';
|
|
95
108
|
export { useBackend } from './hooks/useBackend';
|
|
@@ -234,7 +247,5 @@ export { isInteractionElementVisible } from './interactions/visibility';
|
|
|
234
247
|
|
|
235
248
|
export type { AgentContextContent, AgentContextItem, ContextAttachment } from './agentContext';
|
|
236
249
|
export { useAgentContext } from './hooks/useAgentContext';
|
|
237
|
-
export { NotisCommentBoundary, NotisCommentBox } from './components/NotisCommentBoundary';
|
|
238
|
-
export type { NotisCommentBoundaryProps, NotisCommentBoxProps } from './components/NotisCommentBoundary';
|
|
239
250
|
export { VIEW_PERIODS, isViewDate, isViewPeriod, resolveViewPeriod } from './viewPeriod';
|
|
240
251
|
export { journalViewParams, tasksViewParams, tasksViewFilter } from './standardViewParams';
|
package/dist/sdk/src/runtime.ts
CHANGED
|
@@ -11,7 +11,7 @@ import type { AgentContextContent, AgentContextItem, AgentContextSource } from '
|
|
|
11
11
|
import type { ComponentType, ReactNode } from 'react';
|
|
12
12
|
import type { NotisQueryClient } from './queryCache';
|
|
13
13
|
import type { NotisSpaceSkeleton } from './skeleton';
|
|
14
|
-
import type { SpaceRuntimeDescriptor, SpaceActionOptions, SpaceDocumentBodyRequest, SpaceDocumentBodyResult, SpaceViewerReadOperation, SpaceShownOptions, SpaceCloudComputerTransport, SpaceFilesTransport, SpaceThreadsTransport, SpaceThreadItemTransport, SpaceCommentsTransport } from './space';
|
|
14
|
+
import type { SpaceRuntimeDescriptor, SpaceActionOptions, SpaceDocumentBodyRequest, SpaceDocumentBodyResult, SpaceViewerReadOperation, SpaceShownOptions, SpaceCloudComputerTransport, SpaceConnectionsTransport, SpaceFilesTransport, SpaceThreadsTransport, SpaceThreadItemTransport, SpaceCommentsTransport } from './space';
|
|
15
15
|
|
|
16
16
|
// ---------------------------------------------------------------------------
|
|
17
17
|
// Database types
|
|
@@ -596,6 +596,9 @@ export interface RuntimeResource {
|
|
|
596
596
|
export interface NotisRuntime {
|
|
597
597
|
space?: SpaceRuntimeDescriptor;
|
|
598
598
|
callAction?<TResult = unknown>(actionId: string, inputs?: Record<string, unknown>, options?: SpaceActionOptions): Promise<TResult>;
|
|
599
|
+
/** Space-only: run one of the Space's functions exposed to its views. Absent on hosts that predate functions. */
|
|
600
|
+
callFunction?<TResult = unknown>(name: string, input?: Record<string, unknown>,
|
|
601
|
+
options?: import('./functions').SpaceFunctionCallOptions): Promise<TResult>;
|
|
599
602
|
documentBody?(request: SpaceDocumentBodyRequest): Promise<SpaceDocumentBodyResult>;
|
|
600
603
|
/**
|
|
601
604
|
* Space-only declared viewer read (`viewerReads`): what the signed-in viewer can open,
|
|
@@ -619,6 +622,11 @@ export interface NotisRuntime {
|
|
|
619
622
|
* viewer allows it. Absent on Sites, links, verification harnesses and older hosts.
|
|
620
623
|
*/
|
|
621
624
|
spaceCloudComputer?: SpaceCloudComputerTransport;
|
|
625
|
+
/**
|
|
626
|
+
* Space-only connected apps (`useConnection`): the signed-in viewer's own account in one app, and the Portal's
|
|
627
|
+
* connect flow from the person's click. Absent on Sites, links, verification harnesses and older hosts.
|
|
628
|
+
*/
|
|
629
|
+
spaceConnections?: SpaceConnectionsTransport;
|
|
622
630
|
/**
|
|
623
631
|
* Space-only files attached from a view to a database's files column (comment pictures): the signed-in Editor's
|
|
624
632
|
* own upload into Notis's private EU storage. Absent on Sites, previews, verification harnesses and older hosts.
|
|
@@ -705,6 +713,13 @@ export interface NotisRuntime {
|
|
|
705
713
|
*/
|
|
706
714
|
navigate?: (payload: { kind: string; [key: string]: unknown }) => NotisNavigationAnswer | Promise<NotisNavigationAnswer>;
|
|
707
715
|
|
|
716
|
+
/**
|
|
717
|
+
* True when this host opens its own Settings from `navigate({ kind: 'settings', ... })` (`useNotisSettings()`):
|
|
718
|
+
* a signed-in viewer's Space page in the Portal. Absent on a Site, a link, a release preview, verify and the vite
|
|
719
|
+
* preview.
|
|
720
|
+
*/
|
|
721
|
+
settingsAvailable?: boolean;
|
|
722
|
+
|
|
708
723
|
registerTopBarSearch?: (
|
|
709
724
|
config:
|
|
710
725
|
| {
|