@rendobar/mcp 1.7.0 → 1.7.1
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.
- package/dist/bin.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -40,7 +40,7 @@ Active job types:
|
|
|
40
40
|
${(e.length>0?e:ce).map(o=>` ${o.type} \u2014 ${o.summary}`).join(`
|
|
41
41
|
`)}`;return{name:"submit_job",title:"Submit Rendobar Job",description:ie+r+`
|
|
42
42
|
|
|
43
|
-
For local files, call upload_file first to get a downloadUrl, then use it as inputs.source. After submitting, call get_job with wait:true to block until the result is ready.`,inputSchema:le,outputSchema:{jobId:t.string(),status:t.string().describe("Initial status, normally 'waiting'")},annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},execute:async(o,s)=>{let i=await u(s).jobs.create({type:o.type,inputs:o.inputs,params:o.params,idempotencyKey:o.idempotencyKey});return{jobId:i.id,status:i.status}}}}var ue={name:"cancel_job",title:"Cancel Rendobar Job",description:"Cancel a job that has not started running. Only jobs in status 'waiting' or 'dispatched' can be cancelled. Use when the user changes their mind, or when you submitted the wrong job. Running, completed, failed, or already-cancelled jobs cannot be cancelled.",inputSchema:{jobId:t.string().describe("Job ID to cancel (e.g. 'job_abc123')")},outputSchema:{id:t.string(),status:t.string().describe("'cancelled' on success")},annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!0},execute:async(e,n)=>{let r=await u(n).jobs.cancel(e.jobId);return{id:r.id,status:r.status}}},de=t.object({type:t.string(),tag:t.string(),summary:t.string(),acceptsMedia:t.array(t.string())}),me=`Pick a type by its summary and acceptsMedia (the media kinds it takes), then call submit_job with that type. To chain jobs, pass a completed job's output as the next job's input: use { job: "job_..." } for ffmpeg; for every other job type, get the completed job's output URL from get_job and pass that URL instead.`,fe={name:"list_job_types",title:"List Rendobar Job Types",description:"List every active job type with its short summary and the media kinds it accepts. Call once at the start of a media task and again when planning a chain or unsure. Result is always current.",inputSchema:{},outputSchema:{jobTypes:t.array(t.object({type:t.string().describe("Job type identifier, e.g. 'ffmpeg'"),tag:t.string().describe("Category tag"),summary:t.string().describe("Short description"),acceptsMedia:t.array(t.string()).describe("Media kinds this type accepts, e.g. video, image, audio")})),guidance:t.string()},annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},execute:async(e,n)=>({jobTypes:(await u(n).jobs.types()).map(o=>de.parse(o)),guidance:me})},b=e=>e;async function k(e){let n=[];try{e!==null&&(n=await e.jobs.types())}catch{}return[b(ne),b(se),b(pe(n)),b(ue),b(fe)]}import{z as w}from"zod";import{promises as ge}from"fs";import R from"path";import{promises as L}from"fs";import D from"path";async function F(e,n){let r=D.resolve(n.cwd,e),o=await L.realpath(r);if(n.roots!==void 0&&n.roots.length>0&&!(await Promise.all(n.roots.map(a=>L.realpath(a).catch(()=>null)))).some(a=>a!==null&&(o===a||o.startsWith(a+D.sep))))throw new Error(`Path is outside the allowed MCP roots: ${o}`);return o}async function be(e){if(e.cachedMaxFileSize!==null)return e.cachedMaxFileSize;let n=await u(e).billing.state();return e.cachedMaxFileSize=n.plan.limits.maxInputFileSize,e.cachedMaxFileSize}var he={name:"upload_file",title:"Upload Local File to Rendobar",description:"Read a local file and upload it to Rendobar. Returns a downloadUrl to use as input in submit_job. If the file is already at a public HTTPS URL, skip this and pass the URL directly to submit_job.",inputSchema:{path:w.string().describe("Absolute or working-dir-relative path to the file"),filename:w.string().optional().describe("Filename hint sent to Rendobar (defaults to basename of path)")},outputSchema:{downloadUrl:w.string().url(),sizeBytes:w.number()},annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},execute:async(e,n,r)=>{let o=await F(e.path,{cwd:process.cwd()}),s=await ge.open(o,"r");try{let i=await s.stat();if(!i.isFile())throw new Error(`Path is not a regular file: ${R.basename(o)}`);let a=i.size,l=await be(n);if(a>l)throw new Error(`File size (${a} bytes) exceeds plan limit (${l} bytes). Upgrade your plan for larger uploads.`);n.logger.debug({msg:"upload_start",basename:R.basename(o),sizeBytes:a});let c=await s.readFile(),p=new Blob([c]),d=await u(n).uploads.create(p,{filename:e.filename??R.basename(o),signal:r.signal});return n.logger.info({msg:"upload_complete",basename:R.basename(o),sizeBytes:a}),{downloadUrl:d.url,sizeBytes:a}}finally{await s.close()}}},ye=e=>e;function N(){return[ye(he)]}async function U(e,n){for(let r of P())h(e,n,r);for(let r of await k(n.sdk))h(e,n,r);for(let r of N())h(e,n,r)}import{PostHog as we}from"posthog-node";import{instrument as Re}from"@posthog/mcp";var M=process.env.RENDOBAR_TELEMETRY_KEY??"phc_pf4JwZ5WGtDcWDG6kYEkDZtEAy7dbunkNHthLj8JRa9v",Se=process.env.RENDOBAR_TELEMETRY_HOST??"https://e.rendobar.com",je=["$mcp_parameters","$mcp_response"];function _e(){if(process.env.DO_NOT_TRACK&&process.env.DO_NOT_TRACK!=="0")return!0;let e=(process.env.RENDOBAR_TELEMETRY??"").toLowerCase();return!!(e==="0"||e==="false"||e==="off"||e==="no"||process.env.RENDOBAR_NO_TELEMETRY||process.env.RENDOBAR_DISABLE_TELEMETRY||process.env.CI==="true")}function ve(){return M.length>0&&!_e()}function Te(e){for(let n of je)delete e[n];return e}function B(e,n){if(!ve())return null;let r=new we(M,{host:Se,flushAt:1,flushInterval:0});return Re(e,r,{beforeSend:o=>(o.properties=Te(o.properties),o)}),n.info({msg:"Anonymous MCP usage analytics on (tool name, success, duration, intent \u2014 never your parameters, responses, or credentials). Disable with DO_NOT_TRACK=1 or RENDOBAR_TELEMETRY=0."}),async()=>{try{await r.shutdown()}catch{}}}var Ae="1.7.
|
|
43
|
+
For local files, call upload_file first to get a downloadUrl, then use it as inputs.source. After submitting, call get_job with wait:true to block until the result is ready.`,inputSchema:le,outputSchema:{jobId:t.string(),status:t.string().describe("Initial status, normally 'waiting'")},annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},execute:async(o,s)=>{let i=await u(s).jobs.create({type:o.type,inputs:o.inputs,params:o.params,idempotencyKey:o.idempotencyKey});return{jobId:i.id,status:i.status}}}}var ue={name:"cancel_job",title:"Cancel Rendobar Job",description:"Cancel a job that has not started running. Only jobs in status 'waiting' or 'dispatched' can be cancelled. Use when the user changes their mind, or when you submitted the wrong job. Running, completed, failed, or already-cancelled jobs cannot be cancelled.",inputSchema:{jobId:t.string().describe("Job ID to cancel (e.g. 'job_abc123')")},outputSchema:{id:t.string(),status:t.string().describe("'cancelled' on success")},annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!0},execute:async(e,n)=>{let r=await u(n).jobs.cancel(e.jobId);return{id:r.id,status:r.status}}},de=t.object({type:t.string(),tag:t.string(),summary:t.string(),acceptsMedia:t.array(t.string())}),me=`Pick a type by its summary and acceptsMedia (the media kinds it takes), then call submit_job with that type. To chain jobs, pass a completed job's output as the next job's input: use { job: "job_..." } for ffmpeg; for every other job type, get the completed job's output URL from get_job and pass that URL instead.`,fe={name:"list_job_types",title:"List Rendobar Job Types",description:"List every active job type with its short summary and the media kinds it accepts. Call once at the start of a media task and again when planning a chain or unsure. Result is always current.",inputSchema:{},outputSchema:{jobTypes:t.array(t.object({type:t.string().describe("Job type identifier, e.g. 'ffmpeg'"),tag:t.string().describe("Category tag"),summary:t.string().describe("Short description"),acceptsMedia:t.array(t.string()).describe("Media kinds this type accepts, e.g. video, image, audio")})),guidance:t.string()},annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},execute:async(e,n)=>({jobTypes:(await u(n).jobs.types()).map(o=>de.parse(o)),guidance:me})},b=e=>e;async function k(e){let n=[];try{e!==null&&(n=await e.jobs.types())}catch{}return[b(ne),b(se),b(pe(n)),b(ue),b(fe)]}import{z as w}from"zod";import{promises as ge}from"fs";import R from"path";import{promises as L}from"fs";import D from"path";async function F(e,n){let r=D.resolve(n.cwd,e),o=await L.realpath(r);if(n.roots!==void 0&&n.roots.length>0&&!(await Promise.all(n.roots.map(a=>L.realpath(a).catch(()=>null)))).some(a=>a!==null&&(o===a||o.startsWith(a+D.sep))))throw new Error(`Path is outside the allowed MCP roots: ${o}`);return o}async function be(e){if(e.cachedMaxFileSize!==null)return e.cachedMaxFileSize;let n=await u(e).billing.state();return e.cachedMaxFileSize=n.plan.limits.maxInputFileSize,e.cachedMaxFileSize}var he={name:"upload_file",title:"Upload Local File to Rendobar",description:"Read a local file and upload it to Rendobar. Returns a downloadUrl to use as input in submit_job. If the file is already at a public HTTPS URL, skip this and pass the URL directly to submit_job.",inputSchema:{path:w.string().describe("Absolute or working-dir-relative path to the file"),filename:w.string().optional().describe("Filename hint sent to Rendobar (defaults to basename of path)")},outputSchema:{downloadUrl:w.string().url(),sizeBytes:w.number()},annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},execute:async(e,n,r)=>{let o=await F(e.path,{cwd:process.cwd()}),s=await ge.open(o,"r");try{let i=await s.stat();if(!i.isFile())throw new Error(`Path is not a regular file: ${R.basename(o)}`);let a=i.size,l=await be(n);if(a>l)throw new Error(`File size (${a} bytes) exceeds plan limit (${l} bytes). Upgrade your plan for larger uploads.`);n.logger.debug({msg:"upload_start",basename:R.basename(o),sizeBytes:a});let c=await s.readFile(),p=new Blob([c]),d=await u(n).uploads.create(p,{filename:e.filename??R.basename(o),signal:r.signal});return n.logger.info({msg:"upload_complete",basename:R.basename(o),sizeBytes:a}),{downloadUrl:d.url,sizeBytes:a}}finally{await s.close()}}},ye=e=>e;function N(){return[ye(he)]}async function U(e,n){for(let r of P())h(e,n,r);for(let r of await k(n.sdk))h(e,n,r);for(let r of N())h(e,n,r)}import{PostHog as we}from"posthog-node";import{instrument as Re}from"@posthog/mcp";var M=process.env.RENDOBAR_TELEMETRY_KEY??"phc_pf4JwZ5WGtDcWDG6kYEkDZtEAy7dbunkNHthLj8JRa9v",Se=process.env.RENDOBAR_TELEMETRY_HOST??"https://e.rendobar.com",je=["$mcp_parameters","$mcp_response"];function _e(){if(process.env.DO_NOT_TRACK&&process.env.DO_NOT_TRACK!=="0")return!0;let e=(process.env.RENDOBAR_TELEMETRY??"").toLowerCase();return!!(e==="0"||e==="false"||e==="off"||e==="no"||process.env.RENDOBAR_NO_TELEMETRY||process.env.RENDOBAR_DISABLE_TELEMETRY||process.env.CI==="true")}function ve(){return M.length>0&&!_e()}function Te(e){for(let n of je)delete e[n];return e}function B(e,n){if(!ve())return null;let r=new we(M,{host:Se,flushAt:1,flushInterval:0});return Re(e,r,{beforeSend:o=>(o.properties=Te(o.properties),o)}),n.info({msg:"Anonymous MCP usage analytics on (tool name, success, duration, intent \u2014 never your parameters, responses, or credentials). Disable with DO_NOT_TRACK=1 or RENDOBAR_TELEMETRY=0."}),async()=>{try{await r.shutdown()}catch{}}}var Ae="1.7.1";async function H(e){let n=A(e.config,e.logger),r=new xe({name:"rendobar",version:Ae},{capabilities:{tools:{},logging:{}},instructions:E});await U(r,n);let o=B(r,e.logger);return{server:r,cleanup:async()=>{o&&await o()}}}var j="1.7.1",Ie=`@rendobar/mcp v${j}
|
|
44
44
|
Local stdio Model Context Protocol server for Rendobar.
|
|
45
45
|
|
|
46
46
|
Usage:
|
package/dist/index.js
CHANGED
|
@@ -39,4 +39,4 @@ Active job types:
|
|
|
39
39
|
${(t.length>0?t:q).map(r=>` ${r.type} \u2014 ${r.summary}`).join(`
|
|
40
40
|
`)}`;return{name:"submit_job",title:"Submit Rendobar Job",description:$+n+`
|
|
41
41
|
|
|
42
|
-
For local files, call upload_file first to get a downloadUrl, then use it as inputs.source. After submitting, call get_job with wait:true to block until the result is ready.`,inputSchema:W,outputSchema:{jobId:e.string(),status:e.string().describe("Initial status, normally 'waiting'")},annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},execute:async(r,s)=>{let a=await c(s).jobs.create({type:r.type,inputs:r.inputs,params:r.params,idempotencyKey:r.idempotencyKey});return{jobId:a.id,status:a.status}}}}var X={name:"cancel_job",title:"Cancel Rendobar Job",description:"Cancel a job that has not started running. Only jobs in status 'waiting' or 'dispatched' can be cancelled. Use when the user changes their mind, or when you submitted the wrong job. Running, completed, failed, or already-cancelled jobs cannot be cancelled.",inputSchema:{jobId:e.string().describe("Job ID to cancel (e.g. 'job_abc123')")},outputSchema:{id:e.string(),status:e.string().describe("'cancelled' on success")},annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!0},execute:async(t,o)=>{let n=await c(o).jobs.cancel(t.jobId);return{id:n.id,status:n.status}}},ee=e.object({type:e.string(),tag:e.string(),summary:e.string(),acceptsMedia:e.array(e.string())}),te=`Pick a type by its summary and acceptsMedia (the media kinds it takes), then call submit_job with that type. To chain jobs, pass a completed job's output as the next job's input: use { job: "job_..." } for ffmpeg; for every other job type, get the completed job's output URL from get_job and pass that URL instead.`,oe={name:"list_job_types",title:"List Rendobar Job Types",description:"List every active job type with its short summary and the media kinds it accepts. Call once at the start of a media task and again when planning a chain or unsure. Result is always current.",inputSchema:{},outputSchema:{jobTypes:e.array(e.object({type:e.string().describe("Job type identifier, e.g. 'ffmpeg'"),tag:e.string().describe("Category tag"),summary:e.string().describe("Short description"),acceptsMedia:e.array(e.string()).describe("Media kinds this type accepts, e.g. video, image, audio")})),guidance:e.string()},annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},execute:async(t,o)=>({jobTypes:(await c(o).jobs.types()).map(r=>ee.parse(r)),guidance:te})},m=t=>t;async function v(t){let o=[];try{t!==null&&(o=await t.jobs.types())}catch{}return[m(G),m(Z),m(Q(o)),m(X),m(oe)]}import{z as h}from"zod";import{promises as ne}from"fs";import y from"path";import{promises as E}from"fs";import A from"path";async function C(t,o){let n=A.resolve(o.cwd,t),r=await E.realpath(n);if(o.roots!==void 0&&o.roots.length>0&&!(await Promise.all(o.roots.map(i=>E.realpath(i).catch(()=>null)))).some(i=>i!==null&&(r===i||r.startsWith(i+A.sep))))throw new Error(`Path is outside the allowed MCP roots: ${r}`);return r}async function re(t){if(t.cachedMaxFileSize!==null)return t.cachedMaxFileSize;let o=await c(t).billing.state();return t.cachedMaxFileSize=o.plan.limits.maxInputFileSize,t.cachedMaxFileSize}var se={name:"upload_file",title:"Upload Local File to Rendobar",description:"Read a local file and upload it to Rendobar. Returns a downloadUrl to use as input in submit_job. If the file is already at a public HTTPS URL, skip this and pass the URL directly to submit_job.",inputSchema:{path:h.string().describe("Absolute or working-dir-relative path to the file"),filename:h.string().optional().describe("Filename hint sent to Rendobar (defaults to basename of path)")},outputSchema:{downloadUrl:h.string().url(),sizeBytes:h.number()},annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},execute:async(t,o,n)=>{let r=await C(t.path,{cwd:process.cwd()}),s=await ne.open(r,"r");try{let a=await s.stat();if(!a.isFile())throw new Error(`Path is not a regular file: ${y.basename(r)}`);let i=a.size,l=await re(o);if(i>l)throw new Error(`File size (${i} bytes) exceeds plan limit (${l} bytes). Upgrade your plan for larger uploads.`);o.logger.debug({msg:"upload_start",basename:y.basename(r),sizeBytes:i});let p=await s.readFile(),u=new Blob([p]),w=await c(o).uploads.create(u,{filename:t.filename??y.basename(r),signal:n.signal});return o.logger.info({msg:"upload_complete",basename:y.basename(r),sizeBytes:i}),{downloadUrl:w.url,sizeBytes:i}}finally{await s.close()}}},ie=t=>t;function O(){return[ie(se)]}async function I(t,o){for(let n of _())g(t,o,n);for(let n of await v(o.sdk))g(t,o,n);for(let n of O())g(t,o,n)}import{PostHog as ae}from"posthog-node";import{instrument as le}from"@posthog/mcp";var k=process.env.RENDOBAR_TELEMETRY_KEY??"phc_pf4JwZ5WGtDcWDG6kYEkDZtEAy7dbunkNHthLj8JRa9v",ce=process.env.RENDOBAR_TELEMETRY_HOST??"https://e.rendobar.com",pe=["$mcp_parameters","$mcp_response"];function ue(){if(process.env.DO_NOT_TRACK&&process.env.DO_NOT_TRACK!=="0")return!0;let t=(process.env.RENDOBAR_TELEMETRY??"").toLowerCase();return!!(t==="0"||t==="false"||t==="off"||t==="no"||process.env.RENDOBAR_NO_TELEMETRY||process.env.RENDOBAR_DISABLE_TELEMETRY||process.env.CI==="true")}function de(){return k.length>0&&!ue()}function me(t){for(let o of pe)delete t[o];return t}function P(t,o){if(!de())return null;let n=new ae(k,{host:ce,flushAt:1,flushInterval:0});return le(t,n,{beforeSend:r=>(r.properties=me(r.properties),r)}),o.info({msg:"Anonymous MCP usage analytics on (tool name, success, duration, intent \u2014 never your parameters, responses, or credentials). Disable with DO_NOT_TRACK=1 or RENDOBAR_TELEMETRY=0."}),async()=>{try{await n.shutdown()}catch{}}}var ge="1.7.
|
|
42
|
+
For local files, call upload_file first to get a downloadUrl, then use it as inputs.source. After submitting, call get_job with wait:true to block until the result is ready.`,inputSchema:W,outputSchema:{jobId:e.string(),status:e.string().describe("Initial status, normally 'waiting'")},annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},execute:async(r,s)=>{let a=await c(s).jobs.create({type:r.type,inputs:r.inputs,params:r.params,idempotencyKey:r.idempotencyKey});return{jobId:a.id,status:a.status}}}}var X={name:"cancel_job",title:"Cancel Rendobar Job",description:"Cancel a job that has not started running. Only jobs in status 'waiting' or 'dispatched' can be cancelled. Use when the user changes their mind, or when you submitted the wrong job. Running, completed, failed, or already-cancelled jobs cannot be cancelled.",inputSchema:{jobId:e.string().describe("Job ID to cancel (e.g. 'job_abc123')")},outputSchema:{id:e.string(),status:e.string().describe("'cancelled' on success")},annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!0},execute:async(t,o)=>{let n=await c(o).jobs.cancel(t.jobId);return{id:n.id,status:n.status}}},ee=e.object({type:e.string(),tag:e.string(),summary:e.string(),acceptsMedia:e.array(e.string())}),te=`Pick a type by its summary and acceptsMedia (the media kinds it takes), then call submit_job with that type. To chain jobs, pass a completed job's output as the next job's input: use { job: "job_..." } for ffmpeg; for every other job type, get the completed job's output URL from get_job and pass that URL instead.`,oe={name:"list_job_types",title:"List Rendobar Job Types",description:"List every active job type with its short summary and the media kinds it accepts. Call once at the start of a media task and again when planning a chain or unsure. Result is always current.",inputSchema:{},outputSchema:{jobTypes:e.array(e.object({type:e.string().describe("Job type identifier, e.g. 'ffmpeg'"),tag:e.string().describe("Category tag"),summary:e.string().describe("Short description"),acceptsMedia:e.array(e.string()).describe("Media kinds this type accepts, e.g. video, image, audio")})),guidance:e.string()},annotations:{readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!0},execute:async(t,o)=>({jobTypes:(await c(o).jobs.types()).map(r=>ee.parse(r)),guidance:te})},m=t=>t;async function v(t){let o=[];try{t!==null&&(o=await t.jobs.types())}catch{}return[m(G),m(Z),m(Q(o)),m(X),m(oe)]}import{z as h}from"zod";import{promises as ne}from"fs";import y from"path";import{promises as E}from"fs";import A from"path";async function C(t,o){let n=A.resolve(o.cwd,t),r=await E.realpath(n);if(o.roots!==void 0&&o.roots.length>0&&!(await Promise.all(o.roots.map(i=>E.realpath(i).catch(()=>null)))).some(i=>i!==null&&(r===i||r.startsWith(i+A.sep))))throw new Error(`Path is outside the allowed MCP roots: ${r}`);return r}async function re(t){if(t.cachedMaxFileSize!==null)return t.cachedMaxFileSize;let o=await c(t).billing.state();return t.cachedMaxFileSize=o.plan.limits.maxInputFileSize,t.cachedMaxFileSize}var se={name:"upload_file",title:"Upload Local File to Rendobar",description:"Read a local file and upload it to Rendobar. Returns a downloadUrl to use as input in submit_job. If the file is already at a public HTTPS URL, skip this and pass the URL directly to submit_job.",inputSchema:{path:h.string().describe("Absolute or working-dir-relative path to the file"),filename:h.string().optional().describe("Filename hint sent to Rendobar (defaults to basename of path)")},outputSchema:{downloadUrl:h.string().url(),sizeBytes:h.number()},annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},execute:async(t,o,n)=>{let r=await C(t.path,{cwd:process.cwd()}),s=await ne.open(r,"r");try{let a=await s.stat();if(!a.isFile())throw new Error(`Path is not a regular file: ${y.basename(r)}`);let i=a.size,l=await re(o);if(i>l)throw new Error(`File size (${i} bytes) exceeds plan limit (${l} bytes). Upgrade your plan for larger uploads.`);o.logger.debug({msg:"upload_start",basename:y.basename(r),sizeBytes:i});let p=await s.readFile(),u=new Blob([p]),w=await c(o).uploads.create(u,{filename:t.filename??y.basename(r),signal:n.signal});return o.logger.info({msg:"upload_complete",basename:y.basename(r),sizeBytes:i}),{downloadUrl:w.url,sizeBytes:i}}finally{await s.close()}}},ie=t=>t;function O(){return[ie(se)]}async function I(t,o){for(let n of _())g(t,o,n);for(let n of await v(o.sdk))g(t,o,n);for(let n of O())g(t,o,n)}import{PostHog as ae}from"posthog-node";import{instrument as le}from"@posthog/mcp";var k=process.env.RENDOBAR_TELEMETRY_KEY??"phc_pf4JwZ5WGtDcWDG6kYEkDZtEAy7dbunkNHthLj8JRa9v",ce=process.env.RENDOBAR_TELEMETRY_HOST??"https://e.rendobar.com",pe=["$mcp_parameters","$mcp_response"];function ue(){if(process.env.DO_NOT_TRACK&&process.env.DO_NOT_TRACK!=="0")return!0;let t=(process.env.RENDOBAR_TELEMETRY??"").toLowerCase();return!!(t==="0"||t==="false"||t==="off"||t==="no"||process.env.RENDOBAR_NO_TELEMETRY||process.env.RENDOBAR_DISABLE_TELEMETRY||process.env.CI==="true")}function de(){return k.length>0&&!ue()}function me(t){for(let o of pe)delete t[o];return t}function P(t,o){if(!de())return null;let n=new ae(k,{host:ce,flushAt:1,flushInterval:0});return le(t,n,{beforeSend:r=>(r.properties=me(r.properties),r)}),o.info({msg:"Anonymous MCP usage analytics on (tool name, success, duration, intent \u2014 never your parameters, responses, or credentials). Disable with DO_NOT_TRACK=1 or RENDOBAR_TELEMETRY=0."}),async()=>{try{await n.shutdown()}catch{}}}var ge="1.7.1";async function be(t){let o=R(t.config,t.logger),n=new fe({name:"rendobar",version:ge},{capabilities:{tools:{},logging:{}},instructions:j});await I(n,o);let r=P(n,t.logger);return{server:n,cleanup:async()=>{r&&await r()}}}export{be as createRendobarMcpServer};
|