forge-remote 0.1.26 → 0.1.27

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forge-remote",
3
- "version": "0.1.26",
3
+ "version": "0.1.27",
4
4
  "description": "Desktop relay for Forge Remote — monitor and control Claude Code sessions from your phone",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
package/src/cli.js CHANGED
@@ -35,7 +35,9 @@ import { watchWebhookConfigs, stopWatching } from "./webhook-watcher.js";
35
35
  import * as log from "./logger.js";
36
36
  import { checkForUpdate } from "./update-checker.js";
37
37
  import { deployFirestoreRules } from "./google-auth.js";
38
- import { ensureChannelRegistered } from "./channel-setup.js";
38
+ // Channel auto-registration disabled channels require
39
+ // --dangerously-load-development-channels flag during research preview.
40
+ // import { ensureChannelRegistered } from "./channel-setup.js";
39
41
 
40
42
  program
41
43
  .name("forge-remote")
@@ -872,56 +872,51 @@ async function sendFollowUpPrompt(sessionId, prompt, imageBase64) {
872
872
  session.permissionNeeded = false;
873
873
  session.deniedToolCall = null;
874
874
 
875
- // If an image was attached, save it to a temp file.
876
- let imagePath = null;
877
- if (imageBase64) {
878
- const imageId = `${sessionId.slice(0, 8)}-${Date.now()}`;
879
- imagePath = `/tmp/forge-remote-image-${imageId}.png`;
880
- try {
881
- const imageBuffer = Buffer.from(imageBase64, "base64");
882
- await writeFile(imagePath, imageBuffer);
883
- log.session(
884
- sessionId,
885
- `Saved attached image to ${imagePath} (${imageBuffer.length} bytes)`,
886
- );
887
- } catch (err) {
888
- log.warn(`Failed to save attached image: ${err.message}`);
889
- imagePath = null;
890
- }
891
- }
875
+ // Image attachment feature temporarily disabled the --image flag
876
+ // crashes sessions because the user's Claude Code version doesn't support it.
877
+ // Will re-enable when the flag is supported.
878
+ //
879
+ // let imagePath = null;
880
+ // if (imageBase64) {
881
+ // const imageId = `${sessionId.slice(0, 8)}-${Date.now()}`;
882
+ // imagePath = `/tmp/forge-remote-image-${imageId}.png`;
883
+ // try {
884
+ // const imageBuffer = Buffer.from(imageBase64, "base64");
885
+ // await writeFile(imagePath, imageBuffer);
886
+ // log.session(sessionId, `Saved attached image to ${imagePath} (${imageBuffer.length} bytes)`);
887
+ // } catch (err) {
888
+ // log.warn(`Failed to save attached image: ${err.message}`);
889
+ // imagePath = null;
890
+ // }
891
+ // }
892
892
 
893
893
  // The mobile app writes the user message to Firestore directly (including
894
894
  // image preview) so it shows instantly in the chat UI. The relay does NOT
895
895
  // duplicate this write to avoid showing the message twice.
896
896
  const db = getDb();
897
897
 
898
- // If an image is attached, prepend the file path reference to the prompt
899
- // so Claude Code knows to read the image file.
900
898
  let finalPrompt = prompt;
901
- if (imagePath) {
902
- finalPrompt = `[The user attached an image from their phone. The image is saved at: ${imagePath} — please read and analyze it.]\n\n${prompt || "What do you see in this image?"}`;
903
- }
899
+ // Image path prepending disabled — see note above.
900
+ // if (imagePath) {
901
+ // finalPrompt = `[The user attached an image from their phone. The image is saved at: ${imagePath}]\n\n${prompt || "What do you see in this image?"}`;
902
+ // }
904
903
 
905
904
  log.session(
906
905
  sessionId,
907
- `Follow-up prompt: "${finalPrompt.slice(0, 80)}${finalPrompt.length > 80 ? "..." : ""}"${imagePath ? " [with image]" : ""}`,
906
+ `Follow-up prompt: "${finalPrompt.slice(0, 80)}${finalPrompt.length > 80 ? "..." : ""}"`,
908
907
  );
909
908
 
910
909
  // Run Claude with --continue to pick up conversation history.
911
910
  await runClaudeProcess(sessionId, finalPrompt);
912
911
 
913
- // Clean up the temp image file after the process has started.
914
- if (imagePath) {
915
- // Delay cleanup slightly to ensure Claude has read the file.
916
- setTimeout(async () => {
917
- try {
918
- await unlink(imagePath);
919
- log.session(sessionId, `Cleaned up temp image: ${imagePath}`);
920
- } catch {
921
- // File may already be gone — ignore.
922
- }
923
- }, 30_000);
924
- }
912
+ // Image temp file cleanup disabled see note above.
913
+ // if (imagePath) {
914
+ // setTimeout(async () => {
915
+ // try {
916
+ // await unlink(imagePath);
917
+ // } catch { }
918
+ // }, 30_000);
919
+ // }
925
920
  }
926
921
 
927
922
  // ---------------------------------------------------------------------------
@@ -968,6 +963,15 @@ async function runClaudeProcess(sessionId, prompt) {
968
963
  );
969
964
 
970
965
  const spawnEnv = { ...shellEnv, ...adapter.getExtraEnv() };
966
+
967
+ // NOTE: Claude Code permissions for the .claude/ directory.
968
+ // If users get permission prompts for writing to .claude/ (e.g. CLAUDE.md,
969
+ // settings.json), they need to configure this in their Claude Code settings.
970
+ // This is a Claude Code configuration issue — the relay cannot pass
971
+ // --allowedTools or --permissions flags to auto-allow .claude/ writes.
972
+ // Users should add `.claude/` to their allowed paths in their Claude Code
973
+ // settings or use the "Always Allow" option when prompted.
974
+
971
975
  const claudeProcess = spawn(binary, args, {
972
976
  cwd: session.projectPath,
973
977
  env: spawnEnv,