Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,78 @@ jobs:
env:
CI: true

- name: Verify extension files are present
run: |
echo "🔍 Verifying extension files are included..."

# Check required extension files exist
REQUIRED_FILES=(
"src/extension/manifest.json"
"src/extension/content.js"
"src/extension/background.js"
"src/extension/injected_api.js"
"src/extension/pkg/sentience_core.js"
"src/extension/pkg/sentience_core_bg.wasm"
)

MISSING_FILES=()
for file in "${REQUIRED_FILES[@]}"; do
if [ ! -f "$file" ]; then
MISSING_FILES+=("$file")
fi
done

if [ ${#MISSING_FILES[@]} -ne 0 ]; then
echo "❌ Error: Missing required extension files:"
printf ' - %s\n' "${MISSING_FILES[@]}"
echo ""
echo "Please ensure the extension is synced before releasing."
echo "Run the sync-extension workflow or manually sync extension files."
exit 1
fi

# Verify findTextRect function exists in injected_api.js
if ! grep -q "findTextRect:" src/extension/injected_api.js; then
echo "❌ Error: findTextRect function not found in injected_api.js"
echo "The extension may be out of date. Please sync the extension before releasing."
exit 1
fi

echo "✅ All extension files verified"
echo "📦 Extension files that will be included:"
find src/extension -type f | sort

- name: Build package
run: |
npm run build

- name: Verify extension files in built package
run: |
echo "🔍 Verifying extension files are included in the built package..."

# Check that src/extension directory exists after build
# (TypeScript build doesn't modify extension files, they should still be in src/)
if [ ! -d "src/extension" ]; then
echo "❌ Error: src/extension directory missing after build"
exit 1
fi

# Verify findTextRect is still in the extension after build
if ! grep -q "findTextRect:" src/extension/injected_api.js; then
echo "❌ Error: findTextRect not found in extension after build"
exit 1
fi

# Check package.json files array includes src/extension
if ! grep -q '"src/extension"' package.json; then
echo "⚠️ Warning: package.json files array may not include src/extension"
echo "Current files array:"
grep -A 5 '"files"' package.json || echo "files array not found"
fi

echo "✅ Extension files verified in package"
echo "📦 Extension files that will be published:"
find src/extension -type f | head -20

- name: Publish to npm
run: |
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/sync-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ jobs:
- name: Update extension files
if: steps.release.outputs.skip != 'true'
run: |
# Target directory in sdk-ts
TARGET_DIR="sentience-chrome"
# Target directory in sdk-ts (must match package.json files array)
TARGET_DIR="src/extension"

# Ensure target directory exists and is clean
rm -rf "$TARGET_DIR"
Expand All @@ -161,6 +161,12 @@ jobs:
exit 1
fi

# Verify findTextRect is in the synced extension
if ! grep -q "findTextRect:" "$TARGET_DIR/injected_api.js"; then
echo "⚠️ Warning: findTextRect not found in synced injected_api.js"
echo "The extension may be outdated. Check sentience-chrome repository."
fi

# Cleanup
rm -rf extension-temp

Expand All @@ -171,7 +177,7 @@ jobs:
if: steps.release.outputs.skip != 'true'
id: changes
run: |
git add sentience-chrome/
git add src/extension/

if git diff --staged --quiet; then
echo "No changes detected."
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sentienceapi",
"version": "0.90.8",
"version": "0.90.9",
"description": "TypeScript SDK for Sentience AI Agent Browser Automation",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
233 changes: 0 additions & 233 deletions sentience-chrome/background.js

This file was deleted.

Loading