@fungi.computer/truffle 0.5.0 → 0.7.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 (39) hide show
  1. package/README.md +27 -4
  2. package/dist/internal/private-workerd-sandbox-worker.mjs +243 -273
  3. package/dist/internal/sandbox-metafile.json +35 -30
  4. package/dist/local-extensions.d.ts +2 -2
  5. package/dist/local-extensions.js +43 -19
  6. package/dist/log-event.d.ts +3 -0
  7. package/dist/log-event.js +19 -1
  8. package/dist/private-fungi-mcp-connection.js +6 -1
  9. package/dist/private-invocation-computer.d.ts +6 -2
  10. package/dist/private-invocation-computer.js +20 -13
  11. package/dist/private-local-auth-rpc.d.ts +1 -1
  12. package/dist/private-local-computer-processes.d.ts +7 -2
  13. package/dist/private-local-computer-processes.js +47 -23
  14. package/dist/private-local-delegation.js +15 -11
  15. package/dist/private-local-exec-environment.d.ts +5 -2
  16. package/dist/private-local-exec-environment.js +35 -1
  17. package/dist/private-local-exec-review.js +14 -7
  18. package/dist/private-local-exec-rules.d.ts +7 -0
  19. package/dist/private-local-exec-rules.js +23 -6
  20. package/dist/private-local-extension-records.d.ts +1 -1
  21. package/dist/private-local-runtime-host.js +2 -2
  22. package/dist/private-local-sandbox-policy.js +4 -0
  23. package/dist/private-local-sandbox.d.ts +3 -1
  24. package/dist/private-local-sandbox.js +2 -2
  25. package/dist/private-local-schedule-client.d.ts +12 -0
  26. package/dist/private-local-schedule-client.js +41 -0
  27. package/dist/private-local-schedules.d.ts +84 -0
  28. package/dist/private-local-schedules.js +66 -0
  29. package/dist/private-local-service-contract.d.ts +3 -0
  30. package/dist/private-local-service-discovery.d.ts +4 -4
  31. package/dist/private-local-service-discovery.js +1 -1
  32. package/dist/private-local-service-listener.js +9 -0
  33. package/dist/private-local-service-owner.d.ts +130 -0
  34. package/dist/private-local-service-owner.js +29 -0
  35. package/dist/private-local-service.d.ts +3 -0
  36. package/dist/private-local-service.js +2 -0
  37. package/dist/private-mcp-form-session.d.ts +2 -2
  38. package/dist/private-openai-claims.d.ts +1 -1
  39. package/package.json +18 -14
package/README.md CHANGED
@@ -24,6 +24,13 @@ unit and native patch tests. They do not sign in to a provider or start a
24
24
  customer Agent. Build outputs and test fixtures are disposable. Without a built
25
25
  engine, Local offers no `apply_patch` tool.
26
26
 
27
+ Sandbox policy assertions run in `test:unit` without launching a sandbox: they
28
+ exercise the real admission and command renderer with a deterministic startup
29
+ probe. Native sandbox qualification lives in `test/*.native.test.ts`, selected
30
+ by `test:sandbox:native` through `test:merge`, with one file worker. It retains
31
+ the real bwrap/Seatbelt startup, Git write-refusal, child and delegation proofs;
32
+ `test:merge` also runs the platform sandbox matrix and native patch suite.
33
+
27
34
  ## Host and Session lifetime
28
35
 
29
36
  [openPrivateLocalRuntimeHost](src/private-local-runtime-host.ts) captures the
@@ -172,7 +179,14 @@ model operation that changes Home.
172
179
  interpreted by `sh -c`) and a direct form (`executable` and `args`, run with
173
180
  no shell interpretation at all, through the same bounded native process owner
174
181
  `runPrivateInvocationProcess`). Zod refuses a request carrying both or
175
- neither. Either form accepts optional `stdin`
182
+ neither. Both forms accept optional `env`: at most 64 string-valued entries,
183
+ each at most 1,024 UTF-16 code units, named `^[A-Z_][A-Z0-9_]*$`. Values are
184
+ passed literally, never interpolated into shell source. Host-owned names
185
+ (`HOME`, `PATH`, session/sandbox locators, temporary-directory and loader
186
+ controls such as `LD_*`/`DYLD_*`) are refused; ambient host secrets remain
187
+ excluded. If a host-trusted Node process ever inherits this caller-supplied
188
+ env, `NODE_OPTIONS` must join the refused list before that path is enabled.
189
+ Either form accepts optional `stdin`
176
190
  ([its own bound](src/private-local-exec-launch.ts), not borrowed from Files),
177
191
  written to the child once, then closed; there is no interactive stdin. An
178
192
  omitted `stdin` closes immediately rather than leaving an open pipe, so a
@@ -181,8 +195,8 @@ model operation that changes Home.
181
195
  generic sandbox failure.
182
196
  - [Background processes](src/private-local-computer-processes.ts) support start,
183
197
  poll, wait, list and kill on the existing exec surface. `start` takes the same
184
- shell-or-direct, optional-stdin input as `run`, through the existing
185
- background process owner (`ManagedProcess`/`spawn`, not `run`'s
198
+ shell-or-direct, optional-stdin and bounded-env input as `run`, through the
199
+ existing background process owner (`ManagedProcess`/`spawn`, not `run`'s
186
200
  `runPrivateInvocationProcess`). Wait is bounded to 60 seconds. Cancelling a
187
201
  wait does not kill the process. Output retains a bounded tail with offsets.
188
202
  Session deletion or owner close stops its groups. Process IDs do not survive
@@ -284,10 +298,19 @@ activations its own operations write in `~/.fungi/extensions/activations.json`.
284
298
  Files in a project or an Agent store never enable anything, so a copied folder
285
299
  starts disabled.
286
300
 
287
- - `add(source)` installs a Git URL, npm spec or path with the shipped Bun
301
+ - `add(source, cwd)` installs a Git URL, npm spec or path with the shipped Bun
288
302
  package manager, lifecycle scripts disabled and a private cache. A Git source
289
303
  is pinned to the commit Bun resolved; updating is another `add`. A package
290
304
  whose declared `./host` entry or terminal program is not built is refused.
305
+ Local paths resolve from the caller's `cwd`, not the private staging folder.
306
+ Directory sources go through Bun's `pm pack --ignore-scripts` before install:
307
+ their installed bytes are an isolated package snapshot, not links back into
308
+ the project. Updating still requires another explicit `add` and activation;
309
+ existing Agents keep their accepted revision and capabilities. Behaviour
310
+ outside the manifest, schemas and hashed config needs an extension version
311
+ bump, per
312
+ [Core's identity contract](../../wiki/3-resources/shiitake-v0.0.1/extensions.md).
313
+ Replacing an active extension can require a service restart.
291
314
  - `enableProject(root, id)` turns on the extension's client entry and programs
292
315
  for that folder, whichever Agent is selected.
293
316
  - `enableAgent(store, id, requester?)` grants one Agent store the capabilities