alchemylab 2.0.2 → 2.1.0
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/{674.js → 111.js} +2 -2
- package/dist/{19.js → 24.js} +69 -78
- package/dist/{540.js → 293.js} +3 -3
- package/dist/{491.js → 356.js} +1 -1
- package/dist/{603.js → 414.js} +1 -1
- package/dist/478.js +89 -0
- package/dist/{636.js → 579.js} +2 -2
- package/dist/{565.js → 60.js} +2 -2
- package/dist/729.js +46 -88
- package/dist/{129.js → 776.js} +2 -2
- package/dist/{237.js → 800.js} +2 -2
- package/dist/{403.js → 816.js} +1 -1
- package/dist/{380.js → 939.js} +2 -2
- package/dist/{554.js → 991.js} +3 -3
- package/dist/{301.js → 994.js} +2 -2
- package/dist/cli.js +7777 -7158
- package/dist/document-textconv.js +353 -270
- package/dist/http-server.js +7582 -7486
- package/dist/index.js +7774 -7678
- package/dist/mcp-direct.js +7712 -7616
- package/package.json +5 -2
- package/dist/796.js +0 -47
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alchemylab",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "AlchemyLab: the agentic workbench. Work is a request, with criteria, gates and a receipt.",
|
|
6
6
|
"author": "Testfire Software",
|
|
@@ -45,16 +45,19 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@modelcontextprotocol/sdk": "^1.7.0",
|
|
48
|
-
"alchemylab-opencode": "^1.0.
|
|
48
|
+
"alchemylab-opencode": "^1.0.22",
|
|
49
49
|
"chalk": "^4.1.2",
|
|
50
50
|
"compression": "^1.8.1",
|
|
51
51
|
"cors": "^2.8.5",
|
|
52
52
|
"express": "^4.18.2",
|
|
53
|
+
"js-yaml": "^3.14.2",
|
|
53
54
|
"jszip": "^3.10.2",
|
|
54
55
|
"micromatch": "^4.0.5",
|
|
55
56
|
"pdf-lib": "^1.17.1",
|
|
56
57
|
"playwright-core": "^1.61.1",
|
|
57
58
|
"simple-git": "^3.36.0",
|
|
59
|
+
"ulid": "^3.0.1",
|
|
60
|
+
"undici": "^7.25.0",
|
|
58
61
|
"unpdf": "^1.8.1",
|
|
59
62
|
"winston": "^3.8.2",
|
|
60
63
|
"ws": "^8.14.2",
|
package/dist/796.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict"
|
|
2
|
-
exports.id=796,exports.ids=[796],exports.modules={68796:(e,exports,t)=>{async function n(e){if(p&&Date.now()-p.at<d)return p.servers
|
|
3
|
-
try{const t=await e.apiClient.get(`/api/projects/${e.projectId}/mcp-servers`),n=t?.data??t??[]
|
|
4
|
-
if(Array.isArray(n))return p={at:Date.now(),servers:n},n}catch(t){e.logger.warn("MCP gate: could not read the registry",{error:(0,c.getErrorMessage)(t)})}return p?.servers??[]}function r(e){return e.filter((e=>e.enabled)).map((e=>e.name))}function o(e,t){const n=[...t].sort(((e,t)=>t.length-e.length))
|
|
5
|
-
for(const t of n){const n=`${t}_`
|
|
6
|
-
if(e.startsWith(n)&&e.length>n.length)return{server:t,tool:e.slice(n.length)}}return null}function s(e,t=200){if(!e||"object"!=typeof e||Array.isArray(e))return""
|
|
7
|
-
const n=Object.entries(e)
|
|
8
|
-
if(0===n.length)return""
|
|
9
|
-
const r=e=>{const t=u.indexOf(e)
|
|
10
|
-
return-1===t?u.length:t}
|
|
11
|
-
n.sort(((e,t)=>r(e[0])-r(t[0])))
|
|
12
|
-
const o=[]
|
|
13
|
-
for(const[e,t]of n){if(o.length>=4)break
|
|
14
|
-
let n
|
|
15
|
-
if("string"==typeof t)n=t.length>80?`${t.length} characters`:t
|
|
16
|
-
else if("number"==typeof t||"boolean"==typeof t)n=String(t)
|
|
17
|
-
else if(Array.isArray(t)){const e=t.filter((e=>"string"==typeof e))
|
|
18
|
-
n=e.length===t.length&&e.join(", ").length<=80?e.join(", "):`${t.length} items`}else{if(null==t)continue
|
|
19
|
-
n="an object"}o.push(`${e}: ${n}`)}const s=o.join(", ")
|
|
20
|
-
return s.length>t?`${s.slice(0,t-1)}\u2026`:s}function i(e,t,n,r){const o=[`Let an agent run ${t} on "${e}", an MCP server this project is connected to?`],i=function(e){if(!e||"object"!=typeof e||Array.isArray(e))return""
|
|
21
|
-
const t=s(e,400).split(", ").map((e=>{const t=e.indexOf(": ")
|
|
22
|
-
return-1===t?null:[e.slice(0,t),e.slice(t+2)]})).filter(Boolean)
|
|
23
|
-
if(0===t.length)return""
|
|
24
|
-
const n=Math.max(...t.map((([e])=>e.length)))
|
|
25
|
-
return t.map((([e,t])=>` ${e.padEnd(n)} ${t}`)).join("\n")}(r)
|
|
26
|
-
i&&o.push(i)
|
|
27
|
-
const a=n?`This runs inside "${e}", not in this project. The server's own note on ${t}: ${function(e,t=220){const n=e.trim().replace(/\s+/g," ")
|
|
28
|
-
if(n.length<=t)return n
|
|
29
|
-
const r=n.slice(0,t),o=Math.max(r.lastIndexOf(". "),r.lastIndexOf("! "),r.lastIndexOf("? "))
|
|
30
|
-
if(o>.4*t)return r.slice(0,o+1)
|
|
31
|
-
const s=r.lastIndexOf(" ")
|
|
32
|
-
return`${r.slice(0,s>0?s:t)}\u2026`}(n)}`:`This runs inside "${e}", not in this project, and the server does not say what ${t} does.`
|
|
33
|
-
return o.push(a),o.join("\n\n")}exports.invalidateMcpRegistry=function(){p=null},exports.getRegisteredMcpServers=n,exports.gatedNamespaces=r,exports.splitToolKey=o,exports.summariseArgs=s,exports.gateMcpCall=async function(e,c){const d=await n(e),p=o(c.toolName,r(d))
|
|
34
|
-
if(!p)return{allow:!0,verdict:"not-external",reason:"Not a registered MCP connection tool"}
|
|
35
|
-
const u=d.find((e=>e.name===p.server))
|
|
36
|
-
if(!u||!u.enabled)return{allow:!1,verdict:"unknown-connection",reason:`the MCP server "${p.server}" is not enabled for this project`}
|
|
37
|
-
if(function(e,t){const n=e?.find((e=>e.name===t))
|
|
38
|
-
return!0===n?.readOnly}(u.toolManifest,p.tool))return{allow:!0,verdict:"read-only",reason:`the ${p.server} MCP server marks ${p.tool} read-only`}
|
|
39
|
-
const{requestForSession:f}=await t.e(674).then(t.bind(t,75674)),h=c.sessionId?await f(e,c.sessionId):void 0,g=h??c.sessionId,v=g?`mcp:${p.server}:${g}`:`mcp:${p.server}`,y=s(c.args),$=y?`MCP ${p.server} \xb7 ${p.tool} (${y})`:`MCP ${p.server} \xb7 ${p.tool}`,m=u.toolManifest?.find((e=>e.name===p.tool))?.description
|
|
40
|
-
if((0,a.isSessionAllowed)(v))return{allow:!0,verdict:"session-allowed",reason:h?`already allowed for ${h}`:"already allowed for this run"}
|
|
41
|
-
const{id:w,promise:b,created:j}=(0,a.createApproval)(v,$)
|
|
42
|
-
w&&j&&c.sessionId&&(0,l.bridgeApprovalToNotification)(e.apiClient,e.projectId,{approvalId:w,approvalKey:v,sessionId:c.sessionId,command:$,question:i(p.server,p.tool,m,c.args),approveOption:{description:`Run it once, in "${p.server}"`},denyOption:{description:"Do not run it; the agent is told it was declined"},allowSessionOption:h?{label:`Allow for the rest of ${h}`,description:`Run it, and stop asking about "${p.server}" for the rest of this request`}:{label:"Allow while this agent keeps working",description:`Run it, and stop asking about "${p.server}" until this agent finishes`}})
|
|
43
|
-
const M=await b
|
|
44
|
-
return"deny"===M?{allow:!1,verdict:"denied",reason:"a person declined it"}:"timeout"===M?{allow:!1,verdict:"timeout",reason:"nobody answered the approval in time"}:{allow:!0,verdict:"approved",reason:"a person approved it"}}
|
|
45
|
-
const a=t(70799),l=t(36993),c=t(21319),d=3e4
|
|
46
|
-
let p=null
|
|
47
|
-
const u=["path","file","filename","file_path","filePath","paths","url","uri","endpoint","repo","repository","branch","id","key","name","title","query","q","command","sql","table"]}}
|