@north-light/crouter 0.3.192 → 0.3.193
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/api/client.d.ts +31 -10
- package/dist/api/client.js +83 -24
- package/dist/api/dto/bash-jobs.d.ts +22 -0
- package/dist/api/dto/bash-jobs.js +9 -0
- package/dist/api/dto/human.d.ts +3 -4
- package/dist/api/dto/inbox.d.ts +106 -65
- package/dist/api/dto/inbox.js +2 -8
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/dist/api/routes.d.ts +7 -0
- package/dist/api/routes.js +7 -0
- package/dist/builtin-memory/internal/storage-tiers.md +1 -1
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/__tests__/serial/provider-rotation.test.ts +101 -3
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.d.ts +6 -2
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.js +68 -14
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.ts +87 -13
- package/dist/clients/attach/__tests__/chat-view-snapshot-ordering.test.js +2 -2
- package/dist/clients/attach/__tests__/group-activity.test.js +2 -2
- package/dist/clients/attach/chrome/canvas-panels.d.ts +1 -1
- package/dist/clients/attach/chrome/canvas-panels.js +1 -1
- package/dist/clients/attach/input/overlay-owner.js +1 -1
- package/dist/clients/attach/overlays/auth.js +34 -8
- package/dist/clients/attach/overlays/pickers.d.ts +5 -8
- package/dist/clients/attach/overlays/pickers.js +37 -43
- package/dist/clients/attach/viewer.js +643 -620
- package/dist/clients/inbox/__tests__/serial/inbox-controller.test.js +38 -128
- package/dist/clients/inbox/__tests__/serial/mount-panel.test.js +72 -148
- package/dist/clients/inbox/controller.d.ts +2 -3
- package/dist/clients/inbox/controller.js +41 -42
- package/dist/clients/inbox/page-adapter.d.ts +33 -0
- package/dist/clients/inbox/page-adapter.js +54 -0
- package/dist/clients/inbox/resolve.d.ts +2 -2
- package/dist/clients/inbox/resolve.js +1 -1
- package/dist/clients/inbox/review-visibility.d.ts +1 -1
- package/dist/clients/inbox/review-visibility.js +1 -1
- package/dist/clients/inbox/tui/ansi.d.ts +1 -1
- package/dist/clients/inbox/tui/ansi.js +2 -2
- package/dist/clients/inbox/tui/input.d.ts +1 -3
- package/dist/clients/inbox/tui/input.js +242 -553
- package/dist/clients/inbox/tui/panel.d.ts +3 -1
- package/dist/clients/inbox/tui/panel.js +59 -187
- package/dist/clients/inbox/tui/render.d.ts +0 -25
- package/dist/clients/inbox/tui/render.js +165 -416
- package/dist/clients/inbox/tui/slots.d.ts +32 -0
- package/dist/clients/inbox/tui/slots.js +156 -0
- package/dist/clients/inbox/tui/types.d.ts +25 -13
- package/dist/clients/inbox/tui.js +5 -3
- package/dist/commands/attention.js +2 -2
- package/dist/commands/human/doc.js +66 -20
- package/dist/commands/human/prompts.d.ts +3 -3
- package/dist/commands/human/prompts.js +158 -112
- package/dist/commands/human/queue.d.ts +0 -1
- package/dist/commands/human/queue.js +34 -94
- package/dist/commands/human/shared.d.ts +10 -4
- package/dist/commands/human/shared.js +62 -13
- package/dist/commands/human.js +8 -4
- package/dist/commands/memory/read.js +13 -5
- package/dist/commands/node/bash.js +15 -28
- package/dist/commands/surface/node/focus.js +1 -1
- package/dist/core/__tests__/human-deliver.test.js +40 -46
- package/dist/core/__tests__/seam/broker-attach-stream.test.js +7 -1
- package/dist/core/__tests__/serial/human-deliver-e2e.test.js +40 -31
- package/dist/core/__tests__/serial/spawn-root.test.js +3 -1
- package/dist/core/__tests__/spawn-worktree-id-conflict.test.js +3 -1
- package/dist/core/auth-interaction.d.ts +2 -2
- package/dist/core/bash-jobs.d.ts +32 -0
- package/dist/core/bash-jobs.js +72 -1
- package/dist/core/canvas/__tests__/attention.test.js +16 -10
- package/dist/core/canvas/__tests__/render-remote.test.js +9 -3
- package/dist/core/canvas/attention.js +1 -1
- package/dist/core/canvas/browse/app.js +1 -1
- package/dist/core/canvas/nav-model.d.ts +1 -1
- package/dist/core/canvas/nav-model.js +1 -1
- package/dist/core/canvas/remote-canvas-source.js +1 -1
- package/dist/core/config.js +4 -1
- package/dist/core/human/__tests__/page-render.test.d.ts +1 -0
- package/dist/core/human/__tests__/page-render.test.js +49 -0
- package/dist/core/human/__tests__/page-tickets.test.d.ts +1 -0
- package/dist/core/human/__tests__/page-tickets.test.js +112 -0
- package/dist/core/human/__tests__/page.test.d.ts +1 -0
- package/dist/core/human/__tests__/page.test.js +139 -0
- package/dist/core/human/__tests__/serial/inbox-core.test.js +42 -32
- package/dist/core/human/claim.js +2 -2
- package/dist/core/human/convention.d.ts +4 -4
- package/dist/core/human/convention.js +6 -13
- package/dist/core/human/markdown-html.d.ts +8 -0
- package/dist/core/human/markdown-html.js +581 -0
- package/dist/core/human/page-catalog.d.ts +6 -0
- package/dist/core/human/page-catalog.js +43 -0
- package/dist/core/human/page-render.d.ts +3 -0
- package/dist/core/human/page-render.js +131 -0
- package/dist/core/human/page-schema.d.ts +312 -0
- package/dist/core/human/page-schema.js +291 -0
- package/dist/core/human/page-synth.d.ts +9 -0
- package/dist/core/human/page-synth.js +17 -0
- package/dist/core/human/page.d.ts +22 -0
- package/dist/core/human/page.js +427 -0
- package/dist/core/human/review-schema.d.ts +19 -0
- package/dist/core/human/review-schema.js +34 -0
- package/dist/core/human/scan.d.ts +12 -3
- package/dist/core/human/scan.js +69 -26
- package/dist/core/human/summary.d.ts +5 -6
- package/dist/core/human/summary.js +54 -37
- package/dist/core/human/tickets.d.ts +61 -11
- package/dist/core/human/tickets.js +100 -57
- package/dist/core/human/types.d.ts +21 -66
- package/dist/core/human/types.js +1 -5
- package/dist/core/preview-registry.js +0 -1
- package/dist/core/review/ticket-filter.d.ts +1 -1
- package/dist/core/review/ticket-filter.js +2 -8
- package/dist/core/runtime/broker/read-ops.js +3 -0
- package/dist/core/runtime/broker.js +19 -10
- package/dist/core/runtime/package-health.js +1 -1
- package/dist/core/termrender/termrender.d.ts +1 -1
- package/dist/core/termrender/termrender.js +2 -2
- package/dist/core/tui/page-host.d.ts +1 -1
- package/dist/core/tui/page-host.js +2 -2
- package/dist/core/user-settings.d.ts +19 -0
- package/dist/core/user-settings.js +22 -0
- package/dist/daemon/api/handlers/bash-jobs.d.ts +2 -0
- package/dist/daemon/api/handlers/bash-jobs.js +89 -0
- package/dist/daemon/api/handlers/human.js +16 -14
- package/dist/daemon/api/handlers/inbox.js +311 -227
- package/dist/daemon/api/router.d.ts +5 -1
- package/dist/daemon/api/router.js +5 -0
- package/dist/daemon/api/server.js +2 -0
- package/dist/daemon/cron-run.js +23 -10
- package/dist/daemon/human/finish.d.ts +8 -3
- package/dist/daemon/human/finish.js +35 -15
- package/dist/pages/bundle.css +1 -0
- package/dist/pages/bundle.js +1347 -0
- package/dist/pages/comments.d.ts +34 -0
- package/dist/pages/comments.js +72 -0
- package/dist/pages/elements/cards.d.ts +17 -0
- package/dist/pages/elements/cards.js +785 -0
- package/dist/pages/elements/chart.d.ts +1 -0
- package/dist/pages/elements/chart.js +648 -0
- package/dist/pages/elements/options.d.ts +21 -0
- package/dist/pages/elements/options.js +604 -0
- package/dist/pages/elements/pages.d.ts +24 -0
- package/dist/pages/elements/pages.js +355 -0
- package/dist/pages/elements/slot.d.ts +21 -0
- package/dist/pages/elements/slot.js +105 -0
- package/dist/pages/elements/table.d.ts +19 -0
- package/dist/pages/elements/table.js +906 -0
- package/dist/pages/elements/text.d.ts +25 -0
- package/dist/pages/elements/text.js +951 -0
- package/dist/pages/entry.d.ts +8 -0
- package/dist/pages/entry.js +8 -0
- package/dist/pages/host.d.ts +132 -0
- package/dist/pages/host.js +149 -0
- package/dist/pages/register.d.ts +2 -0
- package/dist/pages/register.js +3 -0
- package/dist/pages/slot-config.d.ts +36 -0
- package/dist/pages/slot-config.js +50 -0
- package/dist/pages/types.d.ts +98 -0
- package/dist/pages/types.js +23 -0
- package/dist/types.d.ts +4 -0
- package/dist/types.js +2 -0
- package/package.json +8 -8
- package/runtime.lock.json +156 -101
- package/dist/clients/inbox/deck-adapter.d.ts +0 -29
- package/dist/clients/inbox/deck-adapter.js +0 -63
- package/dist/core/human/deck-factories.d.ts +0 -8
- package/dist/core/human/deck-factories.js +0 -15
- package/dist/core/human/deck-schema.d.ts +0 -70
- package/dist/core/human/deck-schema.js +0 -92
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { PageResponses } from '../../core/human/page-schema.js';
|
|
2
|
+
import type { PageSourceProjection } from '../../core/human/page.js';
|
|
3
|
+
import type { PageTicket } from '../../core/human/tickets.js';
|
|
4
|
+
import type { Key } from './tui/keys.js';
|
|
5
|
+
export interface PageAdapterOptions {
|
|
6
|
+
dir: string;
|
|
7
|
+
ticket: PageTicket;
|
|
8
|
+
projection: PageSourceProjection;
|
|
9
|
+
productKinds: string[];
|
|
10
|
+
cols: number;
|
|
11
|
+
rows: number;
|
|
12
|
+
onProgress?: (responses: PageResponses) => void;
|
|
13
|
+
onComplete: (responses: PageResponses) => void;
|
|
14
|
+
onBack: () => void;
|
|
15
|
+
onDirty: () => void;
|
|
16
|
+
onEditorRequest?: () => void;
|
|
17
|
+
}
|
|
18
|
+
/** Embeds the page renderer in a controller-owned rectangle. */
|
|
19
|
+
export declare class PageAdapter {
|
|
20
|
+
private readonly opts;
|
|
21
|
+
private panel;
|
|
22
|
+
/** The live manifest — reload() can swap a display page for a response-bearing one. */
|
|
23
|
+
private manifest;
|
|
24
|
+
constructor(opts: PageAdapterOptions);
|
|
25
|
+
render(): string[];
|
|
26
|
+
resize(cols: number, rows: number): string[];
|
|
27
|
+
inputBuffer(): string | undefined;
|
|
28
|
+
setInputBuffer(text: string): void;
|
|
29
|
+
canAcceptHostKeys(): boolean;
|
|
30
|
+
handleKey(input: string, key: Key): void;
|
|
31
|
+
reload(ticket: PageTicket, projection: PageSourceProjection): void;
|
|
32
|
+
close(): void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { writePageProgress } from '../../core/human/tickets.js';
|
|
2
|
+
import { mountPanel } from './tui/panel.js';
|
|
3
|
+
import { awaitsResponse } from './tui/slots.js';
|
|
4
|
+
/** Embeds the page renderer in a controller-owned rectangle. */
|
|
5
|
+
export class PageAdapter {
|
|
6
|
+
opts;
|
|
7
|
+
panel;
|
|
8
|
+
/** The live manifest — reload() can swap a display page for a response-bearing one. */
|
|
9
|
+
manifest;
|
|
10
|
+
constructor(opts) {
|
|
11
|
+
this.opts = opts;
|
|
12
|
+
this.manifest = opts.ticket.manifest;
|
|
13
|
+
this.panel = mountPanel({
|
|
14
|
+
manifest: opts.ticket.manifest,
|
|
15
|
+
projection: opts.projection,
|
|
16
|
+
productKinds: opts.productKinds,
|
|
17
|
+
initialResponses: opts.ticket.progress,
|
|
18
|
+
cols: opts.cols,
|
|
19
|
+
rows: opts.rows,
|
|
20
|
+
onProgress: (responses) => {
|
|
21
|
+
try {
|
|
22
|
+
writePageProgress(opts.dir, responses, opts.productKinds);
|
|
23
|
+
}
|
|
24
|
+
catch { /* partial in-flight input may not validate yet */ }
|
|
25
|
+
opts.onProgress?.(responses);
|
|
26
|
+
},
|
|
27
|
+
onComplete: opts.onComplete,
|
|
28
|
+
onExit: () => { if (awaitsResponse(this.manifest))
|
|
29
|
+
opts.onBack();
|
|
30
|
+
else
|
|
31
|
+
opts.onComplete({}); },
|
|
32
|
+
onDirty: opts.onDirty,
|
|
33
|
+
onEditorRequest: opts.onEditorRequest,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
render() { return this.panel.render(); }
|
|
37
|
+
resize(cols, rows) { return this.panel.handleResize(cols, rows); }
|
|
38
|
+
inputBuffer() { return this.panel.getInputBuffer(); }
|
|
39
|
+
setInputBuffer(text) { this.panel.setInputBuffer(text); }
|
|
40
|
+
canAcceptHostKeys() { return this.panel.canAcceptHostKeys(); }
|
|
41
|
+
handleKey(input, key) {
|
|
42
|
+
if (key.escape && this.panel.atPageTop()) {
|
|
43
|
+
this.opts.onBack();
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
this.panel.handleKey(input, key);
|
|
47
|
+
}
|
|
48
|
+
reload(ticket, projection) {
|
|
49
|
+
this.manifest = ticket.manifest;
|
|
50
|
+
this.panel.loadPage(ticket.manifest, projection, { initialResponses: ticket.progress, productKinds: this.opts.productKinds });
|
|
51
|
+
this.opts.onDirty();
|
|
52
|
+
}
|
|
53
|
+
close() { this.panel.unmount(); }
|
|
54
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PageResponses } from '../../core/human/page-schema.js';
|
|
2
2
|
export declare function nodeIdFor(dir: string): string;
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function resolveTicketPage(dir: string, responses: PageResponses): Promise<void>;
|
|
4
4
|
export declare function cancelTicketViaDaemon(dir: string, opts: {
|
|
5
5
|
reason: string;
|
|
6
6
|
actor: string;
|
|
@@ -4,7 +4,7 @@ import { cliClient } from '../../commands/api-client.js';
|
|
|
4
4
|
export function nodeIdFor(dir) {
|
|
5
5
|
return basename(dir);
|
|
6
6
|
}
|
|
7
|
-
export async function
|
|
7
|
+
export async function resolveTicketPage(dir, responses) {
|
|
8
8
|
await cliClient().resolveHumanTicket(nodeIdFor(dir), { responses });
|
|
9
9
|
}
|
|
10
10
|
export async function cancelTicketViaDaemon(dir, opts) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TicketSummary } from '../../core/human/types.js';
|
|
2
2
|
/** Match the daemon's opaque inbox id: canonical tickets root, NUL, bridge id. */
|
|
3
3
|
export declare function opaqueTicketId(canonicalTicketsRoot: string, bridgeNodeId: string): string;
|
|
4
|
-
/** Retain local
|
|
4
|
+
/** Retain local page rows and only daemon-visible review rows. */
|
|
5
5
|
export declare function filterVisibleReviewTickets(tickets: readonly TicketSummary[], visibleIds: ReadonlySet<string>): TicketSummary[];
|
|
@@ -6,7 +6,7 @@ import { ticketsRoot } from '../../core/human/root.js';
|
|
|
6
6
|
export function opaqueTicketId(canonicalTicketsRoot, bridgeNodeId) {
|
|
7
7
|
return createHash('sha256').update(`${canonicalTicketsRoot}\0${bridgeNodeId}`, 'utf8').digest('hex');
|
|
8
8
|
}
|
|
9
|
-
/** Retain local
|
|
9
|
+
/** Retain local page rows and only daemon-visible review rows. */
|
|
10
10
|
export function filterVisibleReviewTickets(tickets, visibleIds) {
|
|
11
11
|
let canonicalTicketsRoot;
|
|
12
12
|
try {
|
|
@@ -13,7 +13,7 @@ export declare function sanitize(text: string): string;
|
|
|
13
13
|
export declare function singleLine(text: string): string;
|
|
14
14
|
export declare function hline(width: number, char?: string): string;
|
|
15
15
|
export declare function padRight(text: string, width: number): string;
|
|
16
|
-
/** Char-based width truncation with a trailing ellipsis. The canonical
|
|
16
|
+
/** Char-based width truncation with a trailing ellipsis. The canonical page
|
|
17
17
|
* renderer variant. */
|
|
18
18
|
export declare function truncate(text: string, maxWidth: number): string;
|
|
19
19
|
/** Word-aware truncation that also flattens newlines and strips decorative
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import stringWidth from 'string-width';
|
|
2
2
|
// ── ANSI escape constants ─────────────────────────────────────────────────────
|
|
3
|
-
// The single home for these — both the
|
|
3
|
+
// The single home for these — both the page renderer (render.ts) and the inbox
|
|
4
4
|
// picker (inbox/tui.ts) import from here rather than keeping their own copies.
|
|
5
5
|
export const ESC = '\x1b[';
|
|
6
6
|
export const RESET = `${ESC}0m`;
|
|
@@ -34,7 +34,7 @@ export function padRight(text, width) {
|
|
|
34
34
|
return text;
|
|
35
35
|
return text + ' '.repeat(width - w);
|
|
36
36
|
}
|
|
37
|
-
/** Char-based width truncation with a trailing ellipsis. The canonical
|
|
37
|
+
/** Char-based width truncation with a trailing ellipsis. The canonical page
|
|
38
38
|
* renderer variant. */
|
|
39
39
|
export function truncate(text, maxWidth) {
|
|
40
40
|
if (maxWidth < 1)
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { TuiState } from './types.js';
|
|
2
|
-
import type { Interaction } from '../../../core/human/types.js';
|
|
3
2
|
import type { Key } from './keys.js';
|
|
4
3
|
export type RenderFn = () => void;
|
|
5
|
-
export type ExitFn = () => void;
|
|
6
|
-
export declare function assignShortcuts(interactions: Interaction[]): void;
|
|
4
|
+
export type ExitFn = (submit?: boolean) => void;
|
|
7
5
|
export declare function handleKeypress(input: string, key: Key, state: TuiState, render: RenderFn, exit: ExitFn): void;
|