@buoy-gg/mcp 7.0.56 → 7.0.57

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.
@@ -0,0 +1 @@
1
+ import{createRequire as e}from"module";const c=e(import.meta.url);import{cliPath as r,describeDevices as i,describeDiagnosis as t,describeInputs as o,proRequired as s,readEntitlement as m,run as u}from"./chunk-6EOB4FHJ.mjs";import"./chunk-MTTWR4T7.mjs";export{r as cliPath,i as describeDevices,t as describeDiagnosis,o as describeInputs,s as proRequired,m as readEntitlement,u as run};
@@ -0,0 +1,5 @@
1
+ import{createRequire as p}from"module";const j=p(import.meta.url);import{execFile as m}from"child_process";import{promisify as d}from"util";import{existsSync as l,readFileSync as h}from"fs";import u from"os";import i from"path";var f=d(m);function y(){const n=process.env.BUOY_SIMCAM_DIR;const e=[...n?[i.join(n,"buoycam")]:[],"/Applications/Buoy.app/Contents/Resources/simcam/buoycam",i.join(u.homedir(),"Applications/Buoy.app/Contents/Resources/simcam/buoycam")];let t=__dirname;for(let o=0;o<8;o++){e.push(i.join(t,"apps/desktop/resources/simcam/buoycam"));const a=i.dirname(t);if(a===t)break;t=a}return e}var s=null;function c(){if(s)return s;s=y().find(n=>l(n))??null;return s}async function g(n){const e=c();if(!e){return{ok:false,error:"The simulator camera components were not found. They ship with the Buoy desktop app \u2014 install it, or set BUOY_SIMCAM_DIR to the directory holding `buoycam`."}}try{const{stdout:t}=await f(e,[...n,"--json"],{timeout:3e4});return{ok:true,data:JSON.parse(t)}}catch(t){const o=t.stdout??"";try{return{ok:false,data:JSON.parse(o)}}catch{return{ok:false,error:t.message||"the simulator camera CLI failed"}}}}function b(n){const e=n.filter(r=>r.level==="fail");const t=n.filter(r=>r.level==="warn");if(e.length===0&&t.length===0){return"The simulator camera is healthy \u2014 every check passed."}const o=[];for(const r of[...e,...t]){o.push(`- **${r.name}** (${r.level}): ${r.detail}`);if(r.fix)o.push(` ${r.fix}`)}const a=e.length>0?`${e.length} problem${e.length===1?"":"s"} found.`:`No hard failures, but ${t.length} thing${t.length===1?"":"s"} worth knowing.`;return[a,"",...o].join("\n")}function _(n,e){if(n.length===0){return"No booted simulators.\n\n_Boot one first \u2014 `xcrun simctl boot <udid>`, or open Simulator.app. The camera attaches to a simulator, so nothing else here works until one is running._"}const t=[n.length===1?"1 booted simulator:":`${n.length} booted simulators:`,...n.map(o=>`- **${o.name}** (${o.runtime}) \u2014 \`${o.udid}\``)];if(n.length>1&&e===null){t.push("","_More than one is booted, so pass `udid` to list a specific one's apps \u2014 and to every other camera tool that takes one._");return t.join("\n")}if(e===null){t.push("","_Could not read the installed apps._");return t.join("\n")}if(e.length===0){t.push("","No apps installed on it.");return t.join("\n")}t.push("",`${e.length} installed app${e.length===1?"":"s"}:`,...e.map(o=>`- ${o.name} \u2014 \`${o.bundleId}\``),"","_Pass one of these bundle ids to `camera_launch` to relaunch it with the camera attached._");return t.join("\n")}function $(n,e){const t=[];t.push(n.length?'**Mac cameras** (for `kind: "camera"`):':"**Mac cameras**: none found.");if(n.length){t.push(...n.map(o=>`- ${o.name} \u2014 \`${o.uniqueId}\``))}else{t.push("_If this Mac has a webcam, Buoy has not been granted Camera permission (System Settings \u2192 Privacy & Security \u2192 Camera)._")}t.push("");t.push(e.length?'**Capturable windows** (for `kind: "screen"`, `value: "window:<id>"`):':"**Capturable windows**: none found.");if(e.length){t.push(...e.map(o=>`- ${o.app}${o.title?` \u2014 ${o.title}`:""} \u2014 \`window:${o.id}\``))}else{t.push("_Screen Recording permission is almost certainly missing (System Settings \u2192 Privacy & Security \u2192 Screen & System Audio Recording)._")}return t.join("\n")}function k(){const n=process.env.BUOY_ENTITLEMENT_FILE;if(n)return[n];return[i.join(u.homedir(),"Library/Application Support/Buoy/entitlement.json"),i.join(u.homedir(),"Library/Application Support/buoy-desktop/entitlement.json")]}function S(){for(const n of k()){try{if(!l(n))continue;const e=JSON.parse(h(n,"utf8"));return{tier:e.tier==="pro"||e.tier==="free"?e.tier:"locked",isPro:e.isPro===true&&e.hasDesktopAccess===true&&typeof e.validUntil==="number"&&Number.isFinite(e.validUntil)&&Date.now()<e.validUntil&&typeof e.proValidUntil==="number"&&Number.isFinite(e.proValidUntil)&&Date.now()<e.proValidUntil}}catch{}}return{tier:"locked",isPro:false}}function v(n){return`\`${n}\` is a Buoy Pro feature.
2
+
3
+ The simulator camera itself is free \u2014 the Mac camera, image, video, test-pattern and QR sources all work in the Buoy desktop panel with a Free account. Pro adds the screen region, the non-QR symbologies (PDF417, Aztec, DataMatrix, Code 128), and driving any of it from an agent.
4
+
5
+ _Tell the user to enter a licence in Buoy Desktop, or see https://buoy.gg/pricing. Don't try to work around it \u2014 use the desktop panel by hand instead._`}export{c as cliPath,g as run,b as describeDiagnosis,_ as describeDevices,$ as describeInputs,S as readEntitlement,v as proRequired};
@@ -0,0 +1,47 @@
1
+ import{createRequire as x}from"module";const B=x(import.meta.url);import{PACKAGE_NAME as l,VERSION as y}from"./chunk-GBZURL4J.mjs";import{spawnSync as p}from"child_process";import i from"fs";import _ from"os";import a from"path";function h(){return{BUOY_VERIFY:"auto"}}var v="https://registry.npmjs.org";var m=3e3;function j(e={}){const t=e.cwd??process.cwd();const r=e.skillSrcDir??a.resolve(__dirname,"../skill");const n=e.log??(c=>process.stdout.write(c+"\n"));const o=E(e,n);const s=[];f(a.join(t,".mcp.json"),"mcpServers",o,t,s);i.mkdirSync(a.join(t,".cursor"),{recursive:true});f(a.join(t,".cursor","mcp.json"),"mcpServers",o,t,s);if(i.existsSync(a.join(t,".vscode"))){f(a.join(t,".vscode","mcp.json"),"servers",o,t,s)}F(r,t,s);k(a.join(t,"CLAUDE.md"),t,s);k(a.join(t,"AGENTS.md"),t,s);n("Buoy MCP configuration written:");for(const c of s)n(" \u2022 "+c);n("");n("Next steps:");n(" 1. Restart your editor (or reconnect the MCP server) to load `buoy`.");n(" 2. Complete account setup, then open an app with the required Buoy tools and sync integration.");n(" 3. Confirm the device and tools are available. MCP data/action access requires Pro.");if(o.command==="npx"){n("");n(`The editor launches the server with \`npx -y ${l}@latest\`, so it stays`);n(`Registry access may be needed. Re-run \`npx -y ${l}@latest init\` to refresh configuration.`)}else if(!e.cliPath){n("");n(`This uses a pinned local install (no network on startup). To update it later,`);n(`To update the local package, run: npx -y ${o.args[0]?.replace(/dist[/\\]cli\.js$/,"")??""}@latest init --local`)}}function E(e,t){if(e.cliPath){return{type:"stdio",command:"node",args:[e.cliPath],env:h()}}const r=e.mode??"auto";if(r==="npx"){return g()}if(r==="local"){return b(e,t)}const n=C();if(n.reachable){return g()}t(`\u26A0 npm registry ${n.registry?`(${n.registry}) `:""}looks unreachable \u2014 \`npx @latest\` would hang your editor at startup. Falling back to a pinned local install.`);return b(e,t)}function g(){return{type:"stdio",command:"npx",args:["-y",`${l}@latest`],env:h()}}function b(e,t){const r=e.installDir??process.env.BUOY_MCP_HOME??a.join(_.homedir(),".buoy-mcp");const n=e.registry??v;const o=A(r,n,t);if(o){return{type:"stdio",command:"node",args:[o],env:h()}}t("\u26A0 local install failed \u2014 writing the npx entry instead (see the error above).");return g()}function A(e,t,r){const n=`${l}@${y==="0.0.0-dev"?"latest":y}`;i.mkdirSync(e,{recursive:true});const o=process.platform==="win32"?"npm.cmd":"npm";r(`Installing ${n} into ${e} from ${t} \u2026`);const s=p(o,["install",n,"--prefix",e,"--registry",t,`--@buoy-gg:registry=${t}`,"--no-audit","--no-fund","--loglevel=error"],{stdio:["ignore","ignore","inherit"],encoding:"utf8"});if(s.status!==0){r(`\u26A0 npm install exited with code ${s.status??"?"}${s.error?` (${s.error.message})`:""}.`);return null}const c=a.join(e,"node_modules",l,"dist","cli.js");if(!i.existsSync(c)){r(`\u26A0 install finished but ${c} is missing.`);return null}return c}function C(){const e=P();if(!e)return{reachable:false,registry:null};if(/^https?:\/\/registry\.npmjs\.org\/?$/i.test(e)){return{reachable:true,registry:e}}return{reachable:R(e),registry:e}}function P(){const e=w("@buoy-gg:registry");if(e)return e;const t=w("registry");return t??v}function w(e){const t=process.platform==="win32"?"npm.cmd":"npm";const r=p(t,["config","get",e],{encoding:"utf8",timeout:m});if(r.status!==0||typeof r.stdout!=="string")return null;const n=r.stdout.trim();if(!n||n==="undefined"||n==="null")return null;return n}function R(e){const t=p(process.execPath,["-e",I,e,String(m)],{encoding:"utf8",timeout:m+2e3});return t.status===0}var I=`
2
+ const url = process.argv[1];
3
+ const ms = Number(process.argv[2]) || 3000;
4
+ const c = new AbortController();
5
+ const t = setTimeout(() => c.abort(), ms);
6
+ fetch(url, { method: 'HEAD', signal: c.signal })
7
+ .then(() => { clearTimeout(t); process.exit(0); })
8
+ .catch(() => {
9
+ // A HEAD may be rejected while the host is up; a bare TCP-level failure is
10
+ // what we care about. fetch throwing a TypeError = network unreachable.
11
+ clearTimeout(t);
12
+ process.exit(1);
13
+ });
14
+ `;function f(e,t,r,n,o){let s={};if(i.existsSync(e)){try{s=JSON.parse(i.readFileSync(e,"utf8"))}catch{i.copyFileSync(e,e+".bak");o.push(`existing ${u(e,n)} was invalid JSON \u2014 backed up to ${u(e,n)}.bak`);s={}}}else{i.mkdirSync(a.dirname(e),{recursive:true})}const c=s[t]&&typeof s[t]==="object"?s[t]:{};const $="buoy"in c;c.buoy=r;s[t]=c;i.writeFileSync(e,JSON.stringify(s,null,2)+"\n");o.push(`${$?"updated":"added"} \`buoy\` in ${u(e,n)}`)}var d="# Debugging with Buoy";var T=`${d}
15
+
16
+ Use Buoy to inspect a connected app when runtime evidence helps the task.
17
+ Complete account, tool integration and connection setup first. MCP data and
18
+ action access requires Pro. Follow the user's scope and repository instructions.
19
+
20
+ - \`get_triage\`: summarize available device and tool observations, then choose
21
+ a relevant tool. Missing data is not proof that no problem occurred.
22
+ - \`run_flow\`: run supported tap, type, wait and assertion steps to reproduce
23
+ a failure or check a change. Review the flow before running it.
24
+ - \`get_events\`: inspect retained events from connected tools.
25
+ - \`get_network_requests\`: inspect captured requests and responses. Capture
26
+ depends on installed hooks, transport and when recording began.
27
+ - \`network_conditions\`: take the app offline or add latency to check error
28
+ and retry paths. Development builds only. Restore \`normal\` when finished.
29
+ - \`get_console\`: inspect retained console and error output. A terminated or
30
+ disconnected app may not provide new data.
31
+ - \`get_storage\`: inspect registered storage backends and available keys.
32
+ - \`reload_app\`: reload where supported. Confirm the device remains connected;
33
+ a reload does not guarantee recovery from a crash.
34
+ - \`get_snapshot\`: inspect the available state of a specific tool.
35
+
36
+ After a behavior change, repeat the failing interaction when the environment
37
+ allows it. Use relevant tests and report what was actually checked. For a
38
+ performance change, compare \`measure_renders\` runs with the same steps and
39
+ \`compareToPrevious: true\`; inspect the measurements and their limitations.
40
+ Use \`run_flow\` for supported UI checks. Do not claim a fix was verified when
41
+ only source review or a build was performed.
42
+
43
+ \`BUOY_VERIFY\` controls verification reminders: \`auto\` uses edit-based
44
+ reminders, \`always\` repeats until checked, and \`never\` disables them.
45
+ A reminder is not a test result. Choose checks appropriate to the change;
46
+ prose-only edits do not require running device actions.
47
+ `;function k(e,t,r){let n="";if(i.existsSync(e)){try{n=i.readFileSync(e,"utf8")}catch{r.push(`\u26A0 could not read ${u(e,t)} \u2014 skipped the debugging guide`);return}if(n.includes(d)){r.push(`${u(e,t)} already has the "${d}" block; preserved existing text. Review it against the current bundled guidance before relying on older instructions.`);return}}const o=n===""?"":n.endsWith("\n")?"\n":"\n\n";try{i.writeFileSync(e,n+o+T);r.push(`${n?"appended":"created"} "${d}" block in ${u(e,t)}`)}catch{r.push(`\u26A0 could not write ${u(e,t)} \u2014 skipped the debugging guide`)}}function F(e,t,r){if(!i.existsSync(e)){r.push("\u26A0 no bundled skills found \u2014 skipped");return}const n=i.readdirSync(e,{withFileTypes:true}).filter(o=>o.isDirectory()&&i.existsSync(a.join(e,o.name,"SKILL.md")));if(n.length===0){r.push("\u26A0 no skills with a SKILL.md found \u2014 skipped");return}for(const o of n){const s=a.join(e,o.name);const c=a.join(t,".claude","skills",o.name);S(s,c);r.push(`installed the ${o.name} skill \u2192 ${u(a.join(c,"SKILL.md"),t)}`)}}function S(e,t){i.mkdirSync(t,{recursive:true});for(const r of i.readdirSync(e,{withFileTypes:true})){const n=a.join(e,r.name);const o=a.join(t,r.name);if(r.isDirectory())S(n,o);else i.copyFileSync(n,o)}}function u(e,t){const r=a.relative(t,e);return r&&!r.startsWith("..")?r:e}export{j as runInit};