poke-gate 0.0.5 → 0.0.6
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/clients/Poke macOS Gate/Poke macOS Gate/GateService.swift +0 -12
- package/clients/Poke macOS Gate/Poke macOS Gate.xcodeproj/project.pbxproj +2 -2
- package/clients/Poke macOS Gate/Poke macOS Gate.xcodeproj/project.xcworkspace/xcuserdata/fka.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/package.json +1 -1
- package/src/app.js +16 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import Foundation
|
|
2
2
|
import Combine
|
|
3
|
-
import ScreenCaptureKit
|
|
4
3
|
|
|
5
4
|
@MainActor
|
|
6
5
|
class GateService: ObservableObject {
|
|
@@ -35,22 +34,11 @@ class GateService: ObservableObject {
|
|
|
35
34
|
func autoStartIfNeeded() {
|
|
36
35
|
guard !hasAutoStarted else { return }
|
|
37
36
|
hasAutoStarted = true
|
|
38
|
-
requestScreenCapturePermission()
|
|
39
37
|
if hasAPIKey {
|
|
40
38
|
start()
|
|
41
39
|
}
|
|
42
40
|
}
|
|
43
41
|
|
|
44
|
-
private func requestScreenCapturePermission() {
|
|
45
|
-
Task {
|
|
46
|
-
do {
|
|
47
|
-
_ = try await SCShareableContent.current
|
|
48
|
-
} catch {
|
|
49
|
-
appendLog("Screen capture permission not granted yet.")
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
42
|
func start() {
|
|
55
43
|
guard hasAPIKey else {
|
|
56
44
|
status = .error
|
|
@@ -264,7 +264,7 @@
|
|
|
264
264
|
"$(inherited)",
|
|
265
265
|
"@executable_path/../Frameworks",
|
|
266
266
|
);
|
|
267
|
-
MARKETING_VERSION = 0.0.
|
|
267
|
+
MARKETING_VERSION = 0.0.5;
|
|
268
268
|
PRODUCT_BUNDLE_IDENTIFIER = "dev.fka.Poke-macOS-Gate";
|
|
269
269
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
270
270
|
REGISTER_APP_GROUPS = YES;
|
|
@@ -296,7 +296,7 @@
|
|
|
296
296
|
"$(inherited)",
|
|
297
297
|
"@executable_path/../Frameworks",
|
|
298
298
|
);
|
|
299
|
-
MARKETING_VERSION = 0.0.
|
|
299
|
+
MARKETING_VERSION = 0.0.5;
|
|
300
300
|
PRODUCT_BUNDLE_IDENTIFIER = "dev.fka.Poke-macOS-Gate";
|
|
301
301
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
302
302
|
REGISTER_APP_GROUPS = YES;
|
|
Binary file
|
package/package.json
CHANGED
package/src/app.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { startMcpServer, enableLogging } from "./mcp-server.js";
|
|
2
2
|
import { startTunnel } from "./tunnel.js";
|
|
3
|
+
import { Poke } from "poke";
|
|
3
4
|
import { readFileSync } from "node:fs";
|
|
4
5
|
import { join } from "node:path";
|
|
5
6
|
import { homedir } from "node:os";
|
|
@@ -50,6 +51,7 @@ async function main() {
|
|
|
50
51
|
case "connected":
|
|
51
52
|
log(`Tunnel connected (${data.connectionId})`);
|
|
52
53
|
log("Ready — your Poke agent can now access this machine.");
|
|
54
|
+
notifyPoke(data.connectionId);
|
|
53
55
|
break;
|
|
54
56
|
case "disconnected":
|
|
55
57
|
log("Tunnel disconnected. Reconnecting...");
|
|
@@ -72,6 +74,20 @@ async function main() {
|
|
|
72
74
|
}
|
|
73
75
|
}
|
|
74
76
|
|
|
77
|
+
async function notifyPoke(connectionId) {
|
|
78
|
+
try {
|
|
79
|
+
const poke = new Poke({ apiKey: API_KEY });
|
|
80
|
+
await poke.sendMessage(
|
|
81
|
+
`Poke macOS Gate is connected. Tunnel ID: ${connectionId}. ` +
|
|
82
|
+
`You now have access to this machine's terminal, files, and screen. ` +
|
|
83
|
+
`Use the available tools (run_command, read_file, write_file, list_directory, system_info, read_image, take_screenshot) to help the user.`
|
|
84
|
+
);
|
|
85
|
+
log("Notified Poke agent about connection.");
|
|
86
|
+
} catch (err) {
|
|
87
|
+
log(`Failed to notify Poke: ${err.message}`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
75
91
|
process.on("SIGINT", () => {
|
|
76
92
|
log("Shutting down...");
|
|
77
93
|
process.exit(0);
|