diff --git a/index.ts b/index.ts index 47889cb..4aee31f 100644 --- a/index.ts +++ b/index.ts @@ -40,15 +40,15 @@ import http from "http"; import { tool } from "@opencode-ai/plugin"; import type { Plugin } from "@opencode-ai/plugin"; -import type { PushToken } from "./src/push"; -import { formatNotification } from "./src/push/formatter"; -import { sendPush } from "./src/push/sender"; -import { loadTokens, saveTokens } from "./src/push/token-store"; -import { startLocaltunnel, stopLocaltunnel, getLocaltunnelUrl } from "./src/tunnel/localtunnel"; -import { displayQRCode, generateQRCodeAscii, generateQRCodeAsciiPlain } from "./src/tunnel/qrcode"; -import { startNgrokTunnel, stopNgrokTunnel, isNgrokInstalled } from "./src/tunnel/ngrok"; -import { startCloudflareTunnel, stopCloudflareTunnel, getCloudflareUrl, isCloudflareInstalled } from "./src/tunnel/cloudflare"; -import { updateTunnelMetadata, clearTunnelMetadata, loadTunnelMetadata } from "./src/tunnel/metadata"; +import type { PushToken } from "./src/push/index.js"; +import { formatNotification } from "./src/push/formatter.js"; +import { sendPush } from "./src/push/sender.js"; +import { loadTokens, saveTokens } from "./src/push/token-store.js"; +import { startLocaltunnel, stopLocaltunnel, getLocaltunnelUrl } from "./src/tunnel/localtunnel.js"; +import { displayQRCode, generateQRCodeAscii, generateQRCodeAsciiPlain } from "./src/tunnel/qrcode.js"; +import { startNgrokTunnel, stopNgrokTunnel, isNgrokInstalled } from "./src/tunnel/ngrok.js"; +import { startCloudflareTunnel, stopCloudflareTunnel, getCloudflareUrl, isCloudflareInstalled } from "./src/tunnel/cloudflare.js"; +import { updateTunnelMetadata, clearTunnelMetadata, loadTunnelMetadata } from "./src/tunnel/metadata.js"; function logPluginVersion(ctx: Parameters[0]): void { const client = (ctx as any)?.client; diff --git a/package-lock.json b/package-lock.json index 84626c0..19c113a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,9 @@ }, "bin": { "opencode-mobile": "bin/audit", - "opencode-mobile-qr": "bin/qr" + "opencode-mobile-qr": "bin/qr", + "opencode-mobile-tunnel-setup": "dist/src/cli/tunnel-setup.js", + "opencode-mobile-uninstall": "bin/uninstall" }, "devDependencies": { "@types/localtunnel": "^2.0.4", diff --git a/src/proxy/index.ts b/src/proxy/index.ts index bb569f3..071a796 100644 --- a/src/proxy/index.ts +++ b/src/proxy/index.ts @@ -2,4 +2,4 @@ * Proxy module barrel export */ -export * from "./types"; +export * from "./types.js"; diff --git a/src/push/formatter.ts b/src/push/formatter.ts index 8ff06e8..91a5c5f 100644 --- a/src/push/formatter.ts +++ b/src/push/formatter.ts @@ -2,9 +2,9 @@ * Notification formatting utilities */ -import type { Notification, NotificationEvent, PluginContext } from "./types"; -import { truncate } from "./token-store"; -import { loadFilterConfig, shouldFilterSession } from "./filters"; +import type { Notification, NotificationEvent, PluginContext } from "./types.js"; +import { truncate } from "./token-store.js"; +import { loadFilterConfig, shouldFilterSession } from "./filters.js"; const DEBUG_ENABLED = process.env.OPENCODE_MOBILE_DEBUG === "1"; const debugLog = (...args: unknown[]): void => { diff --git a/src/push/index.ts b/src/push/index.ts index 8ea83f4..bc89b97 100644 --- a/src/push/index.ts +++ b/src/push/index.ts @@ -2,8 +2,8 @@ * Push notification module barrel export */ -export * from "./types"; -export * from "./token-store"; -export * from "./formatter"; -export * from "./sender"; -export * from "./notification-handler"; +export * from "./types.js"; +export * from "./token-store.js"; +export * from "./formatter.js"; +export * from "./sender.js"; +export * from "./notification-handler.js"; diff --git a/src/push/sender.ts b/src/push/sender.ts index 0b81139..2132d5b 100644 --- a/src/push/sender.ts +++ b/src/push/sender.ts @@ -2,8 +2,8 @@ * Push notification sender */ -import type { Notification } from "./types"; -import { loadTokens, saveTokens } from "./token-store"; +import type { Notification } from "./types.js"; +import { loadTokens, saveTokens } from "./token-store.js"; const EXPO_PUSH_URL = "https://exp.host/--/api/v2/push/send"; diff --git a/src/push/token-store.ts b/src/push/token-store.ts index 26f9401..a9a5285 100644 --- a/src/push/token-store.ts +++ b/src/push/token-store.ts @@ -4,7 +4,7 @@ import * as fs from "fs"; import * as path from "path"; -import type { PushToken } from "./types"; +import type { PushToken } from "./types.js"; const CONFIG_DIR = path.join(process.env.HOME || "", ".config/opencode"); const TOKEN_FILE = path.join(CONFIG_DIR, "push-tokens.json"); diff --git a/src/tunnel/cloudflare.ts b/src/tunnel/cloudflare.ts index 9423a8e..b0f50df 100644 --- a/src/tunnel/cloudflare.ts +++ b/src/tunnel/cloudflare.ts @@ -12,7 +12,7 @@ import { spawn, ChildProcess, execSync } from "child_process"; import * as fs from "fs"; import * as path from "path"; import * as os from "os"; -import type { TunnelConfig, TunnelInfo } from "./types"; +import type { TunnelConfig, TunnelInfo } from "./types.js"; // Export types for external use export type { TunnelConfig, TunnelInfo }; diff --git a/src/tunnel/index.ts b/src/tunnel/index.ts index 1fb6c9f..37f94ee 100644 --- a/src/tunnel/index.ts +++ b/src/tunnel/index.ts @@ -3,24 +3,24 @@ */ import * as fs from "fs"; -import type { TunnelConfig, TunnelInfo, TunnelDetails } from "./types"; +import type { TunnelConfig, TunnelInfo, TunnelDetails } from "./types.js"; import { startNgrokTunnel, stopNgrokTunnel, diagnoseNgrok, ensureNgrokReady -} from "./ngrok"; +} from "./ngrok.js"; import { startLocaltunnel, stopLocaltunnel, getLocaltunnelUrl -} from "./localtunnel"; +} from "./localtunnel.js"; import { startCloudflareTunnel, stopCloudflareTunnel, getCloudflareUrl -} from "./cloudflare"; -import { displayQRCode } from "./qrcode"; +} from "./cloudflare.js"; +import { displayQRCode } from "./qrcode.js"; let currentTunnel: TunnelInfo | null = null; diff --git a/src/tunnel/localtunnel.ts b/src/tunnel/localtunnel.ts index 890f66e..482560b 100644 --- a/src/tunnel/localtunnel.ts +++ b/src/tunnel/localtunnel.ts @@ -8,7 +8,7 @@ */ import localtunnel from "localtunnel"; -import type { TunnelConfig, TunnelInfo } from "./types"; +import type { TunnelConfig, TunnelInfo } from "./types.js"; // Export the type for external use export type { TunnelConfig, TunnelInfo }; diff --git a/src/tunnel/ngrok.ts b/src/tunnel/ngrok.ts index 5191b74..14dd624 100644 --- a/src/tunnel/ngrok.ts +++ b/src/tunnel/ngrok.ts @@ -6,7 +6,7 @@ import * as fs from "fs"; import * as path from "path"; import { spawn } from "child_process"; import * as ngrok from "@ngrok/ngrok"; -import type { TunnelConfig, TunnelInfo, NgrokDiagnostics } from "./types"; +import type { TunnelConfig, TunnelInfo, NgrokDiagnostics } from "./types.js"; let ngrokInstance: any = null; let ngrokSession: any = null; diff --git a/src/utils/index.ts b/src/utils/index.ts index a5dc802..7183288 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -2,4 +2,4 @@ * Utilities barrel export */ -export * from "./port"; +export * from "./port.js";