@arcforge/kernel 2.0.173 → 2.0.175

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/package.json +8 -8
  2. package/src/capsule.ts +19 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcforge/kernel",
3
- "version": "2.0.173",
3
+ "version": "2.0.175",
4
4
  "description": "The Axon kernel — ring 0. Owns resources and execution, enforces policy, and is the only constructor of the unprivileged capsule.",
5
5
  "type": "module",
6
6
  "private": false,
@@ -15,13 +15,13 @@
15
15
  "deploy": "echo \"This package is published ONLY by apps/tui/scripts/release.ts, which pins workspace:* deps to concrete versions first. Publishing it directly ships an unresolvable dependency.\" && exit 1"
16
16
  },
17
17
  "dependencies": {
18
- "@arcforge/air": "2.0.173",
19
- "@arcforge/engines": "2.0.173",
20
- "@arcforge/err": "2.0.173",
21
- "@arcforge/session": "2.0.173",
22
- "@arcforge/types": "2.0.173",
23
- "@arcforge/cloud": "2.0.173",
24
- "@arcforge/capsule": "2.0.173"
18
+ "@arcforge/air": "2.0.175",
19
+ "@arcforge/engines": "2.0.175",
20
+ "@arcforge/err": "2.0.175",
21
+ "@arcforge/session": "2.0.175",
22
+ "@arcforge/types": "2.0.175",
23
+ "@arcforge/cloud": "2.0.175",
24
+ "@arcforge/capsule": "2.0.175"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/bun": "latest",
package/src/capsule.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { dirname, resolve } from "node:path"
1
2
  import { Capsule, CapsuleT } from "@arcforge/capsule"
2
3
  import type { CapsulePartialConfig, CapsuleTool } from "@arcforge/capsule"
3
4
  import { err } from "@arcforge/err"
@@ -10,12 +11,16 @@ import { isLoadable, toScopeModule } from "./scope"
10
11
 
11
12
  /**
12
13
  * Project-scanned tools carry self-contained bundled source (produced at scan
13
- * time, with the tool's own imports inlined). The capsule materializes that
14
- * source inside the sandbox and imports it there, so NO tool file — and none of
15
- * the project around it — is ever mounted into the box. This is what keeps the
16
- * sandbox filesystem exactly what the fs policy declares and nothing more. A
17
- * raw entryPath is a fallback only for programmatic blueprints that never went
18
- * through scan/bundling.
14
+ * time, with the tool's own imports inlined). Bundled source has no path to
15
+ * import, so it is materialized to a real file first — into the agent's OWN
16
+ * frame cache, never the OS temp directory (see @arcforge/capsule/materialize).
17
+ * A raw entryPath is a fallback only for programmatic blueprints that never
18
+ * went through scan/bundling.
19
+ *
20
+ * The sandbox no longer has a filesystem of its own to keep source out of —
21
+ * the capsule is a mediated scope inside the agent process, not a subprocess
22
+ * behind a mount namespace — so materializing is a mechanical need rather than
23
+ * a containment one.
19
24
  *
20
25
  * Membership is isLoadable()/toScopeModule() from ./scope — the same
21
26
  * decision that produces the model's <scope> and the editor's ambient
@@ -28,11 +33,10 @@ function toCapsuleTools(blueprint: AxonBlueprint): CapsuleTool[] {
28
33
  .map(tool => ({
29
34
  namespace: tool.name,
30
35
  scope: toScopeModule(tool),
31
- // Bundled source is authoritative: the capsule materializes it inside
32
- // the sandbox, so no tool file (and none of the project around it) is
33
- // mounted into the box. entryPath is a fallback only for tools that
34
- // were never bundled (programmatic blueprints); scanned tools always
35
- // carry source now.
36
+ // Bundled source is authoritative: it is self-contained, so it
37
+ // imports identically wherever the agent runs. entryPath is a
38
+ // fallback only for tools that were never bundled (programmatic
39
+ // blueprints); scanned tools always carry source now.
36
40
  ...(tool.source ? { source: tool.source } : { path: tool.entryPath! }),
37
41
  }))
38
42
  }
@@ -116,6 +120,10 @@ export async function AxonCapsule(opts: AxonCapsuleOpts) {
116
120
  return {
117
121
  name: blueprint.agent.name,
118
122
  cwd: liveCwd ?? opts.cwd,
123
+ // The agent's own frame cache, not the OS temp directory — see
124
+ // @arcforge/capsule/materialize. Derived from paths.data so it
125
+ // follows the agent wherever its frame is, including a deployment.
126
+ scratch: resolve(blueprint.paths.root, dirname(blueprint.paths.data), "cache", "tools"),
119
127
  env: blueprint.env,
120
128
  tools: toCapsuleTools(blueprint),
121
129
  policy: defaultPolicy(blueprint),