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
package/dist/tool.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import type { z } from "zod";
|
|
3
|
+
export interface ToolContext {
|
|
4
|
+
readonly sessionID: string;
|
|
5
|
+
readonly messageID: string;
|
|
6
|
+
readonly agent: string;
|
|
7
|
+
readonly directory: string;
|
|
8
|
+
readonly worktree: string;
|
|
9
|
+
readonly abort: AbortSignal;
|
|
10
|
+
readonly pluginOptions?: unknown;
|
|
11
|
+
readonly pluginScope?: object;
|
|
12
|
+
readonly warningSink?: import("./utils/warnings.js").WarningSink | undefined;
|
|
13
|
+
metadata(input: {
|
|
14
|
+
title?: string;
|
|
15
|
+
metadata?: Record<string, any>;
|
|
16
|
+
}): void;
|
|
17
|
+
ask(input: ToolAskInput): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export interface ToolAskInput {
|
|
20
|
+
readonly permission: string;
|
|
21
|
+
readonly patterns: string[];
|
|
22
|
+
readonly always: string[];
|
|
23
|
+
readonly metadata: Record<string, any>;
|
|
24
|
+
}
|
|
25
|
+
export interface ToolAttachment {
|
|
26
|
+
readonly type: "file";
|
|
27
|
+
readonly mime: string;
|
|
28
|
+
readonly url: string;
|
|
29
|
+
readonly filename?: string;
|
|
30
|
+
}
|
|
31
|
+
export type ToolResult = string | {
|
|
32
|
+
readonly title?: string;
|
|
33
|
+
readonly output: string;
|
|
34
|
+
readonly metadata?: Record<string, any>;
|
|
35
|
+
readonly attachments?: ToolAttachment[];
|
|
36
|
+
};
|
|
37
|
+
export interface ToolDefinition<Args extends z.ZodRawShape = z.ZodRawShape> {
|
|
38
|
+
readonly description: string;
|
|
39
|
+
readonly args: Args;
|
|
40
|
+
execute(args: z.infer<z.ZodObject<Args>>, context: ToolContext): Promise<ToolResult>;
|
|
41
|
+
}
|
|
42
|
+
export type AnyToolDefinition = ToolDefinition<z.ZodRawShape>;
|
|
43
|
+
export declare const tool: <Args extends z.ZodRawShape>(definition: ToolDefinition<Args>) => ToolDefinition<Args>;
|
|
44
|
+
export declare const runToolEffect: <A, E>(effect: Effect.Effect<A, E>) => Promise<A>;
|
|
45
|
+
export declare const rethrowPermissionDenied: (error: unknown) => void;
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { ToolContext } from "../tool.js";
|
|
2
|
+
export declare const resolveToolOptions: (context?: ToolContext) => {
|
|
3
|
+
preferUv: boolean;
|
|
4
|
+
helperRelativePath: string;
|
|
5
|
+
defaultTimeoutMs: number;
|
|
6
|
+
defaultMaxOutputChars: number;
|
|
7
|
+
warmKernel: boolean;
|
|
8
|
+
lspDiagnostics: boolean;
|
|
9
|
+
pyrightPath: string;
|
|
10
|
+
diagnosticsTimeoutMs: number;
|
|
11
|
+
pythonPath?: string | undefined;
|
|
12
|
+
allowOutsideWorktree?: boolean | undefined;
|
|
13
|
+
};
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
filePath: z.ZodString;
|
|
7
|
-
cellIndex: z.ZodNumber;
|
|
8
|
-
};
|
|
9
|
-
execute(args: {
|
|
10
|
-
filePath: string;
|
|
11
|
-
cellIndex: number;
|
|
12
|
-
}, context: ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=cell_delete.d.ts.map
|
|
2
|
+
export declare const ipynbCellDeleteTool: import("../tool.js").ToolDefinition<{
|
|
3
|
+
filePath: z.ZodString;
|
|
4
|
+
cellIndex: z.ZodNumber;
|
|
5
|
+
}>;
|
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
source: z.ZodString;
|
|
13
|
-
index: z.ZodOptional<z.ZodNumber>;
|
|
14
|
-
};
|
|
15
|
-
execute(args: {
|
|
16
|
-
filePath: string;
|
|
17
|
-
cellType: "code" | "markdown" | "raw";
|
|
18
|
-
source: string;
|
|
19
|
-
index?: number | undefined;
|
|
20
|
-
}, context: ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=cell_insert.d.ts.map
|
|
2
|
+
export declare const ipynbCellInsertTool: import("../tool.js").ToolDefinition<{
|
|
3
|
+
filePath: z.ZodString;
|
|
4
|
+
cellType: z.ZodEnum<{
|
|
5
|
+
code: "code";
|
|
6
|
+
markdown: "markdown";
|
|
7
|
+
raw: "raw";
|
|
8
|
+
}>;
|
|
9
|
+
source: z.ZodString;
|
|
10
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
}>;
|
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
fromIndex: z.ZodNumber;
|
|
8
|
-
toIndex: z.ZodNumber;
|
|
9
|
-
};
|
|
10
|
-
execute(args: {
|
|
11
|
-
filePath: string;
|
|
12
|
-
fromIndex: number;
|
|
13
|
-
toIndex: number;
|
|
14
|
-
}, context: ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=cell_move.d.ts.map
|
|
2
|
+
export declare const ipynbCellMoveTool: import("../tool.js").ToolDefinition<{
|
|
3
|
+
filePath: z.ZodString;
|
|
4
|
+
fromIndex: z.ZodNumber;
|
|
5
|
+
toIndex: z.ZodNumber;
|
|
6
|
+
}>;
|
package/dist/tools/clean.d.ts
CHANGED
|
@@ -1,22 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
stripLargeImages: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
11
|
-
normalizeSource: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
12
|
-
};
|
|
13
|
-
execute(args: {
|
|
14
|
-
filePath: string;
|
|
15
|
-
clearOutputs: boolean;
|
|
16
|
-
clearExecutionCount: boolean;
|
|
17
|
-
stripWidgetState: boolean;
|
|
18
|
-
stripLargeImages: boolean;
|
|
19
|
-
normalizeSource: boolean;
|
|
20
|
-
}, context: ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=clean.d.ts.map
|
|
2
|
+
export declare const ipynbCleanTool: import("../tool.js").ToolDefinition<{
|
|
3
|
+
filePath: z.ZodString;
|
|
4
|
+
clearOutputs: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
5
|
+
clearExecutionCount: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
6
|
+
stripWidgetState: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
7
|
+
stripLargeImages: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
8
|
+
normalizeSource: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
9
|
+
}>;
|
package/dist/tools/doctor.d.ts
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
args: {
|
|
6
|
-
includeSuggestions: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
7
|
-
};
|
|
8
|
-
execute(args: {
|
|
9
|
-
includeSuggestions: boolean;
|
|
10
|
-
}, context: ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=doctor.d.ts.map
|
|
2
|
+
export declare const ipynbDoctorTool: import("../tool.js").ToolDefinition<{
|
|
3
|
+
includeSuggestions: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
4
|
+
}>;
|
package/dist/tools/edit.d.ts
CHANGED
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
always: "always";
|
|
13
|
-
}>>>;
|
|
14
|
-
};
|
|
15
|
-
execute(args: {
|
|
16
|
-
filePath: string;
|
|
17
|
-
cellIndex: number;
|
|
18
|
-
source: string;
|
|
19
|
-
clearOutputs: "never" | "auto" | "always";
|
|
20
|
-
}, context: ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=edit.d.ts.map
|
|
2
|
+
export declare const ipynbEditTool: import("../tool.js").ToolDefinition<{
|
|
3
|
+
filePath: z.ZodString;
|
|
4
|
+
cellIndex: z.ZodNumber;
|
|
5
|
+
source: z.ZodString;
|
|
6
|
+
clearOutputs: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
7
|
+
never: "never";
|
|
8
|
+
auto: "auto";
|
|
9
|
+
always: "always";
|
|
10
|
+
}>>>;
|
|
11
|
+
}>;
|
package/dist/tools/export.d.ts
CHANGED
|
@@ -1,24 +1,13 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
outputPath: z.ZodOptional<z.ZodString>;
|
|
15
|
-
};
|
|
16
|
-
execute(args: {
|
|
17
|
-
filePath: string;
|
|
18
|
-
format: "markdown" | "python" | "summary";
|
|
19
|
-
includeOutputs: boolean;
|
|
20
|
-
includeErrors: boolean;
|
|
21
|
-
outputPath?: string | undefined;
|
|
22
|
-
}, context: ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=export.d.ts.map
|
|
2
|
+
export declare const ipynbExportTool: import("../tool.js").ToolDefinition<{
|
|
3
|
+
filePath: z.ZodString;
|
|
4
|
+
format: z.ZodEnum<{
|
|
5
|
+
markdown: "markdown";
|
|
6
|
+
python: "python";
|
|
7
|
+
summary: "summary";
|
|
8
|
+
}>;
|
|
9
|
+
includeOutputs: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
10
|
+
includeErrors: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
11
|
+
outputPath: z.ZodOptional<z.ZodString>;
|
|
12
|
+
maxExportChars: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
13
|
+
}>;
|
package/dist/tools/inspect.d.ts
CHANGED
|
@@ -1,20 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
maxCells: z.ZodOptional<z.ZodNumber>;
|
|
10
|
-
checkMissingPackages: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
11
|
-
};
|
|
12
|
-
execute(args: {
|
|
13
|
-
filePath: string;
|
|
14
|
-
includeOutputsSummary: boolean;
|
|
15
|
-
checkMissingPackages: boolean;
|
|
16
|
-
includeMetadata?: boolean | undefined;
|
|
17
|
-
maxCells?: number | undefined;
|
|
18
|
-
}, context: ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=inspect.d.ts.map
|
|
2
|
+
export declare const ipynbInspectTool: import("../tool.js").ToolDefinition<{
|
|
3
|
+
filePath: z.ZodString;
|
|
4
|
+
includeMetadata: z.ZodOptional<z.ZodBoolean>;
|
|
5
|
+
includeOutputsSummary: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
6
|
+
maxCells: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
checkMissingPackages: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
8
|
+
}>;
|
package/dist/tools/kernel.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { Effect } from "effect";
|
|
3
|
-
import type { ToolContext } from "
|
|
3
|
+
import type { ToolContext } from "../tool.js";
|
|
4
4
|
import { buildServices } from "../services/index.js";
|
|
5
|
-
import { type PathOutsideWorktreeError } from "../domain/errors.js";
|
|
5
|
+
import { type PathOutsideWorktreeError, type PermissionDeniedError } from "../domain/errors.js";
|
|
6
6
|
declare const args: {
|
|
7
7
|
action: z.ZodEnum<{
|
|
8
8
|
list: "list";
|
|
@@ -12,25 +12,17 @@ declare const args: {
|
|
|
12
12
|
}>;
|
|
13
13
|
filePath: z.ZodOptional<z.ZodString>;
|
|
14
14
|
};
|
|
15
|
-
declare const run: (services: ReturnType<typeof buildServices>, input: z.infer<z.ZodObject<typeof args
|
|
15
|
+
declare const run: (services: ReturnType<typeof buildServices>, input: z.infer<z.ZodObject<typeof args>>, context?: ToolContext) => Effect.Effect<{
|
|
16
16
|
readonly output: string;
|
|
17
17
|
readonly metadata: Record<string, unknown>;
|
|
18
|
-
}, PathOutsideWorktreeError>;
|
|
18
|
+
}, PathOutsideWorktreeError | PermissionDeniedError>;
|
|
19
19
|
export { run };
|
|
20
|
-
export declare const ipynbKernelTool: {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
filePath: z.ZodOptional<z.ZodString>;
|
|
30
|
-
};
|
|
31
|
-
execute(args: {
|
|
32
|
-
action: "list" | "status" | "shutdown" | "restart";
|
|
33
|
-
filePath?: string | undefined;
|
|
34
|
-
}, context: ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=kernel.d.ts.map
|
|
20
|
+
export declare const ipynbKernelTool: import("../tool.js").ToolDefinition<{
|
|
21
|
+
action: z.ZodEnum<{
|
|
22
|
+
list: "list";
|
|
23
|
+
status: "status";
|
|
24
|
+
shutdown: "shutdown";
|
|
25
|
+
restart: "restart";
|
|
26
|
+
}>;
|
|
27
|
+
filePath: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ipynbLspTool: import("../tool.js").ToolDefinition<{
|
|
3
|
+
filePath: z.ZodString;
|
|
4
|
+
operation: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
5
|
+
diagnostics: "diagnostics";
|
|
6
|
+
materialize: "materialize";
|
|
7
|
+
}>>>;
|
|
8
|
+
maxOutputChars: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
}>;
|
package/dist/tools/outputs.d.ts
CHANGED
|
@@ -1,30 +1,16 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
includeImages: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
18
|
-
maxOutputChars: z.ZodOptional<z.ZodNumber>;
|
|
19
|
-
};
|
|
20
|
-
execute(args: {
|
|
21
|
-
filePath: string;
|
|
22
|
-
operation: "read" | "list" | "read_error" | "clear_cell" | "clear_all";
|
|
23
|
-
includeImages: boolean;
|
|
24
|
-
cellIndex?: number | undefined;
|
|
25
|
-
offset?: number | undefined;
|
|
26
|
-
limit?: number | undefined;
|
|
27
|
-
maxOutputChars?: number | undefined;
|
|
28
|
-
}, context: ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=outputs.d.ts.map
|
|
2
|
+
export declare const ipynbOutputsTool: import("../tool.js").ToolDefinition<{
|
|
3
|
+
filePath: z.ZodString;
|
|
4
|
+
operation: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
5
|
+
read: "read";
|
|
6
|
+
list: "list";
|
|
7
|
+
read_error: "read_error";
|
|
8
|
+
clear_cell: "clear_cell";
|
|
9
|
+
clear_all: "clear_all";
|
|
10
|
+
}>>>;
|
|
11
|
+
cellIndex: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
includeImages: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
15
|
+
maxOutputChars: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
}>;
|
package/dist/tools/read.d.ts
CHANGED
|
@@ -1,30 +1,13 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
maxSourceChars: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
15
|
-
maxOutputChars: z.ZodOptional<z.ZodNumber>;
|
|
16
|
-
};
|
|
17
|
-
execute(args: {
|
|
18
|
-
filePath: string;
|
|
19
|
-
includeOutputs: boolean;
|
|
20
|
-
includeErrors: boolean;
|
|
21
|
-
includeMetadata: boolean;
|
|
22
|
-
includeImages: boolean;
|
|
23
|
-
maxSourceChars: number;
|
|
24
|
-
cellIndex?: number | undefined;
|
|
25
|
-
start?: number | undefined;
|
|
26
|
-
end?: number | undefined;
|
|
27
|
-
maxOutputChars?: number | undefined;
|
|
28
|
-
}, context: ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=read.d.ts.map
|
|
2
|
+
export declare const ipynbReadTool: import("../tool.js").ToolDefinition<{
|
|
3
|
+
filePath: z.ZodString;
|
|
4
|
+
cellIndex: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
start: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
includeOutputs: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
8
|
+
includeErrors: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
9
|
+
includeMetadata: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
10
|
+
includeImages: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
11
|
+
maxSourceChars: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
12
|
+
maxOutputChars: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
}>;
|
package/dist/tools/repro.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { Effect } from "effect";
|
|
3
|
-
import type { ToolContext } from "@opencode-ai/plugin";
|
|
4
3
|
import { buildServices } from "../services/index.js";
|
|
5
|
-
import { type NotebookNotFoundError, type NotebookNotImplementedError, type NotebookParseError, type NotebookValidationError, type PathOutsideWorktreeError, type PythonRunnerError } from "../domain/errors.js";
|
|
4
|
+
import { PermissionDeniedError, type NotebookNotFoundError, type NotebookNotImplementedError, type NotebookParseError, type NotebookValidationError, type PathOutsideWorktreeError, type PythonRunnerError } from "../domain/errors.js";
|
|
6
5
|
import type { NotebookRaw } from "../domain/notebook.js";
|
|
7
6
|
declare const args: {
|
|
8
7
|
filePath: z.ZodString;
|
|
@@ -15,7 +14,7 @@ export declare const detectRandomSeeds: (notebook: NotebookRaw) => ReadonlyArray
|
|
|
15
14
|
readonly cellIndex: number;
|
|
16
15
|
readonly name: string;
|
|
17
16
|
}>;
|
|
18
|
-
declare const run: (services: ReturnType<typeof buildServices>, input: z.infer<z.ZodObject<typeof args
|
|
17
|
+
declare const run: (services: ReturnType<typeof buildServices>, input: z.infer<z.ZodObject<typeof args>>, signal?: AbortSignal) => Effect.Effect<{
|
|
19
18
|
readonly output: string;
|
|
20
19
|
readonly metadata: {
|
|
21
20
|
readonly filePath: string;
|
|
@@ -28,15 +27,8 @@ declare const run: (services: ReturnType<typeof buildServices>, input: z.infer<z
|
|
|
28
27
|
readonly filesystemReadCount: number;
|
|
29
28
|
readonly seedCount: number;
|
|
30
29
|
};
|
|
31
|
-
}, NotebookNotFoundError | NotebookParseError | NotebookValidationError | PathOutsideWorktreeError | NotebookNotImplementedError | PythonRunnerError>;
|
|
30
|
+
}, NotebookNotFoundError | NotebookParseError | NotebookValidationError | PathOutsideWorktreeError | NotebookNotImplementedError | PythonRunnerError | PermissionDeniedError>;
|
|
32
31
|
export { run as runRepro };
|
|
33
|
-
export declare const ipynbReproTool: {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
filePath: z.ZodString;
|
|
37
|
-
};
|
|
38
|
-
execute(args: {
|
|
39
|
-
filePath: string;
|
|
40
|
-
}, context: ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=repro.d.ts.map
|
|
32
|
+
export declare const ipynbReproTool: import("../tool.js").ToolDefinition<{
|
|
33
|
+
filePath: z.ZodString;
|
|
34
|
+
}>;
|
package/dist/tools/run.d.ts
CHANGED
|
@@ -1,35 +1,18 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
workingDirectory: z.ZodOptional<z.ZodString>;
|
|
20
|
-
maxOutputChars: z.ZodOptional<z.ZodNumber>;
|
|
21
|
-
};
|
|
22
|
-
execute(args: {
|
|
23
|
-
filePath: string;
|
|
24
|
-
mode: "cell" | "range" | "all" | "from";
|
|
25
|
-
save: boolean;
|
|
26
|
-
cellIndex?: number | undefined;
|
|
27
|
-
start?: number | undefined;
|
|
28
|
-
end?: number | undefined;
|
|
29
|
-
kernel?: string | undefined;
|
|
30
|
-
timeoutMs?: number | undefined;
|
|
31
|
-
workingDirectory?: string | undefined;
|
|
32
|
-
maxOutputChars?: number | undefined;
|
|
33
|
-
}, context: ToolContext): Promise<import("@opencode-ai/plugin").ToolResult>;
|
|
34
|
-
};
|
|
35
|
-
//# sourceMappingURL=run.d.ts.map
|
|
2
|
+
export declare const ipynbRunTool: import("../tool.js").ToolDefinition<{
|
|
3
|
+
filePath: z.ZodString;
|
|
4
|
+
mode: z.ZodEnum<{
|
|
5
|
+
cell: "cell";
|
|
6
|
+
from: "from";
|
|
7
|
+
range: "range";
|
|
8
|
+
all: "all";
|
|
9
|
+
}>;
|
|
10
|
+
cellIndex: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
start: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
end: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
kernel: z.ZodOptional<z.ZodString>;
|
|
14
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
save: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
16
|
+
workingDirectory: z.ZodOptional<z.ZodString>;
|
|
17
|
+
maxOutputChars: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
}>;
|
package/dist/utils/ansi.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ToolAttachment } from "
|
|
1
|
+
import type { ToolAttachment } from "../tool.js";
|
|
2
2
|
export declare const pickExtensionForMime: (mime: string) => string | undefined;
|
|
3
|
-
export declare const formatAttachment: (mime: string,
|
|
4
|
-
//# sourceMappingURL=attachments.d.ts.map
|
|
3
|
+
export declare const formatAttachment: (mime: string, payload: string, filename?: string) => ToolAttachment;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { NotebookRaw } from "../domain/notebook.js";
|
|
2
|
+
export interface ExecutionOrderEntry {
|
|
3
|
+
readonly cellIndex: number;
|
|
4
|
+
readonly executionCount: number;
|
|
5
|
+
readonly previousCount: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const analyzeExecutionOrder: (notebook: NotebookRaw) => ReadonlyArray<ExecutionOrderEntry>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const codeFence: (text: string) => string;
|
package/dist/utils/i18n.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export type TruncationHintKey = "output" | "source" | "traceback" | "export" | "json" | "stream";
|
|
1
|
+
export type TruncationHintKey = "output" | "source" | "traceback" | "export" | "json" | "stream" | "hard";
|
|
2
2
|
export interface TruncationHintContext {
|
|
3
3
|
readonly paramName: string;
|
|
4
4
|
readonly maxChars: number;
|
|
5
5
|
readonly locale?: string | undefined;
|
|
6
6
|
}
|
|
7
7
|
export declare const formatHint: (key: TruncationHintKey, ctx: TruncationHintContext, locale?: string) => string;
|
|
8
|
-
//# sourceMappingURL=i18n.d.ts.map
|
package/dist/utils/imports.d.ts
CHANGED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export interface JsonTextStyle {
|
|
2
|
+
readonly newline: "\n" | "\r\n";
|
|
3
|
+
readonly itemSeparator: string;
|
|
4
|
+
readonly keySeparator: string;
|
|
5
|
+
readonly ensureAscii: boolean;
|
|
6
|
+
readonly unit: string;
|
|
7
|
+
}
|
|
8
|
+
interface LiteralNode {
|
|
9
|
+
readonly kind: "literal";
|
|
10
|
+
readonly start: number;
|
|
11
|
+
readonly end: number;
|
|
12
|
+
readonly value: unknown;
|
|
13
|
+
}
|
|
14
|
+
interface ItemSpan {
|
|
15
|
+
readonly start: number;
|
|
16
|
+
readonly end: number;
|
|
17
|
+
}
|
|
18
|
+
interface ArrayNode {
|
|
19
|
+
readonly kind: "array";
|
|
20
|
+
readonly start: number;
|
|
21
|
+
readonly end: number;
|
|
22
|
+
readonly items: ReadonlyArray<ItemSpan>;
|
|
23
|
+
readonly value: ReadonlyArray<unknown>;
|
|
24
|
+
}
|
|
25
|
+
interface ObjectEntry {
|
|
26
|
+
readonly key: string;
|
|
27
|
+
readonly keyStart: number;
|
|
28
|
+
readonly value: JsonNode;
|
|
29
|
+
}
|
|
30
|
+
interface ObjectNode {
|
|
31
|
+
readonly kind: "object";
|
|
32
|
+
readonly start: number;
|
|
33
|
+
readonly end: number;
|
|
34
|
+
readonly entries: ReadonlyArray<ObjectEntry>;
|
|
35
|
+
readonly value: Record<string, unknown>;
|
|
36
|
+
}
|
|
37
|
+
export type JsonNode = LiteralNode | ArrayNode | ObjectNode;
|
|
38
|
+
export declare const MAX_JSON_DEPTH = 512;
|
|
39
|
+
export declare const jsonEqual: (left: unknown, right: unknown) => boolean;
|
|
40
|
+
interface Edit {
|
|
41
|
+
readonly start: number;
|
|
42
|
+
readonly end: number;
|
|
43
|
+
readonly text: string;
|
|
44
|
+
}
|
|
45
|
+
export declare const applyEdits: (text: string, edits: ReadonlyArray<Edit>) => string | undefined;
|
|
46
|
+
export interface PatchOptions {
|
|
47
|
+
readonly style: JsonTextStyle;
|
|
48
|
+
}
|
|
49
|
+
export type PatchFailureReason = "parse-failed" | "patch-threw" | "overlapping-edits" | "not-representable" | "verification-failed" | "too-deep";
|
|
50
|
+
export interface PatchResult {
|
|
51
|
+
readonly text?: string;
|
|
52
|
+
readonly reason?: PatchFailureReason;
|
|
53
|
+
}
|
|
54
|
+
export declare const patchJsonTextDetailed: (text: string, next: unknown, options: PatchOptions) => PatchResult;
|
|
55
|
+
export declare const patchJsonText: (text: string, next: unknown, options: PatchOptions) => string | undefined;
|
|
56
|
+
export declare const jsonDepth: (value: unknown, depth?: number) => number;
|
|
57
|
+
export declare const formatJsonValue: (value: unknown, style: JsonTextStyle, multiline?: boolean) => string;
|
|
58
|
+
export {};
|