noumen 0.4.0 → 0.6.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.
Files changed (73) hide show
  1. package/README.md +63 -8
  2. package/dist/a2a/index.d.ts +6 -4
  3. package/dist/acp/index.d.ts +7 -5
  4. package/dist/{agent-1nFVUP9E.d.ts → agent-DWE4_P5X.d.ts} +169 -485
  5. package/dist/{cache-DsRqxx6v.d.ts → cache-BlBwXXPS.d.ts} +1 -1
  6. package/dist/{chunk-4HW6LN6D.js → chunk-6MMYCGJQ.js} +366 -1227
  7. package/dist/chunk-6MMYCGJQ.js.map +1 -0
  8. package/dist/{chunk-5JN4SPI7.js → chunk-7IQCQI2G.js} +1 -1
  9. package/dist/{chunk-L3L3FG5T.js → chunk-CCM2AXZG.js} +1 -1
  10. package/dist/{chunk-L3L3FG5T.js.map → chunk-CCM2AXZG.js.map} +1 -1
  11. package/dist/{chunk-CS6WNDCF.js → chunk-I3JTUFPK.js} +2 -2
  12. package/dist/chunk-I3JTUFPK.js.map +1 -0
  13. package/dist/chunk-I5SBSOS6.js +40 -0
  14. package/dist/chunk-I5SBSOS6.js.map +1 -0
  15. package/dist/{chunk-HL6JCRZJ.js → chunk-XZN4QZLK.js} +4 -4
  16. package/dist/{chunk-EKOGVTBT.js → chunk-ZXSDKBYB.js} +4 -2
  17. package/dist/chunk-ZXSDKBYB.js.map +1 -0
  18. package/dist/cli/index.js +11 -11
  19. package/dist/client/index.d.ts +1 -1
  20. package/dist/computer-BPdxSo6X.d.ts +88 -0
  21. package/dist/docker.d.ts +129 -0
  22. package/dist/docker.js +401 -0
  23. package/dist/docker.js.map +1 -0
  24. package/dist/e2b.d.ts +157 -0
  25. package/dist/e2b.js +202 -0
  26. package/dist/e2b.js.map +1 -0
  27. package/dist/freestyle.d.ts +174 -0
  28. package/dist/freestyle.js +240 -0
  29. package/dist/freestyle.js.map +1 -0
  30. package/dist/index.d.ts +19 -204
  31. package/dist/index.js +38 -48
  32. package/dist/lsp/index.d.ts +4 -3
  33. package/dist/mcp/index.d.ts +5 -4
  34. package/dist/mcp/index.js +2 -2
  35. package/dist/{provider-factory-KCLIF34X.js → provider-factory-TUHU3DIG.js} +2 -2
  36. package/dist/providers/anthropic.d.ts +3 -3
  37. package/dist/providers/anthropic.js +4 -3
  38. package/dist/providers/anthropic.js.map +1 -1
  39. package/dist/providers/bedrock.d.ts +3 -3
  40. package/dist/providers/bedrock.js +2 -2
  41. package/dist/providers/bedrock.js.map +1 -1
  42. package/dist/providers/gemini.d.ts +2 -2
  43. package/dist/providers/gemini.js +1 -1
  44. package/dist/providers/gemini.js.map +1 -1
  45. package/dist/providers/ollama.d.ts +1 -1
  46. package/dist/providers/ollama.js +2 -2
  47. package/dist/providers/openai.d.ts +2 -2
  48. package/dist/providers/openai.js +2 -2
  49. package/dist/providers/openrouter.d.ts +1 -1
  50. package/dist/providers/openrouter.js +2 -2
  51. package/dist/providers/vertex.d.ts +3 -3
  52. package/dist/providers/vertex.js +4 -3
  53. package/dist/providers/vertex.js.map +1 -1
  54. package/dist/{resolve-4JA2BBDA.js → resolve-6KUZNEYW.js} +2 -2
  55. package/dist/sandbox-9qeMTNrD.d.ts +126 -0
  56. package/dist/server/index.d.ts +6 -4
  57. package/dist/{server-CHMxuWKq.d.ts → server-BzNGKTP6.d.ts} +1 -1
  58. package/dist/sprites.d.ts +136 -0
  59. package/dist/sprites.js +334 -0
  60. package/dist/sprites.js.map +1 -0
  61. package/dist/ssh.d.ts +187 -0
  62. package/dist/ssh.js +392 -0
  63. package/dist/ssh.js.map +1 -0
  64. package/dist/{types-RPKUTu1k.d.ts → types-DhXwOQwD.d.ts} +3 -89
  65. package/dist/{types-LrU4LRmX.d.ts → types-kiGBF35b.d.ts} +40 -2
  66. package/package.json +25 -1
  67. package/dist/chunk-4HW6LN6D.js.map +0 -1
  68. package/dist/chunk-CS6WNDCF.js.map +0 -1
  69. package/dist/chunk-EKOGVTBT.js.map +0 -1
  70. /package/dist/{chunk-5JN4SPI7.js.map → chunk-7IQCQI2G.js.map} +0 -0
  71. /package/dist/{chunk-HL6JCRZJ.js.map → chunk-XZN4QZLK.js.map} +0 -0
  72. /package/dist/{provider-factory-KCLIF34X.js.map → provider-factory-TUHU3DIG.js.map} +0 -0
  73. /package/dist/{resolve-4JA2BBDA.js.map → resolve-6KUZNEYW.js.map} +0 -0
