@themoltnet/pi-extension 0.40.24 → 0.40.26

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.
Files changed (2) hide show
  1. package/dist/index.js +15 -8
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -252,7 +252,7 @@ function moltnetExtension(pi) {
252
252
  moltnetAgent = await connect({ configDir: managed.agentDir });
253
253
  diaryId = managed.credentials.agentEnv.MOLTNET_DIARY_ID ?? null;
254
254
  teamId = managed.credentials.agentEnv.MOLTNET_TEAM_ID ?? null;
255
- hostExecBaseEnv = new Set([...HOST_EXEC_DEFAULT_BASE_ENV, ...Object.keys(managed.credentials.agentEnv)]);
255
+ hostExecBaseEnv = /* @__PURE__ */ new Set([...HOST_EXEC_DEFAULT_BASE_ENV, ...Object.keys(managed.credentials.agentEnv)]);
256
256
  vm = managed.vm;
257
257
  guestWorkspace = managed.guestWorkspace;
258
258
  const label = worktreePath ? `${mountPath} → ${guestWorkspace}` : `${localCwd} → ${guestWorkspace}`;
@@ -310,44 +310,51 @@ function moltnetExtension(pi) {
310
310
  pi.registerTool({
311
311
  ...localRead,
312
312
  async execute(id, params, signal, onUpdate, ctx) {
313
- return createReadTool(localCwd, { operations: createGondolinReadOps(await ensureVm(ctx), localCwd, guestWorkspace) }).execute(id, params, signal, onUpdate);
313
+ const activeVm = await ensureVm(ctx);
314
+ return createReadTool(localCwd, { operations: createGondolinReadOps(activeVm, localCwd, guestWorkspace) }).execute(id, params, signal, onUpdate);
314
315
  }
315
316
  });
316
317
  pi.registerTool({
317
318
  ...localWrite,
318
319
  async execute(id, params, signal, onUpdate, ctx) {
319
- return createWriteTool(localCwd, { operations: createGondolinWriteOps(await ensureVm(ctx), localCwd, guestWorkspace) }).execute(id, params, signal, onUpdate);
320
+ const activeVm = await ensureVm(ctx);
321
+ return createWriteTool(localCwd, { operations: createGondolinWriteOps(activeVm, localCwd, guestWorkspace) }).execute(id, params, signal, onUpdate);
320
322
  }
321
323
  });
322
324
  pi.registerTool({
323
325
  ...localEdit,
324
326
  async execute(id, params, signal, onUpdate, ctx) {
325
- return createEditTool(localCwd, { operations: createGondolinEditOps(await ensureVm(ctx), localCwd, guestWorkspace) }).execute(id, params, signal, onUpdate);
327
+ const activeVm = await ensureVm(ctx);
328
+ return createEditTool(localCwd, { operations: createGondolinEditOps(activeVm, localCwd, guestWorkspace) }).execute(id, params, signal, onUpdate);
326
329
  }
327
330
  });
328
331
  pi.registerTool({
329
332
  ...localBash,
330
333
  label: "bash (sandbox)",
331
334
  async execute(id, params, signal, onUpdate, ctx) {
332
- return createBashTool(localCwd, { operations: createSandboxBashOperations(await ensureVm(ctx), ctx) }).execute(id, params, signal, onUpdate);
335
+ const activeVm = await ensureVm(ctx);
336
+ return createBashTool(localCwd, { operations: createSandboxBashOperations(activeVm, ctx) }).execute(id, params, signal, onUpdate);
333
337
  }
334
338
  });
335
339
  pi.registerTool({
336
340
  ...localLs,
337
341
  async execute(id, params, signal, onUpdate, ctx) {
338
- return createLsTool(localCwd, { operations: createGondolinLsOps(await ensureVm(ctx), localCwd, guestWorkspace) }).execute(id, params, signal, onUpdate);
342
+ const activeVm = await ensureVm(ctx);
343
+ return createLsTool(localCwd, { operations: createGondolinLsOps(activeVm, localCwd, guestWorkspace) }).execute(id, params, signal, onUpdate);
339
344
  }
340
345
  });
341
346
  pi.registerTool({
342
347
  ...localFind,
343
348
  async execute(id, params, signal, onUpdate, ctx) {
344
- return createFindTool(localCwd, { operations: createGondolinFindOps(await ensureVm(ctx), localCwd, guestWorkspace) }).execute(id, params, signal, onUpdate);
349
+ const activeVm = await ensureVm(ctx);
350
+ return createFindTool(localCwd, { operations: createGondolinFindOps(activeVm, localCwd, guestWorkspace) }).execute(id, params, signal, onUpdate);
345
351
  }
346
352
  });
347
353
  pi.registerTool({
348
354
  ...localGrep,
349
355
  async execute(_id, params, signal, _onUpdate, ctx) {
350
- return executeGondolinGrep(await ensureVm(ctx), localCwd, guestWorkspace, params, signal);
356
+ const activeVm = await ensureVm(ctx);
357
+ return executeGondolinGrep(activeVm, localCwd, guestWorkspace, params, signal);
351
358
  }
352
359
  });
353
360
  pi.on("user_bash", async (_event, ctx) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@themoltnet/pi-extension",
3
- "version": "0.40.24",
3
+ "version": "0.40.26",
4
4
  "type": "module",
5
5
  "description": "MoltNet pi extension — sandboxed tool execution in Gondolin VMs with MoltNet identity and persistent memory",
6
6
  "keywords": [
@@ -35,8 +35,8 @@
35
35
  "dependencies": {
36
36
  "@earendil-works/gondolin": "^0.12.0",
37
37
  "@themoltnet/os-keyring": "0.4.0",
38
- "@themoltnet/pi-runtime": "0.21.1",
39
- "@themoltnet/sdk": "0.149.0"
38
+ "@themoltnet/pi-runtime": "0.22.0",
39
+ "@themoltnet/sdk": "0.149.1"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@earendil-works/pi-ai": "0.87.1",