@lakitu/sdk 0.1.21 → 0.1.23
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../cli/commands/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAcH,UAAU,YAAY;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../cli/commands/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAcH,UAAU,YAAY;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAyTD,wBAAsB,KAAK,CAAC,OAAO,EAAE,YAAY,iBAoBhD"}
|
|
@@ -171,25 +171,25 @@ const baseTemplate = Template()
|
|
|
171
171
|
LOCAL_CONVEX_URL: "http://localhost:3210",
|
|
172
172
|
});
|
|
173
173
|
// Custom template: Add Lakitu code + PRE-BUILT Convex state + AUTO-START backend
|
|
174
|
+
// Uses tar files to bypass E2B's extraction issues with directory COPY
|
|
174
175
|
function customTemplate(baseId, buildDir, hasProjectKsa) {
|
|
175
|
-
const chownDirs = hasProjectKsa
|
|
176
|
-
? '/home/user/lakitu /home/user/start.sh /home/user/.convex /home/user/project-ksa'
|
|
177
|
-
: '/home/user/lakitu /home/user/start.sh /home/user/.convex';
|
|
178
176
|
const copyKsaCmd = hasProjectKsa
|
|
179
|
-
? 'cp -r /home/user/project-ksa/*.ts /home/user/lakitu/ksa/ && '
|
|
177
|
+
? 'tar -xzf /tmp/project-ksa.tar.gz -C /home/user && cp -r /home/user/project-ksa/*.ts /home/user/lakitu/ksa/ && '
|
|
180
178
|
: '';
|
|
181
|
-
|
|
179
|
+
return Template()
|
|
182
180
|
.fromTemplate(baseId)
|
|
183
|
-
|
|
184
|
-
.copy(`${buildDir}/
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
:
|
|
188
|
-
|
|
189
|
-
.copy(`${buildDir}/convex-state`, "/home/user/.convex/convex-backend-state/lakitu")
|
|
181
|
+
// Copy tar archives instead of directories
|
|
182
|
+
.copy(`${buildDir}/lakitu.tar.gz`, "/tmp/lakitu.tar.gz")
|
|
183
|
+
.copy(`${buildDir}/start.sh`, "/home/user/start.sh")
|
|
184
|
+
.copy(`${buildDir}/convex-state.tar.gz`, "/tmp/convex-state.tar.gz")
|
|
185
|
+
.copy(hasProjectKsa ? `${buildDir}/project-ksa.tar.gz` : `${buildDir}/start.sh`, hasProjectKsa ? "/tmp/project-ksa.tar.gz" : "/tmp/dummy.sh")
|
|
186
|
+
// Extract tars and set up
|
|
190
187
|
.runCmd(`
|
|
191
|
-
|
|
192
|
-
|
|
188
|
+
cd /home/user && tar -xzf /tmp/lakitu.tar.gz && \
|
|
189
|
+
mkdir -p /home/user/.convex/convex-backend-state && \
|
|
190
|
+
tar -xzf /tmp/convex-state.tar.gz -C /home/user/.convex/convex-backend-state && \
|
|
191
|
+
mv /home/user/.convex/convex-backend-state/convex-state /home/user/.convex/convex-backend-state/lakitu && \
|
|
192
|
+
${copyKsaCmd}chmod +x /home/user/start.sh && \
|
|
193
193
|
export HOME=/home/user && \
|
|
194
194
|
export PATH="/home/user/.bun/bin:/usr/local/bin:/usr/bin:/bin" && \
|
|
195
195
|
cd /home/user/lakitu && bun install && \
|
|
@@ -197,8 +197,9 @@ function customTemplate(baseId, buildDir, hasProjectKsa) {
|
|
|
197
197
|
sudo chmod +x /usr/local/bin/generate-pdf && \
|
|
198
198
|
echo '#!/bin/bash\\nbun run /home/user/lakitu/runtime/browser/agent-browser-cli.ts "$@"' | sudo tee /usr/local/bin/agent-browser && \
|
|
199
199
|
sudo chmod +x /usr/local/bin/agent-browser && \
|
|
200
|
-
|
|
201
|
-
chown -R user:user /home/user/lakitu/ksa && \
|
|
200
|
+
ln -sf /home/user/lakitu/ksa /home/user/ksa && \
|
|
201
|
+
chown -R user:user /home/user/lakitu /home/user/ksa /home/user/.convex && \
|
|
202
|
+
rm /tmp/*.tar.gz /tmp/dummy.sh 2>/dev/null || true && \
|
|
202
203
|
echo "KSA modules:" && ls /home/user/lakitu/ksa/*.ts 2>/dev/null | head -20
|
|
203
204
|
`)
|
|
204
205
|
.setEnvs({
|
|
@@ -270,6 +271,13 @@ async function buildCustom(apiKey, baseId) {
|
|
|
270
271
|
writeFileSync(join(buildDir, "lakitu/.build-timestamp"), Date.now().toString());
|
|
271
272
|
// Copy pre-built Convex state
|
|
272
273
|
cpSync(stateDir, join(buildDir, "convex-state"), { recursive: true });
|
|
274
|
+
// Create tar archives to bypass E2B's extraction issues
|
|
275
|
+
console.log(" Creating tar archives...");
|
|
276
|
+
execSync(`cd ${buildDir} && tar -czf lakitu.tar.gz lakitu`, { stdio: "pipe" });
|
|
277
|
+
execSync(`cd ${buildDir} && tar -czf convex-state.tar.gz convex-state`, { stdio: "pipe" });
|
|
278
|
+
if (hasProjectKsa) {
|
|
279
|
+
execSync(`cd ${buildDir} && tar -czf project-ksa.tar.gz project-ksa`, { stdio: "pipe" });
|
|
280
|
+
}
|
|
273
281
|
console.log(" ✓ Build context ready\n");
|
|
274
282
|
// Step 3: Build E2B template with pre-built state
|
|
275
283
|
console.log(`🔧 Building Lakitu custom template on ${baseId}...\n`);
|
package/dist/cli/index.d.ts
CHANGED
package/dist/cli/index.js
CHANGED