package/README.md CHANGED
@@ -375,6 +375,17 @@ The CLI auto-detects a running Ollama server when no cloud API keys are set, so
375
375
 
376
376
  A `Sandbox` bundles a `VirtualFs` (filesystem) and `VirtualComputer` (shell execution) into one object. Every file read/write and shell command the agent executes goes through these interfaces — swap the sandbox to control what the agent can access.
377
377
 
378
+ Local factories live on the root barrel; each remote backend ships on its own subpath so its optional peer dep only enters the module graph when you opt in:
379
+
380
+ | Factory | Import | Peer dep |
381
+ | --- | --- | --- |
382
+ | `LocalSandbox`, `UnsandboxedLocal` | `noumen` | `@anthropic-ai/sandbox-runtime` (bundled) |
383
+ | `SpritesSandbox` | `noumen/sprites` | — |
384
+ | `DockerSandbox` | `noumen/docker` | `dockerode` |
385
+ | `E2BSandbox` | `noumen/e2b` | `e2b` |
386
+ | `FreestyleSandbox` | `noumen/freestyle` | `freestyle-sandboxes` |
387
+ | `SshSandbox` | `noumen/ssh` | `ssh2` |
388
+
378
389
  ### Local — OS-level sandboxing
379
390
 
380
391
  Backed by `@anthropic-ai/sandbox-runtime`. Uses macOS Seatbelt or Linux bubblewrap to restrict filesystem and network access at the OS level — no containers needed:
