@notis_ai/cli 0.2.0-beta.1793098247207.1 → 0.2.0-beta.1793103610908.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/dist/agent-hooks/notis-agent-hook.mjs +5 -7
- package/dist/base-skills/notis-query/.notis-base-skill.json +1 -1
- 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/references/reports.md +6 -6
- package/dist/base-skills/notis-spaces/references/views.md +0 -3
- package/dist/sdk/src/hooks/useCollectionInteractions.ts +14 -1
- package/dist/sdk/src/interactions.ts +2 -0
- package/dist/sdk/src/nativeData.ts +2 -0
- package/dist/sdk/src/ui/engine/step.ts +54 -0
- package/dist/skill-sync-worker.mjs +5 -4
- package/dist/space-harness/host.js +72 -72
- package/dist/space-sdk/dist/{chunk-LJHS6OJW.js → chunk-24AUBDKN.js} +2 -2
- package/dist/space-sdk/dist/index.js +1 -1
- package/dist/space-sdk/dist/ui.js +3 -3
- package/dist/space-sdk/src/hooks/useCollectionInteractions.d.ts +6 -0
- package/dist/space-sdk/src/nativeData.d.ts +6 -0
- package/dist/space-sdk/src/tailwind-candidates.d.ts +5 -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/list/ListReader.d.ts +7 -4
- package/dist/space-sdk/src/ui/list/useListKeys.d.ts +4 -0
- package/dist/view-renderer/dist/host.js +140 -140
- package/package.json +3 -3
- package/src/runtime/oauth.js +8 -4
- package/src/runtime/space-lock.js +1 -4
|
@@ -10551,7 +10551,7 @@ function lockIsStale() {
|
|
|
10551
10551
|
return false;
|
|
10552
10552
|
}
|
|
10553
10553
|
}
|
|
10554
|
-
async function acquireRefreshLock(runtime, waitMs = OAUTH_REFRESH_LOCK_WAIT_MS) {
|
|
10554
|
+
async function acquireRefreshLock(runtime, staleAccessToken, waitMs = OAUTH_REFRESH_LOCK_WAIT_MS) {
|
|
10555
10555
|
mkdirSync4(join4(homedir3(), ".notis"), { recursive: true });
|
|
10556
10556
|
const deadline = Date.now() + waitMs;
|
|
10557
10557
|
for (; ; ) {
|
|
@@ -10561,7 +10561,7 @@ async function acquireRefreshLock(runtime, waitMs = OAUTH_REFRESH_LOCK_WAIT_MS)
|
|
|
10561
10561
|
} catch (error) {
|
|
10562
10562
|
if (error?.code !== "EEXIST") throw error;
|
|
10563
10563
|
const profile = getProfile(loadConfig(), runtime.profileName);
|
|
10564
|
-
if (profile.oauth_access_token && profile.oauth_access_token !==
|
|
10564
|
+
if (profile.oauth_access_token && profile.oauth_access_token !== staleAccessToken && !credentialIsExpired({ credentialKind: "oauth" }, profile)) {
|
|
10565
10565
|
updateRuntimeFromOAuthProfile(runtime, profile);
|
|
10566
10566
|
return false;
|
|
10567
10567
|
}
|
|
@@ -10594,6 +10594,7 @@ function keepLockFoldersFresh(paths) {
|
|
|
10594
10594
|
return () => clearInterval(interval);
|
|
10595
10595
|
}
|
|
10596
10596
|
async function refreshOAuthCredential(runtime, fetchImpl = fetch, tokenRequestOptions = {}) {
|
|
10597
|
+
const staleAccessToken = runtime.oauthAccessToken;
|
|
10597
10598
|
const globalLock = await acquireListenerGlobalLock({ waitMs: OAUTH_REFRESH_LOCK_WAIT_MS });
|
|
10598
10599
|
let profileLock = null;
|
|
10599
10600
|
let ownsLock = false;
|
|
@@ -10602,13 +10603,13 @@ async function refreshOAuthCredential(runtime, fetchImpl = fetch, tokenRequestOp
|
|
|
10602
10603
|
let metadata = null;
|
|
10603
10604
|
try {
|
|
10604
10605
|
profileLock = await acquireListenerStartLock(runtime);
|
|
10605
|
-
ownsLock = await acquireRefreshLock(runtime);
|
|
10606
|
+
ownsLock = await acquireRefreshLock(runtime, staleAccessToken);
|
|
10606
10607
|
if (!ownsLock) return true;
|
|
10607
10608
|
stopTouchingLocks = keepLockFoldersFresh([profileLock, oauthLockDir()]);
|
|
10608
10609
|
const config = loadConfig();
|
|
10609
10610
|
const profile = getProfile(config, runtime.profileName);
|
|
10610
10611
|
assertOAuthApiTarget(runtime, profile);
|
|
10611
|
-
if (profile.oauth_access_token && profile.oauth_access_token !==
|
|
10612
|
+
if (profile.oauth_access_token && profile.oauth_access_token !== staleAccessToken && !credentialIsExpired({ credentialKind: "oauth" }, profile)) {
|
|
10612
10613
|
updateRuntimeFromOAuthProfile(runtime, profile);
|
|
10613
10614
|
return true;
|
|
10614
10615
|
}
|
|
@@ -42385,9 +42386,6 @@ function describeAppliedChanges(result) {
|
|
|
42385
42386
|
const removed = (applied.links || []).flatMap((link) => (link.removed || []).map((entry) => `${entry.alias} (${link.kind})`));
|
|
42386
42387
|
if (added.length) parts.push(`Links added: ${added.join(", ")}`);
|
|
42387
42388
|
if (removed.length) parts.push(`Links removed: ${removed.join(", ")}`);
|
|
42388
|
-
for (const review of result.reviews || []) {
|
|
42389
|
-
if (review.review_url) parts.push(`Review ${review.alias}: ${review.review_url}`);
|
|
42390
|
-
}
|
|
42391
42389
|
return parts.length ? ` ${parts.join(". ")}.` : "";
|
|
42392
42390
|
}
|
|
42393
42391
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"schema":1,"stamp":
|
|
1
|
+
{"schema":1,"stamp":1793100399,"commit":"c7c10755c0d727de0f34f8ffc04fe178edf027fc"}
|
|
@@ -59,6 +59,7 @@ metadata; do not assume the older `documents` result shape. Sorts use
|
|
|
59
59
|
`{field, direction: 'asc'|'desc'}`. Multi-select/relation fields cannot be sorted.
|
|
60
60
|
|
|
61
61
|
Use `include_content: false` for lists. Include bodies only when needed.
|
|
62
|
+
Add `properties: [{"property": "Status"}, ...]` to return only those fields (the title column only when the title property is listed); a public Site action fixes it in its request so visitors never receive internal fields.
|
|
62
63
|
Archived rows are excluded unless `include_archived: true`; binned/inaccessible
|
|
63
64
|
rows remain excluded by authority. Do not turn a missing page into a zero count.
|
|
64
65
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"schema":1,"stamp":
|
|
1
|
+
{"schema":1,"stamp":1793101435,"commit":"60da28dcb0367ced8d2a4716e3e647ac11a43996"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
A report is either a saved page or an interactive view, not a separate UI system:
|
|
4
4
|
|
|
5
5
|
- **Saved page or report** (self-contained HTML, or a finished report the user
|
|
6
|
-
wants to keep): a page in
|
|
7
|
-
|
|
6
|
+
wants to keep): a page in **Notis Notes**, filed by its Save HTML Skill. See
|
|
7
|
+
[Save an HTML page or report](#save-an-html-page-or-report).
|
|
8
8
|
- **Interactive report** (typed params such as a period, live data reads): an
|
|
9
9
|
independently authored Space view with its own source, data declarations and
|
|
10
10
|
memory policy. Editing one report must not replace an unrelated view.
|
|
@@ -27,10 +27,10 @@ Reading does not regenerate historical figures or authorize source/data changes.
|
|
|
27
27
|
|
|
28
28
|
## Save an HTML page or report
|
|
29
29
|
|
|
30
|
-
Save the page in the
|
|
31
|
-
Space
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
Save the page in the Space the user names, or the Space the work belongs to, when
|
|
31
|
+
that Space keeps pages of its own; otherwise save it in **Notis Notes**. The Notes Save HTML Skill alone chooses the folder
|
|
32
|
+
(it files work by its Space and Skill) and creates it when missing; pass it only
|
|
33
|
+
a folder the user or your workflow names. "All notes" hides these notes; each
|
|
34
34
|
folder shows everything in it.
|
|
35
35
|
|
|
36
36
|
1. Save it with the Skill that Space ships for its pages. In Notes that is the
|
|
@@ -216,9 +216,6 @@ presentations; ordinary collection views keep Portal chrome.
|
|
|
216
216
|
A Space whose published view hides chrome starts hidden from each person's sidebar;
|
|
217
217
|
it stays reachable by link and search. Each person can turn on **Show hidden Spaces**
|
|
218
218
|
in the sidebar's Spaces menu, then choose **Show in sidebar** in that Space's menu.
|
|
219
|
-
Skill review Spaces stay out of the sidebar, even with **Show hidden Spaces** on:
|
|
220
|
-
people open them from the Skill page's **Changes** list. A review a person already
|
|
221
|
-
chose to show stays in their sidebar until they hide it.
|
|
222
219
|
Optional `markdown: './markdown.ts'` names a module exporting a pure function of
|
|
223
220
|
`{params, shown}`. Its output must represent this view, not make hidden writes.
|
|
224
221
|
Use `<RenderChartData>` with the chart's actual rows so rendered Markdown contains
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
|
|
27
27
|
import type { MultiSelectActionBarProps } from '../components/MultiSelectActionBar';
|
|
28
28
|
import { isInteractionElementVisible } from '../interactions/visibility';
|
|
29
|
+
import { travelBetween, type TravelDirection } from '../ui/engine/step';
|
|
29
30
|
import { useLongPressSelection } from './useLongPressSelection';
|
|
30
31
|
import { useMarqueeSelection, type SelectionMarqueeRect } from './useMarqueeSelection';
|
|
31
32
|
|
|
@@ -117,6 +118,11 @@ export interface CollectionInteractionController<T> {
|
|
|
117
118
|
lastClickedId: string | null;
|
|
118
119
|
dragRect: SelectionMarqueeRect | null;
|
|
119
120
|
actions: ResolvedCollectionAction[];
|
|
121
|
+
/**
|
|
122
|
+
* The way the active item last moved (J/K, the arrows, a click further up or down); 'next' until it moves. A page
|
|
123
|
+
* that removes the active item continues this way (iOS Photos), else the other way at the edge.
|
|
124
|
+
*/
|
|
125
|
+
travelDirection: () => TravelDirection;
|
|
120
126
|
getActionBarProps: () => Pick<MultiSelectActionBarProps, 'selectedCount' | 'actions' | 'collectionOwnerId' | 'isAvailable' | 'shortcutsEnabled' | 'onClearSelection'>;
|
|
121
127
|
|
|
122
128
|
isSelected: (id: string) => boolean;
|
|
@@ -237,6 +243,7 @@ export function useCollectionInteractions<T>(
|
|
|
237
243
|
const selectedIdsRef = useRef(selectedIds);
|
|
238
244
|
const activeIdRef = useRef(activeId);
|
|
239
245
|
const anchorIdRef = useRef(anchorId);
|
|
246
|
+
const travelRef = useRef<TravelDirection>('next');
|
|
240
247
|
// Keep manually selected rows outside the current keyboard range on reversal.
|
|
241
248
|
const keyboardRangeBaseRef = useRef<Set<string> | null>(null);
|
|
242
249
|
const onSelectionChangeRef = useRef(onSelectionChange);
|
|
@@ -307,6 +314,9 @@ export function useCollectionInteractions<T>(
|
|
|
307
314
|
const setActive = useCallback((id: string | null, reason: CollectionInteractionReason = 'activate') => {
|
|
308
315
|
const next = id && selectableIdsRef.current.includes(id) ? id : null;
|
|
309
316
|
if (activeIdRef.current === next) return;
|
|
317
|
+
// A click or focus further up or down sets the way; keys set it themselves (moveActive), a wrap included.
|
|
318
|
+
const travel = reason === 'items-changed' ? null : travelBetween(selectableIdsRef.current, activeIdRef.current, next);
|
|
319
|
+
if (travel) travelRef.current = travel;
|
|
310
320
|
activeIdRef.current = next;
|
|
311
321
|
if (controlledActiveId === undefined) setUncontrolledActiveId(next);
|
|
312
322
|
onActiveIdChangeRef.current?.(next, reason);
|
|
@@ -448,6 +458,7 @@ export function useCollectionInteractions<T>(
|
|
|
448
458
|
const ids = selectableIdsRef.current;
|
|
449
459
|
if (ids.length === 0) return;
|
|
450
460
|
const current = activeIdRef.current;
|
|
461
|
+
const forward = direction === 'next' || direction === 'down' || direction === 'right';
|
|
451
462
|
// Range gestures follow the displayed order, independent of asymmetric grid geometry.
|
|
452
463
|
let next = extend ? null : resolveNextIdRef.current?.({
|
|
453
464
|
direction,
|
|
@@ -457,7 +468,6 @@ export function useCollectionInteractions<T>(
|
|
|
457
468
|
}) ?? null;
|
|
458
469
|
if (!next) {
|
|
459
470
|
const currentIndex = current ? ids.indexOf(current) : -1;
|
|
460
|
-
const forward = direction === 'next' || direction === 'down' || direction === 'right';
|
|
461
471
|
const nextIndex = currentIndex === -1
|
|
462
472
|
? forward ? 0 : ids.length - 1
|
|
463
473
|
: Math.min(ids.length - 1, Math.max(0, currentIndex + (forward ? 1 : -1)));
|
|
@@ -478,6 +488,7 @@ export function useCollectionInteractions<T>(
|
|
|
478
488
|
setAnchor(next, 'navigate');
|
|
479
489
|
}
|
|
480
490
|
setActive(next, extend ? 'range' : 'navigate');
|
|
491
|
+
travelRef.current = forward ? 'next' : 'previous';
|
|
481
492
|
const nextId = next;
|
|
482
493
|
requestAnimationFrame(() => focusItem(nextId));
|
|
483
494
|
}, [focusItem, replaceRange, setActive, setAnchor]);
|
|
@@ -649,6 +660,7 @@ export function useCollectionInteractions<T>(
|
|
|
649
660
|
}), [enabled, onCheckboxClick]);
|
|
650
661
|
|
|
651
662
|
const getSelectedItems = useCallback(() => getItemsForIds(selectedIdsRef.current), [getItemsForIds]);
|
|
663
|
+
const travelDirection = useCallback(() => travelRef.current, []);
|
|
652
664
|
const isSelected = useCallback((id: string) => selectedIds.has(id), [selectedIds]);
|
|
653
665
|
|
|
654
666
|
const actionContext = useMemo<CollectionActionContext<T>>(() => ({
|
|
@@ -716,6 +728,7 @@ export function useCollectionInteractions<T>(
|
|
|
716
728
|
lastClickedId: anchorId,
|
|
717
729
|
dragRect,
|
|
718
730
|
actions: resolvedActions,
|
|
731
|
+
travelDirection,
|
|
719
732
|
getActionBarProps,
|
|
720
733
|
isSelected,
|
|
721
734
|
getSelectedItems,
|
|
@@ -19,6 +19,8 @@ export type {
|
|
|
19
19
|
ResolvedCollectionAction,
|
|
20
20
|
} from './interactions/actions';
|
|
21
21
|
export { useCollectionInteractions, COLLECTION_ITEM_ATTRIBUTE } from './hooks/useCollectionInteractions';
|
|
22
|
+
export { continuationOf, travelBetween } from './ui/engine/step';
|
|
23
|
+
export type { TravelDirection } from './ui/engine/step';
|
|
22
24
|
export type {
|
|
23
25
|
CollectionInteractionController,
|
|
24
26
|
CollectionInteractionReason,
|
|
@@ -19,6 +19,8 @@ export interface NativeQuery {
|
|
|
19
19
|
aggregate?: { op: 'sum' | 'avg' | 'min' | 'max'; field: NativeField };
|
|
20
20
|
page_size?: number;
|
|
21
21
|
offset?: number;
|
|
22
|
+
/** Return only these properties; the title column follows the title property. */
|
|
23
|
+
properties?: Array<{ property_id: string } | { property: string }>;
|
|
22
24
|
}
|
|
23
25
|
export interface NativeInsert {
|
|
24
26
|
columns?: { title?: string | null; icon?: string | null; cover?: string | null };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export interface StepOptions {
|
|
2
|
+
/** Wrap from the last item to the first (and back). Default true. */
|
|
3
|
+
wrap?: boolean;
|
|
4
|
+
/** The key is held (`event.repeat`): never wrap, stop at the edge. */
|
|
5
|
+
repeat?: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Next cursor id for J/K stepping. Wraps only on a fresh press, so holding J stops at the last row instead of
|
|
10
|
+
* spinning back to the top. No cursor: J lands on the first item, K on the last.
|
|
11
|
+
*/
|
|
12
|
+
export function stepCursor(ids: readonly string[], cursor: string | null | undefined, delta: number,
|
|
13
|
+
options: StepOptions = {}): string | null {
|
|
14
|
+
if (!ids.length) return null;
|
|
15
|
+
const { wrap = true, repeat = false } = options;
|
|
16
|
+
const index = cursor == null ? -1 : ids.indexOf(cursor);
|
|
17
|
+
if (index === -1) return delta >= 0 ? ids[0]! : ids[ids.length - 1]!;
|
|
18
|
+
let next = index + delta;
|
|
19
|
+
if (next < 0 || next >= ids.length) {
|
|
20
|
+
if (wrap && !repeat) next = ((next % ids.length) + ids.length) % ids.length;
|
|
21
|
+
else next = Math.max(0, Math.min(ids.length - 1, next));
|
|
22
|
+
}
|
|
23
|
+
return ids[next]!;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** The way the cursor last moved through a list. A removal continues that way (iOS Photos). */
|
|
27
|
+
export type TravelDirection = 'next' | 'previous';
|
|
28
|
+
|
|
29
|
+
/** The way a move from `from` to `to` went in `ids`; null when either is not in the list or nothing moved. */
|
|
30
|
+
export function travelBetween(ids: readonly string[], from: string | null | undefined,
|
|
31
|
+
to: string | null | undefined): TravelDirection | null {
|
|
32
|
+
if (from == null || to == null || from === to) return null;
|
|
33
|
+
const a = ids.indexOf(from);
|
|
34
|
+
const b = ids.indexOf(to);
|
|
35
|
+
if (a === -1 || b === -1) return null;
|
|
36
|
+
return b > a ? 'next' : 'previous';
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The id that takes `gone`'s place after it left `previous` (`now` holds the ids still listed): the nearest one still
|
|
41
|
+
* there in the travel direction, else the nearest the other way. Null when none is left.
|
|
42
|
+
*/
|
|
43
|
+
export function continuationOf(previous: readonly string[], now: readonly string[] | ReadonlySet<string>,
|
|
44
|
+
gone: string, direction: TravelDirection = 'next'): string | null {
|
|
45
|
+
const present = now instanceof Set ? now : new Set(now as readonly string[]);
|
|
46
|
+
const index = previous.indexOf(gone);
|
|
47
|
+
if (index === -1) return null;
|
|
48
|
+
const scan = (delta: number) => {
|
|
49
|
+
for (let i = index + delta; i >= 0 && i < previous.length; i += delta) if (present.has(previous[i]!)) return previous[i]!;
|
|
50
|
+
return null;
|
|
51
|
+
};
|
|
52
|
+
const first = direction === 'next' ? 1 : -1;
|
|
53
|
+
return scan(first) ?? scan(-first);
|
|
54
|
+
}
|
|
@@ -1473,7 +1473,7 @@ function lockIsStale() {
|
|
|
1473
1473
|
return false;
|
|
1474
1474
|
}
|
|
1475
1475
|
}
|
|
1476
|
-
async function acquireRefreshLock(runtime, waitMs = OAUTH_REFRESH_LOCK_WAIT_MS) {
|
|
1476
|
+
async function acquireRefreshLock(runtime, staleAccessToken, waitMs = OAUTH_REFRESH_LOCK_WAIT_MS) {
|
|
1477
1477
|
mkdirSync4(join4(homedir3(), ".notis"), { recursive: true });
|
|
1478
1478
|
const deadline = Date.now() + waitMs;
|
|
1479
1479
|
for (; ; ) {
|
|
@@ -1483,7 +1483,7 @@ async function acquireRefreshLock(runtime, waitMs = OAUTH_REFRESH_LOCK_WAIT_MS)
|
|
|
1483
1483
|
} catch (error) {
|
|
1484
1484
|
if (error?.code !== "EEXIST") throw error;
|
|
1485
1485
|
const profile = getProfile(loadConfig(), runtime.profileName);
|
|
1486
|
-
if (profile.oauth_access_token && profile.oauth_access_token !==
|
|
1486
|
+
if (profile.oauth_access_token && profile.oauth_access_token !== staleAccessToken && !credentialIsExpired({ credentialKind: "oauth" }, profile)) {
|
|
1487
1487
|
updateRuntimeFromOAuthProfile(runtime, profile);
|
|
1488
1488
|
return false;
|
|
1489
1489
|
}
|
|
@@ -1516,6 +1516,7 @@ function keepLockFoldersFresh(paths) {
|
|
|
1516
1516
|
return () => clearInterval(interval);
|
|
1517
1517
|
}
|
|
1518
1518
|
async function refreshOAuthCredential(runtime, fetchImpl = fetch, tokenRequestOptions = {}) {
|
|
1519
|
+
const staleAccessToken = runtime.oauthAccessToken;
|
|
1519
1520
|
const globalLock = await acquireListenerGlobalLock({ waitMs: OAUTH_REFRESH_LOCK_WAIT_MS });
|
|
1520
1521
|
let profileLock = null;
|
|
1521
1522
|
let ownsLock = false;
|
|
@@ -1524,13 +1525,13 @@ async function refreshOAuthCredential(runtime, fetchImpl = fetch, tokenRequestOp
|
|
|
1524
1525
|
let metadata = null;
|
|
1525
1526
|
try {
|
|
1526
1527
|
profileLock = await acquireListenerStartLock(runtime);
|
|
1527
|
-
ownsLock = await acquireRefreshLock(runtime);
|
|
1528
|
+
ownsLock = await acquireRefreshLock(runtime, staleAccessToken);
|
|
1528
1529
|
if (!ownsLock) return true;
|
|
1529
1530
|
stopTouchingLocks = keepLockFoldersFresh([profileLock, oauthLockDir()]);
|
|
1530
1531
|
const config = loadConfig();
|
|
1531
1532
|
const profile = getProfile(config, runtime.profileName);
|
|
1532
1533
|
assertOAuthApiTarget(runtime, profile);
|
|
1533
|
-
if (profile.oauth_access_token && profile.oauth_access_token !==
|
|
1534
|
+
if (profile.oauth_access_token && profile.oauth_access_token !== staleAccessToken && !credentialIsExpired({ credentialKind: "oauth" }, profile)) {
|
|
1534
1535
|
updateRuntimeFromOAuthProfile(runtime, profile);
|
|
1535
1536
|
return true;
|
|
1536
1537
|
}
|