@fungi.computer/truffle 0.2.2 → 0.3.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 (68) hide show
  1. package/dist/private-files-patch.js +3 -17
  2. package/dist/private-invocation-computer.d.ts +224 -12
  3. package/dist/private-invocation-computer.js +162 -22
  4. package/dist/private-invocation-files.d.ts +3 -2
  5. package/dist/private-invocation-files.js +22 -3
  6. package/dist/private-local-agent-control.d.ts +2 -2
  7. package/dist/private-local-bwrap.d.ts +9 -7
  8. package/dist/private-local-bwrap.js +26 -21
  9. package/dist/private-local-computer-processes.d.ts +15 -0
  10. package/dist/private-local-computer-processes.js +13 -0
  11. package/dist/private-local-containment.d.ts +15 -13
  12. package/dist/private-local-containment.js +49 -65
  13. package/dist/private-local-delegation.d.ts +3 -3
  14. package/dist/private-local-delegation.js +32 -19
  15. package/dist/private-local-exec-review.d.ts +10 -0
  16. package/dist/private-local-exec-review.js +50 -0
  17. package/dist/private-local-exec-rules.d.ts +14 -0
  18. package/dist/private-local-exec-rules.js +420 -0
  19. package/dist/private-local-git-exclude.js +25 -15
  20. package/dist/private-local-linux-sandbox.d.ts +5 -5
  21. package/dist/private-local-linux-sandbox.js +63 -30
  22. package/dist/private-local-mail.d.ts +2 -2
  23. package/dist/private-local-mesh-links.d.ts +4 -1
  24. package/dist/private-local-mesh-links.js +50 -3
  25. package/dist/private-local-native-digests.js +1 -1
  26. package/dist/private-local-native-install-error.d.ts +2 -0
  27. package/dist/private-local-native-install-error.js +10 -0
  28. package/dist/private-local-native-staging.d.ts +7 -8
  29. package/dist/private-local-native-staging.js +132 -43
  30. package/dist/private-local-permission-mode.d.ts +10 -0
  31. package/dist/private-local-permission-mode.js +18 -0
  32. package/dist/private-local-runtime-host.d.ts +19 -5
  33. package/dist/private-local-runtime-host.js +378 -65
  34. package/dist/private-local-sandbox-policy.d.ts +30 -11
  35. package/dist/private-local-sandbox-policy.js +223 -373
  36. package/dist/private-local-sandbox.d.ts +30 -25
  37. package/dist/private-local-sandbox.js +190 -100
  38. package/dist/private-local-seatbelt.d.ts +7 -13
  39. package/dist/private-local-seatbelt.js +55 -32
  40. package/dist/private-local-service-contract.d.ts +5 -4
  41. package/dist/private-local-service-discovery.d.ts +19 -7
  42. package/dist/private-local-service-discovery.js +4 -3
  43. package/dist/private-local-service-listener.js +40 -2
  44. package/dist/private-local-service-log.d.ts +8 -0
  45. package/dist/private-local-service-log.js +3 -0
  46. package/dist/private-local-service-owner.d.ts +18 -10
  47. package/dist/private-local-service-owner.js +117 -25
  48. package/dist/private-local-service.js +30 -3
  49. package/dist/private-local-session-discovery.d.ts +2 -1
  50. package/dist/private-local-session-discovery.js +18 -6
  51. package/dist/private-mcp-form-contract.d.ts +8 -1
  52. package/dist/private-mcp-form-contract.js +8 -1
  53. package/dist/private-mcp-form-session.d.ts +33 -3
  54. package/dist/private-mcp-form-session.js +28 -5
  55. package/dist/private-oyster-mcp-auth.d.ts +1 -1
  56. package/dist/private-oyster-mcp-auth.js +139 -7
  57. package/dist/private-provider-rejection.js +1 -1
  58. package/dist/seatbelt/safe-base.sbpl +2 -2
  59. package/native/bin/bwrap-build-source/Dockerfile +2 -0
  60. package/native/bin/bwrap-build-source/README.md +6 -6
  61. package/native/bin/bwrap-build-source/pin.mjs +2 -2
  62. package/native/bin/bwrap-build-source/record.mjs +12 -1
  63. package/native/bin/bwrap-build-source/vendor/seccomp-unix-block.c +10 -7
  64. package/native/bin/bwrap-build.json +3 -2
  65. package/native/bin/fungi-apply-patch +0 -0
  66. package/native/bin/fungi-seccomp-workspace.bpf +0 -0
  67. package/native/bin/fungi-seccomp-workspace.bpf.sha256 +1 -0
  68. package/package.json +23 -17
