teleportation-cli 1.3.0 → 1.4.1

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.
@@ -185,10 +185,7 @@ const fetchJson = async (url, opts) => {
185
185
  log(`Using parent session ${parent_session_id} for approvals (child session: ${session_id})`);
186
186
  }
187
187
 
188
- // Detect message source
189
- const isAutonomousTask = env.TELEPORTATION_TASK_MODE === 'true' || !!parent_session_id;
190
- const source = isAutonomousTask ? 'autonomous_task' : 'cli_interactive';
191
- log(`Message source: ${source}`);
188
+ const source = 'cli_interactive';
192
189
 
193
190
  // Load config
194
191
  let config;
@@ -232,6 +229,16 @@ const fetchJson = async (url, opts) => {
232
229
  headers: { 'Authorization': `Bearer ${RELAY_API_KEY}` }
233
230
  });
234
231
 
232
+ // Bypass permissions: auto-approve everything when enabled from mobile.
233
+ // NOTE: This reads from the daemon-state fetched above (already needed for away-mode).
234
+ // Eventual consistency: there's a brief delay (~5s poll cycle) between the mobile toggle
235
+ // and the daemon syncing this state. Acceptable for MVP — no extra network call needed.
236
+ if (state.bypass_permissions) {
237
+ log(`[PermissionRequest] Bypass permissions enabled — auto-approving ${tool_name}`);
238
+ stdout.write(JSON.stringify({ decision: 'allow', reason: 'Auto-approve enabled from mobile' }));
239
+ return exit(0);
240
+ }
241
+
235
242
  // Skip auto-toggle if task mode is forcing away
236
243
  if (isTaskMode) {
237
244
  log(`Task mode: skipping auto-detection, using forced away mode`);
@@ -257,9 +257,7 @@ function buildErrorMessage(tool_output) {
257
257
  const { session_id, tool_name, tool_input, tool_output, tool_use_id } = input || {};
258
258
  log(`Session: ${session_id}, Tool: ${tool_name}, tool_use_id: ${tool_use_id || 'none'}`);
259
259
 
260
- // Detect message source
261
- const isAutonomousTask = env.TELEPORTATION_TASK_MODE === 'true' || !!env.TELEPORTATION_PARENT_SESSION_ID;
262
- const source = isAutonomousTask ? 'autonomous_task' : 'cli_interactive';
260
+ const source = 'cli_interactive';
263
261
 
264
262
  // Validate session_id
265
263
  if (!isValidSessionId(session_id)) {