@notis_ai/cli 0.2.24 → 0.2.26
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 +186 -5
- package/config/notis_app_design_rules.json +36 -14
- package/config/portal-route-roots.json +1 -0
- package/dist/agent-hooks/notis-agent-hook.mjs +2784 -541
- package/dist/base-skills/notis-cli/.notis-base-skill.json +1 -1
- package/dist/base-skills/notis-cli/references/intelligence.md +1 -1
- package/dist/base-skills/notis-query/.notis-base-skill.json +1 -1
- package/dist/base-skills/notis-query/SKILL.md +0 -1
- package/dist/base-skills/notis-query/references/documents.md +7 -0
- package/dist/base-skills/notis-query/references/query.md +1 -0
- package/dist/base-skills/notis-spaces/.notis-base-skill.json +1 -1
- package/dist/base-skills/notis-spaces/SKILL.md +96 -24
- package/dist/base-skills/notis-spaces/references/architecture.md +4 -3
- package/dist/base-skills/notis-spaces/references/design.md +37 -18
- package/dist/base-skills/notis-spaces/references/reading.md +8 -1
- package/dist/base-skills/notis-spaces/references/reports.md +6 -6
- package/dist/base-skills/notis-spaces/references/sdk.md +71 -7
- package/dist/base-skills/notis-spaces/references/store.md +22 -13
- package/dist/base-skills/notis-spaces/references/views.md +99 -6
- package/dist/sdk/package.json +3 -0
- package/dist/sdk/src/cloudComputerWords.ts +53 -0
- package/dist/sdk/src/components/Audience.tsx +76 -0
- package/dist/sdk/src/components/DocumentPage.tsx +15 -4
- package/dist/sdk/src/components/MarkdownEditor.tsx +44 -14
- package/dist/sdk/src/components/MultiSelectActionBar.tsx +16 -5
- package/dist/sdk/src/components/Skeleton.tsx +162 -6
- package/dist/sdk/src/hooks/useAction.ts +12 -2
- package/dist/sdk/src/hooks/useAgentQueue.ts +125 -0
- package/dist/sdk/src/hooks/useCloudComputerJob.ts +142 -0
- package/dist/sdk/src/hooks/useCloudComputerService.ts +388 -0
- package/dist/sdk/src/hooks/useCloudComputerShell.ts +95 -7
- package/dist/sdk/src/hooks/useCollectionInteractions.ts +40 -2
- package/dist/sdk/src/hooks/useItemThread.ts +58 -0
- package/dist/sdk/src/hooks/useMarqueeSelection.ts +6 -1
- package/dist/sdk/src/hooks/useNativeDocuments.ts +61 -8
- package/dist/sdk/src/hooks/useNotisNavigation.ts +31 -8
- package/dist/sdk/src/hooks/useQuery.ts +67 -10
- package/dist/sdk/src/hooks/useViewParams.ts +47 -11
- package/dist/sdk/src/index.ts +31 -4
- package/dist/sdk/src/interactions.ts +2 -0
- package/dist/sdk/src/nativeData.ts +2 -0
- package/dist/sdk/src/optimisticRows.ts +329 -0
- package/dist/sdk/src/perf.ts +188 -0
- package/dist/sdk/src/provider.tsx +2 -1
- package/dist/sdk/src/queryCache.ts +366 -17
- package/dist/sdk/src/runtime.ts +55 -4
- package/dist/sdk/src/skeleton.ts +103 -0
- package/dist/sdk/src/space.ts +662 -28
- package/dist/sdk/src/spacePublicUI.ts +36 -0
- package/dist/sdk/src/ui/engine/step.ts +54 -0
- package/dist/sdk/src/ui/icons.tsx +3 -1
- package/dist/sdk/src/words/shell.ts +1 -0
- package/dist/skill-sync/index.js +7 -2
- package/dist/skill-sync-worker.mjs +40 -26
- package/dist/space-harness/host.js +272 -105
- package/dist/space-sdk/dist/chunk-BWHAORT4.js +5 -0
- package/dist/space-sdk/dist/index.js +9 -4
- package/dist/space-sdk/dist/ui.js +12 -12
- package/dist/space-sdk/package.json +3 -0
- package/dist/space-sdk/src/cloudComputerWords.d.ts +34 -0
- package/dist/space-sdk/src/components/Audience.d.ts +46 -0
- package/dist/space-sdk/src/components/DocumentPage.d.ts +3 -1
- package/dist/space-sdk/src/components/MarkdownEditor.d.ts +21 -0
- package/dist/space-sdk/src/components/MultiSelectActionBar.d.ts +5 -1
- package/dist/space-sdk/src/components/Skeleton.d.ts +7 -2
- package/dist/space-sdk/src/hooks/useAction.d.ts +8 -1
- package/dist/space-sdk/src/hooks/useAgentQueue.d.ts +61 -0
- package/dist/space-sdk/src/hooks/useCloudComputerJob.d.ts +35 -0
- package/dist/space-sdk/src/hooks/useCloudComputerService.d.ts +75 -0
- package/dist/space-sdk/src/hooks/useCloudComputerShell.d.ts +36 -3
- package/dist/space-sdk/src/hooks/useCollectionInteractions.d.ts +6 -0
- package/dist/space-sdk/src/hooks/useItemThread.d.ts +32 -0
- package/dist/space-sdk/src/hooks/useMarqueeSelection.d.ts +2 -1
- package/dist/space-sdk/src/hooks/useNativeDocumentBody.d.ts +1 -0
- package/dist/space-sdk/src/hooks/useNativeDocuments.d.ts +20 -5
- package/dist/space-sdk/src/hooks/useNotisNavigation.d.ts +11 -2
- package/dist/space-sdk/src/hooks/useQuery.d.ts +24 -2
- package/dist/space-sdk/src/hooks/useViewParams.d.ts +2 -0
- package/dist/space-sdk/src/index.d.ts +24 -4
- package/dist/space-sdk/src/nativeData.d.ts +6 -0
- package/dist/space-sdk/src/queryCache.d.ts +97 -2
- package/dist/space-sdk/src/runtime.d.ts +53 -4
- package/dist/space-sdk/src/skeleton.d.ts +42 -0
- package/dist/space-sdk/src/space.ts +662 -28
- package/dist/space-sdk/src/tailwind-candidates.d.ts +754 -5
- package/dist/space-sdk/src/ui/cloud/CloudComputerFrame.d.ts +29 -0
- package/dist/space-sdk/src/ui/cloud/CloudComputerWaking.d.ts +20 -0
- package/dist/space-sdk/src/ui/comments/CommentPane.d.ts +15 -2
- package/dist/space-sdk/src/ui/comments/PassageComments.d.ts +50 -0
- package/dist/space-sdk/src/ui/comments/commentFiles.d.ts +64 -0
- package/dist/space-sdk/src/ui/comments/commentModel.d.ts +49 -1
- package/dist/space-sdk/src/ui/comments/commentWords.d.ts +26 -0
- package/dist/space-sdk/src/ui/comments/index.d.ts +4 -0
- package/dist/space-sdk/src/ui/comments/passageModel.d.ts +82 -0
- package/dist/space-sdk/src/ui/comments/useComments.d.ts +34 -4
- package/dist/space-sdk/src/ui/comments/usePassageComments.d.ts +67 -0
- package/dist/space-sdk/src/ui/engine/index.d.ts +2 -2
- package/dist/space-sdk/src/ui/engine/step.d.ts +9 -0
- package/dist/space-sdk/src/ui/fields/fields.d.ts +2 -1
- package/dist/space-sdk/src/ui/index.d.ts +4 -0
- package/dist/space-sdk/src/ui/layout/Panels.d.ts +9 -2
- package/dist/space-sdk/src/ui/layout/SidePane.d.ts +42 -0
- package/dist/space-sdk/src/ui/layout/index.d.ts +2 -1
- package/dist/space-sdk/src/ui/layout/panelMath.d.ts +11 -2
- package/dist/space-sdk/src/ui/list/ListReader.d.ts +38 -7
- package/dist/space-sdk/src/ui/list/Row.d.ts +4 -0
- package/dist/space-sdk/src/ui/list/SelectionBar.d.ts +9 -4
- package/dist/space-sdk/src/ui/list/useListKeys.d.ts +4 -0
- package/dist/space-sdk/src/words/shell.ts +1 -0
- package/dist/view-renderer/dist/host.js +355 -188
- package/dist/view-renderer/dist/theme.css +1 -1
- package/dist/view-renderer/src/host.tsx +4 -1
- package/dist/view-renderer/src/index.js +3 -0
- package/dist/view-renderer/src/pool.js +8 -4
- package/dist/view-renderer/src/renderer.js +92 -23
- package/dist/view-renderer/src/skeleton.js +450 -0
- package/package.json +4 -4
- package/skills/notis-cli/AGENT_INSTRUCTIONS.md +8 -4
- package/skills/notis-onboarding/BRIEF.md +15 -9
- package/skills/notis-spaces/cli.md +43 -4
- package/src/command-specs/auth.js +5 -3
- package/src/command-specs/cc.js +410 -0
- package/src/command-specs/computer.js +320 -0
- package/src/command-specs/diagnostics.js +2 -13
- package/src/command-specs/documents.js +22 -4
- package/src/command-specs/index.js +7 -0
- package/src/command-specs/onboarding.js +127 -7
- package/src/command-specs/skills.js +2 -2
- package/src/command-specs/spaces.js +162 -30
- package/src/command-specs/tools.js +26 -8
- package/src/command-specs/views.js +4 -1
- package/src/runtime/agent-setup.js +20 -2
- package/src/runtime/app-boundary-validator.js +2 -1
- package/src/runtime/app-platform.js +13 -0
- package/src/runtime/auth-recovery.js +5 -0
- package/src/runtime/channel.js +16 -2
- package/src/runtime/cloud-transfer.js +587 -0
- package/src/runtime/computer-ssh.js +127 -0
- package/src/runtime/oauth.js +50 -4
- package/src/runtime/skill-sync/index.ts +20 -1
- package/src/runtime/skill-sync/local-scanner.ts +1 -0
- package/src/runtime/skill-sync/types.ts +2 -0
- package/src/runtime/space-audience.js +94 -0
- package/src/runtime/space-collection-scaffold.js +2 -1
- package/src/runtime/space-fixture-broker.js +2 -1
- package/src/runtime/space-lock.js +1 -4
- package/src/runtime/space-platform.js +18 -2
- package/src/runtime/space-source.js +105 -7
- package/src/runtime/space-test-server.js +13 -2
- package/src/runtime/space-verification.js +99 -6
- package/src/runtime/space-view-manifest.js +22 -4
- package/src/runtime/sync-skills.js +24 -20
- package/src/runtime/transport.js +19 -0
- package/src/runtime/view-render.js +2 -2
- package/template/.harness/index.html.tmpl +1 -1
- package/dist/skill-sync/index.js.map +0 -7
- package/dist/space-sdk/dist/chunk-SVZATGZB.js +0 -5
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Captured loading skeletons (`notis-space-skeleton/v1`). `notis spaces verify` measures the final view at build
|
|
3
|
+
* time into bones and ships them beside the bundle; the host passes them as `NotisRuntimeContext.skeleton` and
|
|
4
|
+
* `ViewSkeleton` draws the region named by its `skeletonKey`.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* One rectangle: `[x, y, w, h, r, t]`. x and w are percent of the region width, y and h px from the region (or row)
|
|
9
|
+
* top, r the corner radius in px, t the type: 0 leaf, 1 filled container, 2 four-side box (outline), 3 divider.
|
|
10
|
+
*/
|
|
11
|
+
export type SkeletonBone = [number, number, number, number, number, 0 | 1 | 2 | 3];
|
|
12
|
+
|
|
13
|
+
/** A row template stacked from `y` until the visible pane is filled. Its bones are relative to the row top. */
|
|
14
|
+
export interface NotisSkeletonRow {
|
|
15
|
+
y: number;
|
|
16
|
+
h: number;
|
|
17
|
+
bones: SkeletonBone[];
|
|
18
|
+
repeat: 'fill';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** The bones of one region at one width and one locale. */
|
|
22
|
+
export interface NotisSkeletonEntry {
|
|
23
|
+
height: number;
|
|
24
|
+
bones: SkeletonBone[];
|
|
25
|
+
rows?: NotisSkeletonRow[];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type NotisSkeletonWidth = '390' | '1440';
|
|
29
|
+
export type NotisSkeletonLocale = 'en' | 'fr';
|
|
30
|
+
|
|
31
|
+
export interface NotisSpaceSkeleton {
|
|
32
|
+
schema: 'notis-space-skeleton/v1';
|
|
33
|
+
/** sha256 hex of the `bundle/app.js` the bones were measured from. */
|
|
34
|
+
sourceHash: string;
|
|
35
|
+
regions: Record<string, Partial<Record<NotisSkeletonWidth, Partial<Record<NotisSkeletonLocale, NotisSkeletonEntry>>>>>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const SPACE_SKELETON_SCHEMA = 'notis-space-skeleton/v1';
|
|
39
|
+
|
|
40
|
+
const REGION_KEY = /^[a-z0-9][a-z0-9_-]{0,31}$/;
|
|
41
|
+
const WIDTHS = new Set(['390', '1440']);
|
|
42
|
+
const LOCALES = new Set(['en', 'fr']);
|
|
43
|
+
const MAX_REGIONS = 16;
|
|
44
|
+
const MAX_ROWS = 8;
|
|
45
|
+
const MAX_BONES = 400;
|
|
46
|
+
const MAX_ROW_BONES = 64;
|
|
47
|
+
const MAX_PX = 100000;
|
|
48
|
+
|
|
49
|
+
const isObject = (value: unknown): value is Record<string, unknown> =>
|
|
50
|
+
typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
51
|
+
const isNumberIn = (value: unknown, min: number, max: number) =>
|
|
52
|
+
typeof value === 'number' && Number.isFinite(value) && value >= min && value <= max;
|
|
53
|
+
|
|
54
|
+
function isBone(value: unknown): value is SkeletonBone {
|
|
55
|
+
return Array.isArray(value) && value.length === 6
|
|
56
|
+
&& isNumberIn(value[0], 0, 100) && isNumberIn(value[1], 0, MAX_PX)
|
|
57
|
+
&& isNumberIn(value[2], 0, 100) && isNumberIn(value[3], 0, MAX_PX)
|
|
58
|
+
&& isNumberIn(value[4], 0, 64) && (value[5] === 0 || value[5] === 1 || value[5] === 2 || value[5] === 3);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function isBones(value: unknown, max: number): value is SkeletonBone[] {
|
|
62
|
+
return Array.isArray(value) && value.length <= max && value.every(isBone);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function isEntry(value: unknown): value is NotisSkeletonEntry {
|
|
66
|
+
if (!isObject(value) || !isNumberIn(value.height, 0, MAX_PX) || !isBones(value.bones, MAX_BONES)) return false;
|
|
67
|
+
if (value.rows === undefined) return true;
|
|
68
|
+
return Array.isArray(value.rows) && value.rows.length <= MAX_ROWS && value.rows.every((row) =>
|
|
69
|
+
isObject(row) && row.repeat === 'fill' && isNumberIn(row.y, 0, MAX_PX) && isNumberIn(row.h, 1, MAX_PX)
|
|
70
|
+
&& isBones(row.bones, MAX_ROW_BONES));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* A light shape check of a captured skeleton: the schema tag, the region, width and locale keys, and numeric bones.
|
|
75
|
+
* The server validates strictly at publish; this only keeps a malformed file from reaching the drawing code.
|
|
76
|
+
*/
|
|
77
|
+
export function isNotisSpaceSkeleton(value: unknown): value is NotisSpaceSkeleton {
|
|
78
|
+
if (!isObject(value) || value.schema !== SPACE_SKELETON_SCHEMA || typeof value.sourceHash !== 'string') return false;
|
|
79
|
+
if (!isObject(value.regions)) return false;
|
|
80
|
+
const regions = Object.entries(value.regions);
|
|
81
|
+
if (regions.length > MAX_REGIONS) return false;
|
|
82
|
+
return regions.every(([key, widths]) => REGION_KEY.test(key) && isObject(widths)
|
|
83
|
+
&& Object.entries(widths).every(([width, locales]) => WIDTHS.has(width) && isObject(locales)
|
|
84
|
+
&& Object.entries(locales).every(([locale, entry]) => LOCALES.has(locale) && isEntry(entry))));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The entry a region draws: the width bucket asked for, else the other one; the locale asked for, else the other one.
|
|
89
|
+
* Null when the region has no entry at all.
|
|
90
|
+
*/
|
|
91
|
+
export function pickSkeletonEntry(skeleton: NotisSpaceSkeleton | null | undefined, key: string,
|
|
92
|
+
width: NotisSkeletonWidth, locale: NotisSkeletonLocale): NotisSkeletonEntry | null {
|
|
93
|
+
const region = skeleton?.regions?.[key];
|
|
94
|
+
if (!region) return null;
|
|
95
|
+
const otherWidth: NotisSkeletonWidth = width === '390' ? '1440' : '390';
|
|
96
|
+
const otherLocale: NotisSkeletonLocale = locale === 'en' ? 'fr' : 'en';
|
|
97
|
+
for (const w of [width, otherWidth]) {
|
|
98
|
+
const locales = region[w];
|
|
99
|
+
const entry = locales?.[locale] ?? locales?.[otherLocale];
|
|
100
|
+
if (entry) return entry;
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
}
|