conformtools 0.6.9 → 0.6.11
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/README.md +53 -22
- package/dist/account-IUWNSDG5.js +3 -0
- package/dist/analysis-engine-M7W32RRC.js +3 -0
- package/dist/bridge-SV7PCLQY.js +3 -0
- package/dist/browser/timeline_core_bg.wasm +0 -0
- package/dist/{chunk-TXQR2HI2.js → chunk-2CY2OOOJ.js} +1 -1
- package/dist/chunk-2QT5MMBP.js +499 -0
- package/dist/chunk-2WBGXD27.js +8 -0
- package/dist/chunk-5YULBQJX.js +3 -0
- package/dist/chunk-5YWO2LBG.js +3 -0
- package/dist/chunk-64X5DLH5.js +6 -0
- package/dist/{chunk-GM6QKY7W.js → chunk-6HZP2OJA.js} +1 -1
- package/dist/chunk-6NLB5TZ2.js +7 -0
- package/dist/chunk-6VP6G7CY.js +10 -0
- package/dist/{chunk-3D3Z4TBR.js → chunk-DGXZB7MO.js} +1 -1
- package/dist/chunk-DPA26AOI.js +3 -0
- package/dist/{chunk-A7FNR3T5.js → chunk-EEDLRRKU.js} +1 -1
- package/dist/chunk-G3SZDPDS.js +3 -0
- package/dist/chunk-IK6RKNS5.js +3 -0
- package/dist/chunk-IN6XVTUS.js +3 -0
- package/dist/{chunk-D4WPRRBT.js → chunk-ISKNIQVO.js} +1 -1
- package/dist/chunk-JKOB3U54.js +3 -0
- package/dist/{chunk-2BPR6LK6.js → chunk-JXTRQ3UG.js} +1 -1
- package/dist/chunk-LVGGCRDW.js +3 -0
- package/dist/chunk-N34DQ6MH.js +14 -0
- package/dist/chunk-NSQP6CTA.js +20 -0
- package/dist/chunk-QTFFVLVJ.js +8 -0
- package/dist/chunk-RKIRHMON.js +5 -0
- package/dist/chunk-ROPKSAFP.js +6 -0
- package/dist/{chunk-GTJ3EM6H.js → chunk-S6KP52OG.js} +1 -1
- package/dist/chunk-THVX57I3.js +4 -0
- package/dist/chunk-VE423Z2L.js +132 -0
- package/dist/chunk-WJ5EWXP2.js +3 -0
- package/dist/chunk-XDI6CPPV.js +3 -0
- package/dist/chunk-XF3YMBI7.js +3 -0
- package/dist/chunk-XIAG7ACN.js +7 -0
- package/dist/chunk-YU3SUSK3.js +3 -0
- package/dist/chunk-YUO3UWPH.js +3 -0
- package/dist/claude-setup-REU4AOKX.js +13 -0
- package/dist/cli.js +8 -8
- package/dist/{cr3-wasm-HLJWEV2S.js → cr3-wasm-NYCB34ND.js} +1 -1
- package/dist/{dng-wasm-CQDLPM5V.js → dng-wasm-XCPPBXPZ.js} +1 -1
- package/dist/{dpx-wasm-TLGMM7BO.js → dpx-wasm-XACWNFPB.js} +1 -1
- package/dist/emscripten-module-Q67P5WYC-HW3D2R5O.js +2161 -0
- package/dist/engine-274GQLUB.js +5 -0
- package/dist/{exr-wasm-2NPKPTVB.js → exr-wasm-FQBUR6QT.js} +1 -1
- package/dist/ffi-7KTOX2T4.js +3 -0
- package/dist/flame/hook/conformtools_flame/verbs.py +9 -9
- package/dist/framing-ZTMYZR2S.js +3 -0
- package/dist/gfx-worker.js +1 -1
- package/dist/{h264-JJMZSUWW.js → h264-B2TLLEMI.js} +1 -1
- package/dist/{h264-mxf-DCUOGLDU.js → h264-mxf-3GED5PBT.js} +1 -1
- package/dist/host-relink-FHNXXMHW.js +10 -0
- package/dist/hosted-BWAYLJXR.js +3 -0
- package/dist/hosts-Y6HGDRLM.js +3 -0
- package/dist/http.js +3 -3
- package/dist/{inspect-FJKYPEXL.js → inspect-RJFJQSHZ.js} +3 -3
- package/dist/{isobmff-VJOWP4MH.js → isobmff-C5A2EFKH.js} +1 -1
- package/dist/{mc-video-5MGGOQN4.js → mc-video-ARKIHPA7.js} +1 -1
- package/dist/mcp.js +7 -7
- package/dist/{media-NZYVREUF.js → media-22VAJIVT.js} +1 -1
- package/dist/media_core-XOKN7UUF.js +9 -0
- package/dist/module-ES6BEMUI-L6VQ7K3J.js +3 -0
- package/dist/module-asyncify-2EFITU5U-Z4EEM6X7.js +3 -0
- package/dist/mxf-CQSI6H5T.js +3 -0
- package/dist/nuke/panel/python/conformtools_nuke/verbs.py +5 -5
- package/dist/{ops-X7NAREC4.js → ops-BCTGDBXT.js} +1 -1
- package/dist/peer-kit/ctpeer/__init__.py +1 -1
- package/dist/peer-kit/ctpeer/neutral.py +10 -10
- package/dist/premiere-uxp/lib/edit.js +94 -9
- package/dist/premiere-uxp/lib/markers.js +12 -11
- package/dist/premiere-uxp/lib/probe.js +6 -3
- package/dist/premiere-uxp/lib/verbs.js +1 -1
- package/dist/premiere-uxp/manifest.json +1 -1
- package/dist/{probe-F7WQHMIA.js → probe-72QZKMCC.js} +1 -1
- package/dist/{r3d-T5O6IIZZ.js → r3d-FX7V4BIE.js} +1 -1
- package/dist/{r3d-CXUNG6VS.js → r3d-I6EYEYX7.js} +1 -1
- package/dist/resolve-bridge.py +725 -88
- package/dist/sequence-patch-CN4VC5W3.js +3 -0
- package/dist/{still-P4JJNTEO.js → still-WUCFH2WX.js} +1 -1
- package/dist/{still-wasm-DN5LPASS.js → still-wasm-RTPOMH7S.js} +1 -1
- package/dist/store-H676BOKI.js +3 -0
- package/dist/{tiff-wasm-BPRDR6EB.js → tiff-wasm-N2S267IA.js} +1 -1
- package/dist/timeline-5TGA5HBY.js +3 -0
- package/dist/timeline_core-ZKQQHUA2.js +3 -0
- package/dist/wasm/media_core_bg.wasm +0 -0
- package/dist/wasm-threads/media_core_bg.wasm +0 -0
- package/dist/{wav-64SC6P7U.js → wav-HSCUCY4U.js} +1 -1
- package/package.json +10 -1
- package/dist/account-M53GEV7P.js +0 -3
- package/dist/bridge-SX5TW4LC.js +0 -3
- package/dist/chunk-5BSXYKLN.js +0 -20
- package/dist/chunk-623EA3TK.js +0 -6
- package/dist/chunk-AMRJXYL4.js +0 -3
- package/dist/chunk-DQGINJDV.js +0 -5
- package/dist/chunk-GK4YYKJ6.js +0 -19
- package/dist/chunk-GRQJGEGV.js +0 -378
- package/dist/chunk-HNBA43BF.js +0 -5
- package/dist/chunk-J2JXLEAI.js +0 -3
- package/dist/chunk-MWDF2R26.js +0 -7
- package/dist/chunk-NFJHWZJX.js +0 -3
- package/dist/chunk-PFISREY4.js +0 -3
- package/dist/chunk-PLRB2YXJ.js +0 -3
- package/dist/chunk-QVH44I66.js +0 -39
- package/dist/chunk-RJ6JA2LZ.js +0 -3
- package/dist/chunk-SGLQY53R.js +0 -3
- package/dist/chunk-VIBEEWPC.js +0 -10
- package/dist/chunk-WN53ARHJ.js +0 -3
- package/dist/chunk-XCKQHL4G.js +0 -9
- package/dist/claude-setup-IIWUB4CE.js +0 -5
- package/dist/conformtools-analyze +0 -0
- package/dist/conformtools-decode +0 -0
- package/dist/engine-P6H5P6HP.js +0 -5
- package/dist/framing-3XIVHSUZ.js +0 -3
- package/dist/host-relink-UWML4C7W.js +0 -10
- package/dist/hosts-SRS5TEM6.js +0 -3
- package/dist/i2o-transfer +0 -0
- package/dist/media_core-YZ3PABEG.js +0 -9
- package/dist/mxf-FJSRFLJC.js +0 -3
- package/dist/store-53BBZBND.js +0 -3
- package/dist/timeline-C3OZJBCZ.js +0 -3
- package/dist/timeline_core-IOENXK4Z.js +0 -3
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ npx -y conformtools@latest whoami # shows the account and plan it found
|
|
|
24
24
|
**Claude Code**
|
|
25
25
|
|
|
26
26
|
```sh
|
|
27
|
-
claude mcp add -s user conformtools -- npx -y conformtools@latest mcp
|
|
27
|
+
claude mcp add -s user conformtools -- npx -y --prefer-online conformtools@latest mcp
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
**Claude Desktop** — Settings → Developer → Edit Config, then add:
|
|
@@ -32,12 +32,17 @@ claude mcp add -s user conformtools -- npx -y conformtools@latest mcp
|
|
|
32
32
|
```json
|
|
33
33
|
{
|
|
34
34
|
"mcpServers": {
|
|
35
|
-
"conformtools": { "command": "npx", "args": ["-y", "conformtools@latest", "mcp"] }
|
|
35
|
+
"conformtools": { "command": "npx", "args": ["-y", "--prefer-online", "conformtools@latest", "mcp"] }
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
Cursor, Codex and other MCP clients take the same command: `npx -y conformtools@latest mcp`.
|
|
40
|
+
Cursor, Codex and other MCP clients take the same command: `npx -y --prefer-online conformtools@latest mcp`.
|
|
41
|
+
|
|
42
|
+
**Updates are automatic.** `--prefer-online` makes npx ask npm for the newest conformtools each time your app starts
|
|
43
|
+
the server, so every new session runs the latest release (offline, it runs the copy it has). A session already open
|
|
44
|
+
keeps its version until the app restarts it. Set it up earlier without `--prefer-online`? Run
|
|
45
|
+
`npx -y conformtools@latest setup claude` (or `setup codex`) once, and it switches your registration over.
|
|
41
46
|
|
|
42
47
|
Then just ask:
|
|
43
48
|
|
|
@@ -113,28 +118,49 @@ writing timelines use conform.tools, exactly as the website does: the engine sen
|
|
|
113
118
|
edit's structure and gets the finished timeline back. Tools that do this are marked
|
|
114
119
|
"(on conform.tools)" in `conformtools --list`, and need an internet connection.
|
|
115
120
|
|
|
121
|
+
## Scripts (`script_run`, `script_read`)
|
|
122
|
+
|
|
123
|
+
For a job of many steps (probe every file in a folder, QC every clip of a cut), the AI writes one
|
|
124
|
+
short TypeScript script that calls the tools as functions, `await ct.media_probe({ path })`, and
|
|
125
|
+
runs it with `script_run`. Only what the script returns goes back to the AI, not every step's
|
|
126
|
+
output: fewer round trips, fewer tokens. The script runs on this machine in a sandbox (QuickJS)
|
|
127
|
+
with no file, network or process access except through the conformtools tools themselves, so
|
|
128
|
+
every call goes through the same checks as a direct tool call. `save_as` keeps a script in the
|
|
129
|
+
project's `scripts/` folder; run it again with `path`, or from a terminal:
|
|
130
|
+
|
|
131
|
+
```sh
|
|
132
|
+
conformtools script_run '{"path":"~/.conform-mcp/projects/local/scripts/check-audio.ts"}'
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
`script_read` is the same, but its scripts can call only the tools that change nothing (probe,
|
|
136
|
+
inspect, QC). It is marked read-only, so apps that ask before a tool changes anything run it
|
|
137
|
+
without asking, and apps that never ask (Codex running unattended) run it at all.
|
|
138
|
+
|
|
116
139
|
## Feedback and privacy
|
|
117
140
|
|
|
118
|
-
When
|
|
119
|
-
|
|
141
|
+
When a tool fails, or you tell the AI a result was wrong, nothing needs filing: the outcome
|
|
142
|
+
telemetry below records it with the run (the error, with every name replaced, and which system
|
|
143
|
+
it ran on), so we see every failure, not only the ones someone reported.
|
|
120
144
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
(which tool ran, in what order, how long it took, whether it failed and the error), with every
|
|
127
|
-
folder path cut down to the file name:
|
|
128
|
-
`/Volumes/CLIENT/secret/A001.mov` is sent as `A001.mov`
|
|
145
|
+
When you or the AI want to tell us a lesson or a suggestion (nothing broke), the `report` tool
|
|
146
|
+
sends it and gives you a report id. A note contains the words the AI wrote, the conformtools
|
|
147
|
+
version, whether timelines were read on this machine or on conform.tools, your OS and Node.js
|
|
148
|
+
version, and the signed-in account. Folder paths are cut to the file name:
|
|
149
|
+
`/Volumes/CLIENT/secret/A001.mov` is sent as `A001.mov`.
|
|
129
150
|
|
|
130
|
-
When
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
know which tool to build next. File names at most, never folder paths.
|
|
151
|
+
When no conformtools tool fits what you asked, the AI looks one up first (`find_verb`). When
|
|
152
|
+
nothing fits, that lookup is how we learn which tool to build next: it is recorded with the
|
|
153
|
+
outcome telemetry below, as a one-line summary with every name replaced.
|
|
134
154
|
|
|
135
|
-
|
|
155
|
+
No note ever sends media, file contents or timeline files. A copy of each one,
|
|
136
156
|
exactly as sent, is kept in `~/.conform-mcp/reports/`.
|
|
137
157
|
|
|
158
|
+
**Conversions are checked.** Reading and writing timelines run on conform.tools (the same engine as the
|
|
159
|
+
website). The timeline's structure goes there to be converted, and the converted file comes back. The original
|
|
160
|
+
timeline file (the `.prproj`, `.drt`, `.aaf`…, never media) is kept with that conversion the same way a website
|
|
161
|
+
conversion keeps it, so our checks can compare what we wrote against it with each host's own rules. It is kept as
|
|
162
|
+
long as your plan keeps conversions, and `conformtools telemetry off` stops it along with the telemetry below.
|
|
163
|
+
|
|
138
164
|
**Outcome telemetry is on unless you turn it off.** It is how we find where the tools fail
|
|
139
165
|
an AI and fix them, and it never carries your material.
|
|
140
166
|
|
|
@@ -142,14 +168,19 @@ an AI and fix them, and it never carries your material.
|
|
|
142
168
|
conformtools telemetry off # or on, or status
|
|
143
169
|
```
|
|
144
170
|
|
|
145
|
-
It records, for each tool run: the tool's name, whether it worked (or the error code
|
|
171
|
+
It records, for each tool run: the tool's name, whether it worked (or the error code and, for
|
|
172
|
+
a failure, the error message with every name and path replaced by a placeholder), how
|
|
146
173
|
long it took, the conformtools version, local or conform.tools, counts such as the number of
|
|
147
174
|
clips, files, or matched and unmatched references (numbers only), the names of the arguments
|
|
148
175
|
the AI gave (never their values), and the call's place in the conversation (a random id and a
|
|
149
|
-
number, so we can see that a call was retried or followed by the wrong tool)
|
|
176
|
+
number, so we can see that a call was retried or followed by the wrong tool), and the system
|
|
177
|
+
it ran on: OS and version, chip (Apple silicon, Intel), Node.js version, memory and CPU count. For a call
|
|
150
178
|
the AI got wrong (missing or invalid arguments) it records the tool's name and the names of
|
|
151
|
-
the arguments, never their values.
|
|
152
|
-
|
|
179
|
+
the arguments, never their values. For each request you make, it also records the AI's own
|
|
180
|
+
one-line summary of it with every show, person, clip, reel, scene and path written as a
|
|
181
|
+
placeholder ("relink {reel} to the camera originals"), scrubbed again on your machine and on
|
|
182
|
+
arrival, and whether the AI found the request before solved. It never records paths, file or
|
|
183
|
+
clip names, timeline contents, project notes, your own words or media. Events are sent in batches at most every 15 minutes, a failed send never
|
|
153
184
|
slows a tool down, and turning it off deletes anything not yet sent. `CONFORM_TELEMETRY=off`
|
|
154
185
|
forces it off on a machine.
|
|
155
186
|
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m}from"./chunk-6NLB5TZ2.js";import"./chunk-64X5DLH5.js";import"./chunk-PHAMF4JF.js";import"./chunk-G3SZDPDS.js";import"./chunk-PSANHDZM.js";export{b as NET_TIMEOUT_MS,c as _forgetOffline,d as accessToken,e as accountStatus,a as config,g as includesOf,l as login,m as logout,k as requireApp,i as requireEntitled,j as requireMcp,h as setAccountGate,f as statusText};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
+
import{a,b,c,d}from"./chunk-64X5DLH5.js";import"./chunk-PHAMF4JF.js";import"./chunk-G3SZDPDS.js";import"./chunk-PSANHDZM.js";export{a as analysisEnginePath,c as analysisOp,d as startAnalysisEngine,b as startAnalysisJob};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
+
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i}from"./chunk-NSQP6CTA.js";import"./chunk-IK6RKNS5.js";import"./chunk-G3SZDPDS.js";import"./chunk-PSANHDZM.js";export{c as BridgeError,g as HostBridge,e as PANEL_PREFIX,b as PORTS,a as PROTOCOL,h as hostBridge,d as pairingPath,f as panelOrigins,i as resetHostBridge};
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{
|
|
3
|
+
import{$ as r,A as O,E as A,F as R,G as q,J as F,K as N,N as f,b as _,g as m,i as L,n as x,r as T,s as U,t as $,u as P,v as E,x as k,y as V}from"./chunk-G3SZDPDS.js";var H="7145B29C33684D8AA1C7E5126F9B405D",w="conform.tools.dvcp.bundle",J="https://raw.githubusercontent.com/tbdpost/conformtools-public/main/plugin/manifest.json";function z(t=m()){return t==="win32"?{system:`${_("PROGRAMDATA")??"C:\\ProgramData"}\\Blackmagic Design\\DaVinci Resolve\\Support\\IOPlugins`,user:`${_("APPDATA")??""}\\Blackmagic Design\\DaVinci Resolve\\Support\\IOPlugins`}:t==="linux"?{system:"/opt/resolve/IOPlugins",user:r(x(),".local/share/DaVinciResolve/IOPlugins")}:{system:"/Library/Application Support/Blackmagic Design/DaVinci Resolve/IOPlugins",user:r(x(),"Library/Application Support/Blackmagic Design/DaVinci Resolve/IOPlugins")}}function W(t=m()){return t==="win32"?`${_("APPDATA")??""}\\Blackmagic Design\\DaVinci Resolve\\Support\\logs\\ResolveDebug.txt`:t==="linux"?r(x(),".local/share/DaVinciResolve/logs/ResolveDebug.txt"):r(x(),"Library/Application Support/Blackmagic Design/DaVinci Resolve/logs/ResolveDebug.txt")}function j(t=m(),e=L()){return t==="darwin"?{key:"darwin-universal",binary:"Contents/MacOS/conform.tools.dvcp"}:t==="linux"&&/x86_64|x64/.test(e)?{key:"linux-x86_64",binary:"Contents/Linux-x86-64/conform.tools.dvcp"}:t==="win32"?{key:"windows-x86_64",binary:"Contents/Win64/conform.tools.dvcp"}:null}async function M(t){let e=r(t,"Contents/Resources/VERSION");if(await P(e))return(await k(e)).trim()||null;let n=r(t,"Contents/Info.plist");return await P(n)?/<key>CFBundleShortVersionString<\/key>\s*<string>([^<]+)</.exec(await k(n))?.[1]??null:null}function K(t,e){let n=t.split(`
|
|
4
4
|
`),s=n.find(l=>l.includes("Running DaVinci Resolve"));if(!s)return null;let i=/(\d{4}-\d{2}-\d{2}) (\d{2}:\d{2}:\d{2}),(\d{3})/.exec(s);if(!i)return null;let u=new Date(`${i[1]}T${i[2]}.${i[3]}`),a=n.some(l=>/plugin repository/i.test(l)&&l.toUpperCase().includes(`LOADED PLUGIN [${H}]`));return{launched_at:u.toISOString(),loaded:a,installed_after_launch:e!==void 0&&e>u.getTime()}}async function tt(t=m()){let e=j(t),n=z(t),s=r(n.system,w),i=e?await E(s)&&await $(r(s,e.binary)):!1,u=i?await M(s):null,a=r(n.user,w),l=await E(a)?{path:a,version:await M(a)}:void 0,c=null;try{let D=i&&e?(await U(r(s,e.binary))).mtimeMs:void 0;c=K(await k(W(t)),D)}catch{}let p=e?i?c?c.loaded&&!c.installed_after_launch?"ready":"needs-restart":"unknown":"plugin-missing":"unsupported-platform",g={ready:"The plugin is installed and loaded.","plugin-missing":l?`Only a per-user copy exists (${a}); Resolve loads I/O plugins only from ${n.system}. Install it with host_setup action=install_renderplugin.`:"Install it with host_setup action=install_renderplugin, then restart Resolve.","needs-restart":"Restart Resolve: it loads I/O plugins only at launch.","unsupported-platform":"There is no build of the plugin for this platform.",unknown:"Start Resolve once so its log says whether it loaded the plugin."}[p];return{platform:e?.key??null,installed:i,path:s,version:u,...l?{shadowed:l}:{},resolve:c,readiness:p,next:g}}async function et(){for(let t of["./presets/conform.tools.xml","./resolve-presets/conform.tools.xml"]){let e=T(new URL(t,import.meta.url));if(await P(e))return e}throw new Error("resolve: the conform.tools render preset is missing from this install")}async function X(t){let e=new Uint8Array(await crypto.subtle.digest("SHA-256",t));return Array.from(e,n=>n.toString(16).padStart(2,"0")).join("")}async function G(t,e=3){for await(let n of N(t)){if(!n.isDirectory)continue;let s=r(t,n.name);if(n.name===w)return s;if(e>0&&!n.name.startsWith("__MACOSX")){let i=await G(s,e-1);if(i)return i}}return null}var Q=async t=>{let e=await fetch(t,{signal:AbortSignal.timeout(12e4)});if(!e.ok)throw new Error(`download failed: ${t} answered ${e.status}`);return new Uint8Array(await e.arrayBuffer())};async function nt(t={}){let e=t.os??m(),n=j(e);if(!n)throw new Error("there is no build of the plugin for this platform");let s=t.fetcher??Q,i=JSON.parse(new TextDecoder().decode(await s(t.manifest_url??J))),u=i.platforms?.[n.key]??(e==="darwin"&&i.bundle_url?{bundle_url:i.bundle_url,sha256:i.sha256??""}:void 0);if(!u)throw new Error(`plugin ${i.version} has no ${n.key} build`);let a=await s(u.bundle_url),l=await X(a);if(l!==u.sha256.toLowerCase())throw new Error(`the downloaded plugin failed its checksum (got ${l}, the manifest says ${u.sha256}); nothing was installed`);let c=await F("conform-plugin-"),p=r(c,"plugin.zip");await V(p,a);let g=r(c,"x");await O(g);let D=e==="darwin"?await f("ditto",["-x","-k",p,g]):e==="win32"?await f("powershell",["-NoProfile","-Command",`Expand-Archive -LiteralPath '${p}' -DestinationPath '${g}' -Force`]):await f("unzip",["-q",p,"-d",g]);if(!D.success)throw new Error(`could not unpack the plugin: ${D.stderr.trim()}`);let b=await G(g);if(!b||!await $(r(b,n.binary)))throw new Error(`the ${n.key} download does not contain ${n.binary}`);let h=t.targetDir??z(e).system,d=r(h,w),I=r(h,`.${w}.staging`),y=r(h,`.${w}.previous`),C=[],S=!1;try{await O(h),await R(I),await q(b,I),await R(y),await $(d)&&await A(d,y);try{await A(I,d)}catch(v){throw await $(y)&&await A(y,d),v}await R(y)}catch(v){let B=v.code;if(B!=="EACCES"&&B!=="EPERM")throw v;S=!0,await Y(e,b,h)}return e==="darwin"&&((await f(S?"osascript":"xattr",S?["-e",`do shell script "xattr -dr com.apple.quarantine ${o(d)}" with administrator privileges`]:["-dr","com.apple.quarantine",d])).success||C.push("could not clear the quarantine flag; if Resolve refuses the plugin, run: xattr -dr com.apple.quarantine "+d)),await R(c),{version:i.version,path:d,elevated:S,restart_required:!0,notes:C}}var o=t=>`'${t.replace(/'/g,"'\\''")}'`;async function Y(t,e,n,s=w){let i=r(n,s),u=r(n,`.${s}.staging`),a=r(n,`.${s}.previous`),l=[`mkdir -p ${o(n)}`,`rm -rf ${o(u)} ${o(a)}`,`cp -R ${o(e)} ${o(u)}`,`if [ -e ${o(i)} ]; then mv ${o(i)} ${o(a)}; fi`,`mv ${o(u)} ${o(i)} || { [ -e ${o(a)} ] && mv ${o(a)} ${o(i)}; exit 1; }`,`rm -rf ${o(a)}`].join(" && "),c=t==="darwin"?await f("osascript",["-e",`do shell script ${JSON.stringify(l)} with administrator privileges`]):t==="linux"?await f("pkexec",["sh","-c",l]):{success:!1,stderr:"run this from an administrator prompt",stdout:"",code:1};if(!c.success)throw new Error(`installing into ${n} needs an administrator, and that was refused or failed: ${c.stderr.trim()}`)}export{tt as a,et as b,nt as c,Y as d};
|