@howaboua/pi-durable-notebook 0.0.0-stage → 0.9.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/LICENSE +21 -0
- package/NOTICE +54 -0
- package/README.md +105 -2
- package/dist/execution/src/cell-contract.d.ts +49 -0
- package/dist/execution/src/cell-observation.d.ts +7 -0
- package/dist/execution/src/cell-progress.d.ts +4 -0
- package/dist/execution/src/cell-task.d.ts +17 -0
- package/dist/execution/src/cell-tools.d.ts +8 -0
- package/dist/execution/src/cells.d.ts +14 -0
- package/dist/execution/src/command-backend.d.ts +22 -0
- package/dist/execution/src/controls.d.ts +3 -0
- package/dist/execution/src/custom-command-config.d.ts +21 -0
- package/dist/execution/src/custom-commands.d.ts +62 -0
- package/dist/execution/src/exec-source.d.ts +21 -0
- package/dist/execution/src/forwarded-tools.d.ts +21 -0
- package/dist/execution/src/forwarding-hook.d.ts +6 -0
- package/dist/execution/src/forwarding.d.ts +15 -0
- package/dist/execution/src/history.d.ts +14 -0
- package/dist/execution/src/index.d.ts +6 -0
- package/dist/execution/src/invocation-state.d.ts +26 -0
- package/dist/execution/src/invocation.d.ts +35 -0
- package/dist/execution/src/native-tools.d.ts +11 -0
- package/dist/execution/src/nested-call.d.ts +26 -0
- package/dist/execution/src/nested-result.d.ts +8 -0
- package/dist/execution/src/nested.d.ts +3 -0
- package/dist/execution/src/output.d.ts +48 -0
- package/dist/execution/src/presentation.d.ts +59 -0
- package/dist/execution/src/progress.d.ts +23 -0
- package/dist/execution/src/projection.d.ts +5 -0
- package/dist/execution/src/shell/backend.d.ts +28 -0
- package/dist/execution/src/shell/format.d.ts +2 -0
- package/dist/execution/src/shell/node-backend.d.ts +9 -0
- package/dist/execution/src/shell/output.d.ts +19 -0
- package/dist/execution/src/shell/process-session.d.ts +50 -0
- package/dist/execution/src/shell/results.d.ts +14 -0
- package/dist/execution/src/shell/session-manager.d.ts +46 -0
- package/dist/execution/src/shell/session-store.d.ts +53 -0
- package/dist/execution/src/shell/shell-args.d.ts +4 -0
- package/dist/execution/src/shell/shell.d.ts +14 -0
- package/dist/execution/src/shell/wait.d.ts +7 -0
- package/dist/execution/src/shell.d.ts +14 -0
- package/dist/execution/src/tool-contract.d.ts +34 -0
- package/dist/execution/src/tool-origin.d.ts +11 -0
- package/dist/execution/src/tool-source.d.ts +6 -0
- package/dist/execution/src/tool-value.d.ts +3 -0
- package/dist/execution/src/wait-session.d.ts +6 -0
- package/dist/history.js +315 -0
- package/dist/index.js +11718 -0
- package/dist/notebook/src/binding-metadata-source.d.ts +2 -0
- package/dist/notebook/src/bridge-protocol.d.ts +29 -0
- package/dist/notebook/src/bridge-server.d.ts +20 -0
- package/dist/notebook/src/cell.d.ts +34 -0
- package/dist/notebook/src/checkpoint-activity.d.ts +7 -0
- package/dist/notebook/src/checkpoint-format.d.ts +32 -0
- package/dist/notebook/src/checkpoint-manager.d.ts +41 -0
- package/dist/notebook/src/checkpoint-runtime.d.ts +18 -0
- package/dist/notebook/src/checkpoint-store.d.ts +8 -0
- package/dist/notebook/src/checkpoint.d.ts +15 -0
- package/dist/notebook/src/client.d.ts +18 -0
- package/dist/notebook/src/command-output.d.ts +1 -0
- package/dist/notebook/src/control-contract.d.ts +5 -0
- package/dist/notebook/src/deno-archive.d.ts +2 -0
- package/dist/notebook/src/deno-assets.d.ts +11 -0
- package/dist/notebook/src/deno-binary.d.ts +6 -0
- package/dist/notebook/src/deno-syntax-diagnostics.d.ts +1 -0
- package/dist/notebook/src/directory-lock.d.ts +10 -0
- package/dist/notebook/src/engine.d.ts +21 -0
- package/dist/notebook/src/execution-runtime.d.ts +33 -0
- package/dist/notebook/src/execution-settlement.d.ts +15 -0
- package/dist/notebook/src/glob.d.ts +1 -0
- package/dist/notebook/src/history.d.ts +6 -0
- package/dist/notebook/src/index.d.ts +57 -0
- package/dist/notebook/src/isolated-runtime.d.ts +19 -0
- package/dist/notebook/src/isolated-storage.d.ts +2 -0
- package/dist/notebook/src/journal-document.d.ts +36 -0
- package/dist/notebook/src/journal.d.ts +37 -0
- package/dist/notebook/src/jupyter-connection.d.ts +17 -0
- package/dist/notebook/src/jupyter-execution.d.ts +29 -0
- package/dist/notebook/src/jupyter-kernel.d.ts +43 -0
- package/dist/notebook/src/jupyter-output.d.ts +32 -0
- package/dist/notebook/src/jupyter-shell.d.ts +18 -0
- package/dist/notebook/src/jupyter-socket.d.ts +17 -0
- package/dist/notebook/src/jupyter-wire.d.ts +16 -0
- package/dist/notebook/src/lifecycle-contract.d.ts +32 -0
- package/dist/notebook/src/lifecycle-inspection.d.ts +7 -0
- package/dist/notebook/src/lifecycle-pins.d.ts +10 -0
- package/dist/notebook/src/lifecycle-release.d.ts +12 -0
- package/dist/notebook/src/lifecycle-result.d.ts +43 -0
- package/dist/notebook/src/lifecycle-runtime.d.ts +35 -0
- package/dist/notebook/src/lifecycle.d.ts +13 -0
- package/dist/notebook/src/lsp-process.d.ts +23 -0
- package/dist/notebook/src/notebook-bootstrap.d.ts +1 -0
- package/dist/notebook/src/notebook-control.d.ts +26 -0
- package/dist/notebook/src/notebook-diagnostic-report.d.ts +25 -0
- package/dist/notebook/src/notebook-diagnostics.d.ts +10 -0
- package/dist/notebook/src/npm-imports.d.ts +10 -0
- package/dist/notebook/src/presentation.d.ts +3 -0
- package/dist/notebook/src/profile-lifecycle.d.ts +22 -0
- package/dist/notebook/src/profile-state-format.d.ts +36 -0
- package/dist/notebook/src/profile-state.d.ts +29 -0
- package/dist/notebook/src/project-identity.d.ts +1 -0
- package/dist/notebook/src/project-state-commit.d.ts +23 -0
- package/dist/notebook/src/project-state-conflicts.d.ts +7 -0
- package/dist/notebook/src/project-state-files.d.ts +9 -0
- package/dist/notebook/src/project-state-format.d.ts +80 -0
- package/dist/notebook/src/project-state-lock.d.ts +1 -0
- package/dist/notebook/src/project-state-merge.d.ts +31 -0
- package/dist/notebook/src/project-state-metadata.d.ts +20 -0
- package/dist/notebook/src/project-state-runtime.d.ts +13 -0
- package/dist/notebook/src/project-state.d.ts +18 -0
- package/dist/notebook/src/recovery.d.ts +28 -0
- package/dist/notebook/src/runtime-contract.d.ts +117 -0
- package/dist/notebook/src/runtime-health.d.ts +9 -0
- package/dist/notebook/src/session-identity.d.ts +2 -0
- package/dist/notebook/src/session-observations.d.ts +35 -0
- package/dist/notebook/src/session-runtime.d.ts +48 -0
- package/dist/notebook/src/session-startup.d.ts +23 -0
- package/dist/notebook/src/storage-retention.d.ts +21 -0
- package/dist/notebook/src/tool-callbacks.d.ts +20 -0
- package/dist/notebook/src/tool-observation.d.ts +21 -0
- package/dist/presentation.js +144 -0
- package/package.json +54 -5
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { JupyterMessage } from "./jupyter-wire.ts";
|
|
2
|
+
import type { RuntimeContentItem } from "./runtime-contract.ts";
|
|
3
|
+
export declare const OUTPUT_DRAIN_MESSAGE = "pi_notebook_output_drained";
|
|
4
|
+
export interface KernelExecutionResult {
|
|
5
|
+
status: "ok" | "error" | "aborted";
|
|
6
|
+
items: RuntimeContentItem[];
|
|
7
|
+
errorText?: string | undefined;
|
|
8
|
+
errorName?: string | undefined;
|
|
9
|
+
errorValue?: string | undefined;
|
|
10
|
+
}
|
|
11
|
+
export interface ActiveKernelExecution {
|
|
12
|
+
requestId: string;
|
|
13
|
+
drain?: {
|
|
14
|
+
requestId: string;
|
|
15
|
+
marker: string;
|
|
16
|
+
idle: boolean;
|
|
17
|
+
seen: boolean;
|
|
18
|
+
} | undefined;
|
|
19
|
+
items: RuntimeContentItem[];
|
|
20
|
+
outputChars: number;
|
|
21
|
+
outputTruncated: boolean;
|
|
22
|
+
status: KernelExecutionResult["status"];
|
|
23
|
+
errorText?: string | undefined;
|
|
24
|
+
errorName?: string | undefined;
|
|
25
|
+
errorValue?: string | undefined;
|
|
26
|
+
onOutput?: ((item: RuntimeContentItem) => void) | undefined;
|
|
27
|
+
resolve(): void;
|
|
28
|
+
reject(error: Error): void;
|
|
29
|
+
}
|
|
30
|
+
export declare function applyKernelOutput(message: JupyterMessage, execution: ActiveKernelExecution): "idle" | undefined;
|
|
31
|
+
export declare function finishKernelExecution(execution: ActiveKernelExecution): KernelExecutionResult;
|
|
32
|
+
export declare function applyExecuteReplyError(result: KernelExecutionResult, reply: JupyterMessage): KernelExecutionResult;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { JupyterConnectionInfo } from "./jupyter-connection.ts";
|
|
2
|
+
import type { JupyterSocket } from "./jupyter-socket.ts";
|
|
3
|
+
import { type JupyterMessage } from "./jupyter-wire.ts";
|
|
4
|
+
/** Correlation, request timeouts and disconnect settlement belong to the shell channel. */
|
|
5
|
+
export declare class JupyterShellChannel {
|
|
6
|
+
private shell;
|
|
7
|
+
private connection;
|
|
8
|
+
private readonly shellReplies;
|
|
9
|
+
private readonly session;
|
|
10
|
+
private readonly stderr;
|
|
11
|
+
private readonly onFailure;
|
|
12
|
+
constructor(session: string, stderr: () => string, onFailure: (error: Error) => void);
|
|
13
|
+
attach(shell: JupyterSocket, connection: JupyterConnectionInfo): void;
|
|
14
|
+
close(): void;
|
|
15
|
+
request(type: string, content: Record<string, unknown>, timeoutMs?: number, signal?: AbortSignal): Promise<JupyterMessage>;
|
|
16
|
+
send(request: JupyterMessage, timeoutMs?: number, requestType?: string, signal?: AbortSignal): Promise<JupyterMessage>;
|
|
17
|
+
pump(socket: JupyterSocket, connection: JupyterConnectionInfo): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare class JupyterSocket {
|
|
2
|
+
private socket;
|
|
3
|
+
private reader;
|
|
4
|
+
private buffered;
|
|
5
|
+
private readonly stopped;
|
|
6
|
+
private ready;
|
|
7
|
+
private readonly type;
|
|
8
|
+
private readonly port;
|
|
9
|
+
constructor(type: "DEALER" | "SUB", port: number);
|
|
10
|
+
connect(signal?: AbortSignal): Promise<void>;
|
|
11
|
+
send(frames: readonly Buffer[]): Promise<void>;
|
|
12
|
+
[Symbol.asyncIterator](): AsyncGenerator<Buffer[]>;
|
|
13
|
+
close(): void;
|
|
14
|
+
private read;
|
|
15
|
+
private readFrame;
|
|
16
|
+
private write;
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface JupyterMessage {
|
|
2
|
+
header: {
|
|
3
|
+
msg_id: string;
|
|
4
|
+
session: string;
|
|
5
|
+
username: string;
|
|
6
|
+
date: string;
|
|
7
|
+
msg_type: string;
|
|
8
|
+
version: string;
|
|
9
|
+
};
|
|
10
|
+
parent_header: Record<string, unknown>;
|
|
11
|
+
metadata: Record<string, unknown>;
|
|
12
|
+
content: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
export declare function createJupyterMessage(type: string, content: Record<string, unknown>, session: string): JupyterMessage;
|
|
15
|
+
export declare function encodeJupyterMessage(message: JupyterMessage, key: string): Buffer[];
|
|
16
|
+
export declare function decodeJupyterMessage(frames: Buffer[], key: string): JupyterMessage | undefined;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { DenoJupyterKernel } from "./jupyter-kernel.ts";
|
|
2
|
+
import type { ProjectStatePinUpdate } from "./project-state-merge.ts";
|
|
3
|
+
import type { RetainedProjectBinding } from "./project-state-metadata.ts";
|
|
4
|
+
import type { NotebookControlResult, NotebookMemoryUsage, NotebookSessionContext, ToolExecutionContext } from "./runtime-contract.ts";
|
|
5
|
+
import type { NotebookRuntimeHealth } from "./runtime-health.ts";
|
|
6
|
+
export interface NotebookLifecycleHost {
|
|
7
|
+
prepare(context: ToolExecutionContext, signal?: AbortSignal): Promise<void>;
|
|
8
|
+
diagnostics(context: ToolExecutionContext, signal?: AbortSignal): Promise<NotebookControlResult>;
|
|
9
|
+
reset(context: ToolExecutionContext, signal?: AbortSignal): Promise<NotebookControlResult>;
|
|
10
|
+
unpinWithoutStartup(names: string[], context: ToolExecutionContext, signal?: AbortSignal): Promise<NotebookControlResult>;
|
|
11
|
+
kernel(): DenoJupyterKernel | undefined;
|
|
12
|
+
activeCellId(): string | undefined;
|
|
13
|
+
stopActive(): Promise<string | undefined>;
|
|
14
|
+
checkpoint(excludeNames?: ReadonlySet<string>, pins?: ProjectStatePinUpdate): Promise<void>;
|
|
15
|
+
retainedBindings(): RetainedProjectBinding[];
|
|
16
|
+
promoteBindings(names: string[]): Promise<() => Promise<void>>;
|
|
17
|
+
markChanged(): void;
|
|
18
|
+
restart(context: NotebookSessionContext, signal?: AbortSignal): Promise<string | undefined>;
|
|
19
|
+
rollback(context: NotebookSessionContext): Promise<void>;
|
|
20
|
+
baselineNames(): ReadonlySet<string>;
|
|
21
|
+
profileStorage(): {
|
|
22
|
+
agentDir: string;
|
|
23
|
+
maxBytes: number;
|
|
24
|
+
};
|
|
25
|
+
runtimeHealth(): NotebookRuntimeHealth;
|
|
26
|
+
metadata(): {
|
|
27
|
+
startedAt?: number | undefined;
|
|
28
|
+
userCells: number;
|
|
29
|
+
memory?: NotebookMemoryUsage | undefined;
|
|
30
|
+
checkpoint: Record<string, unknown>;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DenoJupyterKernel } from "./jupyter-kernel.ts";
|
|
2
|
+
import type { NotebookLifecycleHost } from "./lifecycle-contract.ts";
|
|
3
|
+
import { type NotebookStatusDetails } from "./lifecycle-result.ts";
|
|
4
|
+
import type { NotebookControlResult } from "./runtime-contract.ts";
|
|
5
|
+
export declare const NOTEBOOK_BINDING_IDENTIFIER: RegExp;
|
|
6
|
+
export declare function inspectNotebookStatus(host: Pick<NotebookLifecycleHost, "kernel" | "activeCellId" | "retainedBindings" | "baselineNames" | "metadata">, query: string | undefined, signal?: AbortSignal, format?: (details: NotebookStatusDetails) => string): Promise<NotebookControlResult>;
|
|
7
|
+
export declare function notebookUserBindingNames(host: Pick<NotebookLifecycleHost, "baselineNames">, kernel: DenoJupyterKernel, signal?: AbortSignal): Promise<string[]>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { NotebookLifecycleHost } from "./lifecycle-contract.ts";
|
|
2
|
+
import type { NotebookControlResult, NotebookHook } from "./runtime-contract.ts";
|
|
3
|
+
type BindingHost = Pick<NotebookLifecycleHost, "kernel" | "activeCellId" | "retainedBindings" | "baselineNames" | "promoteBindings" | "checkpoint">;
|
|
4
|
+
export declare class NotebookPinController {
|
|
5
|
+
private readonly host;
|
|
6
|
+
constructor(host: BindingHost);
|
|
7
|
+
pin(names: string[], pinned: boolean, hook?: NotebookHook | false): Promise<NotebookControlResult>;
|
|
8
|
+
private configureToolHooks;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { NotebookLifecycleHost } from "./lifecycle-contract.ts";
|
|
2
|
+
import { type NotebookReleaseResult } from "./lifecycle-runtime.ts";
|
|
3
|
+
import type { NotebookControlResult, ToolExecutionContext } from "./runtime-contract.ts";
|
|
4
|
+
type BindingHost = Pick<NotebookLifecycleHost, "kernel" | "activeCellId" | "retainedBindings" | "baselineNames" | "checkpoint" | "markChanged" | "restart" | "metadata">;
|
|
5
|
+
export declare class NotebookReleaseController {
|
|
6
|
+
private readonly host;
|
|
7
|
+
constructor(host: BindingHost);
|
|
8
|
+
disposeAll(signal?: AbortSignal): Promise<NotebookReleaseResult | undefined>;
|
|
9
|
+
release(names: string[], context: ToolExecutionContext, signal?: AbortSignal, preservedNames?: string[]): Promise<NotebookControlResult>;
|
|
10
|
+
prune(query: string, context: ToolExecutionContext, signal?: AbortSignal): Promise<NotebookControlResult>;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { NotebookKernelStatus, NotebookReleaseResult } from "./lifecycle-runtime.ts";
|
|
2
|
+
import type { RetainedProjectBinding } from "./project-state-metadata.ts";
|
|
3
|
+
import type { NotebookHook, NotebookMemoryUsage } from "./runtime-contract.ts";
|
|
4
|
+
export declare const NOTEBOOK_DETAILS_BUDGET: number;
|
|
5
|
+
export interface NotebookStatusDetails extends Record<string, unknown> {
|
|
6
|
+
state: "idle" | "running";
|
|
7
|
+
activeCell?: string | undefined;
|
|
8
|
+
userBindings?: number | undefined;
|
|
9
|
+
userCells: number;
|
|
10
|
+
startedAt?: string | undefined;
|
|
11
|
+
memory?: NotebookKernelStatus["memory"] | NotebookMemoryUsage | undefined;
|
|
12
|
+
checkpoint: Record<string, unknown>;
|
|
13
|
+
query?: string | undefined;
|
|
14
|
+
matches?: Array<NotebookKernelStatus["bindings"][number] & {
|
|
15
|
+
bytes?: number | undefined;
|
|
16
|
+
updatedAt?: string | undefined;
|
|
17
|
+
pinned?: boolean | undefined;
|
|
18
|
+
hook?: NotebookHook | undefined;
|
|
19
|
+
description?: string | undefined;
|
|
20
|
+
usage?: string | undefined;
|
|
21
|
+
}> | undefined;
|
|
22
|
+
omittedMatches?: number | undefined;
|
|
23
|
+
retainedBindings: number;
|
|
24
|
+
retainedBytes: number;
|
|
25
|
+
pinnedBindings: number;
|
|
26
|
+
pinned: RetainedProjectBinding[];
|
|
27
|
+
omittedPinned: number;
|
|
28
|
+
largestUnpinned: RetainedProjectBinding[];
|
|
29
|
+
omittedLargestUnpinned: number;
|
|
30
|
+
}
|
|
31
|
+
export declare function withinNameBudget(names: string[]): string[];
|
|
32
|
+
export declare function formatNameList(names: string[]): string;
|
|
33
|
+
export declare function takeDetailValues<T>(values: T[], budget: {
|
|
34
|
+
remaining: number;
|
|
35
|
+
}): T[];
|
|
36
|
+
export declare function remainingDetailsBudget(base: unknown): {
|
|
37
|
+
remaining: number;
|
|
38
|
+
};
|
|
39
|
+
export declare function boundedReleaseDetails(result: NotebookReleaseResult, protectedNames: string[], restarted: boolean, checkpoint: Record<string, unknown>): Record<string, unknown>;
|
|
40
|
+
export declare function formatStatus(details: NotebookStatusDetails): string;
|
|
41
|
+
/** Startup inventory excludes sampled diagnostics and relative ages. */
|
|
42
|
+
export declare function formatStartupStatus(details: NotebookStatusDetails): string;
|
|
43
|
+
export declare function formatRelease(result: NotebookReleaseResult, restarted: boolean): string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { KernelExecutionResult } from "./jupyter-kernel.ts";
|
|
2
|
+
interface NotebookBindingStatus {
|
|
3
|
+
name: string;
|
|
4
|
+
type: string;
|
|
5
|
+
constructor?: string | undefined;
|
|
6
|
+
kind: "value" | "definition" | "runtime-only";
|
|
7
|
+
disposable?: "sync" | "async" | undefined;
|
|
8
|
+
globalProperty: boolean;
|
|
9
|
+
configurable: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface NotebookKernelStatus {
|
|
12
|
+
memory: {
|
|
13
|
+
heapUsedBytes: number;
|
|
14
|
+
heapTotalBytes: number;
|
|
15
|
+
heapLimitBytes: number;
|
|
16
|
+
rssBytes: number;
|
|
17
|
+
externalBytes: number;
|
|
18
|
+
};
|
|
19
|
+
bindings: NotebookBindingStatus[];
|
|
20
|
+
}
|
|
21
|
+
export interface NotebookReleaseResult {
|
|
22
|
+
released: string[];
|
|
23
|
+
disposed: string[];
|
|
24
|
+
failures: Array<{
|
|
25
|
+
name: string;
|
|
26
|
+
reason: string;
|
|
27
|
+
}>;
|
|
28
|
+
}
|
|
29
|
+
export declare function notebookStatusSource(names: string[], marker: string): string;
|
|
30
|
+
export declare function notebookReleaseSource(names: string[], marker: string): string;
|
|
31
|
+
export declare function notebookDisposeSource(names: string[], marker: string): string;
|
|
32
|
+
export declare function parseNotebookRuntimeResult<T>(result: KernelExecutionResult, marker: string): T;
|
|
33
|
+
export declare function notebookToolHooksSource(names: readonly string[], enabled: boolean): string;
|
|
34
|
+
export declare function lifecycleMarker(): string;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NotebookLifecycleHost } from "./lifecycle-contract.ts";
|
|
2
|
+
import { NotebookReleaseController } from "./lifecycle-release.ts";
|
|
3
|
+
import type { NotebookControlRequest, NotebookControlResult, ToolExecutionContext } from "./runtime-contract.ts";
|
|
4
|
+
export declare class NotebookLifecycleController {
|
|
5
|
+
private readonly host;
|
|
6
|
+
private readonly profiles;
|
|
7
|
+
private readonly pins;
|
|
8
|
+
readonly releases: NotebookReleaseController;
|
|
9
|
+
constructor(host: NotebookLifecycleHost);
|
|
10
|
+
control(request: NotebookControlRequest, context: ToolExecutionContext, signal?: AbortSignal): Promise<NotebookControlResult>;
|
|
11
|
+
private checkpoint;
|
|
12
|
+
private restart;
|
|
13
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare class OneShotLspProcess {
|
|
2
|
+
private readonly child;
|
|
3
|
+
private readonly pending;
|
|
4
|
+
private nextId;
|
|
5
|
+
private input;
|
|
6
|
+
private stderr;
|
|
7
|
+
private stopped;
|
|
8
|
+
constructor(options: {
|
|
9
|
+
deno: string;
|
|
10
|
+
cwd: string;
|
|
11
|
+
signal: AbortSignal;
|
|
12
|
+
});
|
|
13
|
+
request(method: string, params?: unknown): Promise<unknown>;
|
|
14
|
+
notify(method: string, params?: unknown): void;
|
|
15
|
+
shutdown(): Promise<void>;
|
|
16
|
+
private send;
|
|
17
|
+
private receive;
|
|
18
|
+
private readMessage;
|
|
19
|
+
private handle;
|
|
20
|
+
private answerServerRequest;
|
|
21
|
+
private fail;
|
|
22
|
+
private rejectPending;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function notebookBootstrapSource(origin: string, token: string, exitToken: string, cwd: string): string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Type } from "typebox";
|
|
2
|
+
import type { NotebookControlRequest } from "./runtime-contract.ts";
|
|
3
|
+
export declare const NOTEBOOK_ACTION_PARAMETERS: Type.TUnion<[Type.TObject<{
|
|
4
|
+
action: Type.TUnion<[Type.TLiteral<"status">, Type.TLiteral<"list">]>;
|
|
5
|
+
query: Type.TOptional<Type.TString>;
|
|
6
|
+
}>, Type.TObject<{
|
|
7
|
+
action: Type.TUnion<[Type.TLiteral<"checkpoint">, Type.TLiteral<"restart">, Type.TLiteral<"diagnostics">, Type.TLiteral<"reset">]>;
|
|
8
|
+
}>, Type.TObject<{
|
|
9
|
+
action: Type.TUnion<[Type.TLiteral<"save">, Type.TLiteral<"load">]>;
|
|
10
|
+
name: Type.TString;
|
|
11
|
+
}>, Type.TObject<{
|
|
12
|
+
action: Type.TLiteral<"pin">;
|
|
13
|
+
names: Type.TArray<Type.TString>;
|
|
14
|
+
hook: Type.TOptional<Type.TUnion<[Type.TUnion<[Type.TLiteral<"startup">, Type.TLiteral<"tool_result">]>, Type.TLiteral<false>]>>;
|
|
15
|
+
}>, Type.TObject<{
|
|
16
|
+
action: Type.TUnion<[Type.TLiteral<"unpin">, Type.TLiteral<"release">]>;
|
|
17
|
+
names: Type.TArray<Type.TString>;
|
|
18
|
+
}>, Type.TObject<{
|
|
19
|
+
action: Type.TLiteral<"prune">;
|
|
20
|
+
query: Type.TString;
|
|
21
|
+
}>]>;
|
|
22
|
+
export declare const NOTEBOOK_PARAMETERS: Type.TObject<{
|
|
23
|
+
input: Type.TOptional<Type.TString>;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const NOTEBOOK_HELP = "Call notebook with {} or {\"input\":\"help\"} for help, or {\"input\":\"<JSON action object>\"}.\nExample: {\"input\":\"{\\\"action\\\":\\\"status\\\",\\\"query\\\":\\\"*\\\"}\"}\nAction objects accept only the fields shown below; ? means optional.\n\n{\"action\":\"status\",\"query\"?:string} Memory, checkpoint and retained-state summary; query inspects matching live bindings\n{\"action\":\"list\",\"query\"?:string} List saved profiles and isolated candidates, optionally filtered by name\n{\"action\":\"checkpoint\"} Persist current serializable state\n{\"action\":\"save\",\"name\":string} Save current state as a named profile\n{\"action\":\"load\",\"name\":string} Load a profile by value without replaying cells; release or rename colliding bindings first\n{\"action\":\"pin\",\"names\":string[],\"hook\"?:\"startup\"|\"tool_result\"|false} Promote bindings to durable project state and protect from release/prune; omit hook to preserve it, false removes it\n{\"action\":\"unpin\",\"names\":string[]} Remove pin protection and hooks, keeping bindings\n{\"action\":\"release\",\"names\":string[]} Dispose and remove selected unpinned bindings; unpin protected bindings first\n{\"action\":\"prune\",\"query\":string} Release unpinned bindings matching an explicit glob; pinned matches survive\n{\"action\":\"restart\"} Stop any active cell and restore the last completed checkpoint\n{\"action\":\"diagnostics\"} Check historical cells and runtime health without executing them\n{\"action\":\"reset\"} Stop any active cell and discard the session checkpoint; durable project state, saved notebook and named profiles survive\n\nquery uses case-insensitive * and ? globs. prune requires a nonempty query. names must be a nonempty array of binding-name strings. pin/release require existing JavaScript identifiers. Profile names: 1-64 letters, numbers, dots, underscores or hyphens, starting with a letter or number.\n\nHooks must be self-contained fn(event), awaited when invoked. startup gets {type:\"startup\"} once per fresh kernel after restoration, not when pinned; Tools cannot run during startup. tool_result gets {type:\"tool_result\",toolName,input,status:\"success\"|\"error\",result?,error?} after nested tool settlement; handlers are awaited in name order and their tool calls do not retrigger hooks. Recreate imports and live handles inside the function. Startup failures block execution; unpin remains available. External side effects are not rolled back.\n\nRun management calls after exec returns. Inside exec, tools.notebook({}) returns help. tools.notebook({action,...}) supports status without query, list and diagnostics only. A blocked call returns the top-level retry. release/prune may restart the kernel for lexical bindings, clearing runtime-only handles. Normal cells allow one active execution. isolated:true runs a separate Deno kernel from committed saved state, up to four at once. Use wait to continue or terminate. Completion saves a named candidate without changing live state. list exposes candidates; load adds saved bindings by value and rejects collisions. Release or rename collisions first. Only checkpoint-supported state transfers, not arbitrary closures, types or imports. External tool and file effects remain shared. Inspect reported cleanup failures and restore notices. For failed state/helpers, diagnose, repair or prune, then verify recovery. restart restores completed state; reset discards only session state.\n\nReusable-global examples foo/bar are installed when neither name is occupied; inspect their .description and .usage before use.";
|
|
26
|
+
export declare function parseNotebookRequest(input: unknown): NotebookControlRequest;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { NotebookControlResult } from "./runtime-contract.ts";
|
|
2
|
+
import type { NotebookRuntimeHealthState } from "./runtime-health.ts";
|
|
3
|
+
interface NotebookDiagnostic {
|
|
4
|
+
cellId: string;
|
|
5
|
+
cellIndex: number;
|
|
6
|
+
line: number;
|
|
7
|
+
column: number;
|
|
8
|
+
endLine: number;
|
|
9
|
+
endColumn: number;
|
|
10
|
+
severity: "error" | "warning" | "information" | "hint" | "unknown";
|
|
11
|
+
code?: string | number | undefined;
|
|
12
|
+
source?: string | undefined;
|
|
13
|
+
name?: string | undefined;
|
|
14
|
+
message: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function parseDiagnosticReport(value: unknown, cell: {
|
|
17
|
+
id: string;
|
|
18
|
+
index: number;
|
|
19
|
+
source: string;
|
|
20
|
+
}, runtimeBindings: ReadonlySet<string>): NotebookDiagnostic[];
|
|
21
|
+
export declare function formatNotebookDiagnostics(path: string, cells: number, diagnostics: NotebookDiagnostic[], runtimeHealth?: NotebookRuntimeHealthState): NotebookControlResult;
|
|
22
|
+
export declare function formatRuntimeHealth(state: NotebookRuntimeHealthState): string;
|
|
23
|
+
export declare function boundText(value: string): string;
|
|
24
|
+
export declare function boundedDiagnosticResult(message: string, details: Record<string, unknown>): NotebookControlResult;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { NotebookControlResult } from "./runtime-contract.ts";
|
|
2
|
+
import type { NotebookRuntimeHealthState } from "./runtime-health.ts";
|
|
3
|
+
export declare function diagnoseNotebook(options: {
|
|
4
|
+
deno: string;
|
|
5
|
+
cwd: string;
|
|
6
|
+
path: string;
|
|
7
|
+
runtimeBindings?: ReadonlySet<string> | undefined;
|
|
8
|
+
runtimeHealth?: NotebookRuntimeHealthState | undefined;
|
|
9
|
+
signal?: AbortSignal | undefined;
|
|
10
|
+
}): Promise<NotebookControlResult>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function extractNotebookNpmImports(source: string): string[];
|
|
2
|
+
export declare function readNotebookNpmImports(identity: {
|
|
3
|
+
project: string;
|
|
4
|
+
agentDir: string;
|
|
5
|
+
}): string[];
|
|
6
|
+
export declare function recordNotebookNpmImports(identity: {
|
|
7
|
+
project: string;
|
|
8
|
+
agentDir: string;
|
|
9
|
+
}, imports: string[]): Promise<string[]>;
|
|
10
|
+
export declare function formatNotebookNpmImportsNotice(imports: string[]): string;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { ForwardedToolCall, ForwardedToolCalls, ForwardedToolStatus, } from "../../execution/src/forwarded-tools.ts";
|
|
2
|
+
export { parseForwardedToolCalls } from "../../execution/src/forwarded-tools.ts";
|
|
3
|
+
export type { ExecutionResultReceipt } from "../../execution/src/presentation.ts";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { DenoJupyterKernel } from "./jupyter-kernel.ts";
|
|
2
|
+
import type { NotebookControlResult, NotebookSessionContext, ToolExecutionContext } from "./runtime-contract.ts";
|
|
3
|
+
interface NotebookProfileHost {
|
|
4
|
+
kernel(): DenoJupyterKernel | undefined;
|
|
5
|
+
activeCellId(): string | undefined;
|
|
6
|
+
checkpoint(): Promise<void>;
|
|
7
|
+
markChanged(): void;
|
|
8
|
+
baselineNames(): ReadonlySet<string>;
|
|
9
|
+
profileStorage(): {
|
|
10
|
+
agentDir: string;
|
|
11
|
+
maxBytes: number;
|
|
12
|
+
};
|
|
13
|
+
rollback(context: NotebookSessionContext): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export declare class NotebookProfileController {
|
|
16
|
+
private readonly host;
|
|
17
|
+
constructor(host: NotebookProfileHost);
|
|
18
|
+
list(query: string | undefined): NotebookControlResult;
|
|
19
|
+
save(name: string, context: ToolExecutionContext, signal?: AbortSignal): Promise<NotebookControlResult>;
|
|
20
|
+
load(name: string, context: ToolExecutionContext, signal?: AbortSignal): Promise<NotebookControlResult>;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type ProjectStateEntry } from "./project-state-format.ts";
|
|
2
|
+
export declare const PROFILE_STATE_SCHEMA = 1;
|
|
3
|
+
export interface ProfileStateManifest {
|
|
4
|
+
schema: number;
|
|
5
|
+
name: string;
|
|
6
|
+
deno: string;
|
|
7
|
+
v8: string;
|
|
8
|
+
payload: string;
|
|
9
|
+
createdAt: string;
|
|
10
|
+
sourceProject: string;
|
|
11
|
+
entries: ProjectStateEntry[];
|
|
12
|
+
skipped: Array<{
|
|
13
|
+
name: string;
|
|
14
|
+
reason: string;
|
|
15
|
+
}>;
|
|
16
|
+
}
|
|
17
|
+
export interface ProfileStateSummary {
|
|
18
|
+
name: string;
|
|
19
|
+
createdAt: string;
|
|
20
|
+
sourceProject: string;
|
|
21
|
+
values: number;
|
|
22
|
+
definitions: number;
|
|
23
|
+
skipped: number;
|
|
24
|
+
}
|
|
25
|
+
export declare function profileStatePaths(name: string, agentDir: string): {
|
|
26
|
+
directory: string;
|
|
27
|
+
manifest: string;
|
|
28
|
+
lock: string;
|
|
29
|
+
};
|
|
30
|
+
export declare function profilesDirectory(agentDir: string): string;
|
|
31
|
+
export declare function assertProfileName(name: string): void;
|
|
32
|
+
export declare function readProfileStateManifest(path: string, expectedName?: string): ProfileStateManifest | undefined;
|
|
33
|
+
export declare function assertSafeProfileDirectory(directory: string, agentDir: string): void;
|
|
34
|
+
export declare function readProfileStatePayload(manifest: ProfileStateManifest, path: string, maxBytes: number): Buffer | undefined;
|
|
35
|
+
export declare function profileSummary(manifest: ProfileStateManifest): ProfileStateSummary;
|
|
36
|
+
export declare function hashProfileBytes(bytes: Uint8Array): string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { DenoJupyterKernel } from "./jupyter-kernel.ts";
|
|
2
|
+
import { type ProfileStateSummary } from "./profile-state-format.ts";
|
|
3
|
+
export declare function saveNotebookProfile(options: {
|
|
4
|
+
name: string;
|
|
5
|
+
kernel: DenoJupyterKernel;
|
|
6
|
+
project: string;
|
|
7
|
+
agentDir: string;
|
|
8
|
+
baselineNames: ReadonlySet<string>;
|
|
9
|
+
maxBytes: number;
|
|
10
|
+
signal?: AbortSignal | undefined;
|
|
11
|
+
}): Promise<ProfileStateSummary>;
|
|
12
|
+
export declare function loadNotebookProfile(options: {
|
|
13
|
+
name: string;
|
|
14
|
+
kernel: DenoJupyterKernel;
|
|
15
|
+
agentDir: string;
|
|
16
|
+
baselineNames: ReadonlySet<string>;
|
|
17
|
+
maxBytes: number;
|
|
18
|
+
signal?: AbortSignal | undefined;
|
|
19
|
+
}): Promise<{
|
|
20
|
+
summary: ProfileStateSummary;
|
|
21
|
+
loaded: string[];
|
|
22
|
+
collisions: string[];
|
|
23
|
+
}>;
|
|
24
|
+
export declare function listNotebookProfiles(agentDir: string): ProfileStateSummary[];
|
|
25
|
+
export declare function notebookProfileBindingNames(name: string | undefined, agentDir: string, maxBytes: number): string[];
|
|
26
|
+
export declare class NotebookProfileRestoreError extends Error {
|
|
27
|
+
constructor(message: string, options?: ErrorOptions);
|
|
28
|
+
}
|
|
29
|
+
export declare function withProfileLock<T>(path: string, operation: () => Promise<T>, signal?: AbortSignal): Promise<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function resolveNotebookProject(cwd: string): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { projectStatePaths } from "./project-state-files.ts";
|
|
2
|
+
import { type ProjectStateBaseline, type ProjectStateCandidate, type ProjectStateManifest } from "./project-state-format.ts";
|
|
3
|
+
import { type ProjectStatePinUpdate } from "./project-state-merge.ts";
|
|
4
|
+
export declare function unpinProjectStateBindings(identity: {
|
|
5
|
+
project: string;
|
|
6
|
+
agentDir: string;
|
|
7
|
+
}, names: string[], signal?: AbortSignal): Promise<void>;
|
|
8
|
+
export declare function commitProjectStateCandidate(options: {
|
|
9
|
+
paths: ReturnType<typeof projectStatePaths>;
|
|
10
|
+
identity: {
|
|
11
|
+
project: string;
|
|
12
|
+
session: string;
|
|
13
|
+
};
|
|
14
|
+
baseline: ProjectStateBaseline;
|
|
15
|
+
candidate: ProjectStateCandidate;
|
|
16
|
+
candidatePayload: Buffer;
|
|
17
|
+
maxBytes: number;
|
|
18
|
+
pins?: ProjectStatePinUpdate | undefined;
|
|
19
|
+
}): Promise<{
|
|
20
|
+
manifest?: ProjectStateManifest | undefined;
|
|
21
|
+
baseline: ProjectStateBaseline;
|
|
22
|
+
conflicts: string[];
|
|
23
|
+
}>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ProjectStateMerge } from "./project-state-merge.ts";
|
|
2
|
+
export declare function writeProjectConflict(directory: string, identity: {
|
|
3
|
+
project: string;
|
|
4
|
+
session: string;
|
|
5
|
+
}, merged: ProjectStateMerge): void;
|
|
6
|
+
export declare function listProjectConflicts(directory: string): string[];
|
|
7
|
+
export declare function removeResolvedProjectConflicts(directory: string, names: ReadonlySet<string>): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ProjectStateCandidate, type ProjectStateManifest } from "./project-state-format.ts";
|
|
2
|
+
export declare function projectStatePaths(project: string, agentDir: string): {
|
|
3
|
+
directory: string;
|
|
4
|
+
manifest: string;
|
|
5
|
+
lock: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function readProjectStateManifest(path: string): ProjectStateManifest | undefined;
|
|
8
|
+
export declare function readProjectStateCandidate(manifestPath: string, payloadPath: string, maxBytes: number): ProjectStateCandidate | undefined;
|
|
9
|
+
export declare function readProjectStatePayload(manifest: ProjectStateManifest, path: string, maxBytes: number): Buffer | undefined;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { NotebookHook } from "./runtime-contract.ts";
|
|
2
|
+
export declare const PROJECT_STATE_SCHEMA = 2;
|
|
3
|
+
export declare const MAX_PROJECT_ENTRIES = 10000;
|
|
4
|
+
export declare const MAX_PROJECT_NAME_BYTES: number;
|
|
5
|
+
export declare const MAX_PROJECT_MANIFEST_BYTES: number;
|
|
6
|
+
export declare const MAX_PROJECT_DESCRIPTION_BYTES = 256;
|
|
7
|
+
export declare const MAX_PROJECT_USAGE_BYTES = 512;
|
|
8
|
+
export declare const MAX_PROJECT_USAGE_LINES = 4;
|
|
9
|
+
export interface ProjectStateEntry {
|
|
10
|
+
name: string;
|
|
11
|
+
kind: "value" | "function";
|
|
12
|
+
offset: number;
|
|
13
|
+
length: number;
|
|
14
|
+
hash: string;
|
|
15
|
+
description?: string | undefined;
|
|
16
|
+
usage?: string | undefined;
|
|
17
|
+
updatedAt?: string | undefined;
|
|
18
|
+
pinned?: true | undefined;
|
|
19
|
+
hook?: NotebookHook | undefined;
|
|
20
|
+
}
|
|
21
|
+
export interface ProjectBindingMetadata {
|
|
22
|
+
description?: string | undefined;
|
|
23
|
+
usage?: string | undefined;
|
|
24
|
+
}
|
|
25
|
+
export interface ProjectStateManifest {
|
|
26
|
+
schema: number;
|
|
27
|
+
project: string;
|
|
28
|
+
generation: string;
|
|
29
|
+
parentGeneration?: string | undefined;
|
|
30
|
+
deno: string;
|
|
31
|
+
v8: string;
|
|
32
|
+
payload: string;
|
|
33
|
+
createdAt: string;
|
|
34
|
+
sourceSession: string;
|
|
35
|
+
entries: ProjectStateEntry[];
|
|
36
|
+
skipped: Array<{
|
|
37
|
+
name: string;
|
|
38
|
+
reason: string;
|
|
39
|
+
}>;
|
|
40
|
+
}
|
|
41
|
+
export interface ProjectStateCandidate {
|
|
42
|
+
deno: string;
|
|
43
|
+
v8: string;
|
|
44
|
+
entries: Array<Omit<ProjectStateEntry, "hash">>;
|
|
45
|
+
skipped: Array<{
|
|
46
|
+
name: string;
|
|
47
|
+
reason: string;
|
|
48
|
+
}>;
|
|
49
|
+
}
|
|
50
|
+
export interface ProjectStateBaseline {
|
|
51
|
+
generation: string;
|
|
52
|
+
entries: Array<{
|
|
53
|
+
name: string;
|
|
54
|
+
hash: string;
|
|
55
|
+
} & ProjectBindingMetadata>;
|
|
56
|
+
}
|
|
57
|
+
export interface ProjectStateSummary {
|
|
58
|
+
baseline: ProjectStateBaseline;
|
|
59
|
+
restored: ProjectStateEntry[];
|
|
60
|
+
skipped: Array<{
|
|
61
|
+
name: string;
|
|
62
|
+
reason: string;
|
|
63
|
+
}>;
|
|
64
|
+
conflicts: string[];
|
|
65
|
+
message?: string | undefined;
|
|
66
|
+
}
|
|
67
|
+
export interface ProjectConflictRecord {
|
|
68
|
+
names: string[];
|
|
69
|
+
payload?: string | undefined;
|
|
70
|
+
}
|
|
71
|
+
export declare function baselineFromProjectManifest(manifest: ProjectStateManifest): ProjectStateBaseline;
|
|
72
|
+
export declare function emptyProjectStateSummary(): ProjectStateSummary;
|
|
73
|
+
export declare function hashStateBytes(bytes: Uint8Array): string;
|
|
74
|
+
export declare function parseEntry(value: unknown, payloadLength: number, requireHash: boolean): ProjectStateEntry | Omit<ProjectStateEntry, "hash"> | undefined;
|
|
75
|
+
export declare function parseProjectBindingMetadata(value: Record<string, unknown>): ProjectBindingMetadata | undefined;
|
|
76
|
+
export declare function parseSkipped(value: unknown): {
|
|
77
|
+
name: string;
|
|
78
|
+
reason: string;
|
|
79
|
+
} | undefined;
|
|
80
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function withProjectStateLock<T>(path: string, operation: () => Promise<T>, signal?: AbortSignal): Promise<T>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ProjectStateBaseline, type ProjectStateCandidate, type ProjectStateEntry, type ProjectStateManifest } from "./project-state-format.ts";
|
|
2
|
+
import type { NotebookHook } from "./runtime-contract.ts";
|
|
3
|
+
export interface ProjectStateMerge {
|
|
4
|
+
changed: boolean;
|
|
5
|
+
baseline: ProjectStateBaseline;
|
|
6
|
+
entries: ProjectStateEntry[];
|
|
7
|
+
payload: Buffer;
|
|
8
|
+
conflicts: string[];
|
|
9
|
+
appliedNames: string[];
|
|
10
|
+
conflictEntries: ProjectStateEntry[];
|
|
11
|
+
conflictDeletions: string[];
|
|
12
|
+
conflictPayload: Buffer;
|
|
13
|
+
}
|
|
14
|
+
export interface ProjectStatePinUpdate {
|
|
15
|
+
names: readonly string[];
|
|
16
|
+
pinned: boolean;
|
|
17
|
+
hook?: NotebookHook | false | undefined;
|
|
18
|
+
}
|
|
19
|
+
export declare function mergeProjectState(options: {
|
|
20
|
+
baseline: ProjectStateBaseline;
|
|
21
|
+
current?: ProjectStateManifest | undefined;
|
|
22
|
+
candidate: ProjectStateCandidate;
|
|
23
|
+
candidatePayload: Buffer;
|
|
24
|
+
currentPayload: Buffer;
|
|
25
|
+
pins?: ProjectStatePinUpdate | undefined;
|
|
26
|
+
}): ProjectStateMerge;
|
|
27
|
+
export declare function projectStateEntryFingerprint(entry: {
|
|
28
|
+
hash?: string | undefined;
|
|
29
|
+
description?: string | undefined;
|
|
30
|
+
usage?: string | undefined;
|
|
31
|
+
} | undefined): string | undefined;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ProjectStateEntry, type ProjectStateSummary } from "./project-state-format.ts";
|
|
2
|
+
export interface RetainedProjectBinding {
|
|
3
|
+
name: string;
|
|
4
|
+
kind: ProjectStateEntry["kind"];
|
|
5
|
+
bytes: number;
|
|
6
|
+
updatedAt: string;
|
|
7
|
+
pinned: boolean;
|
|
8
|
+
hook?: ProjectStateEntry["hook"];
|
|
9
|
+
description?: string | undefined;
|
|
10
|
+
usage?: string | undefined;
|
|
11
|
+
}
|
|
12
|
+
export declare function readRetainedProjectBindings(identity: {
|
|
13
|
+
project: string;
|
|
14
|
+
agentDir: string;
|
|
15
|
+
}, maxBytes: number): RetainedProjectBinding[];
|
|
16
|
+
export declare function projectStateBindingNames(identity: {
|
|
17
|
+
project: string;
|
|
18
|
+
agentDir: string;
|
|
19
|
+
}, maxBytes: number): string[];
|
|
20
|
+
export declare function formatProjectStateNotice(summary: ProjectStateSummary): string | undefined;
|