opencode-ipynb 0.1.2 → 3.0.0
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/CHANGELOG.md +187 -0
- package/README.md +197 -41
- package/dist/domain/cell.d.ts +4 -3
- package/dist/domain/errors.d.ts +3 -31
- package/dist/domain/execution.d.ts +4 -1
- package/dist/domain/notebook.d.ts +6 -3
- package/dist/domain/output.d.ts +0 -1
- package/dist/format/diagnostics.d.ts +0 -1
- package/dist/format/markdown.d.ts +1 -2
- package/dist/format/{diff.d.ts → notebook.d.ts} +1 -1
- package/dist/format/outputs.d.ts +2 -2
- package/dist/index.d.ts +3 -1
- package/dist/index.js +11294 -28152
- package/dist/load-document.d.ts +10 -0
- package/dist/lsp.d.ts +58 -0
- package/dist/lsp.js +172 -0
- package/dist/notebook-diagnostics.d.ts +52 -0
- package/dist/notebook-hooks.d.ts +18 -0
- package/dist/plugin-options.d.ts +4 -1
- package/dist/plugin-v2.d.ts +31 -0
- package/dist/plugin.d.ts +2 -3
- package/dist/registrations.d.ts +5 -0
- package/dist/rpc.d.ts +134 -0
- package/dist/rpc.js +84 -0
- package/dist/services/KernelManager.d.ts +45 -0
- package/dist/services/NotebookCleanService.d.ts +7 -7
- package/dist/services/NotebookEditService.d.ts +15 -12
- package/dist/services/NotebookExecutionService.d.ts +41 -12
- package/dist/services/NotebookExportService.d.ts +3 -7
- package/dist/services/NotebookFileService.d.ts +31 -16
- package/dist/services/NotebookInspectService.d.ts +15 -19
- package/dist/services/NotebookOutputService.d.ts +7 -10
- package/dist/services/NotebookReadService.d.ts +4 -10
- package/dist/services/PathService.d.ts +10 -8
- package/dist/services/PermissionService.d.ts +13 -8
- package/dist/services/PythonService.d.ts +14 -43
- package/dist/services/index.d.ts +23 -28
- package/dist/services/revision.d.ts +9 -0
- package/dist/tool.d.ts +45 -0
- package/dist/tools/_readPermission.d.ts +2 -0
- package/dist/tools/_resolveOptions.d.ts +13 -2
- package/dist/tools/cell_delete.d.ts +4 -13
- package/dist/tools/cell_insert.d.ts +10 -21
- package/dist/tools/cell_move.d.ts +5 -15
- package/dist/tools/clean.d.ts +8 -21
- package/dist/tools/doctor.d.ts +3 -11
- package/dist/tools/edit.d.ts +10 -21
- package/dist/tools/export.d.ts +12 -23
- package/dist/tools/inspect.d.ts +7 -19
- package/dist/tools/kernel.d.ts +13 -21
- package/dist/tools/lsp.d.ts +9 -0
- package/dist/tools/outputs.d.ts +15 -29
- package/dist/tools/read.d.ts +12 -29
- package/dist/tools/repro.d.ts +6 -14
- package/dist/tools/run.d.ts +17 -34
- package/dist/utils/ansi.d.ts +1 -1
- package/dist/utils/atomic-replace.d.ts +2 -0
- package/dist/utils/attachments.d.ts +2 -3
- package/dist/utils/execution-order.d.ts +7 -0
- package/dist/utils/fence.d.ts +1 -0
- package/dist/utils/i18n.d.ts +1 -2
- package/dist/utils/imports.d.ts +0 -1
- package/dist/utils/json-patch.d.ts +58 -0
- package/dist/utils/json.d.ts +16 -2
- package/dist/utils/limits.d.ts +11 -2
- package/dist/utils/markdown-safe.d.ts +2 -0
- package/dist/utils/metadata.d.ts +2 -0
- package/dist/utils/mime.d.ts +1 -1
- package/dist/utils/paths.d.ts +2 -2
- package/dist/utils/realpath.d.ts +1 -0
- package/dist/utils/rename-hook.d.ts +6 -0
- package/dist/utils/truncate.d.ts +0 -1
- package/dist/utils/warnings.d.ts +15 -0
- package/dist/utils/windows.d.ts +3 -0
- package/dist/virtual-materialize.d.ts +25 -0
- package/package.json +30 -18
- package/python/ipynb_runner.py +418 -31
- package/python/requirements.txt +5 -4
- package/server.js +3 -0
- package/dist/domain/cell.d.ts.map +0 -1
- package/dist/domain/errors.d.ts.map +0 -1
- package/dist/domain/execution.d.ts.map +0 -1
- package/dist/domain/notebook.d.ts.map +0 -1
- package/dist/domain/output.d.ts.map +0 -1
- package/dist/format/diagnostics.d.ts.map +0 -1
- package/dist/format/diff.d.ts.map +0 -1
- package/dist/format/markdown.d.ts.map +0 -1
- package/dist/format/outputs.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/plugin-options.d.ts.map +0 -1
- package/dist/plugin.d.ts.map +0 -1
- package/dist/services/DiffService.d.ts +0 -17
- package/dist/services/DiffService.d.ts.map +0 -1
- package/dist/services/NotebookCleanService.d.ts.map +0 -1
- package/dist/services/NotebookEditService.d.ts.map +0 -1
- package/dist/services/NotebookExecutionService.d.ts.map +0 -1
- package/dist/services/NotebookExportService.d.ts.map +0 -1
- package/dist/services/NotebookFileService.d.ts.map +0 -1
- package/dist/services/NotebookInspectService.d.ts.map +0 -1
- package/dist/services/NotebookOutputService.d.ts.map +0 -1
- package/dist/services/NotebookReadService.d.ts.map +0 -1
- package/dist/services/PathService.d.ts.map +0 -1
- package/dist/services/PermissionService.d.ts.map +0 -1
- package/dist/services/PythonService.d.ts.map +0 -1
- package/dist/services/index.d.ts.map +0 -1
- package/dist/tools/_resolveOptions.d.ts.map +0 -1
- package/dist/tools/cell_delete.d.ts.map +0 -1
- package/dist/tools/cell_insert.d.ts.map +0 -1
- package/dist/tools/cell_move.d.ts.map +0 -1
- package/dist/tools/clean.d.ts.map +0 -1
- package/dist/tools/doctor.d.ts.map +0 -1
- package/dist/tools/edit.d.ts.map +0 -1
- package/dist/tools/export.d.ts.map +0 -1
- package/dist/tools/inspect.d.ts.map +0 -1
- package/dist/tools/kernel.d.ts.map +0 -1
- package/dist/tools/outputs.d.ts.map +0 -1
- package/dist/tools/read.d.ts.map +0 -1
- package/dist/tools/repro.d.ts.map +0 -1
- package/dist/tools/run.d.ts.map +0 -1
- package/dist/utils/ansi.d.ts.map +0 -1
- package/dist/utils/attachments.d.ts.map +0 -1
- package/dist/utils/fiber.d.ts +0 -2
- package/dist/utils/fiber.d.ts.map +0 -1
- package/dist/utils/i18n.d.ts.map +0 -1
- package/dist/utils/imports.d.ts.map +0 -1
- package/dist/utils/json.d.ts.map +0 -1
- package/dist/utils/limits.d.ts.map +0 -1
- package/dist/utils/mime.d.ts.map +0 -1
- package/dist/utils/paths.d.ts.map +0 -1
- package/dist/utils/truncate.d.ts.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Effect } from "effect";
|
|
2
2
|
import { CellIndexOutOfBoundsError, NotebookNotFoundError, NotebookParseError, NotebookValidationError, NotebookWriteError, PathOutsideWorktreeError, PermissionDeniedError } from "../domain/errors.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import type { NotebookFileServiceShape, WriteMode } from "./NotebookFileService.js";
|
|
4
|
+
import type { PatchFailureReason } from "../utils/json.js";
|
|
5
|
+
import type { PathServiceShape } from "./PathService.js";
|
|
5
6
|
import { type PermissionServiceShape } from "./PermissionService.js";
|
|
6
|
-
import { type DiffServiceShape } from "./DiffService.js";
|
|
7
7
|
import { type NotebookRaw } from "../domain/notebook.js";
|
|
8
8
|
export interface EditRequest {
|
|
9
9
|
readonly cellIndex: number;
|
|
@@ -16,10 +16,10 @@ export interface EditResult {
|
|
|
16
16
|
readonly cellIndex: number;
|
|
17
17
|
readonly cellType: "code" | "markdown" | "raw";
|
|
18
18
|
readonly clearedOutputs: boolean;
|
|
19
|
-
readonly
|
|
20
|
-
readonly oldPreview: string;
|
|
21
|
-
readonly newPreview: string;
|
|
19
|
+
readonly changed: boolean;
|
|
22
20
|
readonly notebook: NotebookRaw;
|
|
21
|
+
readonly writeMode: WriteMode | undefined;
|
|
22
|
+
readonly writeModeReason?: PatchFailureReason | undefined;
|
|
23
23
|
}
|
|
24
24
|
export interface InsertResult {
|
|
25
25
|
readonly displayPath: string;
|
|
@@ -28,6 +28,8 @@ export interface InsertResult {
|
|
|
28
28
|
readonly cellType: "code" | "markdown" | "raw";
|
|
29
29
|
readonly totalCells: number;
|
|
30
30
|
readonly preview: string;
|
|
31
|
+
readonly writeMode: WriteMode;
|
|
32
|
+
readonly writeModeReason?: PatchFailureReason | undefined;
|
|
31
33
|
}
|
|
32
34
|
export interface DeleteResult {
|
|
33
35
|
readonly displayPath: string;
|
|
@@ -36,13 +38,18 @@ export interface DeleteResult {
|
|
|
36
38
|
readonly deletedType: "code" | "markdown" | "raw";
|
|
37
39
|
readonly deletedPreview: string;
|
|
38
40
|
readonly totalCells: number;
|
|
41
|
+
readonly writeMode: WriteMode;
|
|
42
|
+
readonly writeModeReason?: PatchFailureReason | undefined;
|
|
39
43
|
}
|
|
40
44
|
export interface MoveResult {
|
|
41
45
|
readonly displayPath: string;
|
|
42
46
|
readonly absPath: string;
|
|
43
47
|
readonly fromIndex: number;
|
|
44
48
|
readonly toIndex: number;
|
|
49
|
+
readonly cellType: CellType;
|
|
45
50
|
readonly totalCells: number;
|
|
51
|
+
readonly writeMode: WriteMode | undefined;
|
|
52
|
+
readonly writeModeReason?: PatchFailureReason | undefined;
|
|
46
53
|
}
|
|
47
54
|
export type CellType = "code" | "markdown" | "raw";
|
|
48
55
|
export type EditCellError = NotebookNotFoundError | NotebookParseError | NotebookValidationError | CellIndexOutOfBoundsError | NotebookWriteError | PathOutsideWorktreeError | PermissionDeniedError;
|
|
@@ -55,9 +62,5 @@ export interface NotebookEditServiceShape {
|
|
|
55
62
|
readonly deleteCell: (filePath: string, cellIndex: number) => Effect.Effect<DeleteResult, NotebookNotFoundError | NotebookParseError | NotebookValidationError | CellIndexOutOfBoundsError | NotebookWriteError | PathOutsideWorktreeError | PermissionDeniedError>;
|
|
56
63
|
readonly moveCell: (filePath: string, fromIndex: number, toIndex: number) => Effect.Effect<MoveResult, NotebookNotFoundError | NotebookParseError | NotebookValidationError | CellIndexOutOfBoundsError | NotebookWriteError | PathOutsideWorktreeError | PermissionDeniedError>;
|
|
57
64
|
}
|
|
58
|
-
declare const
|
|
59
|
-
export declare class NotebookEditService extends NotebookEditService_base {
|
|
60
|
-
}
|
|
61
|
-
declare const makeEditImpl: (pathSvc: PathServiceShape, fileSvc: NotebookFileServiceShape, diffSvc: DiffServiceShape, permSvc: PermissionServiceShape) => NotebookEditServiceShape;
|
|
65
|
+
declare const makeEditImpl: (pathSvc: PathServiceShape, fileSvc: NotebookFileServiceShape, permSvc: PermissionServiceShape) => NotebookEditServiceShape;
|
|
62
66
|
export { makeEditImpl };
|
|
63
|
-
//# sourceMappingURL=NotebookEditService.d.ts.map
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type NotebookError } from "../domain/errors.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { CellIndexOutOfBoundsError, type NotebookError } from "../domain/errors.js";
|
|
3
|
+
import type { NotebookFileServiceShape } from "./NotebookFileService.js";
|
|
4
|
+
import type { PathServiceShape } from "./PathService.js";
|
|
5
|
+
import type { PatchFailureReason, WriteMode } from "../utils/json.js";
|
|
5
6
|
import { type PermissionServiceShape } from "./PermissionService.js";
|
|
6
|
-
import { type
|
|
7
|
-
import {
|
|
7
|
+
import { type PythonServiceShape } from "./PythonService.js";
|
|
8
|
+
import type { KernelManagerShape } from "./KernelManager.js";
|
|
9
|
+
import type { CellRaw, CodeCellRaw } from "../domain/cell.js";
|
|
8
10
|
import type { RunResponse, CellExecutionSummary, EnvReport } from "../domain/execution.js";
|
|
9
11
|
import { type TruncationHintKey } from "../utils/i18n.js";
|
|
12
|
+
import { type NotebookRaw } from "../domain/notebook.js";
|
|
13
|
+
import { type Warning, type WarningSink } from "../utils/warnings.js";
|
|
10
14
|
export type ExecutionMode = "cell" | "range" | "all" | "from";
|
|
11
15
|
export interface ExecutionRequest {
|
|
12
16
|
readonly mode: ExecutionMode;
|
|
@@ -22,33 +26,58 @@ export interface ExecutionRequest {
|
|
|
22
26
|
export interface ExecutionResult {
|
|
23
27
|
readonly displayPath: string;
|
|
24
28
|
readonly absPath: string;
|
|
29
|
+
readonly kernelPath: string;
|
|
25
30
|
readonly executedCells: ReadonlyArray<number>;
|
|
26
31
|
readonly durationMs: number;
|
|
27
32
|
readonly saved: boolean;
|
|
28
33
|
readonly response: RunResponse;
|
|
34
|
+
readonly warnings?: ReadonlyArray<Warning>;
|
|
35
|
+
readonly writeMode?: WriteMode | undefined;
|
|
36
|
+
readonly writeModeReason?: PatchFailureReason | undefined;
|
|
29
37
|
}
|
|
30
38
|
export interface NotebookExecutionServiceShape {
|
|
31
|
-
readonly execute: (filePath: string, request: ExecutionRequest
|
|
39
|
+
readonly execute: (filePath: string, request: ExecutionRequest, options?: {
|
|
40
|
+
readonly signal?: AbortSignal;
|
|
41
|
+
readonly warningSink?: WarningSink;
|
|
42
|
+
}) => Effect.Effect<ExecutionResult, NotebookError>;
|
|
32
43
|
readonly reportEnv: (filePath: string, options?: ReportEnvOptions) => Effect.Effect<EnvReport, NotebookError>;
|
|
33
44
|
}
|
|
34
45
|
export interface ReportEnvOptions {
|
|
35
46
|
readonly timeoutMs?: number | undefined;
|
|
47
|
+
readonly signal?: AbortSignal | undefined;
|
|
48
|
+
readonly skipShellPermission?: boolean | undefined;
|
|
49
|
+
readonly warningSink?: WarningSink | undefined;
|
|
36
50
|
}
|
|
37
51
|
export interface ExecutionOptions {
|
|
38
52
|
readonly kernelManager?: KernelManagerShape | undefined;
|
|
39
53
|
readonly warmKernel: boolean;
|
|
40
54
|
readonly defaultTimeoutMs: number;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
export declare class NotebookExecutionService extends NotebookExecutionService_base {
|
|
55
|
+
readonly pythonPath?: string | undefined;
|
|
56
|
+
readonly warningSink?: WarningSink | undefined;
|
|
44
57
|
}
|
|
45
58
|
declare const truncateText: (text: string | undefined, maxChars: number, locale?: string, hintKey?: TruncationHintKey) => string | undefined;
|
|
46
59
|
declare const truncateTraceback: (tb: ReadonlyArray<string>, maxChars: number) => ReadonlyArray<string>;
|
|
60
|
+
export declare const cellSummaryChars: (summary: CellExecutionSummary) => number;
|
|
47
61
|
declare const truncateCellSummary: (summary: CellExecutionSummary, maxOutputChars: number) => CellExecutionSummary;
|
|
48
62
|
declare const truncateRunResponse: (response: RunResponse, maxOutputChars: number) => RunResponse;
|
|
63
|
+
export type TextShape = "arrays" | "strings";
|
|
64
|
+
export declare const textShapeOfCell: (cell: CellRaw, fallback: TextShape) => TextShape;
|
|
65
|
+
export interface OutputTextShapes {
|
|
66
|
+
readonly text: TextShape | undefined;
|
|
67
|
+
readonly data: ReadonlyMap<string, TextShape>;
|
|
68
|
+
}
|
|
69
|
+
export type CellValueShapes = ReadonlyArray<OutputTextShapes>;
|
|
70
|
+
export declare const captureValueShapes: (cell: CellRaw) => CellValueShapes;
|
|
71
|
+
export declare const restoreValueShapes: (outputs: ReadonlyArray<Record<string, unknown>>, previous: CellValueShapes | undefined, cellShape: TextShape) => Array<Record<string, unknown>>;
|
|
72
|
+
export declare const notebookTextShape: (notebook: NotebookRaw) => TextShape;
|
|
73
|
+
export declare const notebookUsesLineArrays: (notebook: NotebookRaw) => boolean;
|
|
49
74
|
export declare const buildPersistedOutputs: (summary: CellExecutionSummary) => Array<Record<string, unknown>>;
|
|
75
|
+
export interface MergeShapeInputs {
|
|
76
|
+
readonly fallback: TextShape;
|
|
77
|
+
readonly beforeShapes: ReadonlyMap<number, TextShape> | undefined;
|
|
78
|
+
readonly beforeValueShapes: ReadonlyMap<number, CellValueShapes> | undefined;
|
|
79
|
+
}
|
|
80
|
+
export declare const mergeExecutedOutputs: (filePath: string, cells: ReadonlyArray<CellRaw>, executedCells: ReadonlyArray<number>, summaries: ReadonlyArray<CellExecutionSummary>, shapes: MergeShapeInputs) => Effect.Effect<Map<number, CodeCellRaw>, CellIndexOutOfBoundsError>;
|
|
50
81
|
declare const makeExecutionImpl: (pathSvc: PathServiceShape, fileSvc: NotebookFileServiceShape, permSvc: PermissionServiceShape, pythonSvc: PythonServiceShape, execOpts?: ExecutionOptions) => NotebookExecutionServiceShape;
|
|
51
82
|
export { makeExecutionImpl };
|
|
52
|
-
export { cellSource };
|
|
53
83
|
export { truncateText, truncateTraceback, truncateCellSummary, truncateRunResponse };
|
|
54
|
-
//# sourceMappingURL=NotebookExecutionService.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Effect } from "effect";
|
|
2
2
|
import { NotebookNotFoundError, NotebookParseError, NotebookValidationError, NotebookWriteError, PathOutsideWorktreeError, PermissionDeniedError } from "../domain/errors.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import type { NotebookFileServiceShape } from "./NotebookFileService.js";
|
|
4
|
+
import type { PathServiceShape } from "./PathService.js";
|
|
5
5
|
import { type PermissionServiceShape } from "./PermissionService.js";
|
|
6
6
|
import { DEFAULT_MAX_EXPORT_CHARS } from "../utils/limits.js";
|
|
7
7
|
export type ExportFormat = "markdown" | "python" | "summary";
|
|
@@ -24,10 +24,6 @@ export interface ExportResult {
|
|
|
24
24
|
export interface NotebookExportServiceShape {
|
|
25
25
|
readonly export: (filePath: string, options: ExportOptions) => Effect.Effect<ExportResult, NotebookNotFoundError | NotebookParseError | NotebookValidationError | NotebookWriteError | PathOutsideWorktreeError | PermissionDeniedError>;
|
|
26
26
|
}
|
|
27
|
-
declare const NotebookExportService_base: Context.TagClass<NotebookExportService, "@ipynb/NotebookExportService", NotebookExportServiceShape>;
|
|
28
|
-
export declare class NotebookExportService extends NotebookExportService_base {
|
|
29
|
-
}
|
|
30
27
|
declare const makeExportImpl: (pathSvc: PathServiceShape, fileSvc: NotebookFileServiceShape, permSvc: PermissionServiceShape) => NotebookExportServiceShape;
|
|
31
28
|
export { makeExportImpl };
|
|
32
29
|
export { DEFAULT_MAX_EXPORT_CHARS };
|
|
33
|
-
//# sourceMappingURL=NotebookExportService.d.ts.map
|
|
@@ -1,18 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
readonly
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { NotebookNotFoundError, NotebookParseError, NotebookValidationError, NotebookWriteError, PathOutsideWorktreeError } from "../domain/errors.js";
|
|
3
|
+
import { type NotebookRaw } from "../domain/notebook.js";
|
|
4
|
+
import { type PatchFailureReason, type WriteMode } from "../utils/json.js";
|
|
5
|
+
import { type WarningSink } from "../utils/warnings.js";
|
|
6
|
+
export type { WriteMode };
|
|
7
|
+
export interface WriteOutcome {
|
|
8
|
+
readonly mode: WriteMode;
|
|
9
|
+
readonly reason?: PatchFailureReason | undefined;
|
|
10
|
+
}
|
|
11
|
+
import { type NotebookFormat } from "../utils/json.js";
|
|
12
|
+
export interface NotebookFileServiceOptions {
|
|
13
|
+
readonly worktree?: string;
|
|
14
|
+
readonly warningSink?: WarningSink | undefined;
|
|
15
|
+
readonly signal?: AbortSignal | undefined;
|
|
9
16
|
}
|
|
10
|
-
|
|
11
|
-
|
|
17
|
+
export interface NotebookFileServiceShape {
|
|
18
|
+
readonly read: (filePath: string) => Effect.Effect<NotebookRaw, NotebookNotFoundError | NotebookParseError | NotebookValidationError | PathOutsideWorktreeError>;
|
|
19
|
+
readonly readText: (filePath: string) => Effect.Effect<string, NotebookNotFoundError | NotebookParseError | NotebookValidationError | PathOutsideWorktreeError>;
|
|
20
|
+
readonly readWithText: (filePath: string) => Effect.Effect<{
|
|
21
|
+
readonly notebook: NotebookRaw;
|
|
22
|
+
readonly text: string;
|
|
23
|
+
readonly format: NotebookFormat;
|
|
24
|
+
}, NotebookNotFoundError | NotebookParseError | NotebookValidationError | PathOutsideWorktreeError>;
|
|
25
|
+
readonly writeAtomic: (filePath: string, notebook: NotebookRaw, options?: {
|
|
26
|
+
readonly noFollowFinal?: boolean;
|
|
27
|
+
readonly format?: NotebookFormat;
|
|
28
|
+
readonly previousText?: string;
|
|
29
|
+
readonly trusted?: boolean;
|
|
30
|
+
}) => Effect.Effect<WriteOutcome, NotebookParseError | NotebookValidationError | NotebookWriteError | PathOutsideWorktreeError>;
|
|
31
|
+
readonly withFileLock: <A, E, R>(filePath: string, program: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
12
32
|
}
|
|
13
|
-
export declare const makeNotebookFileService: () => NotebookFileServiceShape;
|
|
14
|
-
export { cellSource };
|
|
15
|
-
export declare const _schemas: {
|
|
16
|
-
readonly NotebookSchema: typeof NotebookSchema;
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=NotebookFileService.d.ts.map
|
|
33
|
+
export declare const makeNotebookFileService: (options?: NotebookFileServiceOptions) => NotebookFileServiceShape;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Effect } from "effect";
|
|
2
2
|
import { NotebookNotFoundError, NotebookParseError, NotebookValidationError, PathOutsideWorktreeError } from "../domain/errors.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import type { NotebookFileServiceShape } from "./NotebookFileService.js";
|
|
4
|
+
import type { PathServiceShape } from "./PathService.js";
|
|
5
5
|
import { type CellInspection } from "../format/diagnostics.js";
|
|
6
6
|
import type { NotebookRaw } from "../domain/notebook.js";
|
|
7
7
|
export interface InspectSummary {
|
|
@@ -25,9 +25,6 @@ export interface InspectOptions {
|
|
|
25
25
|
export interface NotebookInspectServiceShape {
|
|
26
26
|
readonly inspect: (filePath: string, options?: Partial<InspectOptions>) => Effect.Effect<InspectSummary, NotebookNotFoundError | NotebookParseError | NotebookValidationError | PathOutsideWorktreeError>;
|
|
27
27
|
}
|
|
28
|
-
declare const NotebookInspectService_base: Context.TagClass<NotebookInspectService, "@ipynb/NotebookInspectService", NotebookInspectServiceShape>;
|
|
29
|
-
export declare class NotebookInspectService extends NotebookInspectService_base {
|
|
30
|
-
}
|
|
31
28
|
export interface AnalyzeMissingPackagesOptions {
|
|
32
29
|
readonly pythonPath: string;
|
|
33
30
|
readonly checkImport: (pythonPath: string, module: string) => Effect.Effect<{
|
|
@@ -35,28 +32,27 @@ export interface AnalyzeMissingPackagesOptions {
|
|
|
35
32
|
available: boolean;
|
|
36
33
|
detail: string;
|
|
37
34
|
}, never>;
|
|
35
|
+
readonly checkImports?: (pythonPath: string, modules: ReadonlyArray<string>, signal?: AbortSignal) => Effect.Effect<ReadonlyArray<{
|
|
36
|
+
name: string;
|
|
37
|
+
available: boolean;
|
|
38
|
+
detail: string;
|
|
39
|
+
}>, never>;
|
|
40
|
+
readonly signal?: AbortSignal | undefined;
|
|
38
41
|
}
|
|
42
|
+
export declare const MAX_MISSING_PACKAGE_CHECKS = 500;
|
|
39
43
|
export declare const analyzeMissingPackages: (notebook: NotebookRaw, options: AnalyzeMissingPackagesOptions) => Effect.Effect<ReadonlyArray<string>, never>;
|
|
40
44
|
export declare const analyzeReproducibility: (notebook: NotebookRaw) => ReadonlyArray<string>;
|
|
41
|
-
export interface ExecutionOrderEntry {
|
|
42
|
-
readonly cellIndex: number;
|
|
43
|
-
readonly executionCount: number;
|
|
44
|
-
readonly previousCount: number;
|
|
45
|
-
}
|
|
46
|
-
export declare const analyzeExecutionOrder: (notebook: NotebookRaw) => ReadonlyArray<ExecutionOrderEntry>;
|
|
47
45
|
export declare const analyzeExecutionOrderWarnings: (notebook: NotebookRaw) => ReadonlyArray<string>;
|
|
48
46
|
declare const build: (pathSvc: PathServiceShape, fileSvc: NotebookFileServiceShape) => NotebookInspectServiceShape;
|
|
49
|
-
/**
|
|
50
|
-
* Standalone Effect: detect imports that the user's Python cannot resolve.
|
|
51
|
-
* Pass the result of `pythonSvc.probe()` for `pythonPath`; the analyzer skips
|
|
52
|
-
* itself when the probe says "none" (no Python on PATH).
|
|
53
|
-
*/
|
|
54
47
|
export declare const analyzeMissingPackagesForPython: (notebook: NotebookRaw, pythonPath: string, checkImport: (pythonPath: string, module: string) => Effect.Effect<{
|
|
55
48
|
name: string;
|
|
56
49
|
available: boolean;
|
|
57
50
|
detail: string;
|
|
58
|
-
}, never
|
|
51
|
+
}, never>, checkImports?: (pythonPath: string, modules: ReadonlyArray<string>, signal?: AbortSignal) => Effect.Effect<ReadonlyArray<{
|
|
52
|
+
name: string;
|
|
53
|
+
available: boolean;
|
|
54
|
+
detail: string;
|
|
55
|
+
}>, never>, signal?: AbortSignal) => Effect.Effect<ReadonlyArray<string>, never>;
|
|
59
56
|
export { build as makeInspectImpl };
|
|
60
57
|
export declare const formatInspectSummary: (summary: InspectSummary) => string;
|
|
61
58
|
export type { CellInspection };
|
|
62
|
-
//# sourceMappingURL=NotebookInspectService.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Effect } from "effect";
|
|
2
2
|
import { CellIndexOutOfBoundsError, NotebookNotFoundError, NotebookParseError, NotebookValidationError, NotebookWriteError, PathOutsideWorktreeError, PermissionDeniedError } from "../domain/errors.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import type { NotebookFileServiceShape } from "./NotebookFileService.js";
|
|
4
|
+
import type { PathServiceShape } from "./PathService.js";
|
|
5
5
|
import { type PermissionServiceShape } from "./PermissionService.js";
|
|
6
|
-
import {
|
|
6
|
+
import type { PatchFailureReason, WriteMode } from "../utils/json.js";
|
|
7
7
|
export type OutputOperation = "list" | "read" | "read_error" | "clear_cell" | "clear_all";
|
|
8
8
|
export interface OutputListEntry {
|
|
9
9
|
readonly cellIndex: number;
|
|
@@ -43,20 +43,17 @@ export interface ClearOutputsResult {
|
|
|
43
43
|
readonly clearedCells: number;
|
|
44
44
|
readonly removedOutputs: number;
|
|
45
45
|
readonly removedExecutionCounts: number;
|
|
46
|
+
readonly writeMode: WriteMode | undefined;
|
|
47
|
+
readonly writeModeReason?: PatchFailureReason | undefined;
|
|
46
48
|
}
|
|
47
49
|
export interface NotebookOutputServiceShape {
|
|
48
50
|
readonly listOutputs: (filePath: string, offset?: number | undefined, limit?: number | undefined) => Effect.Effect<ListOutputsResult, NotebookNotFoundError | NotebookParseError | NotebookValidationError | PathOutsideWorktreeError>;
|
|
49
51
|
readonly readOutputs: (filePath: string, request: OutputReadRequest) => Effect.Effect<OutputReadResult, NotebookNotFoundError | NotebookParseError | NotebookValidationError | CellIndexOutOfBoundsError | PathOutsideWorktreeError>;
|
|
50
|
-
readonly readError: (filePath: string, cellIndex: number) => Effect.Effect<OutputErrorResult, NotebookNotFoundError | NotebookParseError | NotebookValidationError | CellIndexOutOfBoundsError | PathOutsideWorktreeError>;
|
|
52
|
+
readonly readError: (filePath: string, cellIndex: number, maxOutputChars?: number) => Effect.Effect<OutputErrorResult, NotebookNotFoundError | NotebookParseError | NotebookValidationError | CellIndexOutOfBoundsError | PathOutsideWorktreeError>;
|
|
51
53
|
readonly clearCellOutputs: (filePath: string, cellIndex: number) => Effect.Effect<ClearOutputsResult, NotebookNotFoundError | NotebookParseError | NotebookValidationError | CellIndexOutOfBoundsError | NotebookWriteError | PathOutsideWorktreeError | PermissionDeniedError>;
|
|
52
54
|
readonly clearAllOutputs: (filePath: string) => Effect.Effect<ClearOutputsResult, NotebookNotFoundError | NotebookParseError | NotebookValidationError | NotebookWriteError | PathOutsideWorktreeError | PermissionDeniedError>;
|
|
53
55
|
}
|
|
54
56
|
export type ClearCellOutputsError = NotebookNotFoundError | NotebookParseError | NotebookValidationError | CellIndexOutOfBoundsError | NotebookWriteError | PathOutsideWorktreeError | PermissionDeniedError;
|
|
55
57
|
export type ClearAllOutputsError = NotebookNotFoundError | NotebookParseError | NotebookValidationError | NotebookWriteError | PathOutsideWorktreeError | PermissionDeniedError;
|
|
56
|
-
declare const NotebookOutputService_base: Context.TagClass<NotebookOutputService, "@ipynb/NotebookOutputService", NotebookOutputServiceShape>;
|
|
57
|
-
export declare class NotebookOutputService extends NotebookOutputService_base {
|
|
58
|
-
}
|
|
59
58
|
declare const makeOutputImpl: (pathSvc: PathServiceShape, fileSvc: NotebookFileServiceShape, permSvc: PermissionServiceShape) => NotebookOutputServiceShape;
|
|
60
59
|
export { makeOutputImpl };
|
|
61
|
-
export { cellSource };
|
|
62
|
-
//# sourceMappingURL=NotebookOutputService.d.ts.map
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Effect } from "effect";
|
|
2
2
|
import { CellIndexOutOfBoundsError, NotebookNotFoundError, NotebookParseError, NotebookValidationError, PathOutsideWorktreeError } from "../domain/errors.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import type { ToolAttachment } from "@opencode-ai/plugin";
|
|
3
|
+
import type { NotebookFileServiceShape } from "./NotebookFileService.js";
|
|
4
|
+
import type { PathServiceShape } from "./PathService.js";
|
|
5
|
+
import type { ToolAttachment } from "../tool.js";
|
|
7
6
|
export interface ReadRangeRequest {
|
|
8
7
|
readonly cellIndex?: number | undefined;
|
|
9
8
|
readonly start?: number | undefined;
|
|
@@ -28,9 +27,4 @@ export interface NotebookReadServiceShape {
|
|
|
28
27
|
readonly readCell: (filePath: string, cellIndex: number, options?: Partial<ReadRangeRequest>) => Effect.Effect<ReadRangeResult, NotebookNotFoundError | NotebookParseError | NotebookValidationError | CellIndexOutOfBoundsError | PathOutsideWorktreeError>;
|
|
29
28
|
readonly readRange: (filePath: string, start: number, end: number, options?: Partial<ReadRangeRequest>) => Effect.Effect<ReadRangeResult, NotebookNotFoundError | NotebookParseError | NotebookValidationError | CellIndexOutOfBoundsError | PathOutsideWorktreeError>;
|
|
30
29
|
}
|
|
31
|
-
declare const NotebookReadService_base: Context.TagClass<NotebookReadService, "@ipynb/NotebookReadService", NotebookReadServiceShape>;
|
|
32
|
-
export declare class NotebookReadService extends NotebookReadService_base {
|
|
33
|
-
}
|
|
34
30
|
export declare const makeReadImpl: (pathSvc: PathServiceShape, fileSvc: NotebookFileServiceShape) => NotebookReadServiceShape;
|
|
35
|
-
export { cellSource };
|
|
36
|
-
//# sourceMappingURL=NotebookReadService.d.ts.map
|
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { type WarningSink } from "../utils/warnings.js";
|
|
3
|
+
import { NotebookNotFoundError, NotebookWriteError, PathOutsideWorktreeError } from "../domain/errors.js";
|
|
3
4
|
export interface PathEnv {
|
|
4
5
|
readonly directory: string;
|
|
5
6
|
readonly worktree: string;
|
|
6
7
|
readonly platform: NodeJS.Platform;
|
|
7
8
|
readonly allowOutsideWorktree?: boolean | undefined;
|
|
8
9
|
}
|
|
10
|
+
export interface PathServiceOptions extends PathEnv {
|
|
11
|
+
readonly warningSink?: WarningSink | undefined;
|
|
12
|
+
}
|
|
9
13
|
export interface PathServiceShape {
|
|
10
14
|
readonly env: PathEnv;
|
|
11
15
|
readonly resolve: (inputPath: string) => Effect.Effect<string, never>;
|
|
12
16
|
readonly relative: (absPath: string) => Effect.Effect<string, never>;
|
|
13
17
|
readonly ensureInsideWorktree: (absPath: string) => Effect.Effect<void, PathOutsideWorktreeError>;
|
|
14
18
|
readonly ensureExists: (absPath: string) => Effect.Effect<void, NotebookNotFoundError>;
|
|
19
|
+
readonly writeFileSafe: (absPath: string, content: string, options?: {
|
|
20
|
+
readonly noFollowFinal?: boolean;
|
|
21
|
+
}) => Effect.Effect<void, PathOutsideWorktreeError | NotebookWriteError>;
|
|
15
22
|
readonly ensureIpynb: (absPath: string) => Effect.Effect<{
|
|
16
23
|
absPath: string;
|
|
17
24
|
warned: boolean;
|
|
18
25
|
}, never>;
|
|
19
26
|
readonly toDisplay: (absPath: string) => string;
|
|
20
27
|
}
|
|
21
|
-
declare const
|
|
22
|
-
export declare class PathService extends PathService_base {
|
|
23
|
-
}
|
|
24
|
-
export declare const makePathService: (env: PathEnv) => PathServiceShape;
|
|
25
|
-
export {};
|
|
26
|
-
//# sourceMappingURL=PathService.d.ts.map
|
|
28
|
+
export declare const makePathService: (options: PathServiceOptions) => PathServiceShape;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { ToolContext } from "
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import type { ToolContext } from "../tool.js";
|
|
3
3
|
import { PermissionDeniedError } from "../domain/errors.js";
|
|
4
|
-
|
|
4
|
+
import { type WarningSink } from "../utils/warnings.js";
|
|
5
|
+
export interface AliasResolutionOptions {
|
|
6
|
+
readonly warningSink?: WarningSink | undefined;
|
|
7
|
+
}
|
|
8
|
+
export declare const resolveDeepReal: (target: string, options?: AliasResolutionOptions) => Promise<string>;
|
|
9
|
+
export declare const permissionAliases: (filePath: string, bases?: ReadonlyArray<string>, options?: AliasResolutionOptions) => Promise<ReadonlyArray<string>>;
|
|
10
|
+
export type PermissionKind = "edit" | "shell" | "read";
|
|
5
11
|
export interface PermissionRequest {
|
|
6
12
|
readonly kind: PermissionKind;
|
|
7
13
|
readonly action: string;
|
|
@@ -11,10 +17,9 @@ export interface PermissionRequest {
|
|
|
11
17
|
}
|
|
12
18
|
export interface PermissionServiceShape {
|
|
13
19
|
readonly ask: (req: PermissionRequest) => Effect.Effect<void, PermissionDeniedError>;
|
|
20
|
+
readonly aliases: (filePath: string) => Effect.Effect<ReadonlyArray<string>, never>;
|
|
14
21
|
}
|
|
15
|
-
|
|
16
|
-
|
|
22
|
+
export interface PermissionServiceOptions {
|
|
23
|
+
readonly warningSink?: WarningSink | undefined;
|
|
17
24
|
}
|
|
18
|
-
export declare const makePermissionService: (ctx: ToolContext) => PermissionServiceShape;
|
|
19
|
-
export {};
|
|
20
|
-
//# sourceMappingURL=PermissionService.d.ts.map
|
|
25
|
+
export declare const makePermissionService: (ctx: ToolContext, options?: PermissionServiceOptions) => PermissionServiceShape;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { Effect
|
|
2
|
-
import {
|
|
3
|
-
import { type
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { PermissionDeniedError } from "../domain/errors.js";
|
|
3
|
+
import { type WarningSink } from "../utils/warnings.js";
|
|
4
|
+
export declare const helperSpawnEnv: () => NodeJS.ProcessEnv;
|
|
5
|
+
export declare const kernelEnvOverrides: () => Record<string, string> | undefined;
|
|
4
6
|
export interface PythonProbeResult {
|
|
5
7
|
readonly pythonPath: string;
|
|
6
8
|
readonly version: string;
|
|
@@ -24,57 +26,26 @@ export interface PythonServiceOptions {
|
|
|
24
26
|
readonly pythonPath: string | undefined;
|
|
25
27
|
readonly preferUv: boolean;
|
|
26
28
|
readonly helperRelativePath: string;
|
|
29
|
+
readonly pythonSource?: "options" | "env" | undefined;
|
|
30
|
+
}
|
|
31
|
+
export interface ProbeOptions {
|
|
32
|
+
readonly warningSink?: WarningSink | undefined;
|
|
27
33
|
}
|
|
28
34
|
export interface PythonServiceShape {
|
|
29
|
-
readonly probe: () => Effect.Effect<PythonProbeResult, never>;
|
|
35
|
+
readonly probe: (options?: ProbeOptions) => Effect.Effect<PythonProbeResult, never>;
|
|
30
36
|
readonly candidates: () => Effect.Effect<ReadonlyArray<PythonProbeResult>, never>;
|
|
31
37
|
readonly checkDependencies: (pythonPath: string) => Effect.Effect<ReadonlyArray<DependencyCheck>, never>;
|
|
32
38
|
readonly checkImport: (pythonPath: string, module: string) => Effect.Effect<DependencyCheck, never>;
|
|
39
|
+
readonly checkImports?: (pythonPath: string, modules: ReadonlyArray<string>, signal?: AbortSignal) => Effect.Effect<ReadonlyArray<DependencyCheck>, never>;
|
|
33
40
|
readonly findHelper: () => Effect.Effect<string | undefined, never>;
|
|
34
|
-
readonly doctor: () => Effect.Effect<PythonDoctor,
|
|
41
|
+
readonly doctor: (beforeDependencies?: (selected: PythonProbeResult) => Effect.Effect<void, PermissionDeniedError>) => Effect.Effect<PythonDoctor, PermissionDeniedError>;
|
|
35
42
|
}
|
|
36
43
|
export interface _PythonServiceForTest {
|
|
37
44
|
readonly _invalidateDepsCache: (pythonPath?: string) => void;
|
|
38
45
|
}
|
|
39
|
-
declare const PythonService_base: Context.TagClass<PythonService, "@ipynb/PythonService", PythonServiceShape>;
|
|
40
|
-
export declare class PythonService extends PythonService_base {
|
|
41
|
-
}
|
|
42
46
|
declare const REQUIRED_DEPS: readonly ["nbformat", "nbclient", "jupyter_client", "ipykernel"];
|
|
47
|
+
export declare const pythonInterpreterResources: (configured?: string) => ReadonlyArray<string>;
|
|
48
|
+
export declare const pathPythonCandidates: () => ReadonlyArray<string>;
|
|
43
49
|
declare const findHelper: (rel: string) => string | undefined;
|
|
44
50
|
export declare const makePythonService: (opts: PythonServiceOptions) => PythonServiceShape;
|
|
45
51
|
export { REQUIRED_DEPS, findHelper };
|
|
46
|
-
export interface KernelManagerOptions {
|
|
47
|
-
readonly pythonPath: string;
|
|
48
|
-
readonly helperPath: string;
|
|
49
|
-
readonly workingDirectory: string | undefined;
|
|
50
|
-
readonly defaultTimeoutMs: number;
|
|
51
|
-
}
|
|
52
|
-
export interface KernelRuntimeOptions {
|
|
53
|
-
readonly pythonPath: string;
|
|
54
|
-
readonly helperPath: string;
|
|
55
|
-
}
|
|
56
|
-
export interface KernelInfo {
|
|
57
|
-
readonly filePath: string;
|
|
58
|
-
readonly pid: number;
|
|
59
|
-
readonly lastUsedAt: number;
|
|
60
|
-
readonly requestsHandled: number;
|
|
61
|
-
readonly stderrTail: string;
|
|
62
|
-
}
|
|
63
|
-
export interface KernelManagerStats {
|
|
64
|
-
readonly liveKernels: number;
|
|
65
|
-
readonly totalRequests: number;
|
|
66
|
-
}
|
|
67
|
-
export declare const makeKernelManager: (opts: KernelManagerOptions) => KernelManagerShape;
|
|
68
|
-
export interface KernelManagerShape {
|
|
69
|
-
readonly execute: (filePath: string, request: RunRequest, runtime?: KernelRuntimeOptions) => Effect.Effect<RunResponse, NotebookError>;
|
|
70
|
-
readonly isRunning: (filePath: string) => boolean;
|
|
71
|
-
readonly list: () => ReadonlyArray<KernelInfo>;
|
|
72
|
-
readonly restart: (filePath: string) => Effect.Effect<void, never>;
|
|
73
|
-
readonly shutdown: (filePath: string) => Effect.Effect<void, never>;
|
|
74
|
-
readonly disposeAll: () => Effect.Effect<void, never>;
|
|
75
|
-
readonly stats: () => KernelManagerStats;
|
|
76
|
-
}
|
|
77
|
-
declare const KernelManager_base: Context.TagClass<KernelManager, "@ipynb/KernelManager", KernelManagerShape>;
|
|
78
|
-
export declare class KernelManager extends KernelManager_base {
|
|
79
|
-
}
|
|
80
|
-
//# sourceMappingURL=PythonService.d.ts.map
|
package/dist/services/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { ToolContext } from "
|
|
1
|
+
import type { ToolContext } from "../tool.js";
|
|
2
2
|
import { type PluginOptions } from "../plugin-options.js";
|
|
3
3
|
import { type PathServiceShape } from "./PathService.js";
|
|
4
4
|
import { type PermissionServiceShape } from "./PermissionService.js";
|
|
5
5
|
import { type NotebookFileServiceShape } from "./NotebookFileService.js";
|
|
6
|
-
import { type DiffServiceShape } from "./DiffService.js";
|
|
7
6
|
import { makeInspectImpl } from "./NotebookInspectService.js";
|
|
8
7
|
import { type NotebookReadServiceShape } from "./NotebookReadService.js";
|
|
9
8
|
import { type NotebookEditServiceShape } from "./NotebookEditService.js";
|
|
@@ -11,27 +10,30 @@ import { type NotebookCleanServiceShape } from "./NotebookCleanService.js";
|
|
|
11
10
|
import { type NotebookOutputServiceShape } from "./NotebookOutputService.js";
|
|
12
11
|
import { type NotebookExportServiceShape } from "./NotebookExportService.js";
|
|
13
12
|
import { type NotebookExecutionServiceShape } from "./NotebookExecutionService.js";
|
|
14
|
-
import { type PythonServiceShape
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
13
|
+
import { type PythonServiceShape } from "./PythonService.js";
|
|
14
|
+
import { type KernelManagerShape } from "./KernelManager.js";
|
|
15
|
+
import type { WarningSink } from "../utils/warnings.js";
|
|
16
|
+
export { type PathServiceShape, type PathEnv, makePathService } from "./PathService.js";
|
|
17
|
+
export { type PermissionServiceShape, type PermissionRequest, type PermissionKind, makePermissionService } from "./PermissionService.js";
|
|
18
|
+
export { type NotebookFileServiceShape, makeNotebookFileService } from "./NotebookFileService.js";
|
|
19
|
+
export { makeInspectImpl } from "./NotebookInspectService.js";
|
|
20
|
+
export { type NotebookReadServiceShape, makeReadImpl } from "./NotebookReadService.js";
|
|
21
|
+
export { type NotebookEditServiceShape, makeEditImpl } from "./NotebookEditService.js";
|
|
22
|
+
export { type NotebookCleanServiceShape, makeCleanImpl } from "./NotebookCleanService.js";
|
|
23
|
+
export { type NotebookOutputServiceShape, makeOutputImpl } from "./NotebookOutputService.js";
|
|
24
|
+
export { type NotebookExportServiceShape, makeExportImpl } from "./NotebookExportService.js";
|
|
25
|
+
export { type NotebookExecutionServiceShape, makeExecutionImpl } from "./NotebookExecutionService.js";
|
|
26
|
+
export { type PythonServiceShape, type PythonDoctor, type PythonProbeResult, type DependencyCheck, type PythonServiceOptions, makePythonService } from "./PythonService.js";
|
|
27
|
+
export { type KernelManagerShape, type KernelInfo, type KernelManagerStats, type KernelManagerOptions, type KernelRuntimeOptions, makeKernelManager } from "./KernelManager.js";
|
|
28
28
|
export interface NotebookServices {
|
|
29
29
|
readonly path: PathServiceShape;
|
|
30
30
|
readonly permission: PermissionServiceShape;
|
|
31
31
|
readonly file: NotebookFileServiceShape;
|
|
32
|
-
readonly diff: DiffServiceShape;
|
|
33
32
|
readonly python: PythonServiceShape;
|
|
34
33
|
readonly kernel: KernelManagerShape;
|
|
34
|
+
readonly pythonPath: string | undefined;
|
|
35
|
+
readonly pythonPathError: string | undefined;
|
|
36
|
+
readonly envOptionsError: string | undefined;
|
|
35
37
|
readonly inspect: ReturnType<typeof makeInspectImpl>;
|
|
36
38
|
readonly read: NotebookReadServiceShape;
|
|
37
39
|
readonly edit: NotebookEditServiceShape;
|
|
@@ -40,16 +42,9 @@ export interface NotebookServices {
|
|
|
40
42
|
readonly export: NotebookExportServiceShape;
|
|
41
43
|
readonly execution: NotebookExecutionServiceShape;
|
|
42
44
|
}
|
|
45
|
+
export declare const disposeSharedKernelManager: (scope?: object) => Promise<void>;
|
|
43
46
|
export interface BuildServicesOptions {
|
|
44
|
-
readonly
|
|
45
|
-
readonly preferUv: boolean;
|
|
46
|
-
readonly helperRelativePath: string;
|
|
47
|
-
readonly warmKernel: boolean;
|
|
48
|
-
readonly defaultTimeoutMs: number;
|
|
49
|
-
readonly directory: string;
|
|
47
|
+
readonly warningSink?: WarningSink | undefined;
|
|
50
48
|
}
|
|
51
|
-
export declare const
|
|
52
|
-
export declare const
|
|
53
|
-
declare const resolveOptionsFromEnv: () => PluginOptions;
|
|
54
|
-
export { resolveOptionsFromEnv };
|
|
55
|
-
//# sourceMappingURL=index.d.ts.map
|
|
49
|
+
export declare const buildServices: (ctx: ToolContext, options?: BuildServicesOptions) => NotebookServices;
|
|
50
|
+
export declare const resolveOptionsFromEnv: (instanceOptions?: unknown) => PluginOptions;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { NotebookNotFoundError, NotebookParseError, NotebookValidationError, PathOutsideWorktreeError } from "../domain/errors.js";
|
|
3
|
+
import type { NotebookFileServiceShape } from "./NotebookFileService.js";
|
|
4
|
+
type RevisionError = NotebookNotFoundError | NotebookParseError | NotebookValidationError | PathOutsideWorktreeError;
|
|
5
|
+
export declare const pinRealPath: (filePath: string) => Effect.Effect<string, never>;
|
|
6
|
+
export declare const contentHash: (text: string) => string;
|
|
7
|
+
export declare const readRevision: (fileSvc: NotebookFileServiceShape, absPath: string) => Effect.Effect<string, RevisionError>;
|
|
8
|
+
export declare const assertRevisionUnchanged: (fileSvc: NotebookFileServiceShape, absPath: string, expected: string) => Effect.Effect<void, RevisionError>;
|
|
9
|
+
export {};
|