@octavus/agent 1.0.12 → 1.0.16
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/browser-extension/assets/offscreen-B_-qKXmq.js +1 -0
- package/dist/browser-extension/src/offscreen/recording.html +1 -1
- package/dist/browser-extension-mcp.js +32 -32
- package/dist/code-mcp/index.js +89 -0
- package/dist/computer-mcp/dist/index.js +31 -31
- package/dist/filesystem-mcp.mjs +29 -29
- package/dist/index.js +116 -106
- package/package.json +1 -1
- package/dist/browser-extension/assets/offscreen-BKXLIRW6.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as h,S as u}from"./messages-akAS58tQ.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const n of r)if(n.type==="childList")for(const a of n.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function o(r){const n={};return r.integrity&&(n.integrity=r.integrity),r.referrerPolicy&&(n.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?n.credentials="include":r.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function i(r){if(r.ep)return;r.ep=!0;const n=o(r);fetch(r.href,n)}})();const m=1e3;let c=null;function l(t){chrome.runtime.sendMessage(t)}function g(){const t=["video/mp4;codecs=avc1","video/mp4;codecs=avc1.42E01E","video/mp4;codecs=vp9","video/mp4"];for(const e of t)if(MediaRecorder.isTypeSupported(e))return e;return"video/mp4"}function y(t){return new Promise((e,o)=>{const i=new FileReader;i.onload=()=>{const r=i.result,n=";base64,",a=r.indexOf(n);e(a>=0?r.slice(a+n.length):r)},i.onerror=()=>o(i.error??new Error("FileReader failed")),i.readAsDataURL(t)})}function v(t,e){const o={chromeMediaSource:"tab",chromeMediaSourceId:t.streamId};return e!=="none"&&t.captureWidth!==void 0&&t.captureHeight!==void 0&&(o.maxWidth=t.captureWidth,o.maxHeight=t.captureHeight,e==="exact"&&(o.minWidth=t.captureWidth,o.minHeight=t.captureHeight)),{audio:t.audio?{mandatory:{chromeMediaSource:"tab",chromeMediaSourceId:t.streamId}}:!1,video:{mandatory:o}}}async function I(t){const e=t.captureWidth!==void 0&&t.captureHeight!==void 0?["exact","max","none"]:["none"];let o;for(const i of e)try{return await navigator.mediaDevices.getUserMedia(v(t,i))}catch(r){o=r}throw o instanceof Error?o:new Error("Failed to open tab capture stream")}async function T(t){if(c){l({target:u,type:"error",recordingId:t.recordingId,message:"A recording is already in progress"});return}try{const e=await I(t);let o=null;t.audio&&e.getAudioTracks().length>0&&(o=new AudioContext,o.createMediaStreamSource(e).connect(o.destination));const i=e.getVideoTracks()[0],r=i==null?void 0:i.getSettings(),n=g(),a=new MediaRecorder(e,{mimeType:n,videoBitsPerSecond:t.videoBitsPerSecond}),s={recordingId:t.recordingId,recorder:a,stream:e,audioContext:o,mediaType:n.split(";")[0]??"video/mp4",startedAt:Date.now(),width:(r==null?void 0:r.width)??0,height:(r==null?void 0:r.height)??0,chunkChain:Promise.resolve(),maxDurationTimer:null};c=s,a.ondataavailable=d=>{if(d.data.size===0)return;const p=d.data;s.chunkChain=s.chunkChain.then(async()=>{try{const f=await y(p);l({target:u,type:"chunk",recordingId:s.recordingId,dataB64:f})}catch(f){console.error("[recording] failed to encode chunk",f)}})},a.onstop=()=>{const d=c;c=null,d&&(d.maxDurationTimer&&clearTimeout(d.maxDurationTimer),d.chunkChain.then(()=>{l({target:u,type:"stopped",recordingId:d.recordingId,mediaType:d.mediaType,durationMs:Date.now()-d.startedAt,width:d.width,height:d.height}),S(d)}))},i==null||i.addEventListener("ended",()=>{(c==null?void 0:c.recordingId)===s.recordingId&&a.state!=="inactive"&&a.stop()}),s.maxDurationTimer=setTimeout(()=>{(c==null?void 0:c.recordingId)===s.recordingId&&a.state!=="inactive"&&a.stop()},t.maxDurationMs),a.start(m)}catch(e){c=null,l({target:u,type:"error",recordingId:t.recordingId,message:e instanceof Error?e.message:String(e)})}}function w(t){const e=c;(e==null?void 0:e.recordingId)===t&&e.recorder.state!=="inactive"&&e.recorder.stop()}function S(t){for(const e of t.stream.getTracks())e.stop();t.audioContext&&t.audioContext.close()}chrome.runtime.onMessage.addListener(t=>{const e=t;(e==null?void 0:e.target)===h&&(e.type==="start"?T(e):e.type==="stop"&&typeof e.recordingId=="string"&&w(e.recordingId))});
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
5
|
<title>Octavus recording</title>
|
|
6
|
-
<script type="module" crossorigin src="/assets/offscreen-
|
|
6
|
+
<script type="module" crossorigin src="/assets/offscreen-B_-qKXmq.js"></script>
|
|
7
7
|
<link rel="modulepreload" crossorigin href="/assets/messages-akAS58tQ.js">
|
|
8
8
|
</head>
|
|
9
9
|
<body>
|