alchemylab 3.0.7 → 3.0.8
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/214.js +940 -0
- package/dist/414.js +3095 -42
- package/dist/478.js +2 -2
- package/dist/772.js +2209 -0
- package/dist/776.js +12 -12
- package/dist/833.js +944 -0
- package/dist/994.js +350 -129
- package/dist/cli.js +18016 -7802
- package/dist/document-textconv.js +172 -172
- package/dist/http-server.js +18920 -5975
- package/dist/index.js +19255 -6297
- package/dist/mcp-direct.js +17189 -5770
- package/package.json +19 -19
package/dist/776.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict"
|
|
2
|
-
exports.ids=[776],exports.modules={37776(e,exports,t){function r(e,t){return new Promise(r=>{(0,
|
|
2
|
+
exports.ids=[776],exports.modules={37776(e,exports,t){function r(e,t){return new Promise(r=>{(0,d.execFile)("git",t,{cwd:e,maxBuffer:16777216},(e,t,i)=>{r({code:e?"number"==typeof e.code?e.code:1:0,stdout:String(t??""),stderr:String(i??"")})})})}async function i(e){return 0===(await r(e,["rev-parse","--verify","--quiet","HEAD"])).code}function s(e){try{return h.realpathSync(e)}catch{return u.resolve(e)}}function o(e){if(0===e.length)return""
|
|
3
3
|
const t=1===e.length
|
|
4
4
|
return`It leaves ${e.slice(0,3).join(", ")+(e.length>3?` and ${e.length-3} more`:"")} out of the history, because ${t?"it looks like it holds":"they look like they hold"} a password or key; ${t?"it stays":"they stay"} in the folder as ${t?"it is":"they are"}.`}var a,n=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r)
|
|
5
5
|
var s=Object.getOwnPropertyDescriptor(t,r)
|
|
@@ -10,24 +10,24 @@ var t={}
|
|
|
10
10
|
if(null!=e)for(var r=a(e),i=0;i<r.length;i++)"default"!==r[i]&&n(t,e,r[i])
|
|
11
11
|
return c(t,e),t})
|
|
12
12
|
Object.defineProperty(exports,"__esModule",{value:!0}),exports.hasCommits=i,exports.ensureProjectRepository=async function(e){let t=null
|
|
13
|
-
if(!
|
|
13
|
+
if(!h.existsSync(u.join(e,".git"))){const i=await r(e,["rev-parse","--show-toplevel"])
|
|
14
14
|
if(0===i.code&&i.stdout.trim()){const o=s(i.stdout.trim())
|
|
15
15
|
if(o!==s(e)){const i=await r(e,["ls-files","--","."])
|
|
16
16
|
if(0!==i.code||i.stdout.trim())return{status:"failed",message:`This folder's files belong to the git repository at ${o}, so AlchemyLab will not create a second repository here. Start AlchemyLab in ${o} (requests branch from that repository's default branch), or run \`git init\` here yourself if a nested repository is really what you want.`}
|
|
17
|
-
t=o}}}if(
|
|
17
|
+
t=o}}}if(h.existsSync(u.join(e,".git")))return await(0,m.ensureAlchemyIgnoreEntries)(e),await i(e)?{status:"existing",hasHistory:!0}:{status:"existing",hasHistory:!1,message:'This repository has no commits yet. Requests branch from your default branch, so make a first commit (for example `git add -A && git commit -m "Initial commit"`), then start AlchemyLab again.'}
|
|
18
18
|
const a=await r(e,["init","-q","-b","main"])
|
|
19
|
-
if(0!==a.code)return{status:"failed",message:`Could not create a git repository here: ${a.stderr.trim()||"git is not available"}. Install git and run \`
|
|
20
|
-
await(0,
|
|
19
|
+
if(0!==a.code)return{status:"failed",message:`Could not create a git repository here: ${a.stderr.trim()||"git is not available"}. Install git${"win32"===process.platform?" (winget install --id Git.Git -e, or https://git-scm.com/download/win), open a new terminal":""} and run \`alchemy\` here again.`}
|
|
20
|
+
await(0,m.ensureAlchemyIgnoreEntries)(e)
|
|
21
21
|
const n=[];(await r(e,["config","user.email"])).stdout.trim()||n.push("-c","user.name=AlchemyLab","-c","user.email=alchemylab@localhost")
|
|
22
22
|
const c=await r(e,["add","-A"])
|
|
23
23
|
if(0!==c.code)return{status:"failed",message:`Created the repository but could not record the folder: ${c.stderr.trim()}`}
|
|
24
|
-
let l="",
|
|
25
|
-
try{const t=await(0,
|
|
26
|
-
l=t.note,
|
|
27
|
-
if(0!==
|
|
28
|
-
const
|
|
29
|
-
return{status:"created",filesCommitted:
|
|
30
|
-
const
|
|
24
|
+
let l="",d=[]
|
|
25
|
+
try{const t=await(0,f.holdBackStagedCredentials)(e)
|
|
26
|
+
l=t.note,d=t.held.map(e=>e.file)}catch(e){return{status:"failed",message:`Created the repository but could not check the folder for key material before its first commit: ${e instanceof Error?e.message:String(e)}`}}const p=(await r(e,["diff","--cached","--name-only"])).stdout.split("\n").filter(Boolean),g=p.length,w=await r(e,[...n,"commit","-q","--allow-empty","-m","Initial commit (AlchemyLab created this repository)"+(l?`\n\n${l}`:"")])
|
|
27
|
+
if(0!==w.code)return{status:"failed",message:`Created the repository but could not make its first commit: ${w.stderr.trim()}`}
|
|
28
|
+
const b=`${g} file${1===g?"":"s"}`,v=0===(0,y.codePaths)(p).length
|
|
29
|
+
return{status:"created",filesCommitted:g,message:(v?g>0?`AlchemyLab keeps a history of every change in this folder, starting with the ${b} already here.`:"AlchemyLab keeps a history of every change in this folder, starting now.":g>0?`No git repository here. Created a git repository and recorded the ${b} already here as its first commit.`:"No git repository here. Created a git repository with an empty first commit.")+(t?` This folder is inside the repository at ${t}, which tracks nothing here, so it has its own.`:"")+(l?` ${v?o(d):l}`:"")}},exports.plainHeldLine=o
|
|
30
|
+
const d=t(35317),h=l(t(79896)),u=l(t(16928)),m=t(89796),f=t(96511),y=t(71879)},71879(e,exports,t){exports.codePaths=function(e){return e.filter(e=>{const t=e.split("/")
|
|
31
31
|
return!(t.some(e=>e.startsWith("."))||r.DOC_PATH_RE.test(e)||i.test(e)||/^(licen[cs]e|copying|notice)(\.[a-z]+)?$/i.test(t[t.length-1]))})},t(35317)
|
|
32
32
|
const r=t(92456),i=(t(52232),t(87780),/\.(docx?|odt|ods|odp|rtf|xlsx?|pptx?|pages|numbers|key|pdf|epub|csv|tsv|png|jpe?g|gif|webp|svg|heic|tiff?|bmp|mp3|m4a|wav|mp4|mov)$/i)
|
|
33
33
|
new Set,new Map,new Map}}
|