Commit Graph

21 Commits

Author SHA1 Message Date
mcfn.feng a171ea2192 [root]fix: copy root README.md to CLI package before npm publish 2026-04-02 23:23:56 +08:00
Junliang Feng 34f262220d fix: release workflow — add workflow_dispatch and alpha npm tag (#453)
* [root]fix: release workflow — add workflow_dispatch and alpha npm tag

- Add workflow_dispatch trigger to allow manual releases from any branch
- Add --tag alpha for prerelease versions so alpha doesn't overwrite latest
- Remove stale CHANGELOG.md from 6 CLI platform packages (stuck at 0.8.0)

* [packages/cli]chore: bump version to 1.0.0-alpha.6
2026-04-02 15:18:28 +08:00
mcfn.feng 58545129de [root]refactor: remove actionbook-rs, promote cli-v2 to packages/cli
- Delete packages/actionbook-rs/ (legacy 0.x CLI)
- Delete old packages/cli/ (JS npm wrapper for 0.x)
- Rename packages/cli-v2/ → packages/cli/ (git mv)
- Merge npm wrapper files (bin/actionbook.js, scripts/postinstall.js) into new cli/
- Update package.json: name → @actionbookdev/cli, private → false, add npm distribution fields
- Update sync-versions.js: point Cargo.toml/Cargo.lock sync at packages/cli/
- Update release.yml: build from packages/cli/ instead of packages/actionbook-rs/
- Update test.yml: paths and working-directory from cli-v2 → cli
- Update CLAUDE.md, CONTRIBUTING.md, docs, issue templates
- Delete stale changeset (fix-screenshot-timeout.md)
- Keep 6 platform binary packages unchanged
2026-04-02 00:46:12 +08:00
sen c6ddd3091d [root]fix: make CLI npm publish idempotent for workflow reruns
Add version comparison before npm publish for platform packages and
CLI main package, matching the existing pattern in publish-js job.
Prevents 403 "cannot publish over previously published versions" on rerun.
2026-03-22 01:05:58 +08:00
sen 041f23dbdf [root]fix: fallback to github.token when RELEASE_PAT is unavailable
Ensures GitHub Release creation never fails due to PAT issues.
When RELEASE_PAT is approved, Discord notifications will also fire.
2026-03-22 00:29:40 +08:00
sen 86f2ac9be4 [root]fix: use PAT for GitHub Release creation to trigger Discord notifications
GITHUB_TOKEN-created events don't trigger other workflows.
Switch to RELEASE_PAT so release:published fires discord-release-notify.
2026-03-21 16:28:42 +08:00
sen 0223a45bb3 [root]fix: address PR review feedback
- Add empty permissions block to discord-release-notify.yml (least privilege)
- Fix shell injection risk: pass published_list via env var instead of
  inline ${{ }} expansion to avoid backtick command substitution
2026-03-20 16:11:34 +08:00
sen 85f413fa65 [root]fix: remove avatar_url from Discord webhook payloads
Use webhook's configured avatar instead of overriding it in payload.
2026-03-20 16:10:40 +08:00
sen 0f7a07152a [root]feat: add Discord release notifications
- Add discord-release-notify.yml workflow triggered on GitHub Release events
  - CLI releases: green embed with install instructions (macOS/Linux, Windows, npm)
  - Extension releases: blue embed
  - Dify Plugin releases: purple embed
  - Cleans PR attribution links and Full Changelog from release body
  - Truncates to Discord 4096 char embed limit
- Add npm publish Discord notification step to release.yml publish-js job
  - Orange embed listing all published packages with versions
  - Only fires when packages are actually published
2026-03-20 15:59:42 +08:00
sen 4677a4c70f [root]fix: use pnpm publish to resolve workspace protocol in release CI
npm publish does not resolve workspace:* dependencies, causing
@actionbookdev/openclaw-plugin to ship with unresolvable deps on npm.
Switch to pnpm publish --no-git-checks which auto-resolves workspace
references to actual version numbers.
2026-03-18 10:07:56 +08:00
sen d3c6c265d9 chore: rename openclaw plugin package to @actionbookdev/openclaw-plugin 2026-03-18 02:08:38 +08:00
sen 26213c973b [root]chore: add openclaw-plugin to CI release pipeline
- Add @actionbookdev/actionbook to build:release turbo filter
- Add openclaw-plugin to publish-js PACKAGES array in release.yml
- Add changeset for initial 0.1.1 patch release
2026-03-18 01:13:11 +08:00
sen ac26db42d8 [root]fix: use ubuntu-22.04 runner for linux-x64 CLI build to lower glibc requirement
The linux-x64 binary was built on ubuntu-latest (Ubuntu 24.04, glibc 2.39),
causing "GLIBC_2.39 not found" errors on Debian 12 (glibc 2.36) and other
older but still-supported distributions.

Pin the runner to ubuntu-22.04 (glibc 2.35) to support Debian 12+ and
Ubuntu 22.04+.
2026-03-11 20:46:07 +08:00
Junliang Feng d6fc702677 feat: auto-update homebrew formula on CLI release (CUE-502) (#178) 2026-03-02 21:58:55 +08:00
adcentury 9d2c7a5e8e fix(release): checksum entries should match release asset names 2026-02-28 17:36:18 +08:00
adcentury de64fc4911 feat(release): publish CLI SHA256 checksums 2026-02-28 17:29:00 +08:00
sen eb3035b5be ci(release): fix dify plugin packaging command in release workflow (#158)
* ci(release): use uv tool run for dify packaging

* ci(release): add workflow_dispatch dry-run path for dify release validation

* ci(release): install official dify cli before packaging

* ci(release): create dist directory before dify packaging

* ci(release): keep only dify packaging fix and drop debug flow
2026-02-24 01:37:20 +08:00
sen 93caf967e0 [New Package] Dify Plugin - Browser Automation Manuals (#86)
* [packages/dify-plugin]feat: add Dify plugin for browser automation

- Implement search_actions and get_action_by_area_id tools
- Support API key authentication via Dify plugin SDK
- Add comprehensive tests (34 tests, 99% coverage)
- Add documentation (README, PRIVACY)
- Phase 1: Query action manuals via API

Tools:
- search_actions: Find website elements by keyword/domain filter
- get_action_by_area_id: Get complete selector details by area ID

Testing:
- Unit tests: provider, search_actions, get_action_by_area_id
- Coverage: 99% (412 statements, 3 missed)
- Linting: ruff with zero errors

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* [packages/dify-plugin]fix: align SDK interface, fix API issues and improve reliability

- Fix API endpoint and parameter alignment with Actionbook API
- Align with Dify SDK interface (provider structure, tool signatures)
- Restructure provider: replace provider.yaml with provider/ package
- Add test infrastructure: unit tests, integration tests, E2E checklist
- Improve error handling and remove legacy provider.yaml
- Resolve empty response issue in Dify Cloud
- Pin dify-plugin>=0.5.1,<0.6.0 to prevent breaking changes
- Add *.difypkg, .coverage, .alma-snapshots to root .gitignore

* [packages/dify-plugin]fix: address code review issues in source code

- C4: Add insecure CDP URL warning for non-localhost ws:// connections
- C5: Replace print(stderr) with proper logger in search/get tools
- C6: Re-raise exception after logging in HyperbrowserSession.stop()
- W8: Make API_BASE_URL configurable via ACTIONBOOK_API_URL env var
- W-limit: Fix float limit validation with int() cast
- W-except: Narrow bare Exception to PlaywrightTimeout in operator
- W-use_proxy: Fix bool comparison for string/bool/whitespace inputs
- W7: Document _get_active_page tab selection behavior
- Fix type annotation in providers/__init__.py
- Update misleading comment in provider/actionbook.py
- Add cleanup warning in browser_create_session.yaml

* [packages/dify-plugin]fix: correct integration tests to match tool behavior

Tools yield error messages instead of raising exceptions.
Fix tests that incorrectly used pytest.raises(ValueError) to
instead assert on the returned message content.

* [packages/dify-plugin]test: add missing unit tests for improved coverage

- New test_browser_stop_session.py (6 tests)
- Add HTTP 403, SSL/connection error branch tests for search/get tools
- Add use_proxy edge cases and default provider tests
- Add malformed cdp_url test for browser operator
- Add insecure CDP URL warning tests
- Update operator tests for PlaywrightTimeout narrowing
- Add provider re-raise test

184 tests pass at 86% coverage.

* [packages/dify-plugin]test: add E2E browser tests with Hyperbrowser

- Add verify_hyperbrowser.py manual verification script
- Add 8 E2E tests: tool wrappers (create/stop/navigate/screenshot)
  and Playwright direct (multi-step, form fill, nav history, HTML)
- Add retry logic for intermittent gevent SSL errors
- Add tenacity to dev dependencies

Run: HYPERBROWSER_API_KEY=hb-xxx uv run pytest -m e2e -v --timeout=120 --no-cov

* [packages/dify-plugin]feat: add connection pool, playwright worker and API key resolver

- api_key.py: resolve provider key from params or env vars with placeholder filtering
- connection_pool.py: in-process pool of browser workers keyed by session_id,
  using subprocess-based Playwright workers to avoid asyncio conflicts
- playwright_worker.py: standalone Playwright worker process supporting
  CSS, XPath, and snapshot ref selectors (@eN / [ref=eN])

* [packages/dify-plugin]refactor: simplify cdp_client to URL validation only

Remove CDP connection logic (cdp_page, _get_active_page, CdpConnectionError)
since connections are now managed by the connection pool and playwright worker.
Retain only validate_cdp_url for input validation.

* [packages/dify-plugin]feat: add snapshot action, connection pool integration and improved error handling

browser_operator:
- Add snapshot action with accessibility tree (ported from actionbook-rs)
- Replace cdp_page with connection pool for persistent sessions
- Add SSRF protection for CDP URLs
- Improve click/type/fill error messages with recovery hints
- Remove screenshot action in favor of snapshot

browser_create_session:
- Integrate connection pool (pre-connect on session create)
- Add profile_id fallback retry logic
- Support API key from env vars via resolve_provider_api_key
- Validate provider name against SUPPORTED_PROVIDERS

browser_stop_session:
- Disconnect pooled connection before stopping provider session
- Improved error messages with troubleshooting hints

hyperbrowser provider:
- Add profile_id UUID normalization (uuid5 for non-UUID inputs)

actionbook provider:
- Add API health check in _validate_credentials

* [packages/dify-plugin]fix: improve search/get_action tools with validation and fallback hints

- Add area_id character validation regex to prevent injection
- Add snapshot fallback guidance in tool descriptions
- Reduce debug log verbosity (avoid logging raw parameters)

* [packages/dify-plugin]docs: update README workflow guide, manifest version and difyignore

- README: add snapshot-based recovery workflow and troubleshooting section
- manifest: set version to 0.1.0 (initial release)
- difyignore: add scripts/, dist/, .docs/, .DS_Store exclusions

* [packages/dify-plugin]chore: remove verify_hyperbrowser script

No longer needed — verification is covered by E2E tests.

* [packages/dify-plugin]test: update tests for connection pool, snapshot and improved tools

- Add test_connection_pool.py: pool connect/disconnect/execute lifecycle
- Add test_playwright_worker.py: worker process smoke test
- Add test_workflow_snapshot_recovery.py: snapshot-based selector recovery
- Update browser_operator tests for snapshot action and error handling
- Update browser_create/stop session tests for pool integration
- Update cdp_client tests (simplified to URL validation only)
- Update provider/search/get_action tests for new validation logic
- Replace screenshot references with snapshot in E2E tests

* [packages/dify-plugin]refactor: cache provider info in connection pool so stop_session auto-resolves credentials

browser_stop_session no longer requires provider/api_key params — they are
looked up from the pool via get_session_info(). api_key field in
browser_create_session changed to secret-input with form-level input.

* [packages/dify-plugin]docs: update README with browser tools and remove unused import

- Add documentation for browser_create_session, browser_stop_session,
  browser_operator tools
- Update features list and use cases to reflect browser automation
- Remove outdated Phase 2 roadmap (already implemented)
- Fix provider names (Hyperbrowser/Steel.dev, not Browserbase)
- Note that browser_stop_session auto-resolves provider/api_key
- Remove unused SUPPORTED_PROVIDERS import from browser_stop_session.py

* [packages/dify-plugin]fix: correct YAML descriptions and add zh_Hans translations

- Fix browser_create_session llm_description referencing non-existent
  tool names (browser_navigate → browser_operator)
- Remove Steel.dev mention from descriptions (not yet available)
- Update manifest description to reflect browser automation capabilities
- Add proper zh_Hans translations for search_actions, get_action_by_area_id,
  manifest and provider YAML files

* [packages/dify-plugin]fix: address CodeQL URL sanitization and logging findings

* [packages/dify-plugin]fix: remove dynamic data from error logs

* [packages/dify-plugin]feat: add tag-based release workflow and version sync

Add automated dify-plugin release pipeline:
- release.yml: tag detection (actionbook-dify-plugin-v{VERSION}) and
  release job that packages .difypkg via uv + creates GitHub Release
- sync-versions.js: sync package.json version to manifest.yaml (root +
  meta.version) and pyproject.toml with exact equality checks and
  fail-loud on missing fields

* [packages/dify-plugin]fix: handle stop/create session failure recovery

* [packages/dify-plugin]fix: resolve critical review findings — deadlock, exception safety, timeout handling

- Fix connection pool deadlock: move worker.stop() outside pool lock to
  prevent deadlock when _io_lock is held by another thread in call()/readline().
  All call sites (disconnect, disconnect_all, cleanup_stale, connect eviction,
  get_page health check) now pop under lock and stop outside lock.

- Fix BaseException swallowing: re-raise KeyboardInterrupt, SystemExit, and
  GeneratorExit in search_actions and get_action_by_area_id generators.
  Only non-Exception BaseException subclasses (e.g. gevent.Timeout) are caught.

- Fix timeout exception misclassification: add WorkerTimeoutError exception
  class. SubprocessWorker.call() now detects timeout errors in worker responses
  and raises WorkerTimeoutError instead of RuntimeError, so browser_operator
  handlers can show proper "element not found" hints instead of generic errors.

- Document SSRF DNS rebinding TOCTOU limitation in _is_ssrf_target with
  explanation of cloud browser architecture mitigation.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 00:49:21 +08:00
s1mba fef4152fb7 fix: add CHANGELOG.md to platform packages (#137)
* [root]chore: add changeset for CLI patch to test release workflow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* [root]fix: align CLI and platform package versions to npm (0.7.2)

Local versions were 0.3.1 while npm had 0.7.2 (CI used to overwrite
versions at publish time without committing back). Align to 0.7.2 so
changeset can manage versions going forward.

Also revert pnpm-workspace.yaml to keep platform packages in workspace
(avoids npm resolution failures) and let them pass changeset validation
by not being in the ignore list.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* [root]fix: add CHANGELOG.md to platform packages for changesets/action

changesets/action reads CHANGELOG.md of all modified packages when
composing the Version PR. Platform packages are modified by
sync-versions.js but lacked CHANGELOG.md files, causing ENOENT.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* [root]fix: update lockfile after sync-versions to prevent frozen-lockfile failure

sync-versions.js rewrites CLI optionalDependencies versions, making
the lockfile stale. Add pnpm install after sync to keep it in sync.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* [root]fix: use workspace:* for CLI platform deps to avoid lockfile staleness

- CLI optionalDependencies changed from exact versions to workspace:*
  so pnpm resolves locally instead of from npm registry
- Remove optionalDependencies sync from sync-versions.js (no longer needed)
- Add workspace:* → actual version replacement step in publish-cli job
  before npm publish
- Remove pnpm install from version-packages (lockfile stays stable with
  workspace links)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 21:35:28 +08:00
s1mba 7cc6a13383 feat: unify CLI & extension releases under changeset workflow (#134)
* [root]fix: add workflow permissions and restrict changeset scope

- Add contents:write and pull-requests:write permissions to release
  workflow so changesets/action can create PRs and push commits
- Expand ignore list to exclude all non-releasable packages (services,
  playground) to prevent accidental npm publishes
- Add build:release script that only builds changeset-managed packages
  to avoid CI failures from unrelated build errors

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* [root]feat: unify CLI & extension releases under changeset workflow

Replace 3 separate release flows (changesets for JS, tag-triggered for
CLI, tag-triggered for extension) with a single unified workflow driven
by Version PRs.

- Add scripts/sync-versions.js to sync CLI version to platform packages
  and extension version to manifest.json after changeset version
- Rewrite release.yml with 5 conditional jobs: version-or-release,
  publish-js, build-cli, publish-cli, release-extension
- Remove platform binary packages from pnpm workspace (pure containers)
- Enable privatePackages versioning for extension in changeset config
- Delete release-cli.yml and release-extension.yml

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* [root]chore: ignore json-ui-site and knowledge-builder-any in changesets

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 18:50:02 +08:00
s1mba 2ea146ed12 [root]feat: add changesets for version management and automated releases (#133)
Set up @changesets/cli with GitHub changelog integration for managing
versioning and npm publishing of SDK, MCP, tools-ai-sdk, and json-ui
packages. CLI and extension packages are excluded as they have their
own release workflows.

- Install @changesets/cli and @changesets/changelog-github
- Add .changeset/config.json with public access and ignore rules
- Add changeset, version-packages, and release scripts
- Add GitHub Actions workflow for automated release PR and publishing

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 16:44:05 +08:00