@@ -10,15 +10,35 @@ export declare function resolveAgentFolder(project: string, folder: string): {
10
10
  export type LocalSandboxPolicy = Readonly<{
11
11
  projectRoot: string;
12
12
  writableRoot: string;
13
+ /** Whole Git administration and Agent state, read-only in Workspace. */
13
14
  readOnly: readonly string[];
14
- immovable: readonly string[];
15
15
  }>;
16
+ /** The host, never project configuration, chooses every writable cache grant. */
17
+ export type LinuxSandboxProfile = LocalSandboxPolicy & Readonly<{
18
+ mode: "workspace" | "read-only";
19
+ writable: readonly string[];
20
+ hidden: readonly string[];
21
+ temporaryDirectory: string;
22
+ /** Host-selected cache carve-out to prepare before rendering bwrap mounts. */
23
+ fungiCache: string | undefined;
24
+ sshAgentSocket: string | undefined;
25
+ sshAgentMask: string | undefined;
26
+ }>;
27
+ export declare function linuxSandboxProfile(policy: LocalSandboxPolicy, mode: "workspace" | "read-only", temporaryDirectory: string, host: NodeJS.ProcessEnv,
28
+ /** Pass the real passwd home in production; fixtures supply their own. */
29
+ osHome: string, platform?: "linux" | "darwin"): LinuxSandboxProfile;
30
+ /** Private persistent Agent temp, not the staging directory or host /tmp. */
31
+ export declare function agentSandboxTemporaryDirectory(agentId: string, project: string): string;
16
32
  export declare class UnsafeNativePayload extends Error {
17
33
  readonly name = "UnsafeNativePayload";
18
34
  }
19
35
  export declare class UnsafeHostCode extends Error {
20
36
  readonly name = "UnsafeHostCode";
21
37
  }
38
+ /** A symlinked Git marker cannot be protected by a bind on its logical name. */
39
+ export declare class UnsafeGitMarker extends Error {
40
+ readonly name = "UnsafeGitMarker";
41
+ }
22
42
  /**
23
43
  * Packed CLI identity is supplied by the Node bin wrapper, which loaded both
24
44
  * paths before spawning Bun. This is an admission check, not an integrity
@@ -28,15 +48,14 @@ export declare function assertHostCodeOutsideAgent(project: string, cli: string,
28
48
  /** Refuse both logical and resolved native source locations in the whole
29
49
  * Agent project or Git administration before verifying source bytes. */
30
50
  export declare function assertHostOwnedNativeFile(project: string, path: string): void;
31
- /** Host liveness check for private PID-named run reclamation. */
32
- export type NativeRunLivenessProbe = (pid: number) => void;
33
- /** New private inode, never a link or bind of an installed payload. */
34
- export declare function privateNativeDirectory(project: string, probe?: NativeRunLivenessProbe): string;
35
- export declare function stageNativeBytes(directory: string, label: string, bytes: Uint8Array): string;
36
51
  /** One logical/resolved authority for Files, bwrap and Seatbelt. */
37
52
  export declare function protectedSandboxPaths(paths: readonly string[]): string[];
38
- /**
39
- * Recompute for every command: the previous command may have initialized Git.
40
- * An internal caller may tighten the directory budget, never widen the ceiling.
41
- */
42
- export declare function sandboxPolicy(project: string, folder: string, directoryLimit?: number): LocalSandboxPolicy;
53
+ /** Git owns the representation of the selected folder's worktree and common dir. */
54
+ export declare function gitDirectories(project: string, root: string, path?: string): {
55
+ common: string;
56
+ worktree: string;
57
+ } | undefined;
58
+ /** Remote names from the protected common config only, never a racy worktree path. */
59
+ export declare function protectedGitRemoteNames(project: string, common: string, path: string): ReadonlySet<string> | undefined;
60
+ /** Recompute for each command: the prior command may have initialized Git. */
61
+ export declare function sandboxPolicy(project: string, folder: string): LocalSandboxPolicy;