@arcforge/kernel 2.0.176 → 2.0.178

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/mediation.ts +14 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcforge/kernel",
3
- "version": "2.0.176",
3
+ "version": "2.0.178",
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.176",
19
- "@arcforge/engines": "2.0.176",
20
- "@arcforge/err": "2.0.176",
21
- "@arcforge/session": "2.0.176",
22
- "@arcforge/types": "2.0.176",
23
- "@arcforge/cloud": "2.0.176",
24
- "@arcforge/capsule": "2.0.176"
18
+ "@arcforge/air": "2.0.178",
19
+ "@arcforge/engines": "2.0.178",
20
+ "@arcforge/err": "2.0.178",
21
+ "@arcforge/session": "2.0.178",
22
+ "@arcforge/types": "2.0.178",
23
+ "@arcforge/cloud": "2.0.178",
24
+ "@arcforge/capsule": "2.0.178"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/bun": "latest",
package/src/mediation.ts CHANGED
@@ -205,11 +205,16 @@ export function Mediation(opts: MediationOpts) {
205
205
  * Escalation still routes through the same decider, so a `"escalate"`
206
206
  * verdict on an argument pattern prompts exactly like any other.
207
207
  */
208
- async function shell(argv: string[], owner: string): Promise<ShellDecision> {
208
+ async function shell(argv: string[], owner: string, command?: string): Promise<ShellDecision> {
209
209
  // Axon's posture: an agent whose blueprint declares no shell policy is
210
210
  // a personal tool with the user's own privileges. The capsule's is the
211
211
  // opposite — see decideShell's `fallback`.
212
- const decision = decideShell(opts.policy().shell, argv, "allow")
212
+ //
213
+ // `command` is the unsplit line, and only a caller that HAS one passes
214
+ // it: a chain is invisible once split (a newline becomes whitespace, a
215
+ // quote disappears), and deciding without it means deciding about the
216
+ // first program while `/bin/sh -c` runs the rest.
217
+ const decision = decideShell(opts.policy().shell, argv, "allow", command)
213
218
  if (decision.verdict === "allow") return decision
214
219
 
215
220
  const fn = `shell.run:${decision.program}`
@@ -229,9 +234,14 @@ export function Mediation(opts: MediationOpts) {
229
234
  return {
230
235
  check,
231
236
  shell,
232
- /** `shell()` for a command that arrived as a string rather than argv. */
237
+ /**
238
+ * `shell()` for a command that arrived as a string rather than argv.
239
+ *
240
+ * The string is forwarded ALONGSIDE its argv, because it is the only
241
+ * form in which a chain is still visible — see decideShell.
242
+ */
233
243
  shellCommand(command: string, owner: string): Promise<ShellDecision> {
234
- return shell(splitCommand(command), owner)
244
+ return shell(splitCommand(command), owner, command)
235
245
  },
236
246
  /**
237
247
  * The span stream every surface reads.