@jamesmurdza/opencode-daytona 0.1.14 → 0.1.16
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/.opencode/plugin/daytona/core/logger.d.ts +15 -0
- package/.opencode/plugin/daytona/core/logger.d.ts.map +1 -0
- package/.opencode/plugin/daytona/core/logger.js +43 -0
- package/.opencode/plugin/daytona/core/logger.js.map +1 -0
- package/.opencode/plugin/daytona/core/project-data-storage.d.ts +38 -0
- package/.opencode/plugin/daytona/core/project-data-storage.d.ts.map +1 -0
- package/.opencode/plugin/daytona/core/project-data-storage.js +130 -0
- package/.opencode/plugin/daytona/core/project-data-storage.js.map +1 -0
- package/.opencode/plugin/daytona/core/session-manager.d.ts +42 -0
- package/.opencode/plugin/daytona/core/session-manager.d.ts.map +1 -0
- package/.opencode/plugin/daytona/core/session-manager.js +151 -0
- package/.opencode/plugin/daytona/core/session-manager.js.map +1 -0
- package/.opencode/plugin/daytona/core/types.d.ts +51 -0
- package/.opencode/plugin/daytona/core/types.d.ts.map +1 -0
- package/.opencode/plugin/daytona/core/types.js +11 -0
- package/.opencode/plugin/daytona/core/types.js.map +1 -0
- package/.opencode/plugin/daytona/git/host-git-manager.d.ts +13 -0
- package/.opencode/plugin/daytona/git/host-git-manager.d.ts.map +1 -0
- package/.opencode/plugin/daytona/git/host-git-manager.js +97 -0
- package/.opencode/plugin/daytona/git/host-git-manager.js.map +1 -0
- package/.opencode/plugin/daytona/git/index.d.ts +2 -0
- package/.opencode/plugin/daytona/git/index.d.ts.map +1 -0
- package/.opencode/plugin/daytona/git/index.js +2 -0
- package/.opencode/plugin/daytona/git/index.js.map +1 -0
- package/.opencode/plugin/daytona/git/sandbox-git-manager.d.ts +10 -0
- package/.opencode/plugin/daytona/git/sandbox-git-manager.d.ts.map +1 -0
- package/.opencode/plugin/daytona/git/sandbox-git-manager.js +49 -0
- package/.opencode/plugin/daytona/git/sandbox-git-manager.js.map +1 -0
- package/.opencode/plugin/daytona/git/session-git-manager.d.ts +25 -0
- package/.opencode/plugin/daytona/git/session-git-manager.d.ts.map +1 -0
- package/.opencode/plugin/daytona/git/session-git-manager.js +52 -0
- package/.opencode/plugin/daytona/git/session-git-manager.js.map +1 -0
- package/.opencode/plugin/daytona/index.d.ts +26 -0
- package/.opencode/plugin/daytona/index.d.ts.map +1 -0
- package/.opencode/plugin/daytona/index.js +37 -0
- package/.opencode/plugin/daytona/index.js.map +1 -0
- package/.opencode/plugin/daytona/plugins/custom-tools.d.ts +8 -0
- package/.opencode/plugin/daytona/plugins/custom-tools.d.ts.map +1 -0
- package/.opencode/plugin/daytona/plugins/custom-tools.js +17 -0
- package/.opencode/plugin/daytona/plugins/custom-tools.js.map +1 -0
- package/.opencode/plugin/daytona/plugins/index.d.ts +8 -0
- package/.opencode/plugin/daytona/plugins/index.d.ts.map +1 -0
- package/.opencode/plugin/daytona/plugins/{index.ts → index.js} +5 -5
- package/.opencode/plugin/daytona/plugins/index.js.map +1 -0
- package/.opencode/plugin/daytona/plugins/session-cleanup.d.ts +8 -0
- package/.opencode/plugin/daytona/plugins/session-cleanup.d.ts.map +1 -0
- package/.opencode/plugin/daytona/plugins/session-cleanup.js +19 -0
- package/.opencode/plugin/daytona/plugins/session-cleanup.js.map +1 -0
- package/.opencode/plugin/daytona/plugins/session-idle-auto-commit.d.ts +7 -0
- package/.opencode/plugin/daytona/plugins/session-idle-auto-commit.d.ts.map +1 -0
- package/.opencode/plugin/daytona/plugins/session-idle-auto-commit.js +28 -0
- package/.opencode/plugin/daytona/plugins/session-idle-auto-commit.js.map +1 -0
- package/.opencode/plugin/daytona/plugins/system-transform.d.ts +7 -0
- package/.opencode/plugin/daytona/plugins/system-transform.d.ts.map +1 -0
- package/.opencode/plugin/daytona/plugins/system-transform.js +20 -0
- package/.opencode/plugin/daytona/plugins/system-transform.js.map +1 -0
- package/.opencode/plugin/daytona/tools/bash.d.ts +15 -0
- package/.opencode/plugin/daytona/tools/bash.d.ts.map +1 -0
- package/.opencode/plugin/daytona/tools/bash.js +31 -0
- package/.opencode/plugin/daytona/tools/bash.js.map +1 -0
- package/.opencode/plugin/daytona/tools/edit.d.ts +17 -0
- package/.opencode/plugin/daytona/tools/edit.d.ts.map +1 -0
- package/.opencode/plugin/daytona/tools/edit.js +19 -0
- package/.opencode/plugin/daytona/tools/edit.js.map +1 -0
- package/.opencode/plugin/daytona/tools/get-preview-url.d.ts +13 -0
- package/.opencode/plugin/daytona/tools/get-preview-url.d.ts.map +1 -0
- package/.opencode/plugin/daytona/tools/get-preview-url.js +13 -0
- package/.opencode/plugin/daytona/tools/get-preview-url.js.map +1 -0
- package/.opencode/plugin/daytona/tools/glob.d.ts +13 -0
- package/.opencode/plugin/daytona/tools/glob.d.ts.map +1 -0
- package/.opencode/plugin/daytona/tools/glob.js +17 -0
- package/.opencode/plugin/daytona/tools/glob.js.map +1 -0
- package/.opencode/plugin/daytona/tools/grep.d.ts +13 -0
- package/.opencode/plugin/daytona/tools/grep.d.ts.map +1 -0
- package/.opencode/plugin/daytona/tools/grep.js +17 -0
- package/.opencode/plugin/daytona/tools/grep.js.map +1 -0
- package/.opencode/plugin/daytona/tools/ls.d.ts +13 -0
- package/.opencode/plugin/daytona/tools/ls.d.ts.map +1 -0
- package/.opencode/plugin/daytona/tools/ls.js +18 -0
- package/.opencode/plugin/daytona/tools/ls.js.map +1 -0
- package/.opencode/plugin/daytona/tools/lsp.d.ts +17 -0
- package/.opencode/plugin/daytona/tools/lsp.d.ts.map +1 -0
- package/.opencode/plugin/daytona/tools/lsp.js +13 -0
- package/.opencode/plugin/daytona/tools/lsp.js.map +1 -0
- package/.opencode/plugin/daytona/tools/multiedit.d.ts +21 -0
- package/.opencode/plugin/daytona/tools/multiedit.d.ts.map +1 -0
- package/.opencode/plugin/daytona/tools/multiedit.js +23 -0
- package/.opencode/plugin/daytona/tools/multiedit.js.map +1 -0
- package/.opencode/plugin/daytona/tools/patch.d.ts +17 -0
- package/.opencode/plugin/daytona/tools/patch.d.ts.map +1 -0
- package/.opencode/plugin/daytona/tools/patch.js +19 -0
- package/.opencode/plugin/daytona/tools/patch.js.map +1 -0
- package/.opencode/plugin/daytona/tools/read.d.ts +13 -0
- package/.opencode/plugin/daytona/tools/read.d.ts.map +1 -0
- package/.opencode/plugin/daytona/tools/read.js +14 -0
- package/.opencode/plugin/daytona/tools/read.js.map +1 -0
- package/.opencode/plugin/daytona/tools/write.d.ts +15 -0
- package/.opencode/plugin/daytona/tools/write.d.ts.map +1 -0
- package/.opencode/plugin/daytona/tools/write.js +14 -0
- package/.opencode/plugin/daytona/tools/write.js.map +1 -0
- package/.opencode/plugin/daytona/tools.d.ts +130 -0
- package/.opencode/plugin/daytona/tools.d.ts.map +1 -0
- package/.opencode/plugin/daytona/tools.js +30 -0
- package/.opencode/plugin/daytona/tools.js.map +1 -0
- package/.opencode/plugin/index.d.ts +6 -0
- package/.opencode/plugin/index.d.ts.map +1 -0
- package/.opencode/plugin/{index.ts → index.js} +2 -1
- package/.opencode/plugin/index.js.map +1 -0
- package/package.json +6 -1
- package/.opencode/plugin/daytona/core/logger.ts +0 -50
- package/.opencode/plugin/daytona/core/project-data-storage.ts +0 -154
- package/.opencode/plugin/daytona/core/session-manager.ts +0 -170
- package/.opencode/plugin/daytona/core/types.ts +0 -68
- package/.opencode/plugin/daytona/git/host-git-manager.ts +0 -94
- package/.opencode/plugin/daytona/git/index.ts +0 -1
- package/.opencode/plugin/daytona/git/sandbox-git-manager.ts +0 -51
- package/.opencode/plugin/daytona/git/session-git-manager.ts +0 -65
- package/.opencode/plugin/daytona/index.ts +0 -50
- package/.opencode/plugin/daytona/plugins/custom-tools.ts +0 -20
- package/.opencode/plugin/daytona/plugins/session-cleanup.ts +0 -22
- package/.opencode/plugin/daytona/plugins/session-idle-auto-commit.ts +0 -30
- package/.opencode/plugin/daytona/plugins/system-transform.ts +0 -28
- package/.opencode/plugin/daytona/tools/bash.ts +0 -32
- package/.opencode/plugin/daytona/tools/edit.ts +0 -21
- package/.opencode/plugin/daytona/tools/get-preview-url.ts +0 -15
- package/.opencode/plugin/daytona/tools/glob.ts +0 -16
- package/.opencode/plugin/daytona/tools/grep.ts +0 -16
- package/.opencode/plugin/daytona/tools/ls.ts +0 -18
- package/.opencode/plugin/daytona/tools/lsp.ts +0 -15
- package/.opencode/plugin/daytona/tools/multiedit.ts +0 -32
- package/.opencode/plugin/daytona/tools/patch.ts +0 -21
- package/.opencode/plugin/daytona/tools/read.ts +0 -16
- package/.opencode/plugin/daytona/tools/write.ts +0 -16
- package/.opencode/plugin/daytona/tools.ts +0 -33
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const globTool = (sessionManager, projectId, worktree) => ({
|
|
3
|
+
description: 'Searches for files matching a pattern in Daytona sandbox',
|
|
4
|
+
args: {
|
|
5
|
+
pattern: z.string(),
|
|
6
|
+
},
|
|
7
|
+
async execute(args, ctx) {
|
|
8
|
+
const sandbox = await sessionManager.getSandbox(ctx.sessionID, projectId, worktree);
|
|
9
|
+
const workDir = await sandbox.getWorkDir();
|
|
10
|
+
if (!workDir) {
|
|
11
|
+
throw new Error('Work directory not available');
|
|
12
|
+
}
|
|
13
|
+
const result = await sandbox.fs.searchFiles(workDir, args.pattern);
|
|
14
|
+
return result.files.join('\n');
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=glob.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glob.js","sourceRoot":"","sources":["../../../../../.opencode/plugin/daytona/tools/glob.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,cAAqC,EAAE,SAAiB,EAAE,QAAgB,EAAE,EAAE,CAAC,CAAC;IACvG,WAAW,EAAE,0DAA0D;IACvE,IAAI,EAAE;QACJ,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;KACpB;IACD,KAAK,CAAC,OAAO,CAAC,IAAyB,EAAE,GAAgB;QACvD,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAA;QACnF,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,UAAU,EAAE,CAAA;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAA;QACjD,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QAClE,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAChC,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ToolContext } from '@opencode-ai/plugin';
|
|
3
|
+
import type { DaytonaSessionManager } from '../core/session-manager';
|
|
4
|
+
export declare const grepTool: (sessionManager: DaytonaSessionManager, projectId: string, worktree: string) => {
|
|
5
|
+
description: string;
|
|
6
|
+
args: {
|
|
7
|
+
pattern: z.ZodString;
|
|
8
|
+
};
|
|
9
|
+
execute(args: {
|
|
10
|
+
pattern: string;
|
|
11
|
+
}, ctx: ToolContext): Promise<string>;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=grep.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grep.d.ts","sourceRoot":"","sources":["../../../../../.opencode/plugin/daytona/tools/grep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAEpE,eAAO,MAAM,QAAQ,GAAI,gBAAgB,qBAAqB,EAAE,WAAW,MAAM,EAAE,UAAU,MAAM;;;;;kBAK7E;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,OAAO,WAAW;CASzD,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const grepTool = (sessionManager, projectId, worktree) => ({
|
|
3
|
+
description: 'Searches for text pattern in files in Daytona sandbox',
|
|
4
|
+
args: {
|
|
5
|
+
pattern: z.string(),
|
|
6
|
+
},
|
|
7
|
+
async execute(args, ctx) {
|
|
8
|
+
const sandbox = await sessionManager.getSandbox(ctx.sessionID, projectId, worktree);
|
|
9
|
+
const workDir = await sandbox.getWorkDir();
|
|
10
|
+
if (!workDir) {
|
|
11
|
+
throw new Error('Work directory not available');
|
|
12
|
+
}
|
|
13
|
+
const matches = await sandbox.fs.findFiles(workDir, args.pattern);
|
|
14
|
+
return matches.map((m) => `${m.file}:${m.line}: ${m.content}`).join('\n');
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=grep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grep.js","sourceRoot":"","sources":["../../../../../.opencode/plugin/daytona/tools/grep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,cAAqC,EAAE,SAAiB,EAAE,QAAgB,EAAE,EAAE,CAAC,CAAC;IACvG,WAAW,EAAE,uDAAuD;IACpE,IAAI,EAAE;QACJ,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;KACpB;IACD,KAAK,CAAC,OAAO,CAAC,IAAyB,EAAE,GAAgB;QACvD,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAA;QACnF,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,UAAU,EAAE,CAAA;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAA;QACjD,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QACjE,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3E,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ToolContext } from '@opencode-ai/plugin';
|
|
3
|
+
import type { DaytonaSessionManager } from '../core/session-manager';
|
|
4
|
+
export declare const lsTool: (sessionManager: DaytonaSessionManager, projectId: string, worktree: string) => {
|
|
5
|
+
description: string;
|
|
6
|
+
args: {
|
|
7
|
+
dirPath: z.ZodOptional<z.ZodString>;
|
|
8
|
+
};
|
|
9
|
+
execute(args: {
|
|
10
|
+
dirPath?: string;
|
|
11
|
+
}, ctx: ToolContext): Promise<string>;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=ls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ls.d.ts","sourceRoot":"","sources":["../../../../../.opencode/plugin/daytona/tools/ls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAGpE,eAAO,MAAM,MAAM,GAAI,gBAAgB,qBAAqB,EAAE,WAAW,MAAM,EAAE,UAAU,MAAM;;;;;kBAK3E;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,OAAO,WAAW;CAU1D,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const lsTool = (sessionManager, projectId, worktree) => ({
|
|
3
|
+
description: 'Lists files in a directory in Daytona sandbox',
|
|
4
|
+
args: {
|
|
5
|
+
dirPath: z.string().optional(),
|
|
6
|
+
},
|
|
7
|
+
async execute(args, ctx) {
|
|
8
|
+
const sandbox = await sessionManager.getSandbox(ctx.sessionID, projectId, worktree);
|
|
9
|
+
const workDir = await sandbox.getWorkDir();
|
|
10
|
+
const path = args.dirPath || workDir;
|
|
11
|
+
if (!path) {
|
|
12
|
+
throw new Error('Work directory not available');
|
|
13
|
+
}
|
|
14
|
+
const files = (await sandbox.fs.listFiles(path));
|
|
15
|
+
return files.map((f) => f.name).join('\n');
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=ls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ls.js","sourceRoot":"","sources":["../../../../../.opencode/plugin/daytona/tools/ls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,cAAqC,EAAE,SAAiB,EAAE,QAAgB,EAAE,EAAE,CAAC,CAAC;IACrG,WAAW,EAAE,+CAA+C;IAC5D,IAAI,EAAE;QACJ,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC/B;IACD,KAAK,CAAC,OAAO,CAAC,IAA0B,EAAE,GAAgB;QACxD,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAA;QACnF,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,UAAU,EAAE,CAAA;QAC1C,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,IAAI,OAAO,CAAA;QACpC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAA;QACjD,CAAC;QACD,MAAM,KAAK,GAAG,CAAC,MAAM,OAAO,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAe,CAAA;QAC9D,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5C,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ToolContext } from '@opencode-ai/plugin';
|
|
3
|
+
import type { DaytonaSessionManager } from '../core/session-manager';
|
|
4
|
+
export declare const lspTool: (sessionManager: DaytonaSessionManager, projectId: string, worktree: string) => {
|
|
5
|
+
description: string;
|
|
6
|
+
args: {
|
|
7
|
+
op: z.ZodString;
|
|
8
|
+
filePath: z.ZodString;
|
|
9
|
+
line: z.ZodNumber;
|
|
10
|
+
};
|
|
11
|
+
execute(args: {
|
|
12
|
+
op: string;
|
|
13
|
+
filePath: string;
|
|
14
|
+
line: number;
|
|
15
|
+
}, ctx: ToolContext): Promise<string>;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=lsp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lsp.d.ts","sourceRoot":"","sources":["../../../../../.opencode/plugin/daytona/tools/lsp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAEpE,eAAO,MAAM,OAAO,GAAI,gBAAgB,qBAAqB,EAAE,WAAW,MAAM,EAAE,UAAU,MAAM;;;;;;;kBAO5E;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,OAAO,WAAW;CAGpF,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const lspTool = (sessionManager, projectId, worktree) => ({
|
|
3
|
+
description: 'LSP operation in Daytona sandbox (code intelligence)',
|
|
4
|
+
args: {
|
|
5
|
+
op: z.string(),
|
|
6
|
+
filePath: z.string(),
|
|
7
|
+
line: z.number(),
|
|
8
|
+
},
|
|
9
|
+
async execute(args, ctx) {
|
|
10
|
+
return `LSP operations are not yet implemented in the Daytona plugin.`;
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=lsp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lsp.js","sourceRoot":"","sources":["../../../../../.opencode/plugin/daytona/tools/lsp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,cAAqC,EAAE,SAAiB,EAAE,QAAgB,EAAE,EAAE,CAAC,CAAC;IACtG,WAAW,EAAE,sDAAsD;IACnE,IAAI,EAAE;QACJ,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;QACd,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;QACpB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;KACjB;IACD,KAAK,CAAC,OAAO,CAAC,IAAoD,EAAE,GAAgB;QAClF,OAAO,+DAA+D,CAAA;IACxE,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ToolContext } from '@opencode-ai/plugin';
|
|
3
|
+
import type { DaytonaSessionManager } from '../core/session-manager';
|
|
4
|
+
export declare const multieditTool: (sessionManager: DaytonaSessionManager, projectId: string, worktree: string) => {
|
|
5
|
+
description: string;
|
|
6
|
+
args: {
|
|
7
|
+
filePath: z.ZodString;
|
|
8
|
+
edits: z.ZodArray<z.ZodObject<{
|
|
9
|
+
oldString: z.ZodString;
|
|
10
|
+
newString: z.ZodString;
|
|
11
|
+
}, z.core.$strip>>;
|
|
12
|
+
};
|
|
13
|
+
execute(args: {
|
|
14
|
+
filePath: string;
|
|
15
|
+
edits: Array<{
|
|
16
|
+
oldString: string;
|
|
17
|
+
newString: string;
|
|
18
|
+
}>;
|
|
19
|
+
}, ctx: ToolContext): Promise<string>;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=multiedit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiedit.d.ts","sourceRoot":"","sources":["../../../../../.opencode/plugin/daytona/tools/multiedit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAEpE,eAAO,MAAM,aAAa,GAAI,gBAAgB,qBAAqB,EAAE,WAAW,MAAM,EAAE,UAAU,MAAM;;;;;;;;;kBAY9F;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,KAAK,CAAC;YAAE,SAAS,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,OAC7E,WAAW;CAclB,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const multieditTool = (sessionManager, projectId, worktree) => ({
|
|
3
|
+
description: 'Applies multiple edits to a file in Daytona sandbox atomically',
|
|
4
|
+
args: {
|
|
5
|
+
filePath: z.string(),
|
|
6
|
+
edits: z.array(z.object({
|
|
7
|
+
oldString: z.string(),
|
|
8
|
+
newString: z.string(),
|
|
9
|
+
})),
|
|
10
|
+
},
|
|
11
|
+
async execute(args, ctx) {
|
|
12
|
+
const sandbox = await sessionManager.getSandbox(ctx.sessionID, projectId, worktree);
|
|
13
|
+
const buffer = await sandbox.fs.downloadFile(args.filePath);
|
|
14
|
+
const decoder = new TextDecoder();
|
|
15
|
+
let content = decoder.decode(buffer);
|
|
16
|
+
for (const edit of args.edits) {
|
|
17
|
+
content = content.replace(edit.oldString, edit.newString);
|
|
18
|
+
}
|
|
19
|
+
await sandbox.fs.uploadFile(Buffer.from(content), args.filePath);
|
|
20
|
+
return `Applied ${args.edits.length} edits to ${args.filePath}`;
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=multiedit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiedit.js","sourceRoot":"","sources":["../../../../../.opencode/plugin/daytona/tools/multiedit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,cAAqC,EAAE,SAAiB,EAAE,QAAgB,EAAE,EAAE,CAAC,CAAC;IAC5G,WAAW,EAAE,gEAAgE;IAC7E,IAAI,EAAE;QACJ,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;QACpB,KAAK,EAAE,CAAC,CAAC,KAAK,CACZ,CAAC,CAAC,MAAM,CAAC;YACP,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;YACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;SACtB,CAAC,CACH;KACF;IACD,KAAK,CAAC,OAAO,CACX,IAAkF,EAClF,GAAgB;QAEhB,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAA;QACnF,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAC3D,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAA;QACjC,IAAI,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QAEpC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAC9B,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;QAC3D,CAAC;QAED,MAAM,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;QAChE,OAAO,WAAW,IAAI,CAAC,KAAK,CAAC,MAAM,aAAa,IAAI,CAAC,QAAQ,EAAE,CAAA;IACjE,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ToolContext } from '@opencode-ai/plugin';
|
|
3
|
+
import type { DaytonaSessionManager } from '../core/session-manager';
|
|
4
|
+
export declare const patchTool: (sessionManager: DaytonaSessionManager, projectId: string, worktree: string) => {
|
|
5
|
+
description: string;
|
|
6
|
+
args: {
|
|
7
|
+
filePath: z.ZodString;
|
|
8
|
+
oldSnippet: z.ZodString;
|
|
9
|
+
newSnippet: z.ZodString;
|
|
10
|
+
};
|
|
11
|
+
execute(args: {
|
|
12
|
+
filePath: string;
|
|
13
|
+
oldSnippet: string;
|
|
14
|
+
newSnippet: string;
|
|
15
|
+
}, ctx: ToolContext): Promise<string>;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=patch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patch.d.ts","sourceRoot":"","sources":["../../../../../.opencode/plugin/daytona/tools/patch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAEpE,eAAO,MAAM,SAAS,GAAI,gBAAgB,qBAAqB,EAAE,WAAW,MAAM,EAAE,UAAU,MAAM;;;;;;;kBAO9E;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,OAAO,WAAW;CASlG,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const patchTool = (sessionManager, projectId, worktree) => ({
|
|
3
|
+
description: 'Patches a file with a code snippet in Daytona sandbox',
|
|
4
|
+
args: {
|
|
5
|
+
filePath: z.string(),
|
|
6
|
+
oldSnippet: z.string(),
|
|
7
|
+
newSnippet: z.string(),
|
|
8
|
+
},
|
|
9
|
+
async execute(args, ctx) {
|
|
10
|
+
const sandbox = await sessionManager.getSandbox(ctx.sessionID, projectId, worktree);
|
|
11
|
+
const buffer = await sandbox.fs.downloadFile(args.filePath);
|
|
12
|
+
const decoder = new TextDecoder();
|
|
13
|
+
const content = decoder.decode(buffer);
|
|
14
|
+
const newContent = content.replace(args.oldSnippet, args.newSnippet);
|
|
15
|
+
await sandbox.fs.uploadFile(Buffer.from(newContent), args.filePath);
|
|
16
|
+
return `Patched ${args.filePath}`;
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=patch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patch.js","sourceRoot":"","sources":["../../../../../.opencode/plugin/daytona/tools/patch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,cAAqC,EAAE,SAAiB,EAAE,QAAgB,EAAE,EAAE,CAAC,CAAC;IACxG,WAAW,EAAE,uDAAuD;IACpE,IAAI,EAAE;QACJ,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;QACpB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;QACtB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;KACvB;IACD,KAAK,CAAC,OAAO,CAAC,IAAkE,EAAE,GAAgB;QAChG,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAA;QACnF,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAC3D,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAA;QACjC,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QACtC,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAA;QACpE,MAAM,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;QACnE,OAAO,WAAW,IAAI,CAAC,QAAQ,EAAE,CAAA;IACnC,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ToolContext } from '@opencode-ai/plugin';
|
|
3
|
+
import type { DaytonaSessionManager } from '../core/session-manager';
|
|
4
|
+
export declare const readTool: (sessionManager: DaytonaSessionManager, projectId: string, worktree: string) => {
|
|
5
|
+
description: string;
|
|
6
|
+
args: {
|
|
7
|
+
filePath: z.ZodString;
|
|
8
|
+
};
|
|
9
|
+
execute(args: {
|
|
10
|
+
filePath: string;
|
|
11
|
+
}, ctx: ToolContext): Promise<string>;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../../../.opencode/plugin/daytona/tools/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAEpE,eAAO,MAAM,QAAQ,GAAI,gBAAgB,qBAAqB,EAAE,WAAW,MAAM,EAAE,UAAU,MAAM;;;;;kBAK7E;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,OAAO,WAAW;CAM1D,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const readTool = (sessionManager, projectId, worktree) => ({
|
|
3
|
+
description: 'Reads file from Daytona sandbox',
|
|
4
|
+
args: {
|
|
5
|
+
filePath: z.string(),
|
|
6
|
+
},
|
|
7
|
+
async execute(args, ctx) {
|
|
8
|
+
const sandbox = await sessionManager.getSandbox(ctx.sessionID, projectId, worktree);
|
|
9
|
+
const buffer = await sandbox.fs.downloadFile(args.filePath);
|
|
10
|
+
const decoder = new TextDecoder();
|
|
11
|
+
return decoder.decode(buffer);
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../../../../.opencode/plugin/daytona/tools/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,cAAqC,EAAE,SAAiB,EAAE,QAAgB,EAAE,EAAE,CAAC,CAAC;IACvG,WAAW,EAAE,iCAAiC;IAC9C,IAAI,EAAE;QACJ,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;KACrB;IACD,KAAK,CAAC,OAAO,CAAC,IAA0B,EAAE,GAAgB;QACxD,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAA;QACnF,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAC3D,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAA;QACjC,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC/B,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ToolContext } from '@opencode-ai/plugin';
|
|
3
|
+
import type { DaytonaSessionManager } from '../core/session-manager';
|
|
4
|
+
export declare const writeTool: (sessionManager: DaytonaSessionManager, projectId: string, worktree: string) => {
|
|
5
|
+
description: string;
|
|
6
|
+
args: {
|
|
7
|
+
filePath: z.ZodString;
|
|
8
|
+
content: z.ZodString;
|
|
9
|
+
};
|
|
10
|
+
execute(args: {
|
|
11
|
+
filePath: string;
|
|
12
|
+
content: string;
|
|
13
|
+
}, ctx: ToolContext): Promise<string>;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=write.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../../../../../.opencode/plugin/daytona/tools/write.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAEpE,eAAO,MAAM,SAAS,GAAI,gBAAgB,qBAAqB,EAAE,WAAW,MAAM,EAAE,UAAU,MAAM;;;;;;kBAM9E;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,OAAO,WAAW;CAK3E,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const writeTool = (sessionManager, projectId, worktree) => ({
|
|
3
|
+
description: 'Writes content to file in Daytona sandbox',
|
|
4
|
+
args: {
|
|
5
|
+
filePath: z.string(),
|
|
6
|
+
content: z.string(),
|
|
7
|
+
},
|
|
8
|
+
async execute(args, ctx) {
|
|
9
|
+
const sandbox = await sessionManager.getSandbox(ctx.sessionID, projectId, worktree);
|
|
10
|
+
await sandbox.fs.uploadFile(Buffer.from(args.content), args.filePath);
|
|
11
|
+
return `Written ${args.content.length} bytes to ${args.filePath}`;
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=write.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write.js","sourceRoot":"","sources":["../../../../../.opencode/plugin/daytona/tools/write.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,cAAqC,EAAE,SAAiB,EAAE,QAAgB,EAAE,EAAE,CAAC,CAAC;IACxG,WAAW,EAAE,2CAA2C;IACxD,IAAI,EAAE;QACJ,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;QACpB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;KACpB;IACD,KAAK,CAAC,OAAO,CAAC,IAA2C,EAAE,GAAgB;QACzE,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAA;QACnF,MAAM,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;QACrE,OAAO,WAAW,IAAI,CAAC,OAAO,CAAC,MAAM,aAAa,IAAI,CAAC,QAAQ,EAAE,CAAA;IACnE,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool implementations for Daytona sandbox integration
|
|
3
|
+
*/
|
|
4
|
+
import type { DaytonaSessionManager } from './core/session-manager';
|
|
5
|
+
export declare function createDaytonaTools(sessionManager: DaytonaSessionManager, projectId: string, worktree: string): {
|
|
6
|
+
bash: {
|
|
7
|
+
description: string;
|
|
8
|
+
args: {
|
|
9
|
+
command: import("zod").ZodString;
|
|
10
|
+
background: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
11
|
+
};
|
|
12
|
+
execute(args: {
|
|
13
|
+
command: string;
|
|
14
|
+
background?: boolean;
|
|
15
|
+
}, ctx: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
16
|
+
};
|
|
17
|
+
read: {
|
|
18
|
+
description: string;
|
|
19
|
+
args: {
|
|
20
|
+
filePath: import("zod").ZodString;
|
|
21
|
+
};
|
|
22
|
+
execute(args: {
|
|
23
|
+
filePath: string;
|
|
24
|
+
}, ctx: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
25
|
+
};
|
|
26
|
+
write: {
|
|
27
|
+
description: string;
|
|
28
|
+
args: {
|
|
29
|
+
filePath: import("zod").ZodString;
|
|
30
|
+
content: import("zod").ZodString;
|
|
31
|
+
};
|
|
32
|
+
execute(args: {
|
|
33
|
+
filePath: string;
|
|
34
|
+
content: string;
|
|
35
|
+
}, ctx: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
36
|
+
};
|
|
37
|
+
edit: {
|
|
38
|
+
description: string;
|
|
39
|
+
args: {
|
|
40
|
+
filePath: import("zod").ZodString;
|
|
41
|
+
oldString: import("zod").ZodString;
|
|
42
|
+
newString: import("zod").ZodString;
|
|
43
|
+
};
|
|
44
|
+
execute(args: {
|
|
45
|
+
filePath: string;
|
|
46
|
+
oldString: string;
|
|
47
|
+
newString: string;
|
|
48
|
+
}, ctx: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
49
|
+
};
|
|
50
|
+
multiedit: {
|
|
51
|
+
description: string;
|
|
52
|
+
args: {
|
|
53
|
+
filePath: import("zod").ZodString;
|
|
54
|
+
edits: import("zod").ZodArray<import("zod").ZodObject<{
|
|
55
|
+
oldString: import("zod").ZodString;
|
|
56
|
+
newString: import("zod").ZodString;
|
|
57
|
+
}, import("zod/v4/core").$strip>>;
|
|
58
|
+
};
|
|
59
|
+
execute(args: {
|
|
60
|
+
filePath: string;
|
|
61
|
+
edits: Array<{
|
|
62
|
+
oldString: string;
|
|
63
|
+
newString: string;
|
|
64
|
+
}>;
|
|
65
|
+
}, ctx: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
66
|
+
};
|
|
67
|
+
patch: {
|
|
68
|
+
description: string;
|
|
69
|
+
args: {
|
|
70
|
+
filePath: import("zod").ZodString;
|
|
71
|
+
oldSnippet: import("zod").ZodString;
|
|
72
|
+
newSnippet: import("zod").ZodString;
|
|
73
|
+
};
|
|
74
|
+
execute(args: {
|
|
75
|
+
filePath: string;
|
|
76
|
+
oldSnippet: string;
|
|
77
|
+
newSnippet: string;
|
|
78
|
+
}, ctx: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
79
|
+
};
|
|
80
|
+
ls: {
|
|
81
|
+
description: string;
|
|
82
|
+
args: {
|
|
83
|
+
dirPath: import("zod").ZodOptional<import("zod").ZodString>;
|
|
84
|
+
};
|
|
85
|
+
execute(args: {
|
|
86
|
+
dirPath?: string;
|
|
87
|
+
}, ctx: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
88
|
+
};
|
|
89
|
+
glob: {
|
|
90
|
+
description: string;
|
|
91
|
+
args: {
|
|
92
|
+
pattern: import("zod").ZodString;
|
|
93
|
+
};
|
|
94
|
+
execute(args: {
|
|
95
|
+
pattern: string;
|
|
96
|
+
}, ctx: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
97
|
+
};
|
|
98
|
+
grep: {
|
|
99
|
+
description: string;
|
|
100
|
+
args: {
|
|
101
|
+
pattern: import("zod").ZodString;
|
|
102
|
+
};
|
|
103
|
+
execute(args: {
|
|
104
|
+
pattern: string;
|
|
105
|
+
}, ctx: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
106
|
+
};
|
|
107
|
+
lsp: {
|
|
108
|
+
description: string;
|
|
109
|
+
args: {
|
|
110
|
+
op: import("zod").ZodString;
|
|
111
|
+
filePath: import("zod").ZodString;
|
|
112
|
+
line: import("zod").ZodNumber;
|
|
113
|
+
};
|
|
114
|
+
execute(args: {
|
|
115
|
+
op: string;
|
|
116
|
+
filePath: string;
|
|
117
|
+
line: number;
|
|
118
|
+
}, ctx: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
119
|
+
};
|
|
120
|
+
getPreviewURL: {
|
|
121
|
+
description: string;
|
|
122
|
+
args: {
|
|
123
|
+
port: import("zod").ZodNumber;
|
|
124
|
+
};
|
|
125
|
+
execute(args: {
|
|
126
|
+
port: number;
|
|
127
|
+
}, ctx: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../../.opencode/plugin/daytona/tools.ts"],"names":[],"mappings":"AAAA;;GAEG;AAcH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAEnE,wBAAgB,kBAAkB,CAAC,cAAc,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;;;;;;;;;sBAL9F,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBZ"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool implementations for Daytona sandbox integration
|
|
3
|
+
*/
|
|
4
|
+
import { bashTool } from './tools/bash';
|
|
5
|
+
import { readTool } from './tools/read';
|
|
6
|
+
import { writeTool } from './tools/write';
|
|
7
|
+
import { editTool } from './tools/edit';
|
|
8
|
+
import { multieditTool } from './tools/multiedit';
|
|
9
|
+
import { patchTool } from './tools/patch';
|
|
10
|
+
import { lsTool } from './tools/ls';
|
|
11
|
+
import { globTool } from './tools/glob';
|
|
12
|
+
import { grepTool } from './tools/grep';
|
|
13
|
+
import { lspTool } from './tools/lsp';
|
|
14
|
+
import { getPreviewURLTool } from './tools/get-preview-url';
|
|
15
|
+
export function createDaytonaTools(sessionManager, projectId, worktree) {
|
|
16
|
+
return {
|
|
17
|
+
bash: bashTool(sessionManager, projectId, worktree),
|
|
18
|
+
read: readTool(sessionManager, projectId, worktree),
|
|
19
|
+
write: writeTool(sessionManager, projectId, worktree),
|
|
20
|
+
edit: editTool(sessionManager, projectId, worktree),
|
|
21
|
+
multiedit: multieditTool(sessionManager, projectId, worktree),
|
|
22
|
+
patch: patchTool(sessionManager, projectId, worktree),
|
|
23
|
+
ls: lsTool(sessionManager, projectId, worktree),
|
|
24
|
+
glob: globTool(sessionManager, projectId, worktree),
|
|
25
|
+
grep: grepTool(sessionManager, projectId, worktree),
|
|
26
|
+
lsp: lspTool(sessionManager, projectId, worktree),
|
|
27
|
+
getPreviewURL: getPreviewURLTool(sessionManager, projectId, worktree),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../../../.opencode/plugin/daytona/tools.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAI3D,MAAM,UAAU,kBAAkB,CAAC,cAAqC,EAAE,SAAiB,EAAE,QAAgB;IAC3G,OAAO;QACL,IAAI,EAAE,QAAQ,CAAC,cAAc,EAAE,SAAS,EAAE,QAAQ,CAAC;QACnD,IAAI,EAAE,QAAQ,CAAC,cAAc,EAAE,SAAS,EAAE,QAAQ,CAAC;QACnD,KAAK,EAAE,SAAS,CAAC,cAAc,EAAE,SAAS,EAAE,QAAQ,CAAC;QACrD,IAAI,EAAE,QAAQ,CAAC,cAAc,EAAE,SAAS,EAAE,QAAQ,CAAC;QACnD,SAAS,EAAE,aAAa,CAAC,cAAc,EAAE,SAAS,EAAE,QAAQ,CAAC;QAC7D,KAAK,EAAE,SAAS,CAAC,cAAc,EAAE,SAAS,EAAE,QAAQ,CAAC;QACrD,EAAE,EAAE,MAAM,CAAC,cAAc,EAAE,SAAS,EAAE,QAAQ,CAAC;QAC/C,IAAI,EAAE,QAAQ,CAAC,cAAc,EAAE,SAAS,EAAE,QAAQ,CAAC;QACnD,IAAI,EAAE,QAAQ,CAAC,cAAc,EAAE,SAAS,EAAE,QAAQ,CAAC;QACnD,GAAG,EAAE,OAAO,CAAC,cAAc,EAAE,SAAS,EAAE,QAAQ,CAAC;QACjD,aAAa,EAAE,iBAAiB,CAAC,cAAc,EAAE,SAAS,EAAE,QAAQ,CAAC;KACtE,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../.opencode/plugin/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../.opencode/plugin/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,oBAAoB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jamesmurdza/opencode-daytona",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"description": "OpenCode plugin that automatically runs all sessions in Daytona sandboxes for isolated, reproducible development environments",
|
|
5
5
|
"files": [
|
|
6
6
|
".opencode"
|
|
7
7
|
],
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "rm -rf dist && tsc --project tsconfig.build.json && cp package.json README.md dist/ && cp .npmignore dist/ 2>/dev/null || true",
|
|
10
|
+
"pack": "npm run build && cd dist && npm pack --dry-run",
|
|
11
|
+
"prepack": "npm run build"
|
|
12
|
+
},
|
|
8
13
|
"keywords": [
|
|
9
14
|
"daytona",
|
|
10
15
|
"opencode",
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Logger class for handling plugin logging
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { appendFileSync, statSync, truncateSync } from 'fs'
|
|
6
|
-
import type { LogLevel } from './types'
|
|
7
|
-
import { LOG_LEVEL_INFO, LOG_LEVEL_ERROR, LOG_LEVEL_WARN } from './types'
|
|
8
|
-
|
|
9
|
-
let logFilePath: string | undefined
|
|
10
|
-
|
|
11
|
-
export function setLogFilePath(path: string) {
|
|
12
|
-
logFilePath = path
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
class Logger {
|
|
16
|
-
private get logFile() {
|
|
17
|
-
if (!logFilePath) throw new Error('Logger file path not set. Call setLogFilePath(path) before use.')
|
|
18
|
-
return logFilePath
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
log(message: string, level: LogLevel = LOG_LEVEL_INFO): void {
|
|
22
|
-
// Truncate log file if it exceeds 5MB
|
|
23
|
-
try {
|
|
24
|
-
const stats = statSync(this.logFile)
|
|
25
|
-
const maxSize = 5 * 1024 * 1024 // 5MB
|
|
26
|
-
if (stats.size > maxSize) {
|
|
27
|
-
truncateSync(this.logFile, 0)
|
|
28
|
-
}
|
|
29
|
-
} catch (err) {
|
|
30
|
-
// File may not exist yet, ignore
|
|
31
|
-
}
|
|
32
|
-
const timestamp = new Date().toISOString()
|
|
33
|
-
const logEntry = `[${timestamp}] [${level}] ${message}\n`
|
|
34
|
-
appendFileSync(this.logFile, logEntry)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
info(message: string): void {
|
|
38
|
-
this.log(message, LOG_LEVEL_INFO)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
error(message: string): void {
|
|
42
|
-
this.log(message, LOG_LEVEL_ERROR)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
warn(message: string): void {
|
|
46
|
-
this.log(message, LOG_LEVEL_WARN)
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export const logger = new Logger()
|