@@ -417,7 +428,7 @@ Run inside a remote [sprites.dev](https://docs.sprites.dev) container. The agent
417
428
  **Auto-create** — omit `spriteName` and the sprite is provisioned on first use. The sandbox ID is persisted so sessions can reconnect on resume. `Agent.close()` tears the sprite down automatically:
418
429
 
419
430
  ```typescript
420
- import { SpritesSandbox } from "noumen";
431
+ import { SpritesSandbox } from "noumen/sprites";
421
432
 
422
433
  const sandbox = SpritesSandbox({ token: process.env.SPRITE_TOKEN });
423
434
  ```
@@ -442,7 +453,7 @@ pnpm add dockerode
442
453
  **Auto-create** — pass `image` instead of `container` and the container is created and started on first use. `Agent.close()` stops and removes it:
443
454
 
444
455
  ```typescript
445
- import { DockerSandbox } from "noumen";
456
+ import { DockerSandbox } from "noumen/docker";
446
457
 
447
458
  const sandbox = DockerSandbox({ image: "node:22", cwd: "/workspace" });
448
459
  const agent = new Agent({ provider, sandbox });
@@ -455,7 +466,7 @@ await agent.close();
455
466
 
456
467
  ```typescript
457
468
  import Docker from "dockerode";
458
- import { DockerSandbox } from "noumen";
469
+ import { DockerSandbox } from "noumen/docker";
459
470
 
460
471
  const docker = new Docker();
461
472
  const container = await docker.createContainer({
@@ -483,7 +494,7 @@ pnpm add e2b
483
494
  **Auto-create** — omit `sandbox` and the E2B sandbox is provisioned on first use via the `e2b` SDK. `Agent.close()` kills it:
484
495
 
485
496
  ```typescript
486
- import { E2BSandbox } from "noumen";
497
+ import { E2BSandbox } from "noumen/e2b";
487
498
 
488
499
  const sandbox = E2BSandbox({ template: "base" });
489
500
  const agent = new Agent({ provider, sandbox });
@@ -495,7 +506,7 @@ await agent.close(); // kills the E2B sandbox
495
506
 
496
507
  ```typescript
497
508
  import { Sandbox as E2BSandboxSDK } from "e2b";
498
- import { E2BSandbox } from "noumen";
509
+ import { E2BSandbox } from "noumen/e2b";
499
510
 
500
511
  const e2b = await E2BSandboxSDK.create();
501
512
 
@@ -520,7 +531,7 @@ pnpm add freestyle-sandboxes
520
531
  **Auto-create** — omit `vm` and a Freestyle VM is provisioned on first use. `Agent.close()` **suspends** (not deletes) the VM so it can resume instantly later:
521
532
 
522
533
  ```typescript
523
- import { FreestyleSandbox } from "noumen";
534
+ import { FreestyleSandbox } from "noumen/freestyle";
524
535
 
525
536
  const sandbox = FreestyleSandbox({ cwd: "/workspace" });
526
537
  const agent = new Agent({ provider, sandbox });
@@ -541,7 +552,7 @@ const sandbox = FreestyleSandbox({
541
552
 
542
553
  ```typescript
543
554
  import { freestyle } from "freestyle-sandboxes";
544
- import { FreestyleSandbox } from "noumen";
555
+ import { FreestyleSandbox } from "noumen/freestyle";
545
556
 
546
557
  const { vm } = await freestyle.vms.create({ workdir: "/workspace" });
547
558
 
@@ -549,9 +560,53 @@ const sandbox = FreestyleSandbox({ vm, cwd: "/workspace" });
549
560
  const agent = new Agent({ provider, sandbox });
550
561
  ```
551
562
 
563
+ ### SSH — remote hosts
564
+
565
+ Connect to any remote machine over SSH. Uses `ssh2` for command execution (exec channels) and file I/O (SFTP):
566
+
567
+ ```bash
568
+ pnpm add ssh2
569
+ ```
570
+
571
+ **Auto-connect** — provide credentials and the connection is established lazily on `init()`:
572
+
573
+ ```typescript
574
+ import { Agent } from "noumen";
575
+ import { SshSandbox } from "noumen/ssh";
576
+ import fs from "node:fs";
577
+
578
+ const agent = new Agent({
579
+ provider,
580
+ sandbox: SshSandbox({
581
+ host: "dev.example.com",
582
+ username: "deploy",
583
+ privateKey: fs.readFileSync("/home/deploy/.ssh/id_ed25519"),
584
+ cwd: "/home/deploy/project",
585
+ }),
586
+ });
587
+ ```
588
+
589
+ Password auth is also supported — pass `password` instead of `privateKey`.
590
+
591
+ **Explicit** — pass a pre-connected ssh2 Client. The caller owns its lifecycle:
592
+
593
+ ```typescript
594
+ import { Client } from "ssh2";
595
+ import { SshSandbox } from "noumen/ssh";
596
+
597
+ const client = new Client();
598
+ await new Promise<void>((resolve) => {
599
+ client.on("ready", resolve);
600
+ client.connect({ host: "10.0.0.5", username: "root", privateKey: key });
601
+ });
602
+
603
+ const sandbox = SshSandbox({ client, cwd: "/workspace" });
604
+ const agent = new Agent({ provider, sandbox });
605
+ ```
606
+
552
607
  ### Sandbox auto-creation lifecycle
553
608
 
554
- All four remote backends (Sprites, Docker, E2B, Freestyle) support on-demand provisioning. When you omit the container/instance and let the factory auto-create:
609
+ All five remote backends (Sprites, Docker, E2B, Freestyle, SSH) support on-demand provisioning. When you omit the container/instance and let the factory auto-create:
555
610
 
556
611
  1. **First `createThread()`** calls `sandbox.init()` which provisions the resource
557
612
  2. The sandbox ID is persisted locally (`.noumen/sessions/.sandbox-index.json`) so `resumeThread()` can reconnect to the same resource
@@ -1,10 +1,12 @@
1
- import { A as Agent } from '../agent-1nFVUP9E.js';
1
+ import { A as Agent } from '../agent-DWE4_P5X.js';
2
2
  import { A as AgentSkill, a as AgentCard, T as TaskSendParams, b as Task, c as TaskStreamEvent } from '../types-NIyVwQ4h.js';
3
3
  export { d as A2A_METHODS, e as Artifact, D as DataPart, F as FilePart, M as Message, P as Part, f as TaskState, g as TaskStatus, h as TextPart } from '../types-NIyVwQ4h.js';
4
- import '../types-LrU4LRmX.js';
5
- import '../types-RPKUTu1k.js';
4
+ import '../types-kiGBF35b.js';
5
+ import '../sandbox-9qeMTNrD.js';
6
+ import '../computer-BPdxSo6X.js';
7
+ import '../types-DhXwOQwD.js';
6
8
  import '../types-CD0rUKKT.js';
7
- import '../cache-DsRqxx6v.js';
9
+ import '../cache-BlBwXXPS.js';
8
10
  import '../types-2kTLUCnD.js';
9
11
  import '@modelcontextprotocol/sdk/client/index.js';
10
12
  import '@modelcontextprotocol/sdk/client/auth.js';
@@ -1,14 +1,16 @@
1
- import { A as Agent } from '../agent-1nFVUP9E.js';
1
+ import { A as Agent } from '../agent-DWE4_P5X.js';
2
2
  import { A as AcpTransport } from '../types-QwfylltH.js';
3
3
  export { a as ACP_METHODS, b as AcpCapabilities, c as AcpInitializeParams, d as AcpInitializeResult, e as AcpSessionNewParams, f as AcpSessionPromptParams } from '../types-QwfylltH.js';
4
- import { V as VirtualFs, R as ReadOptions, F as FileEntry, i as FileStat, j as VirtualComputer, E as ExecOptions, C as CommandResult } from '../types-RPKUTu1k.js';
5
- import '../types-LrU4LRmX.js';
6
- import '../cache-DsRqxx6v.js';
4
+ import { a as VirtualFs, R as ReadOptions, F as FileEntry, b as FileStat, V as VirtualComputer, E as ExecOptions, C as CommandResult } from '../computer-BPdxSo6X.js';
5
+ import '../types-kiGBF35b.js';
6
+ import '../sandbox-9qeMTNrD.js';
7
+ import '../types-DhXwOQwD.js';
8
+ import '../types-CD0rUKKT.js';
9
+ import '../cache-BlBwXXPS.js';
7
10
  import '../types-2kTLUCnD.js';
8
11
  import '@modelcontextprotocol/sdk/client/index.js';
9
12
  import '@modelcontextprotocol/sdk/client/auth.js';
10
13
  import '@modelcontextprotocol/sdk/shared/auth.js';
11
- import '../types-CD0rUKKT.js';
12
14
 
13
15
  /**
14
16
  * ACP protocol handler: maps ACP JSON-RPC methods to Agent/Thread APIs.