@jamesmurdza/opencode-daytona 0.1.17 → 0.1.19

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.
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../../../.opencode/plugin/daytona/core/logger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAKvC,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,QAE1C;AAED,cAAM,MAAM;IACV,OAAO,KAAK,OAAO,GAGlB;IAED,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,QAAyB,GAAG,IAAI;IAgB5D,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI3B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI5B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;CAG5B;AAED,eAAO,MAAM,MAAM,QAAe,CAAA"}
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../../../.opencode/plugin/daytona/core/logger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAKvC,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,QAE1C;AAED,cAAM,MAAM;IACV,OAAO,KAAK,OAAO,GAGlB;IAED,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,QAAyB,GAAG,IAAI;IAsB5D,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI3B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI5B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;CAG5B;AAED,eAAO,MAAM,MAAM,QAAe,CAAA"}
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * Logger class for handling plugin logging
3
3
  */
4
- import { appendFileSync, statSync, truncateSync } from 'fs';
4
+ import { appendFileSync, mkdirSync, statSync, truncateSync } from 'fs';
5
+ import { dirname } from 'path';
5
6
  import { LOG_LEVEL_INFO, LOG_LEVEL_ERROR, LOG_LEVEL_WARN } from './types';
6
7
  let logFilePath;
7
8
  export function setLogFilePath(path) {
@@ -14,6 +15,13 @@ class Logger {
14
15
  return logFilePath;
15
16
  }
16
17
  log(message, level = LOG_LEVEL_INFO) {
18
+ // Ensure log directory exists
19
+ try {
20
+ mkdirSync(dirname(this.logFile), { recursive: true });
21
+ }
22
+ catch (err) {
23
+ // Directory may already exist, ignore
24
+ }
17
25
  // Truncate log file if it exceeds 5MB
18
26
  try {
19
27
  const stats = statSync(this.logFile);
@@ -1 +1 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../../../.opencode/plugin/daytona/core/logger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,IAAI,CAAA;AAE3D,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAEzE,IAAI,WAA+B,CAAA;AAEnC,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,WAAW,GAAG,IAAI,CAAA;AACpB,CAAC;AAED,MAAM,MAAM;IACV,IAAY,OAAO;QACjB,IAAI,CAAC,WAAW;YAAE,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAA;QACpG,OAAO,WAAW,CAAA;IACpB,CAAC;IAED,GAAG,CAAC,OAAe,EAAE,QAAkB,cAAc;QACnD,sCAAsC;QACtC,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YACpC,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAA,CAAC,MAAM;YACtC,IAAI,KAAK,CAAC,IAAI,GAAG,OAAO,EAAE,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FilePath } from './core/logger';
24
24
  import { DaytonaSessionManager } from './core/session-manager';
25
25
  import { createCustomToolsPlugin, createSessionCleanupPlugin, createSystemTransformPlugin, createSessionIdleAutoCommitPlugin, } from './plugins';
26
26
  // Initialize logger and session manager using xdg-basedir (same as OpenCode)
27
- const LOG_FILE = join(xdgData, '.daytona-plugin.log');
27
+ const LOG_FILE = join(xdgData, 'opencode', 'log', 'daytona.log');
28
28
  const STORAGE_DIR = join(xdgData, 'opencode', 'storage', 'daytona');
29
29
  const REPO_PATH = '/home/daytona/project';
30
30
  setLogFilePath(LOG_FILE);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../.opencode/plugin/daytona/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAGrC,iBAAiB;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,EAC3B,iCAAiC,GAClC,MAAM,WAAW,CAAA;AAKlB,6EAA6E;AAC7E,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAQ,EAAE,qBAAqB,CAAC,CAAA;AACtD,MAAM,WAAW,GAAG,IAAI,CAAC,OAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,CAAC,CAAA;AACpE,MAAM,SAAS,GAAG,uBAAuB,CAAA;AAEzC,cAAc,CAAC,QAAQ,CAAC,CAAA;AACxB,MAAM,cAAc,GAAG,IAAI,qBAAqB,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,EAAE,EAAE,WAAW,EAAE,SAAS,CAAC,CAAA;AAE3G,0BAA0B;AAC1B,MAAM,CAAC,MAAM,iBAAiB,G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AAc,CAAC,CAAA;AAC7F,MAAM,CAAC,MAAM,qBAAqB,GAAW,2BAA2B,CAAC,SAAS,CAAC,CAAA;AACnF,MAAM,CAAC,MAAM,kCAAkC,GAAW,iCAAiC,CAAC,cAAc,EAAE,SAAS,CAAC,CAAA"}
package/README.md CHANGED
@@ -12,11 +12,11 @@ This is an OpenCode plugin that automatically runs all your OpenCode sessions in
12
12
 
13
13
  ### Installation
14
14
 
15
- You can install this extension globally or within a specific project.
15
+ You can install this plugin globally or within a specific project.
16
16
 
17
17
  To install it globally, edit `~/.config/opencode/opencode.json`. To install for a specific project, add it to `opencode.json` in the project's root directory.
18
18
 
19
- Adding this extension to the plugins field will install it automatically when OpenCode starts:
19
+ Adding this plugin to the plugins field will install it automatically when OpenCode starts:
20
20
 
21
21
  ```json
22
22
  {
@@ -27,7 +27,7 @@ Adding this extension to the plugins field will install it automatically when Op
27
27
 
28
28
  ### Environment Configuration
29
29
 
30
- This extension requires a [Daytona account](https://www.daytona.io/) and [Daytona API key](https://app.daytona.io/dashboard/keys) to create sandboxes.
30
+ This plugin requires a [Daytona account](https://www.daytona.io/) and [Daytona API key](https://app.daytona.io/dashboard/keys) to create sandboxes.
31
31
 
32
32
  Set your Daytona API key and URL as environment variables:
33
33
 
@@ -66,7 +66,7 @@ git checkout opencode/1
66
66
  To see live logs for debugging, run this command in a separate terminal:
67
67
 
68
68
  ```bash
69
- tail -f ~/.local/share/.daytona-plugin.log
69
+ tail -f ~/.local/share/opencode/log/daytona.log
70
70
  ```
71
71
 
72
72
  ## How It Works
@@ -125,21 +125,21 @@ yarn install
125
125
 
126
126
  ### Development and Testing
127
127
 
128
- To modify the extension, edit the source code files in `libs/opencode-plugin/.opencode`.
128
+ To modify the plugin, edit the source code files in `libs/opencode-plugin/.opencode`.
129
129
 
130
- To test the OpenCode extension, create a new directory to run OpenCode in:
130
+ To test the OpenCode plugin, create a test project to run OpenCode in:
131
131
 
132
132
  ```bash
133
133
  mkdir ~/myproject
134
134
  ```
135
135
 
136
- Use a symbolic link to install a development version of the plugin:
136
+ Add a symlink from the project directory to the plugin source code:
137
137
 
138
138
  ```
139
139
  ln -s libs/opencode-plugin/.opencode ~/myproject
140
140
  ```
141
141
 
142
- Open OpenCode in the new directory:
142
+ Start OpenCode in the project directory:
143
143
 
144
144
  ```bash
145
145
  cd ~/myproject && opencode
@@ -148,26 +148,30 @@ cd ~/myproject && opencode
148
148
  Use the instructions from [Running OpenCode](#running-opencode) above to check that the plugin is running and view live logs for debugging.
149
149
 
150
150
  > [!NOTE]
151
- > Because OpenCode uses Bun, the TypeScript plugin is loaded directly without a build step.
151
+ > When developing locally with a symlink, OpenCode loads the TypeScript source directly, so no build step is required.
152
152
 
153
- ### Publishing
153
+ ### Building
154
154
 
155
- Check for TypeScript errors before publishing:
155
+ Build the plugin:
156
156
 
157
157
  ```bash
158
- npx nx run opencode-plugin:type-check
158
+ npx nx run opencode-plugin:build
159
159
  ```
160
160
 
161
+ This compiles the TypeScript source files in `.opencode/` to JavaScript in `dist/.opencode/`.
162
+
163
+ ### Publishing
164
+
161
165
  Log into npm:
162
166
 
163
167
  ```bash
164
168
  npm login
165
169
  ```
166
170
 
167
- Publish the TypeScript package to npm:
171
+ Publish the compiled JavaScript package to npm:
168
172
 
169
173
  ```bash
170
- npx nx publish opencode-plugin:
174
+ npx nx run opencode-plugin:publish
171
175
  ```
172
176
 
173
177
  This will publish to npm with public access and use the version number from `package.json`.
@@ -176,14 +180,17 @@ This will publish to npm with public access and use the version number from `pac
176
180
 
177
181
  ```
178
182
  libs/opencode-plugin/
179
- ├── .opencode/
183
+ ├── .opencode/ # Source TypeScript files
180
184
  │ ├── plugin/
181
185
  │ │ ├── daytona/ # Main Daytona integration
182
186
  │ │ │ └── ...
183
187
  │ │ └── index.ts # Plugin entry point
184
- ├── package.json # Package metadata
188
+ ├── dist/ # Build output
189
+ │ └── .opencode/ # Compiled JavaScript files
190
+ ├── package.json # Package metadata (includes main/types)
185
191
  ├── project.json # Nx build configuration
186
192
  ├── tsconfig.json # TypeScript config
193
+ ├── tsconfig.build.json # TypeScript config
187
194
  └── README.md
188
195
  ```
189
196
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jamesmurdza/opencode-daytona",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "description": "OpenCode plugin that automatically runs all sessions in Daytona sandboxes for isolated, reproducible development environments",
5
5
  "main": "./.opencode/plugin/index.js",
6
6
  "types": "./.opencode/plugin/index.d.ts",