@daytona/opencode 0.0.0-dev
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.js +64 -0
- package/.opencode/plugin/daytona/core/logger.js.map +1 -0
- package/.opencode/plugin/daytona/core/project-data-storage.d.ts +42 -0
- package/.opencode/plugin/daytona/core/project-data-storage.js +171 -0
- package/.opencode/plugin/daytona/core/project-data-storage.js.map +1 -0
- package/.opencode/plugin/daytona/core/session-manager.d.ts +46 -0
- package/.opencode/plugin/daytona/core/session-manager.js +239 -0
- package/.opencode/plugin/daytona/core/session-manager.js.map +1 -0
- package/.opencode/plugin/daytona/core/toast.d.ts +47 -0
- package/.opencode/plugin/daytona/core/toast.js +73 -0
- package/.opencode/plugin/daytona/core/toast.js.map +1 -0
- package/.opencode/plugin/daytona/core/types.d.ts +53 -0
- package/.opencode/plugin/daytona/core/types.js +15 -0
- package/.opencode/plugin/daytona/core/types.js.map +1 -0
- package/.opencode/plugin/daytona/git/host-git-manager.d.ts +40 -0
- package/.opencode/plugin/daytona/git/host-git-manager.js +283 -0
- package/.opencode/plugin/daytona/git/host-git-manager.js.map +1 -0
- package/.opencode/plugin/daytona/git/index.d.ts +5 -0
- package/.opencode/plugin/daytona/git/index.js +10 -0
- package/.opencode/plugin/daytona/git/index.js.map +1 -0
- package/.opencode/plugin/daytona/git/sandbox-git-manager.d.ts +14 -0
- package/.opencode/plugin/daytona/git/sandbox-git-manager.js +68 -0
- package/.opencode/plugin/daytona/git/sandbox-git-manager.js.map +1 -0
- package/.opencode/plugin/daytona/git/session-git-manager.d.ts +43 -0
- package/.opencode/plugin/daytona/git/session-git-manager.js +132 -0
- package/.opencode/plugin/daytona/git/session-git-manager.js.map +1 -0
- package/.opencode/plugin/daytona/index.d.ts +134 -0
- package/.opencode/plugin/daytona/index.js +48 -0
- package/.opencode/plugin/daytona/index.js.map +1 -0
- package/.opencode/plugin/daytona/plugins/custom-tools.d.ts +132 -0
- package/.opencode/plugin/daytona/plugins/custom-tools.js +19 -0
- package/.opencode/plugin/daytona/plugins/custom-tools.js.map +1 -0
- package/.opencode/plugin/daytona/plugins/session-events.d.ts +10 -0
- package/.opencode/plugin/daytona/plugins/session-events.js +55 -0
- package/.opencode/plugin/daytona/plugins/session-events.js.map +1 -0
- package/.opencode/plugin/daytona/plugins/system-transform.d.ts +10 -0
- package/.opencode/plugin/daytona/plugins/system-transform.js +24 -0
- package/.opencode/plugin/daytona/plugins/system-transform.js.map +1 -0
- package/.opencode/plugin/daytona/tools/bash.d.ts +19 -0
- package/.opencode/plugin/daytona/tools/bash.js +42 -0
- package/.opencode/plugin/daytona/tools/bash.js.map +1 -0
- package/.opencode/plugin/daytona/tools/edit.d.ts +21 -0
- package/.opencode/plugin/daytona/tools/edit.js +27 -0
- package/.opencode/plugin/daytona/tools/edit.js.map +1 -0
- package/.opencode/plugin/daytona/tools/get-preview-url.d.ts +17 -0
- package/.opencode/plugin/daytona/tools/get-preview-url.js +21 -0
- package/.opencode/plugin/daytona/tools/get-preview-url.js.map +1 -0
- package/.opencode/plugin/daytona/tools/glob.d.ts +17 -0
- package/.opencode/plugin/daytona/tools/glob.js +25 -0
- package/.opencode/plugin/daytona/tools/glob.js.map +1 -0
- package/.opencode/plugin/daytona/tools/grep.d.ts +17 -0
- package/.opencode/plugin/daytona/tools/grep.js +25 -0
- package/.opencode/plugin/daytona/tools/grep.js.map +1 -0
- package/.opencode/plugin/daytona/tools/ls.d.ts +17 -0
- package/.opencode/plugin/daytona/tools/ls.js +26 -0
- package/.opencode/plugin/daytona/tools/ls.js.map +1 -0
- package/.opencode/plugin/daytona/tools/lsp.d.ts +21 -0
- package/.opencode/plugin/daytona/tools/lsp.js +21 -0
- package/.opencode/plugin/daytona/tools/lsp.js.map +1 -0
- package/.opencode/plugin/daytona/tools/multiedit.d.ts +25 -0
- package/.opencode/plugin/daytona/tools/multiedit.js +31 -0
- package/.opencode/plugin/daytona/tools/multiedit.js.map +1 -0
- package/.opencode/plugin/daytona/tools/patch.d.ts +19 -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 +17 -0
- package/.opencode/plugin/daytona/tools/read.js +22 -0
- package/.opencode/plugin/daytona/tools/read.js.map +1 -0
- package/.opencode/plugin/daytona/tools/write.d.ts +19 -0
- package/.opencode/plugin/daytona/tools/write.js +22 -0
- package/.opencode/plugin/daytona/tools/write.js.map +1 -0
- package/.opencode/plugin/daytona/tools.d.ts +129 -0
- package/.opencode/plugin/daytona/tools.js +38 -0
- package/.opencode/plugin/daytona/tools.js.map +1 -0
- package/.opencode/plugin/index.d.ts +9 -0
- package/.opencode/plugin/index.js +15 -0
- package/.opencode/plugin/index.js.map +1 -0
- package/README.md +238 -0
- package/package.json +56 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bash.js","sourceRoot":"","sources":["../../../../../../../libs/opencode-plugin/.opencode/plugin/daytona/tools/bash.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6BAAuB;AAKhB,MAAM,QAAQ,GAAG,CACtB,cAAqC,EACrC,SAAiB,EACjB,QAAgB,EAChB,SAAsB,EACtB,QAAgB,EAChB,EAAE,CAAC,CAAC;IACJ,WAAW,EAAE,8CAA8C;IAC3D,IAAI,EAAE;QACJ,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;QACnB,UAAU,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;KACnC;IACD,KAAK,CAAC,OAAO,CAAC,IAA+C,EAAE,GAAgB;QAC7E,MAAM,SAAS,GAAG,GAAG,CAAC,SAAS,CAAA;QAC/B,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,UAAU,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAA;QAE1F,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,MAAM,aAAa,GAAG,gBAAgB,SAAS,EAAE,CAAA;YACjD,IAAI,CAAC;gBACH,MAAM,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;YACjD,CAAC;YAAC,MAAM,CAAC;gBACP,MAAM,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,CAAA;YACpD,CAAC;YACD,MAAM,OAAO,CAAC,OAAO,CAAC,qBAAqB,CAAC,aAAa,EAAE;gBACzD,OAAO,EAAE,MAAM,QAAQ,EAAE;aAC1B,CAAC,CAAA;YACF,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,qBAAqB,CAAC,aAAa,EAAE;gBACxE,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,QAAQ,EAAE,IAAI;aACf,CAAC,CAAA;YACF,OAAO,yCAAyC,MAAM,CAAC,KAAK,GAAG,CAAA;QACjE,CAAC;aAAM,CAAC;YACN,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;YAC3E,OAAO,cAAc,MAAM,CAAC,QAAQ,KAAK,MAAM,CAAC,MAAM,EAAE,CAAA;QAC1D,CAAC;IACH,CAAC;CACF,CAAC,CAAA;AApCW,QAAA,QAAQ,YAoCnB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Daytona Platforms Inc.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
7
|
+
import type { ToolContext } from '@opencode-ai/plugin/tool';
|
|
8
|
+
import type { DaytonaSessionManager } from '../core/session-manager';
|
|
9
|
+
export declare const editTool: (sessionManager: DaytonaSessionManager, projectId: string, worktree: string, pluginCtx: PluginInput) => {
|
|
10
|
+
description: string;
|
|
11
|
+
args: {
|
|
12
|
+
filePath: z.ZodString;
|
|
13
|
+
oldString: z.ZodString;
|
|
14
|
+
newString: z.ZodString;
|
|
15
|
+
};
|
|
16
|
+
execute(args: {
|
|
17
|
+
filePath: string;
|
|
18
|
+
oldString: string;
|
|
19
|
+
newString: string;
|
|
20
|
+
}, ctx: ToolContext): Promise<string>;
|
|
21
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright Daytona Platforms Inc.
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.editTool = void 0;
|
|
8
|
+
const zod_1 = require("zod");
|
|
9
|
+
const editTool = (sessionManager, projectId, worktree, pluginCtx) => ({
|
|
10
|
+
description: 'Replaces text in a file in Daytona sandbox',
|
|
11
|
+
args: {
|
|
12
|
+
filePath: zod_1.z.string(),
|
|
13
|
+
oldString: zod_1.z.string(),
|
|
14
|
+
newString: zod_1.z.string(),
|
|
15
|
+
},
|
|
16
|
+
async execute(args, ctx) {
|
|
17
|
+
const sandbox = await sessionManager.getSandbox(ctx.sessionID, projectId, worktree, pluginCtx);
|
|
18
|
+
const buffer = await sandbox.fs.downloadFile(args.filePath);
|
|
19
|
+
const decoder = new TextDecoder();
|
|
20
|
+
const content = decoder.decode(buffer);
|
|
21
|
+
const newContent = content.replace(args.oldString, args.newString);
|
|
22
|
+
await sandbox.fs.uploadFile(Buffer.from(newContent), args.filePath);
|
|
23
|
+
return `Edited ${args.filePath}`;
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
exports.editTool = editTool;
|
|
27
|
+
//# sourceMappingURL=edit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit.js","sourceRoot":"","sources":["../../../../../../../libs/opencode-plugin/.opencode/plugin/daytona/tools/edit.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6BAAuB;AAKhB,MAAM,QAAQ,GAAG,CACtB,cAAqC,EACrC,SAAiB,EACjB,QAAgB,EAChB,SAAsB,EACtB,EAAE,CAAC,CAAC;IACJ,WAAW,EAAE,4CAA4C;IACzD,IAAI,EAAE;QACJ,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;QACpB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;QACrB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;KACtB;IACD,KAAK,CAAC,OAAO,CAAC,IAAgE,EAAE,GAAgB;QAC9F,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAA;QAC9F,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,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;QAClE,MAAM,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;QACnE,OAAO,UAAU,IAAI,CAAC,QAAQ,EAAE,CAAA;IAClC,CAAC;CACF,CAAC,CAAA;AArBW,QAAA,QAAQ,YAqBnB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Daytona Platforms Inc.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
7
|
+
import type { ToolContext } from '@opencode-ai/plugin/tool';
|
|
8
|
+
import type { DaytonaSessionManager } from '../core/session-manager';
|
|
9
|
+
export declare const getPreviewURLTool: (sessionManager: DaytonaSessionManager, projectId: string, worktree: string, pluginCtx: PluginInput) => {
|
|
10
|
+
description: string;
|
|
11
|
+
args: {
|
|
12
|
+
port: z.ZodNumber;
|
|
13
|
+
};
|
|
14
|
+
execute(args: {
|
|
15
|
+
port: number;
|
|
16
|
+
}, ctx: ToolContext): Promise<string>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright Daytona Platforms Inc.
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.getPreviewURLTool = void 0;
|
|
8
|
+
const zod_1 = require("zod");
|
|
9
|
+
const getPreviewURLTool = (sessionManager, projectId, worktree, pluginCtx) => ({
|
|
10
|
+
description: 'Gets a preview URL for the Daytona sandbox',
|
|
11
|
+
args: {
|
|
12
|
+
port: zod_1.z.number(),
|
|
13
|
+
},
|
|
14
|
+
async execute(args, ctx) {
|
|
15
|
+
const sandbox = await sessionManager.getSandbox(ctx.sessionID, projectId, worktree, pluginCtx);
|
|
16
|
+
const previewLink = await sandbox.getPreviewLink(args.port);
|
|
17
|
+
return `Sandbox Preview URL: ${previewLink.url}`;
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
exports.getPreviewURLTool = getPreviewURLTool;
|
|
21
|
+
//# sourceMappingURL=get-preview-url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-preview-url.js","sourceRoot":"","sources":["../../../../../../../libs/opencode-plugin/.opencode/plugin/daytona/tools/get-preview-url.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6BAAuB;AAKhB,MAAM,iBAAiB,GAAG,CAC/B,cAAqC,EACrC,SAAiB,EACjB,QAAgB,EAChB,SAAsB,EACtB,EAAE,CAAC,CAAC;IACJ,WAAW,EAAE,4CAA4C;IACzD,IAAI,EAAE;QACJ,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;KACjB;IACD,KAAK,CAAC,OAAO,CAAC,IAAsB,EAAE,GAAgB;QACpD,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAA;QAC9F,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC3D,OAAO,wBAAwB,WAAW,CAAC,GAAG,EAAE,CAAA;IAClD,CAAC;CACF,CAAC,CAAA;AAfW,QAAA,iBAAiB,qBAe5B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Daytona Platforms Inc.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
7
|
+
import type { ToolContext } from '@opencode-ai/plugin/tool';
|
|
8
|
+
import type { DaytonaSessionManager } from '../core/session-manager';
|
|
9
|
+
export declare const globTool: (sessionManager: DaytonaSessionManager, projectId: string, worktree: string, pluginCtx: PluginInput) => {
|
|
10
|
+
description: string;
|
|
11
|
+
args: {
|
|
12
|
+
pattern: z.ZodString;
|
|
13
|
+
};
|
|
14
|
+
execute(args: {
|
|
15
|
+
pattern: string;
|
|
16
|
+
}, ctx: ToolContext): Promise<string>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright Daytona Platforms Inc.
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.globTool = void 0;
|
|
8
|
+
const zod_1 = require("zod");
|
|
9
|
+
const globTool = (sessionManager, projectId, worktree, pluginCtx) => ({
|
|
10
|
+
description: 'Searches for files matching a pattern in Daytona sandbox',
|
|
11
|
+
args: {
|
|
12
|
+
pattern: zod_1.z.string(),
|
|
13
|
+
},
|
|
14
|
+
async execute(args, ctx) {
|
|
15
|
+
const sandbox = await sessionManager.getSandbox(ctx.sessionID, projectId, worktree, pluginCtx);
|
|
16
|
+
const workDir = await sandbox.getWorkDir();
|
|
17
|
+
if (!workDir) {
|
|
18
|
+
throw new Error('Work directory not available');
|
|
19
|
+
}
|
|
20
|
+
const result = await sandbox.fs.searchFiles(workDir, args.pattern);
|
|
21
|
+
return result.files.join('\n');
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
exports.globTool = globTool;
|
|
25
|
+
//# sourceMappingURL=glob.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glob.js","sourceRoot":"","sources":["../../../../../../../libs/opencode-plugin/.opencode/plugin/daytona/tools/glob.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6BAAuB;AAKhB,MAAM,QAAQ,GAAG,CACtB,cAAqC,EACrC,SAAiB,EACjB,QAAgB,EAChB,SAAsB,EACtB,EAAE,CAAC,CAAC;IACJ,WAAW,EAAE,0DAA0D;IACvE,IAAI,EAAE;QACJ,OAAO,EAAE,OAAC,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,EAAE,SAAS,CAAC,CAAA;QAC9F,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;AAnBW,QAAA,QAAQ,YAmBnB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Daytona Platforms Inc.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
7
|
+
import type { ToolContext } from '@opencode-ai/plugin/tool';
|
|
8
|
+
import type { DaytonaSessionManager } from '../core/session-manager';
|
|
9
|
+
export declare const grepTool: (sessionManager: DaytonaSessionManager, projectId: string, worktree: string, pluginCtx: PluginInput) => {
|
|
10
|
+
description: string;
|
|
11
|
+
args: {
|
|
12
|
+
pattern: z.ZodString;
|
|
13
|
+
};
|
|
14
|
+
execute(args: {
|
|
15
|
+
pattern: string;
|
|
16
|
+
}, ctx: ToolContext): Promise<string>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright Daytona Platforms Inc.
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.grepTool = void 0;
|
|
8
|
+
const zod_1 = require("zod");
|
|
9
|
+
const grepTool = (sessionManager, projectId, worktree, pluginCtx) => ({
|
|
10
|
+
description: 'Searches for text pattern in files in Daytona sandbox',
|
|
11
|
+
args: {
|
|
12
|
+
pattern: zod_1.z.string(),
|
|
13
|
+
},
|
|
14
|
+
async execute(args, ctx) {
|
|
15
|
+
const sandbox = await sessionManager.getSandbox(ctx.sessionID, projectId, worktree, pluginCtx);
|
|
16
|
+
const workDir = await sandbox.getWorkDir();
|
|
17
|
+
if (!workDir) {
|
|
18
|
+
throw new Error('Work directory not available');
|
|
19
|
+
}
|
|
20
|
+
const matches = await sandbox.fs.findFiles(workDir, args.pattern);
|
|
21
|
+
return matches.map((m) => `${m.file}:${m.line}: ${m.content}`).join('\n');
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
exports.grepTool = grepTool;
|
|
25
|
+
//# sourceMappingURL=grep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grep.js","sourceRoot":"","sources":["../../../../../../../libs/opencode-plugin/.opencode/plugin/daytona/tools/grep.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6BAAuB;AAMhB,MAAM,QAAQ,GAAG,CACtB,cAAqC,EACrC,SAAiB,EACjB,QAAgB,EAChB,SAAsB,EACtB,EAAE,CAAC,CAAC;IACJ,WAAW,EAAE,uDAAuD;IACpE,IAAI,EAAE;QACJ,OAAO,EAAE,OAAC,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,EAAE,SAAS,CAAC,CAAA;QAC9F,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,CAAQ,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAClF,CAAC;CACF,CAAC,CAAA;AAnBW,QAAA,QAAQ,YAmBnB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Daytona Platforms Inc.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
7
|
+
import type { ToolContext } from '@opencode-ai/plugin/tool';
|
|
8
|
+
import type { DaytonaSessionManager } from '../core/session-manager';
|
|
9
|
+
export declare const lsTool: (sessionManager: DaytonaSessionManager, projectId: string, worktree: string, pluginCtx: PluginInput) => {
|
|
10
|
+
description: string;
|
|
11
|
+
args: {
|
|
12
|
+
dirPath: z.ZodOptional<z.ZodString>;
|
|
13
|
+
};
|
|
14
|
+
execute(args: {
|
|
15
|
+
dirPath?: string;
|
|
16
|
+
}, ctx: ToolContext): Promise<string>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright Daytona Platforms Inc.
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.lsTool = void 0;
|
|
8
|
+
const zod_1 = require("zod");
|
|
9
|
+
const lsTool = (sessionManager, projectId, worktree, pluginCtx) => ({
|
|
10
|
+
description: 'Lists files in a directory in Daytona sandbox',
|
|
11
|
+
args: {
|
|
12
|
+
dirPath: zod_1.z.string().optional(),
|
|
13
|
+
},
|
|
14
|
+
async execute(args, ctx) {
|
|
15
|
+
const sandbox = await sessionManager.getSandbox(ctx.sessionID, projectId, worktree, pluginCtx);
|
|
16
|
+
const workDir = await sandbox.getWorkDir();
|
|
17
|
+
const path = args.dirPath || workDir;
|
|
18
|
+
if (!path) {
|
|
19
|
+
throw new Error('Work directory not available');
|
|
20
|
+
}
|
|
21
|
+
const files = (await sandbox.fs.listFiles(path));
|
|
22
|
+
return files.map((f) => f.name).join('\n');
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
exports.lsTool = lsTool;
|
|
26
|
+
//# sourceMappingURL=ls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ls.js","sourceRoot":"","sources":["../../../../../../../libs/opencode-plugin/.opencode/plugin/daytona/tools/ls.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6BAAuB;AAMhB,MAAM,MAAM,GAAG,CACpB,cAAqC,EACrC,SAAiB,EACjB,QAAgB,EAChB,SAAsB,EACtB,EAAE,CAAC,CAAC;IACJ,WAAW,EAAE,+CAA+C;IAC5D,IAAI,EAAE;QACJ,OAAO,EAAE,OAAC,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,EAAE,SAAS,CAAC,CAAA;QAC9F,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;AApBW,QAAA,MAAM,UAoBjB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Daytona Platforms Inc.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
7
|
+
import type { ToolContext } from '@opencode-ai/plugin/tool';
|
|
8
|
+
import type { DaytonaSessionManager } from '../core/session-manager';
|
|
9
|
+
export declare const lspTool: (sessionManager: DaytonaSessionManager, projectId: string, worktree: string, pluginCtx: PluginInput) => {
|
|
10
|
+
description: string;
|
|
11
|
+
args: {
|
|
12
|
+
op: z.ZodString;
|
|
13
|
+
filePath: z.ZodString;
|
|
14
|
+
line: z.ZodNumber;
|
|
15
|
+
};
|
|
16
|
+
execute(args: {
|
|
17
|
+
op: string;
|
|
18
|
+
filePath: string;
|
|
19
|
+
line: number;
|
|
20
|
+
}, ctx: ToolContext): Promise<string>;
|
|
21
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright Daytona Platforms Inc.
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.lspTool = void 0;
|
|
8
|
+
const zod_1 = require("zod");
|
|
9
|
+
const lspTool = (sessionManager, projectId, worktree, pluginCtx) => ({
|
|
10
|
+
description: 'LSP operation in Daytona sandbox (code intelligence)',
|
|
11
|
+
args: {
|
|
12
|
+
op: zod_1.z.string(),
|
|
13
|
+
filePath: zod_1.z.string(),
|
|
14
|
+
line: zod_1.z.number(),
|
|
15
|
+
},
|
|
16
|
+
async execute(args, ctx) {
|
|
17
|
+
return `LSP operations are not yet implemented in the Daytona plugin.`;
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
exports.lspTool = lspTool;
|
|
21
|
+
//# sourceMappingURL=lsp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lsp.js","sourceRoot":"","sources":["../../../../../../../libs/opencode-plugin/.opencode/plugin/daytona/tools/lsp.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6BAAuB;AAKhB,MAAM,OAAO,GAAG,CACrB,cAAqC,EACrC,SAAiB,EACjB,QAAgB,EAChB,SAAsB,EACtB,EAAE,CAAC,CAAC;IACJ,WAAW,EAAE,sDAAsD;IACnE,IAAI,EAAE;QACJ,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;QACd,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;QACpB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;KACjB;IACD,KAAK,CAAC,OAAO,CAAC,IAAoD,EAAE,GAAgB;QAClF,OAAO,+DAA+D,CAAA;IACxE,CAAC;CACF,CAAC,CAAA;AAfW,QAAA,OAAO,WAelB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Daytona Platforms Inc.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
7
|
+
import type { ToolContext } from '@opencode-ai/plugin/tool';
|
|
8
|
+
import type { DaytonaSessionManager } from '../core/session-manager';
|
|
9
|
+
export declare const multieditTool: (sessionManager: DaytonaSessionManager, projectId: string, worktree: string, pluginCtx: PluginInput) => {
|
|
10
|
+
description: string;
|
|
11
|
+
args: {
|
|
12
|
+
filePath: z.ZodString;
|
|
13
|
+
edits: z.ZodArray<z.ZodObject<{
|
|
14
|
+
oldString: z.ZodString;
|
|
15
|
+
newString: z.ZodString;
|
|
16
|
+
}, z.core.$strip>>;
|
|
17
|
+
};
|
|
18
|
+
execute(args: {
|
|
19
|
+
filePath: string;
|
|
20
|
+
edits: Array<{
|
|
21
|
+
oldString: string;
|
|
22
|
+
newString: string;
|
|
23
|
+
}>;
|
|
24
|
+
}, ctx: ToolContext): Promise<string>;
|
|
25
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright Daytona Platforms Inc.
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.multieditTool = void 0;
|
|
8
|
+
const zod_1 = require("zod");
|
|
9
|
+
const multieditTool = (sessionManager, projectId, worktree, pluginCtx) => ({
|
|
10
|
+
description: 'Applies multiple edits to a file in Daytona sandbox atomically',
|
|
11
|
+
args: {
|
|
12
|
+
filePath: zod_1.z.string(),
|
|
13
|
+
edits: zod_1.z.array(zod_1.z.object({
|
|
14
|
+
oldString: zod_1.z.string(),
|
|
15
|
+
newString: zod_1.z.string(),
|
|
16
|
+
})),
|
|
17
|
+
},
|
|
18
|
+
async execute(args, ctx) {
|
|
19
|
+
const sandbox = await sessionManager.getSandbox(ctx.sessionID, projectId, worktree, pluginCtx);
|
|
20
|
+
const buffer = await sandbox.fs.downloadFile(args.filePath);
|
|
21
|
+
const decoder = new TextDecoder();
|
|
22
|
+
let content = decoder.decode(buffer);
|
|
23
|
+
for (const edit of args.edits) {
|
|
24
|
+
content = content.replace(edit.oldString, edit.newString);
|
|
25
|
+
}
|
|
26
|
+
await sandbox.fs.uploadFile(Buffer.from(content), args.filePath);
|
|
27
|
+
return `Applied ${args.edits.length} edits to ${args.filePath}`;
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
exports.multieditTool = multieditTool;
|
|
31
|
+
//# sourceMappingURL=multiedit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiedit.js","sourceRoot":"","sources":["../../../../../../../libs/opencode-plugin/.opencode/plugin/daytona/tools/multiedit.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6BAAuB;AAKhB,MAAM,aAAa,GAAG,CAC3B,cAAqC,EACrC,SAAiB,EACjB,QAAgB,EAChB,SAAsB,EACtB,EAAE,CAAC,CAAC;IACJ,WAAW,EAAE,gEAAgE;IAC7E,IAAI,EAAE;QACJ,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;QACpB,KAAK,EAAE,OAAC,CAAC,KAAK,CACZ,OAAC,CAAC,MAAM,CAAC;YACP,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;YACrB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;SACtB,CAAC,CACH;KACF;IACD,KAAK,CAAC,OAAO,CAAC,IAAkF,EAAE,GAAgB;QAChH,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAA;QAC9F,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;AA7BW,QAAA,aAAa,iBA6BxB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Daytona Platforms Inc.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
7
|
+
import type { ToolContext } from '@opencode-ai/plugin/tool';
|
|
8
|
+
import type { DaytonaSessionManager } from '../core/session-manager';
|
|
9
|
+
export declare const patchTool: (sessionManager: DaytonaSessionManager, projectId: string, worktree: string, pluginCtx: PluginInput) => {
|
|
10
|
+
description: string;
|
|
11
|
+
args: {
|
|
12
|
+
patchText: z.ZodString;
|
|
13
|
+
};
|
|
14
|
+
execute(args: {
|
|
15
|
+
filePath: string;
|
|
16
|
+
oldSnippet: string;
|
|
17
|
+
newSnippet: string;
|
|
18
|
+
}, ctx: ToolContext): Promise<string>;
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright Daytona Platforms Inc.
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.patchTool = void 0;
|
|
8
|
+
const zod_1 = require("zod");
|
|
9
|
+
const patchTool = (sessionManager, projectId, worktree, pluginCtx) => ({
|
|
10
|
+
description: 'Applies a patch to the project in Daytona sandbox',
|
|
11
|
+
args: {
|
|
12
|
+
patchText: zod_1.z.string().describe('The full patch text that describes all changes to be made'),
|
|
13
|
+
},
|
|
14
|
+
async execute(args, ctx) {
|
|
15
|
+
return `Patch operations are not yet implemented in the Daytona plugin.`;
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
exports.patchTool = patchTool;
|
|
19
|
+
//# sourceMappingURL=patch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patch.js","sourceRoot":"","sources":["../../../../../../../libs/opencode-plugin/.opencode/plugin/daytona/tools/patch.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6BAAuB;AAKhB,MAAM,SAAS,GAAG,CACvB,cAAqC,EACrC,SAAiB,EACjB,QAAgB,EAChB,SAAsB,EACtB,EAAE,CAAC,CAAC;IACJ,WAAW,EAAE,mDAAmD;IAChE,IAAI,EAAE;QACJ,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2DAA2D,CAAC;KAC5F;IACD,KAAK,CAAC,OAAO,CAAC,IAAkE,EAAE,GAAgB;QAChG,OAAO,iEAAiE,CAAA;IAC1E,CAAC;CACF,CAAC,CAAA;AAbW,QAAA,SAAS,aAapB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Daytona Platforms Inc.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
7
|
+
import type { ToolContext } from '@opencode-ai/plugin/tool';
|
|
8
|
+
import type { DaytonaSessionManager } from '../core/session-manager';
|
|
9
|
+
export declare const readTool: (sessionManager: DaytonaSessionManager, projectId: string, worktree: string, pluginCtx: PluginInput) => {
|
|
10
|
+
description: string;
|
|
11
|
+
args: {
|
|
12
|
+
filePath: z.ZodString;
|
|
13
|
+
};
|
|
14
|
+
execute(args: {
|
|
15
|
+
filePath: string;
|
|
16
|
+
}, ctx: ToolContext): Promise<string>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright Daytona Platforms Inc.
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.readTool = void 0;
|
|
8
|
+
const zod_1 = require("zod");
|
|
9
|
+
const readTool = (sessionManager, projectId, worktree, pluginCtx) => ({
|
|
10
|
+
description: 'Reads file from Daytona sandbox',
|
|
11
|
+
args: {
|
|
12
|
+
filePath: zod_1.z.string(),
|
|
13
|
+
},
|
|
14
|
+
async execute(args, ctx) {
|
|
15
|
+
const sandbox = await sessionManager.getSandbox(ctx.sessionID, projectId, worktree, pluginCtx);
|
|
16
|
+
const buffer = await sandbox.fs.downloadFile(args.filePath);
|
|
17
|
+
const decoder = new TextDecoder();
|
|
18
|
+
return decoder.decode(buffer);
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
exports.readTool = readTool;
|
|
22
|
+
//# sourceMappingURL=read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../../../../../../libs/opencode-plugin/.opencode/plugin/daytona/tools/read.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6BAAuB;AAKhB,MAAM,QAAQ,GAAG,CACtB,cAAqC,EACrC,SAAiB,EACjB,QAAgB,EAChB,SAAsB,EACtB,EAAE,CAAC,CAAC;IACJ,WAAW,EAAE,iCAAiC;IAC9C,IAAI,EAAE;QACJ,QAAQ,EAAE,OAAC,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,EAAE,SAAS,CAAC,CAAA;QAC9F,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;AAhBW,QAAA,QAAQ,YAgBnB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Daytona Platforms Inc.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
7
|
+
import type { ToolContext } from '@opencode-ai/plugin/tool';
|
|
8
|
+
import type { DaytonaSessionManager } from '../core/session-manager';
|
|
9
|
+
export declare const writeTool: (sessionManager: DaytonaSessionManager, projectId: string, worktree: string, pluginCtx: PluginInput) => {
|
|
10
|
+
description: string;
|
|
11
|
+
args: {
|
|
12
|
+
filePath: z.ZodString;
|
|
13
|
+
content: z.ZodString;
|
|
14
|
+
};
|
|
15
|
+
execute(args: {
|
|
16
|
+
filePath: string;
|
|
17
|
+
content: string;
|
|
18
|
+
}, ctx: ToolContext): Promise<string>;
|
|
19
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright Daytona Platforms Inc.
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.writeTool = void 0;
|
|
8
|
+
const zod_1 = require("zod");
|
|
9
|
+
const writeTool = (sessionManager, projectId, worktree, pluginCtx) => ({
|
|
10
|
+
description: 'Writes content to file in Daytona sandbox',
|
|
11
|
+
args: {
|
|
12
|
+
filePath: zod_1.z.string(),
|
|
13
|
+
content: zod_1.z.string(),
|
|
14
|
+
},
|
|
15
|
+
async execute(args, ctx) {
|
|
16
|
+
const sandbox = await sessionManager.getSandbox(ctx.sessionID, projectId, worktree, pluginCtx);
|
|
17
|
+
await sandbox.fs.uploadFile(Buffer.from(args.content), args.filePath);
|
|
18
|
+
return `Written ${args.content.length} bytes to ${args.filePath}`;
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
exports.writeTool = writeTool;
|
|
22
|
+
//# sourceMappingURL=write.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write.js","sourceRoot":"","sources":["../../../../../../../libs/opencode-plugin/.opencode/plugin/daytona/tools/write.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6BAAuB;AAKhB,MAAM,SAAS,GAAG,CACvB,cAAqC,EACrC,SAAiB,EACjB,QAAgB,EAChB,SAAsB,EACtB,EAAE,CAAC,CAAC;IACJ,WAAW,EAAE,2CAA2C;IACxD,IAAI,EAAE;QACJ,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;QACpB,OAAO,EAAE,OAAC,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,EAAE,SAAS,CAAC,CAAA;QAC9F,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;AAhBW,QAAA,SAAS,aAgBpB"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Daytona Platforms Inc.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import type { DaytonaSessionManager } from './core/session-manager';
|
|
6
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
7
|
+
export declare function createDaytonaTools(sessionManager: DaytonaSessionManager, projectId: string, worktree: string, pluginCtx: PluginInput): {
|
|
8
|
+
bash: {
|
|
9
|
+
description: string;
|
|
10
|
+
args: {
|
|
11
|
+
command: import("zod").ZodString;
|
|
12
|
+
background: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
13
|
+
};
|
|
14
|
+
execute(args: {
|
|
15
|
+
command: string;
|
|
16
|
+
background?: boolean;
|
|
17
|
+
}, ctx: import("@opencode-ai/plugin/tool", { with: { "resolution-mode": "import" } }).ToolContext): Promise<string>;
|
|
18
|
+
};
|
|
19
|
+
read: {
|
|
20
|
+
description: string;
|
|
21
|
+
args: {
|
|
22
|
+
filePath: import("zod").ZodString;
|
|
23
|
+
};
|
|
24
|
+
execute(args: {
|
|
25
|
+
filePath: string;
|
|
26
|
+
}, ctx: import("@opencode-ai/plugin/tool", { with: { "resolution-mode": "import" } }).ToolContext): Promise<string>;
|
|
27
|
+
};
|
|
28
|
+
write: {
|
|
29
|
+
description: string;
|
|
30
|
+
args: {
|
|
31
|
+
filePath: import("zod").ZodString;
|
|
32
|
+
content: import("zod").ZodString;
|
|
33
|
+
};
|
|
34
|
+
execute(args: {
|
|
35
|
+
filePath: string;
|
|
36
|
+
content: string;
|
|
37
|
+
}, ctx: import("@opencode-ai/plugin/tool", { with: { "resolution-mode": "import" } }).ToolContext): Promise<string>;
|
|
38
|
+
};
|
|
39
|
+
edit: {
|
|
40
|
+
description: string;
|
|
41
|
+
args: {
|
|
42
|
+
filePath: import("zod").ZodString;
|
|
43
|
+
oldString: import("zod").ZodString;
|
|
44
|
+
newString: import("zod").ZodString;
|
|
45
|
+
};
|
|
46
|
+
execute(args: {
|
|
47
|
+
filePath: string;
|
|
48
|
+
oldString: string;
|
|
49
|
+
newString: string;
|
|
50
|
+
}, ctx: import("@opencode-ai/plugin/tool", { with: { "resolution-mode": "import" } }).ToolContext): Promise<string>;
|
|
51
|
+
};
|
|
52
|
+
multiedit: {
|
|
53
|
+
description: string;
|
|
54
|
+
args: {
|
|
55
|
+
filePath: import("zod").ZodString;
|
|
56
|
+
edits: import("zod").ZodArray<import("zod").ZodObject<{
|
|
57
|
+
oldString: import("zod").ZodString;
|
|
58
|
+
newString: import("zod").ZodString;
|
|
59
|
+
}, import("zod/v4/core").$strip>>;
|
|
60
|
+
};
|
|
61
|
+
execute(args: {
|
|
62
|
+
filePath: string;
|
|
63
|
+
edits: Array<{
|
|
64
|
+
oldString: string;
|
|
65
|
+
newString: string;
|
|
66
|
+
}>;
|
|
67
|
+
}, ctx: import("@opencode-ai/plugin/tool", { with: { "resolution-mode": "import" } }).ToolContext): Promise<string>;
|
|
68
|
+
};
|
|
69
|
+
patch: {
|
|
70
|
+
description: string;
|
|
71
|
+
args: {
|
|
72
|
+
patchText: import("zod").ZodString;
|
|
73
|
+
};
|
|
74
|
+
execute(args: {
|
|
75
|
+
filePath: string;
|
|
76
|
+
oldSnippet: string;
|
|
77
|
+
newSnippet: string;
|
|
78
|
+
}, ctx: import("@opencode-ai/plugin/tool", { with: { "resolution-mode": "import" } }).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/tool", { with: { "resolution-mode": "import" } }).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/tool", { with: { "resolution-mode": "import" } }).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/tool", { with: { "resolution-mode": "import" } }).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/tool", { with: { "resolution-mode": "import" } }).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/tool", { with: { "resolution-mode": "import" } }).ToolContext): Promise<string>;
|
|
128
|
+
};
|
|
129
|
+
};
|