poke-gate 0.0.3 → 0.0.5
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/.github/workflows/release.yml +124 -0
- package/README.md +98 -37
- package/assets/logo.png +0 -0
- package/build.sh +52 -0
- package/clients/Poke macOS Gate/Poke macOS Gate/Assets.xcassets/AppIcon.appiconset/Contents.json +10 -0
- package/clients/Poke macOS Gate/Poke macOS Gate/Assets.xcassets/AppIcon.appiconset/icon_128x128.png +0 -0
- package/clients/Poke macOS Gate/Poke macOS Gate/Assets.xcassets/AppIcon.appiconset/icon_128x128@2x.png +0 -0
- package/clients/Poke macOS Gate/Poke macOS Gate/Assets.xcassets/AppIcon.appiconset/icon_16x16.png +0 -0
- package/clients/Poke macOS Gate/Poke macOS Gate/Assets.xcassets/AppIcon.appiconset/icon_16x16@2x.png +0 -0
- package/clients/Poke macOS Gate/Poke macOS Gate/Assets.xcassets/AppIcon.appiconset/icon_256x256.png +0 -0
- package/clients/Poke macOS Gate/Poke macOS Gate/Assets.xcassets/AppIcon.appiconset/icon_256x256@2x.png +0 -0
- package/clients/Poke macOS Gate/Poke macOS Gate/Assets.xcassets/AppIcon.appiconset/icon_32x32.png +0 -0
- package/clients/Poke macOS Gate/Poke macOS Gate/Assets.xcassets/AppIcon.appiconset/icon_32x32@2x.png +0 -0
- package/clients/Poke macOS Gate/Poke macOS Gate/Assets.xcassets/AppIcon.appiconset/icon_512x512.png +0 -0
- package/clients/Poke macOS Gate/Poke macOS Gate/Assets.xcassets/AppIcon.appiconset/icon_512x512@2x.png +0 -0
- package/clients/Poke macOS Gate/Poke macOS Gate/GateService.swift +19 -0
- package/clients/Poke macOS Gate/Poke macOS Gate/Poke_macOS_GateApp.swift +32 -1
- 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
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
name: Build & Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
runs-on: macos-26
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout
|
|
16
|
+
uses: actions/checkout@v4
|
|
17
|
+
with:
|
|
18
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
19
|
+
|
|
20
|
+
- name: Get version from tag
|
|
21
|
+
id: version
|
|
22
|
+
run: |
|
|
23
|
+
TAG="${GITHUB_REF#refs/tags/}"
|
|
24
|
+
VERSION="${TAG#v}"
|
|
25
|
+
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
|
|
26
|
+
echo "number=${VERSION}" >> "$GITHUB_OUTPUT"
|
|
27
|
+
|
|
28
|
+
- name: Update app version in Xcode project
|
|
29
|
+
run: |
|
|
30
|
+
sed -i '' "s/MARKETING_VERSION = .*;/MARKETING_VERSION = ${{ steps.version.outputs.number }};/g" "clients/Poke macOS Gate/Poke macOS Gate.xcodeproj/project.pbxproj"
|
|
31
|
+
|
|
32
|
+
- name: Commit version bump
|
|
33
|
+
run: |
|
|
34
|
+
git config user.name "github-actions[bot]"
|
|
35
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
36
|
+
git add "clients/Poke macOS Gate/Poke macOS Gate.xcodeproj/project.pbxproj"
|
|
37
|
+
git commit -m "Bump version to ${{ steps.version.outputs.number }}" || echo "No changes to commit"
|
|
38
|
+
git push origin HEAD:refs/heads/main || echo "Push skipped"
|
|
39
|
+
|
|
40
|
+
- name: Select Xcode
|
|
41
|
+
run: sudo xcode-select -s /Applications/Xcode_26.0.app/Contents/Developer
|
|
42
|
+
|
|
43
|
+
- name: Build universal app
|
|
44
|
+
run: |
|
|
45
|
+
chmod +x build.sh
|
|
46
|
+
./build.sh
|
|
47
|
+
|
|
48
|
+
- name: Upload DMG to GitHub Release
|
|
49
|
+
uses: softprops/action-gh-release@v2
|
|
50
|
+
with:
|
|
51
|
+
files: "build/release/Poke.macOS.Gate.dmg"
|
|
52
|
+
name: Poke Gate ${{ steps.version.outputs.tag }}
|
|
53
|
+
draft: false
|
|
54
|
+
prerelease: false
|
|
55
|
+
generate_release_notes: true
|
|
56
|
+
body: |
|
|
57
|
+
## Installation
|
|
58
|
+
|
|
59
|
+
1. Download **Poke.macOS.Gate.dmg** below
|
|
60
|
+
2. Open the DMG and drag **Poke macOS Gate** to Applications
|
|
61
|
+
3. Since the app is not notarized, macOS may block it on first launch. Run:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
xattr -cr /Applications/Poke\ macOS\ Gate.app
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Then open Poke macOS Gate from your menu bar.
|
|
68
|
+
|
|
69
|
+
Or install via Homebrew:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
brew install f/tap/poke-gate
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## CLI alternative
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
npx poke-gate
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
- name: Compute DMG SHA256
|
|
82
|
+
id: sha
|
|
83
|
+
run: echo "sha256=$(shasum -a 256 'build/release/Poke.macOS.Gate.dmg' | awk '{print $1}')" >> "$GITHUB_OUTPUT"
|
|
84
|
+
|
|
85
|
+
- name: Update Homebrew Cask tap
|
|
86
|
+
env:
|
|
87
|
+
TAP_REPO_TOKEN_HOMEBREW: ${{ secrets.TAP_REPO_TOKEN_HOMEBREW }}
|
|
88
|
+
VERSION: ${{ steps.version.outputs.tag }}
|
|
89
|
+
SHA256: ${{ steps.sha.outputs.sha256 }}
|
|
90
|
+
run: |
|
|
91
|
+
VERSION_NUM="${VERSION#v}"
|
|
92
|
+
git clone https://x-access-token:${TAP_REPO_TOKEN_HOMEBREW}@github.com/f/homebrew-tap.git tap
|
|
93
|
+
mkdir -p tap/Casks
|
|
94
|
+
cat > tap/Casks/poke-gate.rb << EOF
|
|
95
|
+
cask "poke-gate" do
|
|
96
|
+
version "${VERSION_NUM}"
|
|
97
|
+
sha256 "${SHA256}"
|
|
98
|
+
|
|
99
|
+
url "https://github.com/f/poke-gate/releases/download/${VERSION}/Poke.macOS.Gate.dmg"
|
|
100
|
+
name "Poke Gate"
|
|
101
|
+
desc "macOS menu bar app to expose your machine to your Poke AI assistant"
|
|
102
|
+
homepage "https://github.com/f/poke-gate"
|
|
103
|
+
|
|
104
|
+
depends_on macos: ">= :sequoia"
|
|
105
|
+
|
|
106
|
+
app "Poke macOS Gate.app"
|
|
107
|
+
|
|
108
|
+
postflight do
|
|
109
|
+
system_command "/usr/bin/xattr", args: ["-cr", "#{appdir}/Poke macOS Gate.app"]
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
zap trash: [
|
|
113
|
+
"~/Library/Preferences/dev.fka.Poke-macOS-Gate.plist",
|
|
114
|
+
"~/Library/Saved Application State/dev.fka.Poke-macOS-Gate.savedState",
|
|
115
|
+
"~/.config/poke-gate",
|
|
116
|
+
]
|
|
117
|
+
end
|
|
118
|
+
EOF
|
|
119
|
+
cd tap
|
|
120
|
+
git config user.name "github-actions[bot]"
|
|
121
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
122
|
+
git add .
|
|
123
|
+
git commit -m "Update poke-gate to ${VERSION}"
|
|
124
|
+
git push
|
package/README.md
CHANGED
|
@@ -1,16 +1,54 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/logo.png" width="128" height="128" alt="Poke Gate icon">
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
<h1 align="center">Poke Gate</h1>
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
<p align="center">
|
|
8
|
+
Let your <a href="https://poke.com">Poke</a> AI assistant access your machine.<br>
|
|
9
|
+
<sub>A community project — not affiliated with Poke or The Interaction Company.</sub>
|
|
10
|
+
</p>
|
|
6
11
|
|
|
7
|
-
|
|
12
|
+
<p align="center">
|
|
13
|
+
<a href="https://github.com/f/poke-gate/releases/latest"><img src="https://img.shields.io/github/v/release/f/poke-gate?style=flat-square" alt="Latest Release"></a>
|
|
14
|
+
<a href="https://www.npmjs.com/package/poke-gate"><img src="https://img.shields.io/npm/v/poke-gate?style=flat-square" alt="npm"></a>
|
|
15
|
+
<a href="https://github.com/f/poke-gate/blob/main/LICENSE"><img src="https://img.shields.io/github/license/f/poke-gate?style=flat-square" alt="License"></a>
|
|
16
|
+
<img src="https://img.shields.io/badge/platform-macOS%2015%2B-blue?style=flat-square" alt="Platform">
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
Run Poke Gate on your Mac, then message Poke from iMessage, Telegram, or SMS to run commands, read files, take screenshots, and more — all on your machine.
|
|
22
|
+
|
|
23
|
+
## Install
|
|
24
|
+
|
|
25
|
+
**Homebrew** (recommended)
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
brew install f/tap/poke-gate
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Manual download**
|
|
32
|
+
|
|
33
|
+
Download the latest **Poke.macOS.Gate.dmg** from [Releases](https://github.com/f/poke-gate/releases), open it, and drag to Applications. Since the app is not notarized, you may need to run:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
xattr -cr /Applications/Poke\ macOS\ Gate.app
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**CLI** (no macOS app needed)
|
|
8
40
|
|
|
9
41
|
```bash
|
|
10
42
|
npx poke-gate
|
|
11
43
|
```
|
|
12
44
|
|
|
13
|
-
|
|
45
|
+
## Setup
|
|
46
|
+
|
|
47
|
+
1. Get an API key from [poke.com/kitchen/api-keys](https://poke.com/kitchen/api-keys)
|
|
48
|
+
2. Open Poke Gate from your menu bar and go to **Settings**
|
|
49
|
+
3. Paste your API key and save
|
|
50
|
+
|
|
51
|
+
The app connects automatically and shows a green dot when ready.
|
|
14
52
|
|
|
15
53
|
## How it works
|
|
16
54
|
|
|
@@ -19,82 +57,105 @@ flowchart TD
|
|
|
19
57
|
A["You message Poke\nfrom iMessage / Telegram / SMS"] --> B["Poke Agent"]
|
|
20
58
|
B --> C["Agent calls MCP tool"]
|
|
21
59
|
C --> D["MCP Tunnel (WebSocket)"]
|
|
22
|
-
D --> E["
|
|
23
|
-
E --> F["Runs command / reads file /
|
|
60
|
+
D --> E["Poke Gate on your Mac"]
|
|
61
|
+
E --> F["Runs command / reads file / takes screenshot"]
|
|
24
62
|
F --> D
|
|
25
63
|
D --> B
|
|
26
64
|
B --> A
|
|
27
65
|
```
|
|
28
66
|
|
|
29
|
-
|
|
67
|
+
Poke Gate runs a local MCP server and tunnels it to Poke's cloud. When you ask Poke something that needs your machine, the agent calls the tools, Poke Gate executes them locally, and the result flows back to your chat.
|
|
30
68
|
|
|
31
69
|
## Tools
|
|
32
70
|
|
|
33
|
-
| Tool |
|
|
71
|
+
| Tool | What it does |
|
|
34
72
|
|------|-------------|
|
|
35
|
-
| `run_command` | Execute any shell command (ls, git, brew, python, curl
|
|
36
|
-
| `read_file` | Read a file
|
|
73
|
+
| `run_command` | Execute any shell command (ls, git, brew, python, curl…) |
|
|
74
|
+
| `read_file` | Read a text file |
|
|
75
|
+
| `read_image` | Read an image file and return it as base64 |
|
|
37
76
|
| `write_file` | Write content to a file |
|
|
38
77
|
| `list_directory` | List files and directories |
|
|
39
78
|
| `system_info` | OS, hostname, architecture, uptime, memory |
|
|
79
|
+
| `take_screenshot` | Capture the screen (requires Screen Recording permission) |
|
|
40
80
|
|
|
41
81
|
## Examples
|
|
42
82
|
|
|
43
|
-
From iMessage
|
|
83
|
+
From iMessage or Telegram, ask Poke:
|
|
44
84
|
|
|
45
85
|
- "What's running on port 3000?"
|
|
46
86
|
- "Show me the last 5 git commits in my project"
|
|
47
87
|
- "How much disk space do I have left?"
|
|
48
88
|
- "Read my ~/.zshrc and suggest improvements"
|
|
49
|
-
- "
|
|
50
|
-
- "
|
|
89
|
+
- "Take a screenshot of my screen"
|
|
90
|
+
- "Create a file called notes.txt on my Desktop"
|
|
51
91
|
|
|
52
|
-
##
|
|
92
|
+
## macOS App
|
|
93
|
+
|
|
94
|
+
The menu bar app manages everything:
|
|
95
|
+
|
|
96
|
+
- **Status** — green dot when connected, yellow when connecting, red on error
|
|
97
|
+
- **Personalized** — shows "Connected to your Poke, [name]"
|
|
98
|
+
- **Auto-start** — connects on launch if API key is saved
|
|
99
|
+
- **Auto-restart** — reconnects automatically if the connection drops
|
|
100
|
+
- **Settings** — paste your API key
|
|
101
|
+
- **Logs** — view real-time tool calls and connection events
|
|
102
|
+
- **Screen Recording** — prompts for permission on first launch
|
|
53
103
|
|
|
54
|
-
|
|
104
|
+
The app runs in the menu bar only (no Dock icon). Quit is the only way to stop it.
|
|
105
|
+
|
|
106
|
+
### Building from source
|
|
107
|
+
|
|
108
|
+
Requires macOS 15+ and Xcode 26+.
|
|
55
109
|
|
|
56
110
|
```bash
|
|
57
|
-
|
|
111
|
+
git clone https://github.com/f/poke-gate.git
|
|
112
|
+
cd poke-gate/clients/Poke\ macOS\ Gate
|
|
113
|
+
open Poke\ macOS\ Gate.xcodeproj
|
|
58
114
|
```
|
|
59
115
|
|
|
60
|
-
|
|
116
|
+
Hit **Run** in Xcode, or build from the command line:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
./build.sh
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## CLI usage
|
|
123
|
+
|
|
124
|
+
If you prefer the command line over the macOS app:
|
|
61
125
|
|
|
62
126
|
```bash
|
|
63
|
-
export POKE_API_KEY=your_key_here
|
|
64
127
|
npx poke-gate
|
|
65
128
|
```
|
|
66
129
|
|
|
130
|
+
On first run, paste your API key when prompted. Add `--verbose` to see tool calls in real time:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
npx poke-gate --verbose
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Config is stored at `~/.config/poke-gate/config.json`.
|
|
137
|
+
|
|
67
138
|
## Security
|
|
68
139
|
|
|
69
|
-
**
|
|
140
|
+
**Poke Gate grants full shell access to your Poke agent.** This means:
|
|
70
141
|
|
|
71
142
|
- Any command can be run with your user's permissions
|
|
72
143
|
- Files can be read and written anywhere your user has access
|
|
73
144
|
- Only your Poke agent (authenticated by your API key) can reach the tunnel
|
|
74
145
|
|
|
75
|
-
Only run
|
|
76
|
-
|
|
77
|
-
## Configuration
|
|
78
|
-
|
|
79
|
-
Config is stored at `~/.config/poke-gate/config.json`:
|
|
80
|
-
|
|
81
|
-
```json
|
|
82
|
-
{
|
|
83
|
-
"apiKey": "your_key_here"
|
|
84
|
-
}
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
To reset, delete the file and run `npx poke-gate` again.
|
|
146
|
+
Only run Poke Gate on machines and networks you trust.
|
|
88
147
|
|
|
89
148
|
## Project structure
|
|
90
149
|
|
|
91
150
|
```
|
|
151
|
+
clients/
|
|
152
|
+
Poke macOS Gate/ macOS menu bar app (SwiftUI)
|
|
92
153
|
bin/
|
|
93
|
-
poke-gate.js
|
|
154
|
+
poke-gate.js CLI entry point + onboarding
|
|
94
155
|
src/
|
|
95
|
-
app.js
|
|
96
|
-
mcp-server.js
|
|
97
|
-
tunnel.js
|
|
156
|
+
app.js Startup: MCP server + tunnel
|
|
157
|
+
mcp-server.js JSON-RPC MCP handler with OS tools
|
|
158
|
+
tunnel.js PokeTunnel wrapper
|
|
98
159
|
```
|
|
99
160
|
|
|
100
161
|
## Credits
|
package/assets/logo.png
ADDED
|
Binary file
|
package/build.sh
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
APP_NAME="Poke macOS Gate"
|
|
5
|
+
SCHEME="Poke macOS Gate"
|
|
6
|
+
PROJECT="clients/Poke macOS Gate/Poke macOS Gate.xcodeproj"
|
|
7
|
+
BUILD_DIR="build"
|
|
8
|
+
RELEASE_DIR="${BUILD_DIR}/release"
|
|
9
|
+
ARM64_DIR="${BUILD_DIR}/arm64"
|
|
10
|
+
X86_DIR="${BUILD_DIR}/x86_64"
|
|
11
|
+
UNIVERSAL_APP="${RELEASE_DIR}/${APP_NAME}.app"
|
|
12
|
+
DMG_NAME="Poke.macOS.Gate.dmg"
|
|
13
|
+
DMG_PATH="${RELEASE_DIR}/${DMG_NAME}"
|
|
14
|
+
|
|
15
|
+
rm -rf "$BUILD_DIR"
|
|
16
|
+
mkdir -p "$RELEASE_DIR"
|
|
17
|
+
|
|
18
|
+
echo "Building arm64..."
|
|
19
|
+
xcodebuild -project "$PROJECT" -scheme "$SCHEME" -configuration Release \
|
|
20
|
+
-arch arm64 -derivedDataPath "$ARM64_DIR" \
|
|
21
|
+
CODE_SIGN_IDENTITY="-" CODE_SIGNING_REQUIRED=NO \
|
|
22
|
+
DEVELOPMENT_TEAM="" \
|
|
23
|
+
clean build 2>&1 | tail -5
|
|
24
|
+
|
|
25
|
+
echo "Building x86_64..."
|
|
26
|
+
xcodebuild -project "$PROJECT" -scheme "$SCHEME" -configuration Release \
|
|
27
|
+
-arch x86_64 -derivedDataPath "$X86_DIR" \
|
|
28
|
+
CODE_SIGN_IDENTITY="-" CODE_SIGNING_REQUIRED=NO \
|
|
29
|
+
DEVELOPMENT_TEAM="" \
|
|
30
|
+
clean build 2>&1 | tail -5
|
|
31
|
+
|
|
32
|
+
ARM64_APP=$(find "$ARM64_DIR" -name "${APP_NAME}.app" -type d | head -1)
|
|
33
|
+
X86_APP=$(find "$X86_DIR" -name "${APP_NAME}.app" -type d | head -1)
|
|
34
|
+
|
|
35
|
+
echo "Creating universal binary..."
|
|
36
|
+
cp -R "$ARM64_APP" "$UNIVERSAL_APP"
|
|
37
|
+
|
|
38
|
+
find "$ARM64_APP" -type f -perm +111 | while read arm_bin; do
|
|
39
|
+
rel_path="${arm_bin#$ARM64_APP/}"
|
|
40
|
+
x86_bin="${X86_APP}/${rel_path}"
|
|
41
|
+
uni_bin="${UNIVERSAL_APP}/${rel_path}"
|
|
42
|
+
|
|
43
|
+
if [ -f "$x86_bin" ] && file "$arm_bin" | grep -q "Mach-O"; then
|
|
44
|
+
lipo -create "$arm_bin" "$x86_bin" -output "$uni_bin" 2>/dev/null || true
|
|
45
|
+
fi
|
|
46
|
+
done
|
|
47
|
+
|
|
48
|
+
echo "Creating DMG..."
|
|
49
|
+
hdiutil create -volname "$APP_NAME" -srcfolder "$UNIVERSAL_APP" \
|
|
50
|
+
-ov -format UDZO "$DMG_PATH"
|
|
51
|
+
|
|
52
|
+
echo "Done: $DMG_PATH"
|
package/clients/Poke macOS Gate/Poke macOS Gate/Assets.xcassets/AppIcon.appiconset/Contents.json
CHANGED
|
@@ -1,51 +1,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"images" : [
|
|
3
3
|
{
|
|
4
|
+
"filename" : "icon_16x16.png",
|
|
4
5
|
"idiom" : "mac",
|
|
5
6
|
"scale" : "1x",
|
|
6
7
|
"size" : "16x16"
|
|
7
8
|
},
|
|
8
9
|
{
|
|
10
|
+
"filename" : "icon_16x16@2x.png",
|
|
9
11
|
"idiom" : "mac",
|
|
10
12
|
"scale" : "2x",
|
|
11
13
|
"size" : "16x16"
|
|
12
14
|
},
|
|
13
15
|
{
|
|
16
|
+
"filename" : "icon_32x32.png",
|
|
14
17
|
"idiom" : "mac",
|
|
15
18
|
"scale" : "1x",
|
|
16
19
|
"size" : "32x32"
|
|
17
20
|
},
|
|
18
21
|
{
|
|
22
|
+
"filename" : "icon_32x32@2x.png",
|
|
19
23
|
"idiom" : "mac",
|
|
20
24
|
"scale" : "2x",
|
|
21
25
|
"size" : "32x32"
|
|
22
26
|
},
|
|
23
27
|
{
|
|
28
|
+
"filename" : "icon_128x128.png",
|
|
24
29
|
"idiom" : "mac",
|
|
25
30
|
"scale" : "1x",
|
|
26
31
|
"size" : "128x128"
|
|
27
32
|
},
|
|
28
33
|
{
|
|
34
|
+
"filename" : "icon_128x128@2x.png",
|
|
29
35
|
"idiom" : "mac",
|
|
30
36
|
"scale" : "2x",
|
|
31
37
|
"size" : "128x128"
|
|
32
38
|
},
|
|
33
39
|
{
|
|
40
|
+
"filename" : "icon_256x256.png",
|
|
34
41
|
"idiom" : "mac",
|
|
35
42
|
"scale" : "1x",
|
|
36
43
|
"size" : "256x256"
|
|
37
44
|
},
|
|
38
45
|
{
|
|
46
|
+
"filename" : "icon_256x256@2x.png",
|
|
39
47
|
"idiom" : "mac",
|
|
40
48
|
"scale" : "2x",
|
|
41
49
|
"size" : "256x256"
|
|
42
50
|
},
|
|
43
51
|
{
|
|
52
|
+
"filename" : "icon_512x512.png",
|
|
44
53
|
"idiom" : "mac",
|
|
45
54
|
"scale" : "1x",
|
|
46
55
|
"size" : "512x512"
|
|
47
56
|
},
|
|
48
57
|
{
|
|
58
|
+
"filename" : "icon_512x512@2x.png",
|
|
49
59
|
"idiom" : "mac",
|
|
50
60
|
"scale" : "2x",
|
|
51
61
|
"size" : "512x512"
|
package/clients/Poke macOS Gate/Poke macOS Gate/Assets.xcassets/AppIcon.appiconset/icon_128x128.png
ADDED
|
Binary file
|
|
Binary file
|
package/clients/Poke macOS Gate/Poke macOS Gate/Assets.xcassets/AppIcon.appiconset/icon_16x16.png
ADDED
|
Binary file
|
package/clients/Poke macOS Gate/Poke macOS Gate/Assets.xcassets/AppIcon.appiconset/icon_16x16@2x.png
ADDED
|
Binary file
|
package/clients/Poke macOS Gate/Poke macOS Gate/Assets.xcassets/AppIcon.appiconset/icon_256x256.png
ADDED
|
Binary file
|
|
Binary file
|
package/clients/Poke macOS Gate/Poke macOS Gate/Assets.xcassets/AppIcon.appiconset/icon_32x32.png
ADDED
|
Binary file
|
package/clients/Poke macOS Gate/Poke macOS Gate/Assets.xcassets/AppIcon.appiconset/icon_32x32@2x.png
ADDED
|
Binary file
|
package/clients/Poke macOS Gate/Poke macOS Gate/Assets.xcassets/AppIcon.appiconset/icon_512x512.png
ADDED
|
Binary file
|
|
Binary file
|
|
@@ -58,9 +58,28 @@ class GateService: ObservableObject {
|
|
|
58
58
|
return
|
|
59
59
|
}
|
|
60
60
|
shouldRestart = true
|
|
61
|
+
fetchUserName()
|
|
61
62
|
launchProcess()
|
|
62
63
|
}
|
|
63
64
|
|
|
65
|
+
private func fetchUserName() {
|
|
66
|
+
guard let key = loadAPIKey() else { return }
|
|
67
|
+
Task {
|
|
68
|
+
let url = URL(string: "https://poke.com/api/v1/user/profile")!
|
|
69
|
+
var request = URLRequest(url: url)
|
|
70
|
+
request.setValue("Bearer \(key)", forHTTPHeaderField: "Authorization")
|
|
71
|
+
do {
|
|
72
|
+
let (data, response) = try await URLSession.shared.data(for: request)
|
|
73
|
+
guard let httpResp = response as? HTTPURLResponse, httpResp.statusCode == 200 else { return }
|
|
74
|
+
if let json = try? JSONSerialization.jsonObject(with: data) as? [String: Any],
|
|
75
|
+
let fullName = json["name"] as? String ?? json["email"] as? String {
|
|
76
|
+
let firstName = fullName.components(separatedBy: CharacterSet.whitespaces.union(CharacterSet(charactersIn: "@"))).first ?? fullName
|
|
77
|
+
self.userName = firstName
|
|
78
|
+
}
|
|
79
|
+
} catch {}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
64
83
|
func stop() {
|
|
65
84
|
shouldRestart = false
|
|
66
85
|
killProcess()
|
|
@@ -38,9 +38,26 @@ struct MenuBarContent: View {
|
|
|
38
38
|
@Environment(\.openWindow) private var openWindow
|
|
39
39
|
|
|
40
40
|
var body: some View {
|
|
41
|
-
Label(
|
|
41
|
+
Label(statusText, systemImage: statusIcon)
|
|
42
42
|
.foregroundStyle(statusColor)
|
|
43
43
|
|
|
44
|
+
if service.status == .connected {
|
|
45
|
+
Text("This machine is now accessible via Poke.")
|
|
46
|
+
.font(.caption2)
|
|
47
|
+
.foregroundStyle(.secondary)
|
|
48
|
+
Text("Ask your Poke to run commands or read files.")
|
|
49
|
+
.font(.caption2)
|
|
50
|
+
.foregroundStyle(.secondary)
|
|
51
|
+
} else if service.status == .starting {
|
|
52
|
+
Text("Establishing connection…")
|
|
53
|
+
.font(.caption2)
|
|
54
|
+
.foregroundStyle(.secondary)
|
|
55
|
+
} else if service.status == .error {
|
|
56
|
+
Text("Check Settings or view Logs for details.")
|
|
57
|
+
.font(.caption2)
|
|
58
|
+
.foregroundStyle(.secondary)
|
|
59
|
+
}
|
|
60
|
+
|
|
44
61
|
Divider()
|
|
45
62
|
|
|
46
63
|
Button("View Logs…") {
|
|
@@ -89,6 +106,20 @@ struct MenuBarContent: View {
|
|
|
89
106
|
.font(.caption)
|
|
90
107
|
}
|
|
91
108
|
|
|
109
|
+
private var statusText: String {
|
|
110
|
+
switch service.status {
|
|
111
|
+
case .connected:
|
|
112
|
+
if let name = service.userName {
|
|
113
|
+
return "Connected to your Poke, \(name)"
|
|
114
|
+
}
|
|
115
|
+
return "Connected to your Poke"
|
|
116
|
+
case .starting: return "Connecting…"
|
|
117
|
+
case .disconnected: return "Reconnecting…"
|
|
118
|
+
case .error: return "Connection error"
|
|
119
|
+
case .stopped: return "Stopped"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
92
123
|
private var statusIcon: String {
|
|
93
124
|
switch service.status {
|
|
94
125
|
case .connected: "circle.fill"
|
|
@@ -264,7 +264,7 @@
|
|
|
264
264
|
"$(inherited)",
|
|
265
265
|
"@executable_path/../Frameworks",
|
|
266
266
|
);
|
|
267
|
-
MARKETING_VERSION =
|
|
267
|
+
MARKETING_VERSION = 0.0.4;
|
|
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 =
|
|
299
|
+
MARKETING_VERSION = 0.0.4;
|
|
300
300
|
PRODUCT_BUNDLE_IDENTIFIER = "dev.fka.Poke-macOS-Gate";
|
|
301
301
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
302
302
|
REGISTER_APP_GROUPS = YES;
|
|
Binary file
|