@tiflis-io/tiflis-code-workstation 0.3.2 → 0.3.4

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.
Files changed (2) hide show
  1. package/dist/main.js +77 -30
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -114,6 +114,16 @@ var EnvSchema = z.object({
114
114
  AGENT_EXECUTION_TIMEOUT: z.coerce.number().default(900),
115
115
  CLAUDE_SESSION_LOCK_WAIT_MS: z.coerce.number().default(1500),
116
116
  // ─────────────────────────────────────────────────────────────
117
+ // Agent Visibility Configuration
118
+ // Hide base agent options in mobile apps (only show aliases)
119
+ // ─────────────────────────────────────────────────────────────
120
+ /** Hide base Cursor agent option (only show aliases) */
121
+ HIDE_BASE_CURSOR: z.string().transform((val) => val?.toLowerCase() === "true").default("false"),
122
+ /** Hide base Claude agent option (only show aliases) */
123
+ HIDE_BASE_CLAUDE: z.string().transform((val) => val?.toLowerCase() === "true").default("false"),
124
+ /** Hide base OpenCode agent option (only show aliases) */
125
+ HIDE_BASE_OPENCODE: z.string().transform((val) => val?.toLowerCase() === "true").default("false"),
126
+ // ─────────────────────────────────────────────────────────────
117
127
  // Terminal Configuration
118
128
  // ─────────────────────────────────────────────────────────────
119
129
  /** Terminal output buffer size (number of messages, in-memory only, does not survive restarts) */
@@ -337,6 +347,22 @@ var AGENT_EXECUTION_CONFIG = {
337
347
  ]
338
348
  };
339
349
  var BASE_AGENT_TYPES = ["cursor", "claude", "opencode"];
350
+ function isBaseAgentDisabled(baseType) {
351
+ const env = getEnv();
352
+ switch (baseType) {
353
+ case "cursor":
354
+ return env.HIDE_BASE_CURSOR;
355
+ case "claude":
356
+ return env.HIDE_BASE_CLAUDE;
357
+ case "opencode":
358
+ return env.HIDE_BASE_OPENCODE;
359
+ default:
360
+ return false;
361
+ }
362
+ }
363
+ function getDisabledBaseAgents() {
364
+ return BASE_AGENT_TYPES.filter(isBaseAgentDisabled);
365
+ }
340
366
  function getBaseTypeFromCommand(command) {
341
367
  const commandMap = {
342
368
  claude: "claude",
@@ -347,33 +373,39 @@ function getBaseTypeFromCommand(command) {
347
373
  }
348
374
  function getAvailableAgents() {
349
375
  const agents = /* @__PURE__ */ new Map();
350
- agents.set("cursor", {
351
- name: "cursor",
352
- command: AGENT_COMMANDS.cursor.command,
353
- aliasArgs: [],
354
- aliasEnvVars: {},
355
- baseType: "cursor",
356
- description: AGENT_COMMANDS.cursor.description,
357
- isAlias: false
358
- });
359
- agents.set("claude", {
360
- name: "claude",
361
- command: AGENT_COMMANDS.claude.command,
362
- aliasArgs: [],
363
- aliasEnvVars: {},
364
- baseType: "claude",
365
- description: AGENT_COMMANDS.claude.description,
366
- isAlias: false
367
- });
368
- agents.set("opencode", {
369
- name: "opencode",
370
- command: AGENT_COMMANDS.opencode.command,
371
- aliasArgs: [],
372
- aliasEnvVars: {},
373
- baseType: "opencode",
374
- description: AGENT_COMMANDS.opencode.description,
375
- isAlias: false
376
- });
376
+ if (!isBaseAgentDisabled("cursor")) {
377
+ agents.set("cursor", {
378
+ name: "cursor",
379
+ command: AGENT_COMMANDS.cursor.command,
380
+ aliasArgs: [],
381
+ aliasEnvVars: {},
382
+ baseType: "cursor",
383
+ description: AGENT_COMMANDS.cursor.description,
384
+ isAlias: false
385
+ });
386
+ }
387
+ if (!isBaseAgentDisabled("claude")) {
388
+ agents.set("claude", {
389
+ name: "claude",
390
+ command: AGENT_COMMANDS.claude.command,
391
+ aliasArgs: [],
392
+ aliasEnvVars: {},
393
+ baseType: "claude",
394
+ description: AGENT_COMMANDS.claude.description,
395
+ isAlias: false
396
+ });
397
+ }
398
+ if (!isBaseAgentDisabled("opencode")) {
399
+ agents.set("opencode", {
400
+ name: "opencode",
401
+ command: AGENT_COMMANDS.opencode.command,
402
+ aliasArgs: [],
403
+ aliasEnvVars: {},
404
+ baseType: "opencode",
405
+ description: AGENT_COMMANDS.opencode.description,
406
+ isAlias: false
407
+ });
408
+ }
377
409
  const aliases = getAgentAliases();
378
410
  for (const [name, alias] of aliases) {
379
411
  const baseType = getBaseTypeFromCommand(alias.baseCommand);
@@ -4432,13 +4464,26 @@ var MessageBroadcasterImpl = class {
4432
4464
  }
4433
4465
  /**
4434
4466
  * Sends a message to a specific client by device ID.
4467
+ *
4468
+ * Note: We always send to tunnel regardless of local registry state because:
4469
+ * 1. HTTP polling clients (watchOS) don't authenticate with the workstation
4470
+ * - They only authenticate with the tunnel server
4471
+ * - The tunnel handles message queuing for HTTP clients
4472
+ * 2. After workstation restart, WebSocket clients may still be connected to the tunnel
4473
+ * but not yet re-authenticated with the workstation
4435
4474
  */
4436
4475
  sendToClient(deviceId, message) {
4437
4476
  const device = new DeviceId(deviceId);
4438
4477
  const client = this.deps.clientRegistry.getByDeviceId(device);
4439
- if (!client?.isAuthenticated) {
4440
- return false;
4441
- }
4478
+ this.logger.info(
4479
+ {
4480
+ deviceId,
4481
+ clientInRegistry: !!client,
4482
+ clientAuthenticated: client?.isAuthenticated,
4483
+ messagePreview: message.slice(0, 100)
4484
+ },
4485
+ "sendToClient - sending via tunnel (supports HTTP polling clients)"
4486
+ );
4442
4487
  return this.deps.tunnelClient.sendToDevice(deviceId, message);
4443
4488
  }
4444
4489
  /**
@@ -7414,6 +7459,7 @@ async function bootstrap() {
7414
7459
  is_alias: agent.isAlias
7415
7460
  })
7416
7461
  );
7462
+ const hiddenBaseTypes = getDisabledBaseAgents();
7417
7463
  const workspacesList = await workspaceDiscovery.listWorkspaces();
7418
7464
  const workspaces = await Promise.all(
7419
7465
  workspacesList.map(async (ws) => {
@@ -7471,6 +7517,7 @@ async function bootstrap() {
7471
7517
  supervisorHistory,
7472
7518
  agentHistories,
7473
7519
  availableAgents,
7520
+ hiddenBaseTypes,
7474
7521
  workspaces,
7475
7522
  supervisorIsExecuting,
7476
7523
  executingStates,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiflis-io/tiflis-code-workstation",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "Workstation server for tiflis-code - manages agent sessions and terminal access",
5
5
  "author": "Roman Barinov <rbarinov@gmail.com>",
6
6
  "license": "FSL-1.1-NC",