ticlawk 0.1.15-dev.3 → 0.1.15-dev.5

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
@@ -321,11 +321,11 @@ Usage:
321
321
  ticlawk config set <adapter|streaming...|runtimes.claude_code.path|runtimes.codex.path|runtimes.opencode.path|runtimes.pi.path|telegram.bot-token|ticlawk.connector-api-key|ticlawk.api-url|ticlawk.connector-ws-url> <value>
322
322
  ticlawk auth <adapter> [adapter-auth-args...]
323
323
  ticlawk connect
324
- ticlawk connect [--adapter <adapter>] [--session-id <id>] --workdir <dir> [--switch-user]
325
- ticlawk connect [--adapter <adapter>] --type codex [--session-id <id>] --workdir <dir> [--name <name>] [--runtime-path <path>] [--switch-user]
324
+ ticlawk connect [--adapter <adapter>] [--session-id <id>] [--workdir <dir>] [--switch-user]
325
+ ticlawk connect [--adapter <adapter>] --type codex [--session-id <id>] [--workdir <dir>] [--name <name>] [--runtime-path <path>] [--switch-user]
326
326
  ticlawk connect [--adapter <adapter>] --type openclaw --agent-id <id> [--name <name>] [--runtime-path <path>] [--switch-user]
327
- ticlawk connect [--adapter <adapter>] --type opencode [--session-id <id>] --workdir <dir> [--name <name>] [--runtime-path <path>] [--switch-user]
328
- ticlawk connect [--adapter <adapter>] --type pi [--session-id <id>] --workdir <dir> [--name <name>] [--runtime-path <path>] [--switch-user]
327
+ ticlawk connect [--adapter <adapter>] --type opencode [--session-id <id>] [--workdir <dir>] [--name <name>] [--runtime-path <path>] [--switch-user]
328
+ ticlawk connect [--adapter <adapter>] --type pi [--session-id <id>] [--workdir <dir>] [--name <name>] [--runtime-path <path>] [--switch-user]
329
329
  ticlawk profile list
330
330
  ticlawk profile current
331
331
  ticlawk profile use ticlawk:<user-id>
package/bin/ticlawk.mjs CHANGED
@@ -51,7 +51,7 @@ function getRuntimeConnectUsageLines() {
51
51
  if (runtime.connect?.locator === 'agentId') {
52
52
  return ` ticlawk connect [--adapter <adapter>] --type ${runtime.name} --agent-id <id> [--name <name>] [--runtime-path <path>] [--switch-user]`;
53
53
  }
54
- return ` ticlawk connect [--adapter <adapter>] --type ${runtime.name} [--session-id <id>] --workdir <dir> [--name <name>] [--runtime-path <path>] [--switch-user]`;
54
+ return ` ticlawk connect [--adapter <adapter>] --type ${runtime.name} [--session-id <id>] [--workdir <dir>] [--name <name>] [--runtime-path <path>] [--switch-user]`;
55
55
  })
56
56
  .join('\n');
57
57
  }
@@ -92,7 +92,7 @@ Usage:
92
92
  ticlawk config set <${configKeys}> <value>
93
93
  ticlawk auth <adapter> [adapter-auth-args...]
94
94
  ticlawk connect
95
- ticlawk connect [--adapter <adapter>] [--session-id <id>] --workdir <dir> [--switch-user]
95
+ ticlawk connect [--adapter <adapter>] [--session-id <id>] [--workdir <dir>] [--switch-user]
96
96
  ${getRuntimeConnectUsageLines()}
97
97
  ticlawk profile list
98
98
  ticlawk profile current
@@ -281,7 +281,7 @@ function buildConnectPayload(args) {
281
281
  const positionalRuntime = args._?.[1];
282
282
  const serviceType = normalizeServiceType(args.type || positionalRuntime);
283
283
  const explicitWorkdir = args.workdir || args.cwd || args['project-dir'];
284
- const workdir = explicitWorkdir || null;
284
+ const workdir = explicitWorkdir ? resolve(explicitWorkdir) : process.cwd();
285
285
  const hasExplicitAdapter = Boolean(args.adapter);
286
286
  const adapter = (!serviceType && !hasExplicitAdapter)
287
287
  ? 'ticlawk'
@@ -292,7 +292,7 @@ function buildConnectPayload(args) {
292
292
  adapter,
293
293
  autoRuntime: true,
294
294
  switchUser: Boolean(args['switch-user']),
295
- ...(workdir ? { workdir } : {}),
295
+ workdir,
296
296
  ...(args.name ? { name: args.name } : {}),
297
297
  };
298
298
  }
@@ -306,7 +306,7 @@ function buildConnectPayload(args) {
306
306
  adapter,
307
307
  serviceType,
308
308
  agentId: args['agent-id'],
309
- ...(workdir ? { workdir } : {}),
309
+ ...(explicitWorkdir ? { workdir } : {}),
310
310
  ...(args['runtime-path'] ? { runtimePath: resolve(args['runtime-path']) } : {}),
311
311
  name: args.name || args['agent-id'],
312
312
  switchUser: Boolean(args['switch-user']),
@@ -318,7 +318,7 @@ function buildConnectPayload(args) {
318
318
  serviceType,
319
319
  sessionId: args['session-id'],
320
320
  switchUser: Boolean(args['switch-user']),
321
- ...(workdir ? { workdir } : {}),
321
+ workdir,
322
322
  ...(args.name ? { name: args.name } : {}),
323
323
  ...(args['runtime-path'] ? { runtimePath: resolve(args['runtime-path']) } : {}),
324
324
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ticlawk",
3
- "version": "0.1.15-dev.3",
3
+ "version": "0.1.15-dev.5",
4
4
  "description": "Connect local agent harnesses to Ticlawk, Telegram, and other mobile clients.",
5
5
  "type": "module",
6
6
  "main": "ticlawk.mjs",
@@ -192,6 +192,16 @@ function runtimeLabel(runtime) {
192
192
  return runtime || 'Agent';
193
193
  }
194
194
 
195
+ function printDetectedRuntimeOptions(runtimeOptions = []) {
196
+ if (!runtimeOptions.length) return;
197
+ console.log('Detected agent harness:');
198
+ for (const option of runtimeOptions) {
199
+ const label = option.runtime_label || runtimeLabel(option.runtime);
200
+ const workdir = option.workdir ? ` (${option.workdir})` : '';
201
+ console.log(` - ${label}${workdir}`);
202
+ }
203
+ }
204
+
195
205
  async function buildAutoRuntimeOptions(ctx, payload = {}) {
196
206
  const workdir = getRuntimeWorkdir(payload) || process.cwd();
197
207
  const candidates = ['codex', 'claude_code', 'opencode', 'pi'];
@@ -878,6 +888,9 @@ export function createTiclawkAdapter(ctx) {
878
888
  if (autoRuntime && runtimeOptions.length === 0) {
879
889
  throw new Error('No supported local agent runtime found in this terminal. Install or sign in to Codex, Claude Code, OpenCode, or pi, then try again.');
880
890
  }
891
+ if (autoRuntime) {
892
+ printDetectedRuntimeOptions(runtimeOptions);
893
+ }
881
894
  const resolved = autoRuntime ? null : await ctx.resolveRuntimeBinding(payload);
882
895
  const runtimeMeta = resolved?.runtimeMeta || {};
883
896
  const workdir = getRuntimeWorkdir(runtimeMeta) || getRuntimeWorkdir(payload) || process.cwd();