wtt-connect 0.2.1 → 0.2.2

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/README.md CHANGED
@@ -142,7 +142,7 @@ Workdir rules:
142
142
 
143
143
  - If `--workdir` or `WTT_CONNECT_WORKDIR` is provided, that exact directory is used for agent execution, shell, terminal, runtime info, and adapter cwd.
144
144
  - If no workdir is provided, `wtt-connect` uses `./workspaces/<agent_id>` under the current default directory. This prevents multiple claimed agents on the same host from sharing the `wtt-connect` package directory.
145
- - For an existing profile, edit `~/.config/wtt-connect/profiles/<profile>.env` and change `WTT_CONNECT_WORKDIR`, then run `wtt-connect restart <profile>`.
145
+ - For an existing profile, run `wtt-connect workdir <profile> /path/to/workspace --restart`. This updates `~/.config/wtt-connect/profiles/<profile>.env`, creates the directory, and restarts the service.
146
146
 
147
147
  Useful flags:
148
148
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wtt-connect",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "private": false,
5
5
  "description": "WTT-native connector daemon for Codex, Claude Code, Cursor, Gemini, ACP, and other coding agent surfaces.",
6
6
  "type": "module",
package/src/main.js CHANGED
@@ -10,7 +10,7 @@ import { DurableStore } from './store.js';
10
10
  import { log, redact } from './logger.js';
11
11
  import { adapterBin, normalizeProfileName } from './adapters/generic-cli.js';
12
12
  import { normalizeAdapterName } from './adapters/index.js';
13
- import { down, listProfiles, logs, resolveProfileEnvFile, restart, status, up } from './service-manager.js';
13
+ import { down, listProfiles, logs, resolveProfileEnvFile, restart, status, up, workdir } from './service-manager.js';
14
14
 
15
15
  export async function main(args) {
16
16
  const cmd = args[0] || 'help';
@@ -23,6 +23,7 @@ export async function main(args) {
23
23
  if (cmd === 'status') return status(argv);
24
24
  if (cmd === 'restart') return restart(argv);
25
25
  if (cmd === 'logs') return logs(argv);
26
+ if (cmd === 'workdir') return workdir(argv);
26
27
  if (cmd === 'down' || cmd === 'unlink') return down(argv);
27
28
  if (cmd === 'doctor') return doctor(loadConfig(argv));
28
29
  if (cmd === 'setup') return setup(loadConfig(argv), argv);
@@ -61,6 +62,7 @@ function parseArgs(args) {
61
62
  else if (a === '--allow-yolo' || a === '--allow-dangerous-permissions') out.allowYolo = true;
62
63
  else if (a === '--yes' || a === '-y') out.yes = true;
63
64
  else if (a === '--publish-progress') out.publishProgress = true;
65
+ else if (a === '--restart') out.restart = true;
64
66
  else if (a === '--enable-linger') out.enableLinger = true;
65
67
  else if (a === '--no-start') out.noStart = true;
66
68
  else if (a === '--node-bin') out.nodeBin = args[++i];
@@ -97,6 +99,8 @@ Commands:
97
99
  status [profile|all] Show systemd service status for profiles
98
100
  restart [profile|all] Restart one or all configured services
99
101
  logs <profile> [--lines 100] Show service logs
102
+ workdir <profile> [path] [--restart]
103
+ Show or update the agent execution directory
100
104
  down <profile> Stop/disable service; keep profile/state files
101
105
  unlink <profile> Alias for down
102
106
  setup [--claim-code] Register/write local .env and optionally print claim code
@@ -142,6 +142,30 @@ export function logs(argv) {
142
142
  throw new Error(`unsupported platform: ${process.platform}`);
143
143
  }
144
144
 
145
+ export function workdir(argv) {
146
+ const [profile = '', nextDir = ''] = argv._ || [];
147
+ if (!profile) throw new Error('usage: wtt-connect workdir <profile> [path] [--restart]');
148
+ const safe = sanitizeProfile(profile);
149
+ const envFile = profileEnvFile(safe);
150
+ if (!fs.existsSync(envFile)) throw new Error(`profile not found: ${safe}`);
151
+ const env = readEnv(envFile);
152
+ if (!nextDir) {
153
+ console.log(env.WTT_CONNECT_WORKDIR || '');
154
+ return;
155
+ }
156
+ const resolved = path.resolve(nextDir);
157
+ ensureDir(resolved);
158
+ env.WTT_CONNECT_WORKDIR = resolved;
159
+ writeProfileEnv(envFile, env);
160
+ console.log(`updated ${safe} workdir: ${resolved}`);
161
+ if (argv.restart) {
162
+ restartService(safe);
163
+ console.log(`${safe}: ${serviceStatus(safe)}`);
164
+ } else {
165
+ console.log(`restart required: wtt-connect restart ${safe}`);
166
+ }
167
+ }
168
+
145
169
  export function down(argv) {
146
170
  const [profile = ''] = argv._ || [];
147
171
  if (!profile) throw new Error('usage: wtt-connect down <profile>');