Skip to content

Commit 7f24916

Browse files
author
SentienceDEV
committed
Merge pull request #74 from SentienceAPI/release_fix2
fix extension directory
2 parents 3ee9c0e + 1d1d02e commit 7f24916

File tree

9 files changed

+79
-2163
lines changed

9 files changed

+79
-2163
lines changed

.github/workflows/release.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,78 @@ jobs:
5656
env:
5757
CI: true
5858

59+
- name: Verify extension files are present
60+
run: |
61+
echo "🔍 Verifying extension files are included..."
62+
63+
# Check required extension files exist
64+
REQUIRED_FILES=(
65+
"src/extension/manifest.json"
66+
"src/extension/content.js"
67+
"src/extension/background.js"
68+
"src/extension/injected_api.js"
69+
"src/extension/pkg/sentience_core.js"
70+
"src/extension/pkg/sentience_core_bg.wasm"
71+
)
72+
73+
MISSING_FILES=()
74+
for file in "${REQUIRED_FILES[@]}"; do
75+
if [ ! -f "$file" ]; then
76+
MISSING_FILES+=("$file")
77+
fi
78+
done
79+
80+
if [ ${#MISSING_FILES[@]} -ne 0 ]; then
81+
echo "❌ Error: Missing required extension files:"
82+
printf ' - %s\n' "${MISSING_FILES[@]}"
83+
echo ""
84+
echo "Please ensure the extension is synced before releasing."
85+
echo "Run the sync-extension workflow or manually sync extension files."
86+
exit 1
87+
fi
88+
89+
# Verify findTextRect function exists in injected_api.js
90+
if ! grep -q "findTextRect:" src/extension/injected_api.js; then
91+
echo "❌ Error: findTextRect function not found in injected_api.js"
92+
echo "The extension may be out of date. Please sync the extension before releasing."
93+
exit 1
94+
fi
95+
96+
echo "✅ All extension files verified"
97+
echo "📦 Extension files that will be included:"
98+
find src/extension -type f | sort
99+
59100
- name: Build package
60101
run: |
61102
npm run build
103+
104+
- name: Verify extension files in built package
105+
run: |
106+
echo "🔍 Verifying extension files are included in the built package..."
107+
108+
# Check that src/extension directory exists after build
109+
# (TypeScript build doesn't modify extension files, they should still be in src/)
110+
if [ ! -d "src/extension" ]; then
111+
echo "❌ Error: src/extension directory missing after build"
112+
exit 1
113+
fi
114+
115+
# Verify findTextRect is still in the extension after build
116+
if ! grep -q "findTextRect:" src/extension/injected_api.js; then
117+
echo "❌ Error: findTextRect not found in extension after build"
118+
exit 1
119+
fi
120+
121+
# Check package.json files array includes src/extension
122+
if ! grep -q '"src/extension"' package.json; then
123+
echo "⚠️ Warning: package.json files array may not include src/extension"
124+
echo "Current files array:"
125+
grep -A 5 '"files"' package.json || echo "files array not found"
126+
fi
127+
128+
echo "✅ Extension files verified in package"
129+
echo "📦 Extension files that will be published:"
130+
find src/extension -type f | head -20
62131
63132
- name: Publish to npm
64133
run: |

.github/workflows/sync-extension.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ jobs:
145145
- name: Update extension files
146146
if: steps.release.outputs.skip != 'true'
147147
run: |
148-
# Target directory in sdk-ts
149-
TARGET_DIR="sentience-chrome"
148+
# Target directory in sdk-ts (must match package.json files array)
149+
TARGET_DIR="src/extension"
150150
151151
# Ensure target directory exists and is clean
152152
rm -rf "$TARGET_DIR"
@@ -161,6 +161,12 @@ jobs:
161161
exit 1
162162
fi
163163
164+
# Verify findTextRect is in the synced extension
165+
if ! grep -q "findTextRect:" "$TARGET_DIR/injected_api.js"; then
166+
echo "⚠️ Warning: findTextRect not found in synced injected_api.js"
167+
echo "The extension may be outdated. Check sentience-chrome repository."
168+
fi
169+
164170
# Cleanup
165171
rm -rf extension-temp
166172
@@ -171,7 +177,7 @@ jobs:
171177
if: steps.release.outputs.skip != 'true'
172178
id: changes
173179
run: |
174-
git add sentience-chrome/
180+
git add src/extension/
175181
176182
if git diff --staged --quiet; then
177183
echo "No changes detected."

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sentienceapi",
3-
"version": "0.90.8",
3+
"version": "0.90.9",
44
"description": "TypeScript SDK for Sentience AI Agent Browser Automation",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

sentience-chrome/background.js

Lines changed: 0 additions & 233 deletions
This file was deleted.

0 commit comments

Comments
 (0)