Open-source AI browser agent for Chrome and Firefox (monorepo) π§
JavaScript ai-agentai-agentsai-toolsbrowser-aibrowser-automationbrowser-extensionchrome-aichrome-devtoolschrome-extensionchrome-extensionsfirefox-addonfirefox-addonsfirefox-extensionfirefox-extensionsgemmagemma4minimaxoffline-aioffline-llmqwen
fix(adapters): consolidate Bluesky workflow
Barack Sokullua682979bcfb8
diff --git a/src/chrome/src/agent/adapters.js b/src/chrome/src/agent/adapters.jsindex 7f579a422..f168d6f8e 100644--- a/src/chrome/src/agent/adapters.js+++ b/src/chrome/src/agent/adapters.js@@ -16172,32 +16172,6 @@ const ADAPTERS = [},// βββ Social & Content βββββββββββββββββββββββββββββββββββββββββββββββββ- {- name: 'bluesky',- category: 'general',- revision: 1,- regions: ['global'],- jobs: ['publish-post'],- workflow: {- schema: ADAPTER_WORKFLOW_SCHEMA,- jobs: {- 'publish-post': {- description: 'Prepare, publish, and verify a Bluesky post.',- template: 'publish',- stateChange: true,- requiresSubmission: true,- requiresLedger: false,- stages: ['access_gate', 'fill', 'review', 'commit', 'verify', 'deliver'],- successEvidence: ['The reviewed post appears on the intended account with matching text and a stable post URL.'],- partialEvidence: ['The verified composer content and exact account, validation, publication, or verification blocker are reported.'],- },- },- },- matches: (url) => /^https?:\/\/bsky\.app\//.test(url),- notes: `-- The post composer is a rich text control. Re-read it after filling and verify the complete text, mentions, link card, media, language, and account before publishing.-- Treat a cleared or closed composer as an intermediate signal only. Report success only after one new bsky.app/profile/<account>/post/<id> link appears and that post card contains the complete reviewed text.`,- },{name: 'twitter',category: 'general',@@ -16290,21 +16264,33 @@ const ADAPTERS = [{name: 'bluesky',category: 'general',- // Deliberately notes-only for now. A publish-post workflow job would route- // completion through the published_resource contract, which binds its- // identity either from a submit that changes the URL or from an- // observation-tool read afterwards. A Bluesky publish does neither β the- // composer closes over XHR and the agent opens the new post by clicking β- // so adding the job would leave done permanently blocked instead of- // letting the ordinary submit-transition evidence path verify the post.+ revision: 1,+ regions: ['global'],+ jobs: ['publish-post'],+ workflow: {+ schema: ADAPTER_WORKFLOW_SCHEMA,+ jobs: {+ 'publish-post': {+ description: 'Prepare, publish, and verify a Bluesky post.',+ template: 'publish',+ stateChange: true,+ requiresSubmission: true,+ requiresLedger: false,+ stages: ['access_gate', 'fill', 'review', 'commit', 'verify', 'deliver'],+ successEvidence: ['The reviewed post appears on the intended account with matching text and a stable post URL.'],+ partialEvidence: ['The verified composer content and exact account, validation, publication, or verification blocker are reported.'],+ },+ },+ },matches: (url) => /^https?:\/\/(www\.)?bsky\.app\//.test(url),notes: `- The composer opens from "Compose new post" (also the "New Post" button on wider layouts) and renders as a dialog over the current feed; the URL does not change while it is open.-- The post body is a contenteditable rich-text editor, not a textarea. Use set_field / type_ax against the composer textbox ref rather than clicking into it by coordinates.+- The post body is a contenteditable rich-text editor, not a textarea. Use set_field / type_ax against the composer textbox ref rather than clicking into it by coordinates. Re-read it after filling and verify the complete text, mentions, link card, media, language, and account before publishing.- Images attach through a hidden <input type=file> behind "Add media to post" / "Add images". Do NOT click that control to open an OS file dialog β call upload_file with the file input's selector and the downloadId or absolute path, which attaches the file without any dialog.- Bluesky enforces a 300-character graphene limit and shows a live counter; a post over the limit leaves "Post" disabled rather than reporting an error.- Alt text is a separate per-image control. Add it only when the user asked for it.- "Post" (labelled "Publish post") commits. There is no <form> submit: the composer closes and the new post is inserted into the feed via XHR, so a closed composer alone is not proof.+- Treat a cleared or closed composer as an intermediate signal only. Require one new bsky.app/profile/<account>/post/<id> link whose post card contains the complete reviewed text.- Report publication only after the post is reachable at its own /profile/<handle>/post/<id> URL under the intended handle, with the requested text and any attached image visible there.`,},{diff --git a/src/firefox/src/agent/adapters.js b/src/firefox/src/agent/adapters.jsindex ede5abc6c..68ee51a43 100644--- a/src/firefox/src/agent/adapters.js+++ b/src/firefox/src/agent/adapters.js@@ -16171,32 +16171,6 @@ const ADAPTERS = [},// βββ Social & Content βββββββββββββββββββββββββββββββββββββββββββββββββ- {- name: 'bluesky',- category: 'general',- revision: 1,- regions: ['global'],- jobs: ['publish-post'],- workflow: {- schema: ADAPTER_WORKFLOW_SCHEMA,- jobs: {- 'publish-post': {- description: 'Prepare, publish, and verify a Bluesky post.',- template: 'publish',- stateChange: true,- requiresSubmission: true,- requiresLedger: false,- stages: ['access_gate', 'fill', 'review', 'commit', 'verify', 'deliver'],- successEvidence: ['The reviewed post appears on the intended account with matching text and a stable post URL.'],- partialEvidence: ['The verified composer content and exact account, validation, publication, or verification blocker are reported.'],- },- },- },- matches: (url) => /^https?:\/\/bsky\.app\//.test(url),- notes: `-- The post composer is a rich text control. Re-read it after filling and verify the complete text, mentions, link card, media, language, and account before publishing.-- Treat a cleared or closed composer as an intermediate signal only. Report success only after one new bsky.app/profile/<account>/post/<id> link appears and that post card contains the complete reviewed text.`,- },{name: 'twitter',category: 'general',@@ -16289,21 +16263,33 @@ const ADAPTERS = [{name: 'bluesky',category: 'general',- // Deliberately notes-only for now. A publish-post workflow job would route- // completion through the published_resource contract, which binds its- // identity either from a submit that changes the URL or from an- // observation-tool read afterwards. A Bluesky publish does neither β the- // composer closes over XHR and the agent opens the new post by clicking β- // so adding the job would leave done permanently blocked instead of- // letting the ordinary submit-transition evidence path verify the post.+ revision: 1,+ regions: ['global'],+ jobs: ['publish-post'],+ workflow: {+ schema: ADAPTER_WORKFLOW_SCHEMA,+ jobs: {+ 'publish-post': {+ description: 'Prepare, publish, and verify a Bluesky post.',+ template: 'publish',+ stateChange: true,+ requiresSubmission: true,+ requiresLedger: false,+ stages: ['access_gate', 'fill', 'review', 'commit', 'verify', 'deliver'],+ successEvidence: ['The reviewed post appears on the intended account with matching text and a stable post URL.'],+ partialEvidence: ['The verified composer content and exact account, validation, publication, or verification blocker are reported.'],+ },+ },+ },matches: (url) => /^https?:\/\/(www\.)?bsky\.app\//.test(url),notes: `- The composer opens from "Compose new post" (also the "New Post" button on wider layouts) and renders as a dialog over the current feed; the URL does not change while it is open.-- The post body is a contenteditable rich-text editor, not a textarea. Use set_field / type_ax against the composer textbox ref rather than clicking into it by coordinates.+- The post body is a contenteditable rich-text editor, not a textarea. Use set_field / type_ax against the composer textbox ref rather than clicking into it by coordinates. Re-read it after filling and verify the complete text, mentions, link card, media, language, and account before publishing.- Images attach through a hidden <input type=file> behind "Add media to post" / "Add images". Do NOT click that control to open an OS file dialog β call upload_file with the file input's selector and the downloadId or absolute path, which attaches the file without any dialog.- Bluesky enforces a 300-character graphene limit and shows a live counter; a post over the limit leaves "Post" disabled rather than reporting an error.- Alt text is a separate per-image control. Add it only when the user asked for it.- "Post" (labelled "Publish post") commits. There is no <form> submit: the composer closes and the new post is inserted into the feed via XHR, so a closed composer alone is not proof.+- Treat a cleared or closed composer as an intermediate signal only. Require one new bsky.app/profile/<account>/post/<id> link whose post card contains the complete reviewed text.- Report publication only after the post is reachable at its own /profile/<handle>/post/<id> URL under the intended handle, with the requested text and any attached image visible there.`,},{diff --git a/test/run.js b/test/run.jsindex 5c35ed12f..fe470b469 100644--- a/test/run.js+++ b/test/run.js@@ -278,6 +278,7 @@ const {getMessageRecipientGuardPolicy: getMessageRecipientGuardPolicyFx,getAdapterWorkflowRouting: getAdapterWorkflowRoutingFx,resolveAdapterWorkflowJob: resolveAdapterWorkflowJobFx,+ listAdapters: listAdaptersFx,listAdapterWorkflowProfiles: listAdapterWorkflowProfilesFx,} = await import('file://' + path.join(ROOT, 'src/firefox/src/agent/adapters.js').replace(/\\/g, '/')@@ -4621,14 +4622,27 @@ test('matches twitter.com and x.com', () => {test('matches Bluesky and exposes a mirrored publish-post workflow', () => {const chromeAdapter = getActiveAdapter('https://bsky.app/');- const firefoxAdapter = getActiveAdapterFx('https://bsky.app/profile/webbrain.one');+ const firefoxAdapter = getActiveAdapterFx('https://www.bsky.app/profile/webbrain.one');assert.equal(chromeAdapter?.name, 'bluesky');assert.equal(firefoxAdapter?.name, 'bluesky');assert.deepEqual(validateAdapterWorkflowProfile(chromeAdapter), { ok: true });assert.deepEqual(validateAdapterWorkflowProfileFx(firefoxAdapter), { ok: true });assert.deepEqual(firefoxAdapter?.workflow, chromeAdapter?.workflow);assert.deepEqual(chromeAdapter?.jobs, ['publish-post']);+ assert.match(chromeAdapter?.notes || '', /hidden <input type=file>/i);+ assert.match(chromeAdapter?.notes || '', /complete text, mentions, link card, media, language, and account/i);assert.match(chromeAdapter?.notes || '', /new bsky\.app\/profile\/<account>\/post\/<id> link/i);+ for (const [getAdapter, resolveWorkflow, adapters] of [+ [getActiveAdapter, resolveAdapterWorkflowJob, listAdapters],+ [getActiveAdapterFx, resolveAdapterWorkflowJobFx, listAdaptersFx],+ ]) {+ assert.equal(adapters().filter(adapter => adapter.name === 'bluesky').length, 1,+ 'Bluesky should have one consolidated adapter');+ for (const url of ['https://bsky.app/', 'https://www.bsky.app/']) {+ assert.deepEqual(getAdapter(url)?.jobs, ['publish-post']);+ assert.equal(resolveWorkflow(url, 'publish-post')?.adapterName, 'bluesky');+ }+ }assert.notEqual(getActiveAdapter('https://bsky.app.evil.example/')?.name, 'bluesky');assert.notEqual(getActiveAdapterFx('https://bsky.app.evil.example/')?.name, 'bluesky');});@@ -9896,9 +9910,9 @@ test('12306 exposes a validated regional workflow profile with browser parity','producthunt','microsoft-forms','gmail',- 'bluesky','twitter','linkedin',+ 'bluesky','youtube','railway-12306','douyin',