diff --git a/package.json b/package.json index 74b148b18..f70ceece6 100644 --- a/package.json +++ b/package.json @@ -163,10 +163,10 @@ "@homebridge/ciao": "^1.3.4", "@line/bot-sdk": "^10.6.0", "@lydell/node-pty": "1.2.0-beta.3", - "@mariozechner/pi-agent-core": "0.49.3", - "@mariozechner/pi-ai": "0.49.3", - "@mariozechner/pi-coding-agent": "0.49.3", - "@mariozechner/pi-tui": "0.49.3", + "@mariozechner/pi-agent-core": "0.50.7", + "@mariozechner/pi-ai": "0.50.7", + "@mariozechner/pi-coding-agent": "0.50.7", + "@mariozechner/pi-tui": "0.50.7", "@mozilla/readability": "^0.6.0", "@sinclair/typebox": "0.34.47", "@slack/bolt": "^4.6.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 95b940c97..5862bf592 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -41,17 +41,17 @@ importers: specifier: 1.2.0-beta.3 version: 1.2.0-beta.3 '@mariozechner/pi-agent-core': - specifier: 0.49.3 - version: 0.49.3(ws@8.19.0)(zod@4.3.6) + specifier: 0.50.7 + version: 0.50.7(ws@8.19.0)(zod@4.3.6) '@mariozechner/pi-ai': - specifier: 0.49.3 - version: 0.49.3(ws@8.19.0)(zod@4.3.6) + specifier: 0.50.7 + version: 0.50.7(ws@8.19.0)(zod@4.3.6) '@mariozechner/pi-coding-agent': - specifier: 0.49.3 - version: 0.49.3(ws@8.19.0)(zod@4.3.6) + specifier: 0.50.7 + version: 0.50.7(ws@8.19.0)(zod@4.3.6) '@mariozechner/pi-tui': - specifier: 0.49.3 - version: 0.49.3 + specifier: 0.50.7 + version: 0.50.7 '@mozilla/readability': specifier: ^0.6.0 version: 0.6.0 @@ -1448,22 +1448,22 @@ packages: peerDependencies: lit: ^3.3.1 - '@mariozechner/pi-agent-core@0.49.3': - resolution: {integrity: sha512-YL3PrLA8//Cklx58GJBUyNBCVLIOtK+wpAgqimuR03EgToaGPkSM7B/1S4CP4pFkr7b3DTIsC6t++tK7LgfjQg==} + '@mariozechner/pi-agent-core@0.50.7': + resolution: {integrity: sha512-iSNh+7QQFVge3co0Au1X6sqXAr+X6e3XlRXM7oE3m6zMWj76A1YCciV2sLI/imBcoFLum8blIaM0empwL477dQ==} engines: {node: '>=20.0.0'} - '@mariozechner/pi-ai@0.49.3': - resolution: {integrity: sha512-FYck4TPrF7ps3WBKxLnBQdda9OXUWN6rukni0LgK8m/GpMAXGienHouDrWPn0XIgTwrz5r7SGI3sfsEYslCICA==} + '@mariozechner/pi-ai@0.50.7': + resolution: {integrity: sha512-mVqaTE/Ulijd1olduEU02IfIP91aNt6F0UYJQNLR+m3b/6bsn21csZJZnkjYia0kHX7PnOLtikO2jG7dJpYY6g==} engines: {node: '>=20.0.0'} hasBin: true - '@mariozechner/pi-coding-agent@0.49.3': - resolution: {integrity: sha512-V/Fsq0PeYB5svmw5lZsbD/glmkXofegQcPSKecK2ab3VihKwQp/MQfYjyK6nY4b/B1HIugatcDWaH5WvPKIKwg==} + '@mariozechner/pi-coding-agent@0.50.7': + resolution: {integrity: sha512-A3SK7VoVY/xVNoRyLWwKoLRBTJ1cBq8hfqIiKOuE9BPBimEONu7lr7BZF/ma8rbOakPfhJ5TvLHCegwW9RhnwQ==} engines: {node: '>=20.0.0'} hasBin: true - '@mariozechner/pi-tui@0.49.3': - resolution: {integrity: sha512-SyBtQ0B9A/8V4eX7z3l9Q7sEVAnSueNJ1gC6+nRakDBfBOSxuqA61vz6tic0C7Jj46NERRuvJKdQSmk1VP5sUA==} + '@mariozechner/pi-tui@0.50.7': + resolution: {integrity: sha512-O8H8hXqoWdE+5eUUPiswq+WT+2eeshJHJmXKWMJMoSitNqdwzYZds9umAKdVLII6ZvjnFtd0awnf4VThYQBFIA==} engines: {node: '>=20.0.0'} '@matrix-org/matrix-sdk-crypto-nodejs@0.4.0': @@ -2416,10 +2416,6 @@ packages: resolution: {integrity: sha512-qJpzYC64kaj3S0fueiu3kXm8xPrR3PcXDPEgnaNMRn0EjNSZFoFjvbUp0YUDsRhN1CB90EnHJtbxWKevnH99UQ==} engines: {node: '>=18.0.0'} - '@smithy/core@3.21.0': - resolution: {integrity: sha512-bg2TfzgsERyETAxc/Ims/eJX8eAnIeTi4r4LHpMpfF/2NyO6RsWis0rjKcCPaGksljmOb23BZRiCeT/3NvwkXw==} - engines: {node: '>=18.0.0'} - '@smithy/core@3.21.1': resolution: {integrity: sha512-NUH8R4O6FkN8HKMojzbGg/5pNjsfTjlMmeFclyPfPaXXUrbr5TzhWgbf7t92wfrpCHRgpjyz7ffASIS3wX28aA==} engines: {node: '>=18.0.0'} @@ -2472,18 +2468,10 @@ packages: resolution: {integrity: sha512-RO0jeoaYAB1qBRhfVyq0pMgBoUK34YEJxVxyjOWYZiOKOq2yMZ4MnVXMZCUDenpozHue207+9P5ilTV1zeda0A==} engines: {node: '>=18.0.0'} - '@smithy/middleware-endpoint@4.4.10': - resolution: {integrity: sha512-kwWpNltpxrvPabnjEFvwSmA+66l6s2ReCvgVSzW/z92LU4T28fTdgZ18IdYRYOrisu2NMQ0jUndRScbO65A/zg==} - engines: {node: '>=18.0.0'} - '@smithy/middleware-endpoint@4.4.11': resolution: {integrity: sha512-/WqsrycweGGfb9sSzME4CrsuayjJF6BueBmkKlcbeU5q18OhxRrvvKlmfw3tpDsK5ilx2XUJvoukwxHB0nHs/Q==} engines: {node: '>=18.0.0'} - '@smithy/middleware-retry@4.4.26': - resolution: {integrity: sha512-ozZMoTAr+B2aVYfLYfkssFvc8ZV3p/vLpVQ7/k277xxUOA9ykSPe5obL2j6yHfbdrM/SZV7qj0uk/hSqavHrLw==} - engines: {node: '>=18.0.0'} - '@smithy/middleware-retry@4.4.27': resolution: {integrity: sha512-xFUYCGRVsfgiN5EjsJJSzih9+yjStgMTCLANPlf0LVQkPDYCe0hz97qbdTZosFOiYlGBlHYityGRxrQ/hxhfVQ==} engines: {node: '>=18.0.0'} @@ -2532,10 +2520,6 @@ packages: resolution: {integrity: sha512-6A4vdGj7qKNRF16UIcO8HhHjKW27thsxYci+5r/uVRkdcBEkOEiY8OMPuydLX4QHSrJqGHPJzPRwwVTqbLZJhg==} engines: {node: '>=18.0.0'} - '@smithy/smithy-client@4.10.11': - resolution: {integrity: sha512-6o804SCyHGMXAb5mFJ+iTy9kVKv7F91a9szN0J+9X6p8A0NrdpUxdaC57aye2ipQkP2C4IAqETEpGZ0Zj77Haw==} - engines: {node: '>=18.0.0'} - '@smithy/smithy-client@4.10.12': resolution: {integrity: sha512-VKO/HKoQ5OrSHW6AJUmEnUKeXI1/5LfCwO9cwyao7CmLvGnZeM1i36Lyful3LK1XU7HwTVieTqO1y2C/6t3qtA==} engines: {node: '>=18.0.0'} @@ -2572,18 +2556,10 @@ packages: resolution: {integrity: sha512-YEjpl6XJ36FTKmD+kRJJWYvrHeUvm5ykaUS5xK+6oXffQPHeEM4/nXlZPe+Wu0lsgRUcNZiliYNh/y7q9c2y6Q==} engines: {node: '>=18.0.0'} - '@smithy/util-defaults-mode-browser@4.3.25': - resolution: {integrity: sha512-8ugoNMtss2dJHsXnqsibGPqoaafvWJPACmYKxJ4E6QWaDrixsAemmiMMAVbvwYadjR0H9G2+AlzsInSzRi8PSw==} - engines: {node: '>=18.0.0'} - '@smithy/util-defaults-mode-browser@4.3.26': resolution: {integrity: sha512-vva0dzYUTgn7DdE0uaha10uEdAgmdLnNFowKFjpMm6p2R0XDk5FHPX3CBJLzWQkQXuEprsb0hGz9YwbicNWhjw==} engines: {node: '>=18.0.0'} - '@smithy/util-defaults-mode-node@4.2.28': - resolution: {integrity: sha512-mjUdcP8h3E0K/XvNMi9oBXRV3DMCzeRiYIieZ1LQ7jq5tu6GH/GTWym7a1xIIE0pKSoLcpGsaImuQhGPSIJzAA==} - engines: {node: '>=18.0.0'} - '@smithy/util-defaults-mode-node@4.2.29': resolution: {integrity: sha512-c6D7IUBsZt/aNnTBHMTf+OVh+h/JcxUUgfTcIJaWRe6zhOum1X+pNKSZtZ+7fbOn5I99XVFtmrnXKv8yHHErTQ==} engines: {node: '>=18.0.0'} @@ -2649,6 +2625,9 @@ packages: '@tokenizer/token@0.3.0': resolution: {integrity: sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==} + '@tootallnate/quickjs-emscripten@0.23.0': + resolution: {integrity: sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==} + '@twurple/api-call@8.0.3': resolution: {integrity: sha512-/5DBTqFjpYB+qqOkkFzoTWE79a7+I8uLXmBIIIYjGoq/CIPxKcHnlemXlU8cQhTr87PVa3th8zJXGYiNkpRx8w==} @@ -3042,6 +3021,10 @@ packages: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} + ast-types@0.13.4: + resolution: {integrity: sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==} + engines: {node: '>=4'} + ast-v8-to-istanbul@0.3.10: resolution: {integrity: sha512-p4K7vMz2ZSk3wN8l5o3y2bJAoZXT3VuJI5OLTATY/01CYWumWvwkUw0SqDBnNq6IiTO3qDa1eSQDibAV8g7XOQ==} @@ -3094,6 +3077,10 @@ packages: resolution: {integrity: sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==} engines: {node: '>= 0.8'} + basic-ftp@5.1.0: + resolution: {integrity: sha512-RkaJzeJKDbaDWTIPiJwubyljaEPwpVWkm9Rt5h9Nd6h7tEXTJ3VB4qxdZBioV7JO5yLUaOKwz7vDOzlncUsegw==} + engines: {node: '>=10.0.0'} + bcrypt-pbkdf@1.0.2: resolution: {integrity: sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==} @@ -3357,6 +3344,10 @@ packages: resolution: {integrity: sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==} engines: {node: '>= 12'} + data-uri-to-buffer@6.0.2: + resolution: {integrity: sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==} + engines: {node: '>= 14'} + debug@2.6.9: resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} peerDependencies: @@ -3382,6 +3373,10 @@ packages: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} + degenerator@5.0.1: + resolution: {integrity: sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==} + engines: {node: '>= 14'} + delayed-stream@1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} @@ -3510,9 +3505,27 @@ packages: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} + escodegen@2.1.0: + resolution: {integrity: sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==} + engines: {node: '>=6.0'} + hasBin: true + + esprima@4.0.1: + resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} + engines: {node: '>=4'} + hasBin: true + + estraverse@5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + estree-walker@3.0.3: resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} + esutils@2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + etag@1.8.1: resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} engines: {node: '>= 0.6'} @@ -3710,6 +3723,10 @@ packages: get-tsconfig@4.13.0: resolution: {integrity: sha512-1VKTZJCwBrvbd+Wn3AOgQP/2Av+TfTCOlE4AcRJE72W1ksZXbAx8PPBR9RzgTeSPzlPMHrbANMH3LbltH73wxQ==} + get-uri@6.0.5: + resolution: {integrity: sha512-b1O07XYq8eRuVzBNgJLstU6FYc1tS6wnMtF1I1D9lE8LxZSOGZ7LhxN54yPP6mGw5f2CkXY2BQUL9Fx41qvcIg==} + engines: {node: '>= 14'} + getpass@0.1.7: resolution: {integrity: sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==} @@ -3866,6 +3883,10 @@ packages: ini@1.3.8: resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + ip-address@10.1.0: + resolution: {integrity: sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q==} + engines: {node: '>= 12'} + ipaddr.js@1.9.1: resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} engines: {node: '>= 0.10'} @@ -4223,6 +4244,10 @@ packages: resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} engines: {node: '>=10'} + lru-cache@7.18.3: + resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==} + engines: {node: '>=12'} + lru-memoizer@2.3.0: resolution: {integrity: sha512-GXn7gyHAMhO13WSKrIiNfztwxodVsP8IoZ3XfrJV4yH2x0/OeTO/FIaAHTY5YekdGgW94njfuKmyyt1E0mR6Ug==} @@ -4398,6 +4423,10 @@ packages: resolution: {integrity: sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==} engines: {node: '>= 0.6'} + netmask@2.0.2: + resolution: {integrity: sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==} + engines: {node: '>= 0.4.0'} + node-addon-api@8.5.0: resolution: {integrity: sha512-/bRZty2mXUIFY/xU5HLvveNHlswNJej+RnxBjOMkidWfwZzgTbPG1E3K5TOxRLOR+5hX7bSofy8yf1hZevMS8A==} engines: {node: ^18 || ^20 || >= 21} @@ -4598,6 +4627,14 @@ packages: resolution: {integrity: sha512-AxTM2wDGORHGEkPCt8yqxOTMgpfbEHqF51f/5fJCmwFC3C/zNcGT63SymH2ttOAaiIws2zVg4+izQCjrakcwHg==} engines: {node: '>=20'} + pac-proxy-agent@7.2.0: + resolution: {integrity: sha512-TEB8ESquiLMc0lV8vcd5Ql/JAKAoyzHFXaStwjkzpOpC5Yv+pIzLfHvjTSdf3vpa2bMiUQrg9i6276yn8666aA==} + engines: {node: '>= 14'} + + pac-resolver@7.0.1: + resolution: {integrity: sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==} + engines: {node: '>= 14'} + package-json-from-dist@1.0.1: resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} @@ -4781,6 +4818,10 @@ packages: resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} engines: {node: '>= 0.10'} + proxy-agent@6.5.0: + resolution: {integrity: sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A==} + engines: {node: '>= 14'} + proxy-from-env@1.1.0: resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} @@ -5050,6 +5091,18 @@ packages: resolution: {integrity: sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==} engines: {node: '>=18'} + smart-buffer@4.2.0: + resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==} + engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} + + socks-proxy-agent@8.0.5: + resolution: {integrity: sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==} + engines: {node: '>= 14'} + + socks@2.8.7: + resolution: {integrity: sha512-HLpt+uLy/pxB+bum/9DzAgiKS8CX1EvbWxI4zlmgGCExImLdiad2iCwXT5Z4c9c3Eq8rP2318mPW2c+QbtjK8A==} + engines: {node: '>= 10.0.0', npm: '>= 3.0.0'} + sonic-boom@4.2.0: resolution: {integrity: sha512-INb7TM37/mAcsGmc9hyyI6+QR3rR1zVRu36B0NeGXKnOOLiZOfER5SA+N7X7k3yUYRzLWafduTDvJAfDswwEww==} @@ -5323,6 +5376,10 @@ packages: resolution: {integrity: sha512-Heho1hJD81YChi+uS2RkSjcVO+EQLmLSyUlHyp7Y/wFbxQaGb4WXVKD073JytrjXJVkSZVzoE2MCSOKugFGtOQ==} engines: {node: '>=20.18.1'} + undici@7.19.2: + resolution: {integrity: sha512-4VQSpGEGsWzk0VYxyB/wVX/Q7qf9t5znLRgs0dzszr9w9Fej/8RVNQ+S20vdXSAyra/bJ7ZQfGv6ZMj7UEbzSg==} + engines: {node: '>=20.18.1'} + unicode-properties@1.4.1: resolution: {integrity: sha512-CLjCCLQ6UuMxWnbIylkisbRj31qxHPAurvena/0iwSVbQ2G1VY5/HjV0IRabOEbDHlzZlRdCrD4NhB0JtU40Pg==} @@ -5592,7 +5649,7 @@ snapshots: '@aws-crypto/crc32@5.2.0': dependencies: '@aws-crypto/util': 5.2.0 - '@aws-sdk/types': 3.972.0 + '@aws-sdk/types': 3.973.0 tslib: 2.8.1 '@aws-crypto/sha256-browser@5.2.0': @@ -5641,7 +5698,7 @@ snapshots: '@aws-sdk/util-user-agent-browser': 3.972.0 '@aws-sdk/util-user-agent-node': 3.972.0 '@smithy/config-resolver': 4.4.6 - '@smithy/core': 3.21.0 + '@smithy/core': 3.21.1 '@smithy/eventstream-serde-browser': 4.2.8 '@smithy/eventstream-serde-config-resolver': 4.3.8 '@smithy/eventstream-serde-node': 4.2.8 @@ -5649,21 +5706,21 @@ snapshots: '@smithy/hash-node': 4.2.8 '@smithy/invalid-dependency': 4.2.8 '@smithy/middleware-content-length': 4.2.8 - '@smithy/middleware-endpoint': 4.4.10 - '@smithy/middleware-retry': 4.4.26 + '@smithy/middleware-endpoint': 4.4.11 + '@smithy/middleware-retry': 4.4.27 '@smithy/middleware-serde': 4.2.9 '@smithy/middleware-stack': 4.2.8 '@smithy/node-config-provider': 4.3.8 '@smithy/node-http-handler': 4.4.8 '@smithy/protocol-http': 5.3.8 - '@smithy/smithy-client': 4.10.11 + '@smithy/smithy-client': 4.10.12 '@smithy/types': 4.12.0 '@smithy/url-parser': 4.2.8 '@smithy/util-base64': 4.3.0 '@smithy/util-body-length-browser': 4.2.0 '@smithy/util-body-length-node': 4.2.1 - '@smithy/util-defaults-mode-browser': 4.3.25 - '@smithy/util-defaults-mode-node': 4.2.28 + '@smithy/util-defaults-mode-browser': 4.3.26 + '@smithy/util-defaults-mode-node': 4.2.29 '@smithy/util-endpoints': 3.2.8 '@smithy/util-middleware': 4.2.8 '@smithy/util-retry': 4.2.8 @@ -5733,26 +5790,26 @@ snapshots: '@aws-sdk/util-user-agent-browser': 3.972.0 '@aws-sdk/util-user-agent-node': 3.972.0 '@smithy/config-resolver': 4.4.6 - '@smithy/core': 3.21.0 + '@smithy/core': 3.21.1 '@smithy/fetch-http-handler': 5.3.9 '@smithy/hash-node': 4.2.8 '@smithy/invalid-dependency': 4.2.8 '@smithy/middleware-content-length': 4.2.8 - '@smithy/middleware-endpoint': 4.4.10 - '@smithy/middleware-retry': 4.4.26 + '@smithy/middleware-endpoint': 4.4.11 + '@smithy/middleware-retry': 4.4.27 '@smithy/middleware-serde': 4.2.9 '@smithy/middleware-stack': 4.2.8 '@smithy/node-config-provider': 4.3.8 '@smithy/node-http-handler': 4.4.8 '@smithy/protocol-http': 5.3.8 - '@smithy/smithy-client': 4.10.11 + '@smithy/smithy-client': 4.10.12 '@smithy/types': 4.12.0 '@smithy/url-parser': 4.2.8 '@smithy/util-base64': 4.3.0 '@smithy/util-body-length-browser': 4.2.0 '@smithy/util-body-length-node': 4.2.1 - '@smithy/util-defaults-mode-browser': 4.3.25 - '@smithy/util-defaults-mode-node': 4.2.28 + '@smithy/util-defaults-mode-browser': 4.3.26 + '@smithy/util-defaults-mode-node': 4.2.29 '@smithy/util-endpoints': 3.2.8 '@smithy/util-middleware': 4.2.8 '@smithy/util-retry': 4.2.8 @@ -5808,12 +5865,12 @@ snapshots: dependencies: '@aws-sdk/types': 3.972.0 '@aws-sdk/xml-builder': 3.972.0 - '@smithy/core': 3.21.0 + '@smithy/core': 3.21.1 '@smithy/node-config-provider': 4.3.8 '@smithy/property-provider': 4.2.8 '@smithy/protocol-http': 5.3.8 '@smithy/signature-v4': 5.3.8 - '@smithy/smithy-client': 4.10.11 + '@smithy/smithy-client': 4.10.12 '@smithy/types': 4.12.0 '@smithy/util-base64': 4.3.0 '@smithy/util-middleware': 4.2.8 @@ -5860,7 +5917,7 @@ snapshots: '@smithy/node-http-handler': 4.4.8 '@smithy/property-provider': 4.2.8 '@smithy/protocol-http': 5.3.8 - '@smithy/smithy-client': 4.10.11 + '@smithy/smithy-client': 4.10.12 '@smithy/types': 4.12.0 '@smithy/util-stream': 4.5.10 tslib: 2.8.1 @@ -6105,7 +6162,7 @@ snapshots: '@aws-sdk/core': 3.972.0 '@aws-sdk/types': 3.972.0 '@aws-sdk/util-endpoints': 3.972.0 - '@smithy/core': 3.21.0 + '@smithy/core': 3.21.1 '@smithy/protocol-http': 5.3.8 '@smithy/types': 4.12.0 tslib: 2.8.1 @@ -6148,26 +6205,26 @@ snapshots: '@aws-sdk/util-user-agent-browser': 3.972.0 '@aws-sdk/util-user-agent-node': 3.972.0 '@smithy/config-resolver': 4.4.6 - '@smithy/core': 3.21.0 + '@smithy/core': 3.21.1 '@smithy/fetch-http-handler': 5.3.9 '@smithy/hash-node': 4.2.8 '@smithy/invalid-dependency': 4.2.8 '@smithy/middleware-content-length': 4.2.8 - '@smithy/middleware-endpoint': 4.4.10 - '@smithy/middleware-retry': 4.4.26 + '@smithy/middleware-endpoint': 4.4.11 + '@smithy/middleware-retry': 4.4.27 '@smithy/middleware-serde': 4.2.9 '@smithy/middleware-stack': 4.2.8 '@smithy/node-config-provider': 4.3.8 '@smithy/node-http-handler': 4.4.8 '@smithy/protocol-http': 5.3.8 - '@smithy/smithy-client': 4.10.11 + '@smithy/smithy-client': 4.10.12 '@smithy/types': 4.12.0 '@smithy/url-parser': 4.2.8 '@smithy/util-base64': 4.3.0 '@smithy/util-body-length-browser': 4.2.0 '@smithy/util-body-length-node': 4.2.1 - '@smithy/util-defaults-mode-browser': 4.3.25 - '@smithy/util-defaults-mode-node': 4.2.28 + '@smithy/util-defaults-mode-browser': 4.3.26 + '@smithy/util-defaults-mode-node': 4.2.29 '@smithy/util-endpoints': 3.2.8 '@smithy/util-middleware': 4.2.8 '@smithy/util-retry': 4.2.8 @@ -6994,10 +7051,10 @@ snapshots: transitivePeerDependencies: - tailwindcss - '@mariozechner/pi-agent-core@0.49.3(ws@8.19.0)(zod@4.3.6)': + '@mariozechner/pi-agent-core@0.50.7(ws@8.19.0)(zod@4.3.6)': dependencies: - '@mariozechner/pi-ai': 0.49.3(ws@8.19.0)(zod@4.3.6) - '@mariozechner/pi-tui': 0.49.3 + '@mariozechner/pi-ai': 0.50.7(ws@8.19.0)(zod@4.3.6) + '@mariozechner/pi-tui': 0.50.7 transitivePeerDependencies: - '@modelcontextprotocol/sdk' - aws-crt @@ -7007,7 +7064,7 @@ snapshots: - ws - zod - '@mariozechner/pi-ai@0.49.3(ws@8.19.0)(zod@4.3.6)': + '@mariozechner/pi-ai@0.50.7(ws@8.19.0)(zod@4.3.6)': dependencies: '@anthropic-ai/sdk': 0.71.2(zod@4.3.6) '@aws-sdk/client-bedrock-runtime': 3.972.0 @@ -7019,6 +7076,8 @@ snapshots: chalk: 5.6.2 openai: 6.10.0(ws@8.19.0)(zod@4.3.6) partial-json: 0.1.7 + proxy-agent: 6.5.0 + undici: 7.19.2 zod-to-json-schema: 3.25.1(zod@4.3.6) transitivePeerDependencies: - '@modelcontextprotocol/sdk' @@ -7029,19 +7088,20 @@ snapshots: - ws - zod - '@mariozechner/pi-coding-agent@0.49.3(ws@8.19.0)(zod@4.3.6)': + '@mariozechner/pi-coding-agent@0.50.7(ws@8.19.0)(zod@4.3.6)': dependencies: '@mariozechner/clipboard': 0.3.0 '@mariozechner/jiti': 2.6.5 - '@mariozechner/pi-agent-core': 0.49.3(ws@8.19.0)(zod@4.3.6) - '@mariozechner/pi-ai': 0.49.3(ws@8.19.0)(zod@4.3.6) - '@mariozechner/pi-tui': 0.49.3 + '@mariozechner/pi-agent-core': 0.50.7(ws@8.19.0)(zod@4.3.6) + '@mariozechner/pi-ai': 0.50.7(ws@8.19.0)(zod@4.3.6) + '@mariozechner/pi-tui': 0.50.7 '@silvia-odwyer/photon-node': 0.3.4 chalk: 5.6.2 cli-highlight: 2.1.11 diff: 8.0.3 file-type: 21.3.0 glob: 11.1.0 + ignore: 7.0.5 marked: 15.0.12 minimatch: 10.1.1 proper-lockfile: 4.1.2 @@ -7055,7 +7115,7 @@ snapshots: - ws - zod - '@mariozechner/pi-tui@0.49.3': + '@mariozechner/pi-tui@0.50.7': dependencies: '@types/mime-types': 2.1.4 chalk: 5.6.2 @@ -7997,19 +8057,6 @@ snapshots: '@smithy/util-middleware': 4.2.8 tslib: 2.8.1 - '@smithy/core@3.21.0': - dependencies: - '@smithy/middleware-serde': 4.2.9 - '@smithy/protocol-http': 5.3.8 - '@smithy/types': 4.12.0 - '@smithy/util-base64': 4.3.0 - '@smithy/util-body-length-browser': 4.2.0 - '@smithy/util-middleware': 4.2.8 - '@smithy/util-stream': 4.5.10 - '@smithy/util-utf8': 4.2.0 - '@smithy/uuid': 1.1.0 - tslib: 2.8.1 - '@smithy/core@3.21.1': dependencies: '@smithy/middleware-serde': 4.2.9 @@ -8095,17 +8142,6 @@ snapshots: '@smithy/types': 4.12.0 tslib: 2.8.1 - '@smithy/middleware-endpoint@4.4.10': - dependencies: - '@smithy/core': 3.21.0 - '@smithy/middleware-serde': 4.2.9 - '@smithy/node-config-provider': 4.3.8 - '@smithy/shared-ini-file-loader': 4.4.3 - '@smithy/types': 4.12.0 - '@smithy/url-parser': 4.2.8 - '@smithy/util-middleware': 4.2.8 - tslib: 2.8.1 - '@smithy/middleware-endpoint@4.4.11': dependencies: '@smithy/core': 3.21.1 @@ -8117,18 +8153,6 @@ snapshots: '@smithy/util-middleware': 4.2.8 tslib: 2.8.1 - '@smithy/middleware-retry@4.4.26': - dependencies: - '@smithy/node-config-provider': 4.3.8 - '@smithy/protocol-http': 5.3.8 - '@smithy/service-error-classification': 4.2.8 - '@smithy/smithy-client': 4.10.11 - '@smithy/types': 4.12.0 - '@smithy/util-middleware': 4.2.8 - '@smithy/util-retry': 4.2.8 - '@smithy/uuid': 1.1.0 - tslib: 2.8.1 - '@smithy/middleware-retry@4.4.27': dependencies: '@smithy/node-config-provider': 4.3.8 @@ -8208,16 +8232,6 @@ snapshots: '@smithy/util-utf8': 4.2.0 tslib: 2.8.1 - '@smithy/smithy-client@4.10.11': - dependencies: - '@smithy/core': 3.21.0 - '@smithy/middleware-endpoint': 4.4.10 - '@smithy/middleware-stack': 4.2.8 - '@smithy/protocol-http': 5.3.8 - '@smithy/types': 4.12.0 - '@smithy/util-stream': 4.5.10 - tslib: 2.8.1 - '@smithy/smithy-client@4.10.12': dependencies: '@smithy/core': 3.21.1 @@ -8266,13 +8280,6 @@ snapshots: dependencies: tslib: 2.8.1 - '@smithy/util-defaults-mode-browser@4.3.25': - dependencies: - '@smithy/property-provider': 4.2.8 - '@smithy/smithy-client': 4.10.11 - '@smithy/types': 4.12.0 - tslib: 2.8.1 - '@smithy/util-defaults-mode-browser@4.3.26': dependencies: '@smithy/property-provider': 4.2.8 @@ -8280,16 +8287,6 @@ snapshots: '@smithy/types': 4.12.0 tslib: 2.8.1 - '@smithy/util-defaults-mode-node@4.2.28': - dependencies: - '@smithy/config-resolver': 4.4.6 - '@smithy/credential-provider-imds': 4.2.8 - '@smithy/node-config-provider': 4.3.8 - '@smithy/property-provider': 4.2.8 - '@smithy/smithy-client': 4.10.11 - '@smithy/types': 4.12.0 - tslib: 2.8.1 - '@smithy/util-defaults-mode-node@4.2.29': dependencies: '@smithy/config-resolver': 4.4.6 @@ -8376,6 +8373,8 @@ snapshots: '@tokenizer/token@0.3.0': {} + '@tootallnate/quickjs-emscripten@0.23.0': {} + '@twurple/api-call@8.0.3': dependencies: '@d-fischer/shared-utils': 3.6.4 @@ -8887,6 +8886,10 @@ snapshots: assertion-error@2.0.1: {} + ast-types@0.13.4: + dependencies: + tslib: 2.8.1 + ast-v8-to-istanbul@0.3.10: dependencies: '@jridgewell/trace-mapping': 0.3.31 @@ -8948,6 +8951,8 @@ snapshots: dependencies: safe-buffer: 5.1.2 + basic-ftp@5.1.0: {} + bcrypt-pbkdf@1.0.2: dependencies: tweetnacl: 0.14.5 @@ -9244,6 +9249,8 @@ snapshots: data-uri-to-buffer@4.0.1: {} + data-uri-to-buffer@6.0.2: {} + debug@2.6.9: dependencies: ms: 2.0.0 @@ -9257,6 +9264,12 @@ snapshots: deepmerge@4.3.1: {} + degenerator@5.0.1: + dependencies: + ast-types: 0.13.4 + escodegen: 2.1.0 + esprima: 4.0.1 + delayed-stream@1.0.0: {} delegates@1.0.0: @@ -9389,10 +9402,24 @@ snapshots: escape-string-regexp@4.0.0: {} + escodegen@2.1.0: + dependencies: + esprima: 4.0.1 + estraverse: 5.3.0 + esutils: 2.0.3 + optionalDependencies: + source-map: 0.6.1 + + esprima@4.0.1: {} + + estraverse@5.3.0: {} + estree-walker@3.0.3: dependencies: '@types/estree': 1.0.8 + esutils@2.0.3: {} + etag@1.8.1: {} event-target-shim@5.0.1: {} @@ -9676,6 +9703,14 @@ snapshots: dependencies: resolve-pkg-maps: 1.0.0 + get-uri@6.0.5: + dependencies: + basic-ftp: 5.1.0 + data-uri-to-buffer: 6.0.2 + debug: 4.4.3 + transitivePeerDependencies: + - supports-color + getpass@0.1.7: dependencies: assert-plus: 1.0.0 @@ -9846,8 +9881,7 @@ snapshots: ieee754@1.2.1: {} - ignore@7.0.5: - optional: true + ignore@7.0.5: {} immediate@3.0.6: {} @@ -9863,6 +9897,8 @@ snapshots: ini@1.3.8: optional: true + ip-address@10.1.0: {} + ipaddr.js@1.9.1: {} ipull@3.9.3: @@ -10227,6 +10263,8 @@ snapshots: dependencies: yallist: 4.0.0 + lru-cache@7.18.3: {} + lru-memoizer@2.3.0: dependencies: lodash.clonedeep: 4.5.0 @@ -10384,6 +10422,8 @@ snapshots: negotiator@1.0.0: {} + netmask@2.0.2: {} + node-addon-api@8.5.0: optional: true @@ -10640,6 +10680,24 @@ snapshots: p-timeout@7.0.1: {} + pac-proxy-agent@7.2.0: + dependencies: + '@tootallnate/quickjs-emscripten': 0.23.0 + agent-base: 7.1.4 + debug: 4.4.3 + get-uri: 6.0.5 + http-proxy-agent: 7.0.2 + https-proxy-agent: 7.0.6 + pac-resolver: 7.0.1 + socks-proxy-agent: 8.0.5 + transitivePeerDependencies: + - supports-color + + pac-resolver@7.0.1: + dependencies: + degenerator: 5.0.1 + netmask: 2.0.2 + package-json-from-dist@1.0.1: {} pako@0.2.9: {} @@ -10828,6 +10886,19 @@ snapshots: forwarded: 0.2.0 ipaddr.js: 1.9.1 + proxy-agent@6.5.0: + dependencies: + agent-base: 7.1.4 + debug: 4.4.3 + http-proxy-agent: 7.0.2 + https-proxy-agent: 7.0.6 + lru-cache: 7.18.3 + pac-proxy-agent: 7.2.0 + proxy-from-env: 1.1.0 + socks-proxy-agent: 8.0.5 + transitivePeerDependencies: + - supports-color + proxy-from-env@1.1.0: {} psl@1.15.0: @@ -11254,6 +11325,21 @@ snapshots: is-fullwidth-code-point: 5.1.0 optional: true + smart-buffer@4.2.0: {} + + socks-proxy-agent@8.0.5: + dependencies: + agent-base: 7.1.4 + debug: 4.4.3 + socks: 2.8.7 + transitivePeerDependencies: + - supports-color + + socks@2.8.7: + dependencies: + ip-address: 10.1.0 + smart-buffer: 4.2.0 + sonic-boom@4.2.0: dependencies: atomic-sleep: 1.0.0 @@ -11506,6 +11592,8 @@ snapshots: undici@7.19.0: {} + undici@7.19.2: {} + unicode-properties@1.4.1: dependencies: base64-js: 1.5.1 diff --git a/src/agents/context.ts b/src/agents/context.ts index d2559820f..c410709ef 100644 --- a/src/agents/context.ts +++ b/src/agents/context.ts @@ -1,6 +1,8 @@ // Lazy-load pi-coding-agent model metadata so we can infer context windows when // the agent reports a model id. This includes custom models.json entries. +import { join } from "node:path"; + import { loadConfig } from "../config/config.js"; import { resolveOpenClawAgentDir } from "./agent-paths.js"; import { ensureOpenClawModelsJson } from "./models-config.js"; @@ -10,12 +12,12 @@ type ModelEntry = { id: string; contextWindow?: number }; const MODEL_CACHE = new Map(); const loadPromise = (async () => { try { - const { discoverAuthStorage, discoverModels } = await import("@mariozechner/pi-coding-agent"); + const { AuthStorage, ModelRegistry } = await import("@mariozechner/pi-coding-agent"); const cfg = loadConfig(); await ensureOpenClawModelsJson(cfg); const agentDir = resolveOpenClawAgentDir(); - const authStorage = discoverAuthStorage(agentDir); - const modelRegistry = discoverModels(authStorage, agentDir); + const authStorage = new AuthStorage(join(agentDir, "auth.json")); + const modelRegistry = new ModelRegistry(authStorage, join(agentDir, "models.json")); const models = modelRegistry.getAll() as ModelEntry[]; for (const m of models) { if (!m?.id) continue; diff --git a/src/agents/model-catalog.ts b/src/agents/model-catalog.ts index a52a25f87..dc301d89c 100644 --- a/src/agents/model-catalog.ts +++ b/src/agents/model-catalog.ts @@ -64,8 +64,9 @@ export async function loadModelCatalog(params?: { // will keep failing until restart). const piSdk = await importPiSdk(); const agentDir = resolveOpenClawAgentDir(); - const authStorage = piSdk.discoverAuthStorage(agentDir); - const registry = piSdk.discoverModels(authStorage, agentDir) as + const { join } = await import("node:path"); + const authStorage = new piSdk.AuthStorage(join(agentDir, "auth.json")); + const registry = new piSdk.ModelRegistry(authStorage, join(agentDir, "models.json")) as | { getAll: () => Array; } diff --git a/src/agents/pi-embedded-runner/compact.ts b/src/agents/pi-embedded-runner/compact.ts index 2dc4c5325..fafb02af6 100644 --- a/src/agents/pi-embedded-runner/compact.ts +++ b/src/agents/pi-embedded-runner/compact.ts @@ -3,6 +3,7 @@ import os from "node:os"; import { createAgentSession, + DefaultResourceLoader, estimateTokens, SessionManager, SettingsManager, @@ -383,6 +384,17 @@ export async function compactEmbeddedPiSessionDirect( sandboxEnabled: !!sandbox?.enabled, }); + const resourceLoader = new DefaultResourceLoader({ + cwd: resolvedWorkspace, + agentDir, + settingsManager, + additionalExtensionPaths, + noSkills: true, + systemPromptOverride: () => systemPrompt(""), + agentsFilesOverride: () => ({ agentsFiles: [] }), + }); + await resourceLoader.reload(); + let session: Awaited>["session"]; ({ session } = await createAgentSession({ cwd: resolvedWorkspace, @@ -391,14 +403,11 @@ export async function compactEmbeddedPiSessionDirect( modelRegistry, model, thinkingLevel: mapThinkingLevel(params.thinkLevel), - systemPrompt, tools: builtInTools, customTools, sessionManager, settingsManager, - skills: [], - contextFiles: [], - additionalExtensionPaths, + resourceLoader, })); try { diff --git a/src/agents/pi-embedded-runner/model.ts b/src/agents/pi-embedded-runner/model.ts index 9dd94cd43..8988bd4c5 100644 --- a/src/agents/pi-embedded-runner/model.ts +++ b/src/agents/pi-embedded-runner/model.ts @@ -1,5 +1,7 @@ +import { join } from "node:path"; + import type { Api, Model } from "@mariozechner/pi-ai"; -import { discoverAuthStorage, discoverModels } from "@mariozechner/pi-coding-agent"; +import { AuthStorage, ModelRegistry } from "@mariozechner/pi-coding-agent"; import type { OpenClawConfig } from "../../config/config.js"; import type { ModelDefinitionConfig } from "../../config/types.js"; @@ -53,12 +55,12 @@ export function resolveModel( ): { model?: Model; error?: string; - authStorage: ReturnType; - modelRegistry: ReturnType; + authStorage: AuthStorage; + modelRegistry: ModelRegistry; } { const resolvedAgentDir = agentDir ?? resolveOpenClawAgentDir(); - const authStorage = discoverAuthStorage(resolvedAgentDir); - const modelRegistry = discoverModels(authStorage, resolvedAgentDir); + const authStorage = new AuthStorage(join(resolvedAgentDir, "auth.json")); + const modelRegistry = new ModelRegistry(authStorage, join(resolvedAgentDir, "models.json")); const model = modelRegistry.find(provider, modelId) as Model | null; if (!model) { const providers = cfg?.models?.providers ?? {}; diff --git a/src/agents/pi-embedded-runner/run/attempt.ts b/src/agents/pi-embedded-runner/run/attempt.ts index e83c3ae4a..e2b26bcd8 100644 --- a/src/agents/pi-embedded-runner/run/attempt.ts +++ b/src/agents/pi-embedded-runner/run/attempt.ts @@ -4,7 +4,12 @@ import os from "node:os"; import type { AgentMessage } from "@mariozechner/pi-agent-core"; import type { AssistantMessage, ImageContent } from "@mariozechner/pi-ai"; import { streamSimple } from "@mariozechner/pi-ai"; -import { createAgentSession, SessionManager, SettingsManager } from "@mariozechner/pi-coding-agent"; +import { + createAgentSession, + DefaultResourceLoader, + SessionManager, + SettingsManager, +} from "@mariozechner/pi-coding-agent"; import { resolveHeartbeatPrompt } from "../../../auto-reply/heartbeat.js"; import { @@ -447,6 +452,17 @@ export async function runEmbeddedAttempt( const allCustomTools = [...customTools, ...clientToolDefs]; + const resourceLoader = new DefaultResourceLoader({ + cwd: resolvedWorkspace, + agentDir, + settingsManager, + additionalExtensionPaths, + noSkills: true, + systemPromptOverride: () => systemPrompt(""), + agentsFilesOverride: () => ({ agentsFiles: [] }), + }); + await resourceLoader.reload(); + ({ session } = await createAgentSession({ cwd: resolvedWorkspace, agentDir, @@ -454,14 +470,11 @@ export async function runEmbeddedAttempt( modelRegistry: params.modelRegistry, model: params.model, thinkingLevel: mapThinkingLevel(params.thinkLevel), - systemPrompt, tools: builtInTools, customTools: allCustomTools, sessionManager, settingsManager, - skills: [], - contextFiles: [], - additionalExtensionPaths, + resourceLoader, })); if (!session) { throw new Error("Embedded agent session missing"); diff --git a/src/agents/pi-embedded-runner/run/types.ts b/src/agents/pi-embedded-runner/run/types.ts index ffef0fb8a..c32149dce 100644 --- a/src/agents/pi-embedded-runner/run/types.ts +++ b/src/agents/pi-embedded-runner/run/types.ts @@ -1,6 +1,6 @@ import type { AgentMessage } from "@mariozechner/pi-agent-core"; import type { Api, AssistantMessage, ImageContent, Model } from "@mariozechner/pi-ai"; -import type { discoverAuthStorage, discoverModels } from "@mariozechner/pi-coding-agent"; +import type { AuthStorage, ModelRegistry } from "@mariozechner/pi-coding-agent"; import type { ReasoningLevel, ThinkLevel, VerboseLevel } from "../../../auto-reply/thinking.js"; import type { OpenClawConfig } from "../../../config/config.js"; @@ -12,9 +12,6 @@ import type { SkillSnapshot } from "../../skills.js"; import type { SessionSystemPromptReport } from "../../../config/sessions/types.js"; import type { ClientToolDefinition } from "./params.js"; -type AuthStorage = ReturnType; -type ModelRegistry = ReturnType; - export type EmbeddedRunAttemptParams = { sessionId: string; sessionKey?: string; diff --git a/src/agents/tools/image-tool.ts b/src/agents/tools/image-tool.ts index 2f7b0fec7..57569d4d0 100644 --- a/src/agents/tools/image-tool.ts +++ b/src/agents/tools/image-tool.ts @@ -8,7 +8,7 @@ import { complete, type Model, } from "@mariozechner/pi-ai"; -import { discoverAuthStorage, discoverModels } from "@mariozechner/pi-coding-agent"; +import { AuthStorage, ModelRegistry } from "@mariozechner/pi-coding-agent"; import { Type } from "@sinclair/typebox"; import type { OpenClawConfig } from "../../config/config.js"; @@ -233,8 +233,8 @@ async function runImagePrompt(params: { : undefined; await ensureOpenClawModelsJson(effectiveCfg, params.agentDir); - const authStorage = discoverAuthStorage(params.agentDir); - const modelRegistry = discoverModels(authStorage, params.agentDir); + const authStorage = new AuthStorage(path.join(params.agentDir, "auth.json")); + const modelRegistry = new ModelRegistry(authStorage, path.join(params.agentDir, "models.json")); const result = await runWithImageModelFallback({ cfg: effectiveCfg, diff --git a/src/commands/auth-choice.apply.oauth.ts b/src/commands/auth-choice.apply.oauth.ts index 9e618e4c5..fe0395790 100644 --- a/src/commands/auth-choice.apply.oauth.ts +++ b/src/commands/auth-choice.apply.oauth.ts @@ -68,7 +68,9 @@ export async function applyAuthChoiceOAuth( }); spin.stop("Chutes OAuth complete"); - const email = creds.email?.trim() || "default"; + const email = + (typeof creds.email === "string" ? creds.email.trim() : String(creds.email ?? "").trim()) || + "default"; const profileId = `chutes:${email}`; await writeOAuthCredentials("chutes", creds, params.agentDir); diff --git a/src/commands/models/list.registry.ts b/src/commands/models/list.registry.ts index 76fba9b84..2ceb8b7e5 100644 --- a/src/commands/models/list.registry.ts +++ b/src/commands/models/list.registry.ts @@ -1,5 +1,7 @@ +import { join } from "node:path"; + import type { Api, Model } from "@mariozechner/pi-ai"; -import { discoverAuthStorage, discoverModels } from "@mariozechner/pi-coding-agent"; +import { AuthStorage, ModelRegistry } from "@mariozechner/pi-coding-agent"; import { resolveOpenClawAgentDir } from "../../agents/agent-paths.js"; import type { AuthProfileStore } from "../../agents/auth-profiles.js"; @@ -41,8 +43,8 @@ const hasAuthForProvider = (provider: string, cfg: OpenClawConfig, authStore: Au export async function loadModelRegistry(cfg: OpenClawConfig) { await ensureOpenClawModelsJson(cfg); const agentDir = resolveOpenClawAgentDir(); - const authStorage = discoverAuthStorage(agentDir); - const registry = discoverModels(authStorage, agentDir); + const authStorage = new AuthStorage(join(agentDir, "auth.json")); + const registry = new ModelRegistry(authStorage, join(agentDir, "models.json")); const models = registry.getAll() as Model[]; const availableModels = registry.getAvailable() as Model[]; const availableKeys = new Set(availableModels.map((model) => modelKey(model.provider, model.id))); diff --git a/src/gateway/test-helpers.mocks.ts b/src/gateway/test-helpers.mocks.ts index 15127ef31..5ce6b9610 100644 --- a/src/gateway/test-helpers.mocks.ts +++ b/src/gateway/test-helpers.mocks.ts @@ -232,15 +232,20 @@ vi.mock("@mariozechner/pi-coding-agent", async () => { "@mariozechner/pi-coding-agent", ); - return { - ...actual, - discoverModels: (...args: unknown[]) => { + class MockModelRegistry extends actual.ModelRegistry { + override getAll(): ReturnType { if (!piSdkMock.enabled) { - return (actual.discoverModels as (...args: unknown[]) => unknown)(...args); + return super.getAll(); } piSdkMock.discoverCalls += 1; - return piSdkMock.models; - }, + // Cast to expected type for testing purposes + return piSdkMock.models as ReturnType; + } + } + + return { + ...actual, + ModelRegistry: MockModelRegistry, }; }); diff --git a/src/media-understanding/providers/image.ts b/src/media-understanding/providers/image.ts index d996c7583..e3557583d 100644 --- a/src/media-understanding/providers/image.ts +++ b/src/media-understanding/providers/image.ts @@ -1,6 +1,8 @@ +import { join } from "node:path"; + import type { Api, AssistantMessage, Context, Model } from "@mariozechner/pi-ai"; import { complete } from "@mariozechner/pi-ai"; -import { discoverAuthStorage, discoverModels } from "@mariozechner/pi-coding-agent"; +import { AuthStorage, ModelRegistry } from "@mariozechner/pi-coding-agent"; import { getApiKeyForModel, requireApiKey } from "../../agents/model-auth.js"; import { ensureOpenClawModelsJson } from "../../agents/models-config.js"; @@ -12,8 +14,8 @@ export async function describeImageWithModel( params: ImageDescriptionRequest, ): Promise { await ensureOpenClawModelsJson(params.cfg, params.agentDir); - const authStorage = discoverAuthStorage(params.agentDir); - const modelRegistry = discoverModels(authStorage, params.agentDir); + const authStorage = new AuthStorage(join(params.agentDir, "auth.json")); + const modelRegistry = new ModelRegistry(authStorage, join(params.agentDir, "models.json")); const model = modelRegistry.find(params.provider, params.model) as Model | null; if (!model) { throw new Error(`Unknown model: ${params.provider}/${params.model}`);