@sema-agent/core 7.44.0 → 7.46.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 (159) hide show
  1. package/CHANGELOG.md +418 -1
  2. package/dist/agents/extra-tool-names.d.ts +65 -0
  3. package/dist/agents/extra-tool-names.js +124 -0
  4. package/dist/agents/subagent.d.ts +17 -5
  5. package/dist/agents/subagent.js +65 -38
  6. package/dist/agents/tool-filter.d.ts +82 -5
  7. package/dist/agents/tool-filter.js +134 -4
  8. package/dist/core/agent-config-dir.d.ts +20 -0
  9. package/dist/core/agent-config-dir.js +49 -0
  10. package/dist/core/agent-definition.d.ts +2 -2
  11. package/dist/core/allow-entry.d.ts +30 -4
  12. package/dist/core/allow-entry.js +32 -5
  13. package/dist/core/ask-origin.d.ts +23 -4
  14. package/dist/core/ask-origin.js +11 -5
  15. package/dist/core/checkpoint-store.d.ts +41 -4
  16. package/dist/core/decision-receipt.js +1 -1
  17. package/dist/core/effective-path-target.d.ts +143 -10
  18. package/dist/core/effective-path-target.js +113 -9
  19. package/dist/core/engine-notice.d.ts +25 -3
  20. package/dist/core/engine-notice.js +12 -6
  21. package/dist/core/gate-fold.js +3 -0
  22. package/dist/core/gate-lanes.js +11 -3
  23. package/dist/core/gate-outcome.d.ts +5 -0
  24. package/dist/core/gate-outcome.js +2 -0
  25. package/dist/core/governance-codes.d.ts +3 -1
  26. package/dist/core/governance-codes.js +3 -0
  27. package/dist/core/hooks.d.ts +5 -0
  28. package/dist/core/memory-engine/content-origin.d.ts +0 -34
  29. package/dist/core/memory-engine/content-origin.js +9 -4
  30. package/dist/core/memory-engine/layout.d.ts +5 -1
  31. package/dist/core/memory-engine/layout.js +1 -0
  32. package/dist/core/path-rule-binding.d.ts +65 -0
  33. package/dist/core/path-rule-binding.js +99 -0
  34. package/dist/core/permission-rule-model.d.ts +47 -18
  35. package/dist/core/permission-rule-model.js +38 -42
  36. package/dist/core/permission-rule-provider.d.ts +7 -0
  37. package/dist/core/permission-rule-provider.js +10 -3
  38. package/dist/core/permission-rule-store.d.ts +8 -0
  39. package/dist/core/permission-rule-store.js +6 -2
  40. package/dist/core/permission-rule-sync.js +2 -2
  41. package/dist/core/permission-rules.d.ts +22 -36
  42. package/dist/core/permission-rules.js +50 -40
  43. package/dist/core/real-approval.d.ts +9 -6
  44. package/dist/core/real-approval.js +5 -5
  45. package/dist/core/runner/child-tree.d.ts +110 -0
  46. package/dist/core/runner/child-tree.js +107 -0
  47. package/dist/core/runner/construction-doors.d.ts +5 -0
  48. package/dist/core/runner/construction-doors.js +6 -0
  49. package/dist/core/runner/contracts.d.ts +54 -2
  50. package/dist/core/runner/permission-rule-lanes.d.ts +34 -25
  51. package/dist/core/runner/permission-rule-lanes.js +18 -12
  52. package/dist/core/runner/persisted-path-rows.d.ts +31 -7
  53. package/dist/core/runner/persisted-path-rows.js +31 -12
  54. package/dist/core/runner/prepare-ask-lane.d.ts +6 -0
  55. package/dist/core/runner/prepare-ask-lane.js +4 -2
  56. package/dist/core/runner/prepare-config-doors.js +3 -1
  57. package/dist/core/runner/prepare-execution-env.d.ts +5 -2
  58. package/dist/core/runner/prepare-execution-env.js +11 -3
  59. package/dist/core/runner/prepare-gate-stations.d.ts +6 -0
  60. package/dist/core/runner/prepare-gate-stations.js +3 -1
  61. package/dist/core/runner/prepare-hands-readface.d.ts +8 -4
  62. package/dist/core/runner/prepare-hands-readface.js +6 -6
  63. package/dist/core/runner/prepare-inherited-gate.d.ts +8 -1
  64. package/dist/core/runner/prepare-inherited-gate.js +8 -2
  65. package/dist/core/runner/prepare-listings.d.ts +4 -4
  66. package/dist/core/runner/prepare-listings.js +2 -22
  67. package/dist/core/runner/prepare-park-ask.d.ts +5 -0
  68. package/dist/core/runner/prepare-park-ask.js +6 -4
  69. package/dist/core/runner/prepare-policy-chain.d.ts +16 -2
  70. package/dist/core/runner/prepare-policy-chain.js +14 -5
  71. package/dist/core/runner/prepare-suspend-saga.d.ts +10 -0
  72. package/dist/core/runner/prepare-suspend-saga.js +7 -1
  73. package/dist/core/runner/prepare-task.js +41 -18
  74. package/dist/core/runner/prepare-turn-wiring.d.ts +2 -0
  75. package/dist/core/runner/prepare-turn-wiring.js +2 -1
  76. package/dist/core/runner/prepare-workspace-restore.d.ts +3 -0
  77. package/dist/core/runner/prepare-workspace-restore.js +1 -0
  78. package/dist/core/runner/resume-apply.js +17 -3
  79. package/dist/core/runner/resume-checkpoint-screen.js +13 -0
  80. package/dist/core/runner/resume-policy-outcome.js +2 -1
  81. package/dist/core/runner/run-leg.js +5 -1
  82. package/dist/core/runner/run-notification-lane.js +2 -2
  83. package/dist/core/runner/runtask.d.ts +2 -0
  84. package/dist/core/runner/runtask.js +4 -2
  85. package/dist/core/runner/stream-steer-verb.js +2 -2
  86. package/dist/core/runner/sub-agent-deny-lists.d.ts +32 -0
  87. package/dist/core/runner/sub-agent-deny-lists.js +121 -0
  88. package/dist/core/runner/synthetic-tools.d.ts +1 -1
  89. package/dist/core/runner/synthetic-tools.js +3 -2
  90. package/dist/core/runner/write-protection-station.d.ts +3 -2
  91. package/dist/core/runner/write-protection-station.js +1 -0
  92. package/dist/core/runner-deps.d.ts +14 -0
  93. package/dist/core/sensitive-path-policy.d.ts +8 -0
  94. package/dist/core/sensitive-path-policy.js +18 -2
  95. package/dist/core/session-policy-store.d.ts +6 -2
  96. package/dist/core/session-policy-store.js +2 -1
  97. package/dist/core/shell-wrapper-projection.d.ts +11 -0
  98. package/dist/core/shell-wrapper-projection.js +56 -0
  99. package/dist/core/shell-wrapper-table.d.ts +144 -34
  100. package/dist/core/shell-wrapper-table.js +40 -20
  101. package/dist/core/skill-grant.d.ts +10 -2
  102. package/dist/core/skill-grant.js +20 -4
  103. package/dist/core/synthetic-read-verdict.d.ts +3 -0
  104. package/dist/core/synthetic-read-verdict.js +3 -1
  105. package/dist/core/task-notification.d.ts +12 -1
  106. package/dist/core/task-notification.js +13 -1
  107. package/dist/core/task-spec.d.ts +5 -3
  108. package/dist/core/tool-catalog-entries.d.ts +21 -0
  109. package/dist/core/tool-catalog-entries.js +9 -0
  110. package/dist/core/tool-policy.d.ts +45 -12
  111. package/dist/core/tool-policy.js +18 -20
  112. package/dist/core/tool-spec.d.ts +23 -4
  113. package/dist/core/types.d.ts +1 -1
  114. package/dist/core/types.js +1 -1
  115. package/dist/core/write-protect.d.ts +4 -0
  116. package/dist/core/write-protect.js +30 -9
  117. package/dist/index.d.ts +10 -6
  118. package/dist/index.js +9 -5
  119. package/dist/orchestration/run-spec.js +8 -7
  120. package/dist/orchestration/workflow.js +3 -2
  121. package/dist/shell/lex.d.ts +7 -0
  122. package/dist/shell/lex.js +17 -0
  123. package/dist/tools/fs/bash-program-position.d.ts +8 -87
  124. package/dist/tools/fs/bash-program-position.js +33 -69
  125. package/dist/tools/fs/bash-readonly-classifier.d.ts +17 -444
  126. package/dist/tools/fs/bash-readonly-classifier.js +169 -1225
  127. package/dist/tools/fs/index.d.ts +3 -2
  128. package/dist/tools/fs/program-read-model.d.ts +694 -0
  129. package/dist/tools/fs/program-read-model.js +1252 -0
  130. package/dist/tools/fs/program-read-model.rows.d.ts +18 -0
  131. package/dist/tools/fs/program-read-model.rows.js +613 -0
  132. package/dist/tools/fs/read-deny-home.d.ts +19 -1
  133. package/dist/tools/fs/read-deny-home.js +62 -24
  134. package/dist/tools/fs/read-deny.d.ts +54 -14
  135. package/dist/tools/fs/read-deny.js +104 -50
  136. package/dist/tools/fs/removal-targets.d.ts +83 -0
  137. package/dist/tools/fs/removal-targets.js +236 -0
  138. package/dist/tools/fs/safety.d.ts +3 -0
  139. package/dist/tools/fs/safety.js +10 -3
  140. package/dist/tools/fs/shell-read-argv.d.ts +85 -0
  141. package/dist/tools/fs/shell-read-argv.js +386 -0
  142. package/dist/tools/fs/shell-read-bindings.d.ts +273 -0
  143. package/dist/tools/fs/shell-read-bindings.js +746 -0
  144. package/dist/tools/fs/shell-read-check.js +23 -15
  145. package/dist/tools/fs/shell-read-establish.js +79 -5
  146. package/dist/tools/fs/shell-read-judge.d.ts +11 -1
  147. package/dist/tools/fs/shell-read-judge.js +9 -1
  148. package/dist/tools/fs/shell-read-plan.d.ts +31 -7
  149. package/dist/tools/fs/shell-read-plan.js +299 -393
  150. package/dist/tools/fs/shell-read-word.d.ts +29 -26
  151. package/dist/tools/fs/shell-read-word.js +30 -38
  152. package/dist/tools/fs/shell-read-write-targets.d.ts +15 -37
  153. package/dist/tools/fs/shell-read-write-targets.js +83 -136
  154. package/dist/tools/fs/shell-reentry-text.d.ts +38 -6
  155. package/dist/tools/fs/shell-reentry-text.js +90 -53
  156. package/package.json +1 -1
  157. package/test/export-surface.snapshot.json +49 -3
  158. package/wire-changes/core@7.45.0.json +1084 -0
  159. package/wire-changes/core@7.46.0.json +1522 -0
@@ -11,7 +11,10 @@
11
11
  * caller asks a person) instead of guessing its arity, because a wrong guess names the option's VALUE
12
12
  * or an operand as the program — a phantom run no deny matches. Three adversarial rounds found exactly
13
13
  * that shape behind every "unknown is value-less" reading; the closed sets end the family rather than
14
- * the instance. Growing a row is a data edit with upstream's manual page as its source.
14
+ * the instance. The table is the PROJECTION of the program read model's rows
15
+ * ({@link import("./shell-wrapper-projection.js").shellWrapperProjection}) written
16
+ * out with its literal type: a launcher fact is edited in its row (one table of program facts, read by the binary gate
17
+ * and by the read station alike), and `test/shell-wrapper-table-projection.test.ts` keeps the two equal.
15
18
  *
16
19
  * Per row: `valueFlags` — options whose value is the NEXT word (`-u root`; the attached `-uroot` and
17
20
  * `--user=root` spellings are one word and need no row); `flags` — value-less options, including those
@@ -56,26 +59,26 @@ export declare const SHELL_WRAPPER_TABLE: {
56
59
  readonly commandString: readonly [];
57
60
  };
58
61
  readonly env: {
59
- readonly valueFlags: readonly ["-u", "-C", "-a", "-P", "--unset", "--chdir", "--argv0"];
60
- readonly flags: readonly ["-i", "-0", "-v", "--ignore-environment", "--null", "--debug", "--list-signal-handling", "--default-signal", "--ignore-signal", "--block-signal", "--help", "--version"];
61
- readonly commandString: readonly ["-S", "--split-string"];
62
+ readonly valueFlags: readonly ["--argv0", "--chdir", "--unset", "-C", "-P", "-a", "-u"];
63
+ readonly flags: readonly ["--debug", "--default-signal", "--help", "--ignore-environment", "--ignore-signal", "--list-signal-handling", "--version", "-i", "-v"];
64
+ readonly commandString: readonly ["--split-string", "-S"];
62
65
  readonly bareDash: true;
63
66
  readonly assignments: true;
64
67
  };
65
68
  readonly sudo: {
66
- readonly valueFlags: readonly ["-u", "-g", "-U", "-C", "-D", "-h", "-p", "-r", "-R", "-t", "-T", "--user", "--group", "--other-user", "--close-from", "--chdir", "--host", "--prompt", "--role", "--chroot", "--type", "--command-timeout", "-a", "--auth-type"];
67
- readonly flags: readonly ["-A", "-b", "-E", "-H", "-i", "-K", "-k", "-l", "-n", "-P", "-S", "-s", "-V", "-v", "--askpass", "--background", "--preserve-env", "--set-home", "--login", "--remove-timestamp", "--reset-timestamp", "--list", "--non-interactive", "--preserve-groups", "--stdin", "--shell", "--version", "--validate", "--bell", "--help"];
69
+ readonly valueFlags: readonly ["--auth-type", "--chdir", "--chroot", "--close-from", "--command-timeout", "--group", "--host", "--other-user", "--prompt", "--role", "--type", "--user", "-C", "-D", "-R", "-T", "-U", "-a", "-g", "-h", "-p", "-r", "-t", "-u"];
70
+ readonly flags: readonly ["--askpass", "--background", "--bell", "--help", "--list", "--login", "--non-interactive", "--preserve-env", "--preserve-groups", "--remove-timestamp", "--reset-timestamp", "--set-home", "--shell", "--stdin", "--validate", "--version", "-A", "-E", "-H", "-K", "-P", "-S", "-V", "-b", "-i", "-k", "-l", "-n", "-s", "-v"];
68
71
  readonly commandString: readonly [];
69
72
  readonly assignments: true;
70
73
  };
71
74
  readonly doas: {
72
- readonly valueFlags: readonly ["-a", "-u", "-C"];
75
+ readonly valueFlags: readonly ["-C", "-a", "-u"];
73
76
  readonly flags: readonly ["-L", "-n", "-s"];
74
77
  readonly commandString: readonly [];
75
78
  };
76
79
  readonly pkexec: {
77
80
  readonly valueFlags: readonly ["--user"];
78
- readonly flags: readonly ["--disable-internal-agent", "--keep-cwd", "--version", "--help"];
81
+ readonly flags: readonly ["--disable-internal-agent", "--help", "--keep-cwd", "--version"];
79
82
  readonly commandString: readonly [];
80
83
  };
81
84
  readonly nohup: {
@@ -84,29 +87,29 @@ export declare const SHELL_WRAPPER_TABLE: {
84
87
  readonly commandString: readonly [];
85
88
  };
86
89
  readonly time: {
87
- readonly valueFlags: readonly ["-o", "--output", "-f", "--format"];
88
- readonly flags: readonly ["-p", "-a", "-v", "-q", "--append", "--portability", "--verbose", "--quiet", "--help", "--version"];
90
+ readonly valueFlags: readonly ["--format", "--output", "-f", "-o"];
91
+ readonly flags: readonly ["--append", "--help", "--portability", "--quiet", "--verbose", "--version", "-a", "-p", "-q", "-v"];
89
92
  readonly commandString: readonly [];
90
93
  };
91
94
  readonly nice: {
92
- readonly valueFlags: readonly ["-n", "--adjustment"];
95
+ readonly valueFlags: readonly ["--adjustment", "-n"];
93
96
  readonly flags: readonly ["--help", "--version"];
94
97
  readonly commandString: readonly [];
95
98
  };
96
99
  readonly timeout: {
97
- readonly valueFlags: readonly ["-k", "-s", "--kill-after", "--signal"];
98
- readonly flags: readonly ["-v", "--foreground", "--preserve-status", "--verbose", "--help", "--version"];
100
+ readonly valueFlags: readonly ["--kill-after", "--signal", "-k", "-s"];
101
+ readonly flags: readonly ["--foreground", "--help", "--preserve-status", "--verbose", "--version", "-v"];
99
102
  readonly commandString: readonly [];
100
103
  readonly duration: true;
101
104
  };
102
105
  readonly stdbuf: {
103
- readonly valueFlags: readonly ["-i", "-o", "-e", "--input", "--output", "--error"];
106
+ readonly valueFlags: readonly ["--error", "--input", "--output", "-e", "-i", "-o"];
104
107
  readonly flags: readonly ["--help", "--version"];
105
108
  readonly commandString: readonly [];
106
109
  };
107
110
  readonly xargs: {
108
- readonly valueFlags: readonly ["-n", "-L", "-P", "-I", "-d", "-s", "-a", "-E", "--max-args", "--max-procs", "--delimiter", "--max-chars", "--arg-file", "--process-slot-var"];
109
- readonly flags: readonly ["-0", "-r", "-t", "-x", "-p", "-o", "--null", "--no-run-if-empty", "--verbose", "--exit", "--interactive", "--open-tty", "--show-limits", "--help", "--version", "--replace", "--eof", "--max-lines"];
111
+ readonly valueFlags: readonly ["--arg-file", "--delimiter", "--max-args", "--max-chars", "--max-procs", "--process-slot-var", "-E", "-I", "-L", "-P", "-a", "-d", "-n", "-s"];
112
+ readonly flags: readonly ["--eof", "--exit", "--help", "--interactive", "--max-lines", "--no-run-if-empty", "--null", "--open-tty", "--replace", "--show-limits", "--verbose", "--version", "-0", "-o", "-p", "-r", "-t", "-x"];
110
113
  readonly attached: readonly ["-i", "-l"];
111
114
  readonly commandString: readonly [];
112
115
  };
@@ -117,57 +120,58 @@ export declare const SHELL_WRAPPER_TABLE: {
117
120
  readonly viaShell: true;
118
121
  };
119
122
  readonly ionice: {
120
- readonly valueFlags: readonly ["-c", "-n", "-p", "-P", "-u", "--class", "--classdata", "--pid", "--pgid", "--uid"];
121
- readonly flags: readonly ["-t", "--ignore", "-h", "--help", "-V", "--version"];
123
+ readonly valueFlags: readonly ["--class", "--classdata", "--pgid", "--pid", "--uid", "-P", "-c", "-n", "-p", "-u"];
124
+ readonly flags: readonly ["--help", "--ignore", "--version", "-V", "-h", "-t"];
122
125
  readonly commandString: readonly [];
123
126
  };
124
127
  readonly setsid: {
125
128
  readonly valueFlags: readonly [];
126
- readonly flags: readonly ["-c", "-f", "-w", "--ctty", "--fork", "--wait", "--help", "--version"];
129
+ readonly flags: readonly ["--ctty", "--fork", "--help", "--version", "--wait", "-c", "-f", "-w"];
127
130
  readonly commandString: readonly [];
128
131
  };
129
132
  readonly taskset: {
130
133
  readonly valueFlags: readonly [];
131
- readonly flags: readonly ["-a", "-p", "-c", "--all-tasks", "--pid", "--cpu-list", "--help", "--version"];
134
+ readonly flags: readonly ["--all-tasks", "--cpu-list", "--help", "--pid", "--version", "-a", "-c", "-p"];
132
135
  readonly commandString: readonly [];
133
136
  readonly positional: RegExp;
134
137
  };
135
138
  readonly chrt: {
136
- readonly valueFlags: readonly ["-p", "--pid", "-T", "-P", "-D", "--sched-runtime", "--sched-period", "--sched-deadline"];
137
- readonly flags: readonly ["-b", "-f", "-i", "-o", "-r", "-d", "-m", "-a", "-R", "-v", "--batch", "--fifo", "--idle", "--other", "--rr", "--deadline", "--max", "--all-tasks", "--reset-on-fork", "--verbose", "--help", "--version"];
139
+ readonly valueFlags: readonly ["--pid", "--sched-deadline", "--sched-period", "--sched-runtime", "-D", "-P", "-T", "-p"];
140
+ readonly flags: readonly ["--all-tasks", "--batch", "--deadline", "--fifo", "--help", "--idle", "--max", "--other", "--reset-on-fork", "--rr", "--verbose", "--version", "-R", "-a", "-b", "-d", "-f", "-i", "-m", "-o", "-r", "-v"];
138
141
  readonly commandString: readonly [];
139
142
  readonly positional: RegExp;
140
143
  };
141
144
  readonly strace: {
142
- readonly valueFlags: readonly ["-e", "-o", "-p", "-s", "-E", "-P", "-S", "-a", "-b", "-I", "-u", "-X", "-O", "-U", "--output", "--trace", "--expr", "--attach", "--string-limit", "--env", "--trace-path", "--columns", "--user", "--interruptible", "--detach-on", "--const-print-style", "--summary-sort-by", "--summary-syscall-overhead", "--summary-columns"];
143
- readonly flags: readonly ["-f", "-ff", "-c", "-C", "-d", "-D", "-h", "-i", "-k", "-q", "-qq", "-r", "-t", "-tt", "-ttt", "-T", "-v", "-V", "-w", "-x", "-xx", "-y", "-yy", "-z", "-Z", "-F", "--follow-forks", "--summary-only", "--summary", "--debug", "--help", "--version"];
145
+ readonly valueFlags: readonly ["--attach", "--columns", "--const-print-style", "--detach-on", "--env", "--expr", "--interruptible", "--output", "--string-limit", "--summary-columns", "--summary-sort-by", "--summary-syscall-overhead", "--trace", "--trace-path", "--user", "-E", "-I", "-O", "-P", "-S", "-U", "-X", "-a", "-b", "-e", "-o", "-p", "-s", "-u"];
146
+ readonly flags: readonly ["--debug", "--follow-forks", "--help", "--summary", "--summary-only", "--version", "-C", "-D", "-F", "-T", "-V", "-Z", "-c", "-d", "-f", "-h", "-i", "-k", "-q", "-r", "-t", "-v", "-w", "-x", "-y", "-z"];
144
147
  readonly commandString: readonly [];
145
148
  };
146
149
  readonly ltrace: {
147
- readonly valueFlags: readonly ["-a", "-A", "-e", "-l", "-n", "-o", "-p", "-s", "-u", "-x", "-D", "-F", "--align", "--config", "--debug", "--indent", "--library", "--output", "--string-max", "-w", "--where"];
148
- readonly flags: readonly ["-c", "-C", "-f", "-i", "-L", "-r", "-S", "-t", "-tt", "-ttt", "-T", "-V", "--demangle", "--help", "--version"];
150
+ readonly valueFlags: readonly ["--align", "--config", "--debug", "--indent", "--library", "--output", "--string-max", "--where", "-A", "-D", "-F", "-a", "-e", "-l", "-n", "-o", "-p", "-s", "-u", "-w", "-x"];
151
+ readonly flags: readonly ["--demangle", "--help", "--version", "-C", "-L", "-S", "-T", "-V", "-c", "-f", "-i", "-r", "-t"];
149
152
  readonly commandString: readonly [];
150
153
  };
151
154
  readonly flock: {
152
- readonly valueFlags: readonly ["-w", "-E", "--timeout", "--wait", "--conflict-exit-code"];
153
- readonly flags: readonly ["-s", "-x", "-u", "-n", "-o", "-F", "--shared", "--exclusive", "--unlock", "--nonblock", "--nb", "--close", "--no-fork", "--verbose", "--help", "--version"];
154
- readonly commandString: readonly ["-c", "--command"];
155
+ readonly valueFlags: readonly ["--conflict-exit-code", "--timeout", "--wait", "-E", "-w"];
156
+ readonly flags: readonly ["--close", "--exclusive", "--help", "--nb", "--no-fork", "--nonblock", "--shared", "--unlock", "--verbose", "--version", "-F", "-n", "-o", "-s", "-u", "-x"];
157
+ readonly commandString: readonly ["--command", "-c"];
155
158
  readonly positional: RegExp;
156
159
  };
157
160
  readonly script: {
158
161
  readonly valueFlags: readonly [];
159
162
  readonly flags: readonly [];
160
- readonly commandString: readonly ["-c", "--command"];
163
+ readonly commandString: readonly ["--command", "-c"];
161
164
  readonly viaShell: true;
162
165
  };
163
166
  readonly unshare: {
164
- readonly valueFlags: readonly ["-R", "-w", "-S", "-G", "--setuid", "--setgid", "--root", "--wd", "--propagation", "--setgroups", "--monotonic", "--boottime", "--map-user", "--map-group"];
165
- readonly flags: readonly ["-m", "-u", "-i", "-n", "-p", "-U", "-C", "-T", "-f", "-r", "-c", "--mount", "--uts", "--ipc", "--net", "--pid", "--user", "--cgroup", "--time", "--fork", "--map-root-user", "--map-current-user", "--kill-child", "--mount-proc", "--keep-caps", "--help", "--version"];
167
+ readonly valueFlags: readonly ["--boottime", "--map-group", "--map-user", "--monotonic", "--propagation", "--root", "--setgid", "--setgroups", "--setuid", "--wd", "-G", "-R", "-S", "-w"];
168
+ readonly flags: readonly ["--cgroup", "--fork", "--help", "--ipc", "--keep-caps", "--kill-child", "--map-current-user", "--map-root-user", "--mount", "--mount-proc", "--net", "--pid", "--time", "--user", "--uts", "--version", "-C", "-T", "-U", "-c", "-f", "-i", "-m", "-n", "-p", "-r", "-u"];
166
169
  readonly commandString: readonly [];
167
170
  };
168
171
  readonly nsenter: {
169
- readonly valueFlags: readonly ["-t", "-S", "-G", "--target", "--setuid", "--setgid"];
170
- readonly flags: readonly ["-a", "-m", "-u", "-i", "-n", "-p", "-U", "-C", "-T", "-r", "-w", "-F", "-Z", "--all", "--mount", "--uts", "--ipc", "--net", "--pid", "--user", "--cgroup", "--time", "--root", "--wd", "--no-fork", "--preserve-credentials", "--help", "--version"];
172
+ readonly valueFlags: readonly ["--setgid", "--setuid", "--target", "-G", "-S", "-t"];
173
+ readonly flags: readonly ["--all", "--cgroup", "--help", "--ipc", "--mount", "--net", "--no-fork", "--pid", "--preserve-credentials", "--root", "--time", "--user", "--uts", "--version", "--wd", "-C", "-F", "-T", "-U", "-Z", "-a", "-i", "-m", "-n", "-p", "-u"];
174
+ readonly attached: readonly ["-r", "-w"];
171
175
  readonly commandString: readonly [];
172
176
  };
173
177
  readonly eval: {
@@ -266,6 +270,112 @@ export declare const SHELL_WRAPPER_TABLE: {
266
270
  readonly commandString: readonly [];
267
271
  readonly executes: readonly ["-C", "-F"];
268
272
  };
273
+ readonly busybox: {
274
+ readonly valueFlags: readonly [];
275
+ readonly flags: readonly [];
276
+ readonly commandString: readonly [];
277
+ };
278
+ readonly su: {
279
+ readonly valueFlags: readonly [];
280
+ readonly flags: readonly [];
281
+ readonly commandString: readonly [];
282
+ readonly viaShell: true;
283
+ };
284
+ readonly runuser: {
285
+ readonly valueFlags: readonly [];
286
+ readonly flags: readonly [];
287
+ readonly commandString: readonly [];
288
+ readonly viaShell: true;
289
+ };
290
+ readonly chroot: {
291
+ readonly valueFlags: readonly [];
292
+ readonly flags: readonly [];
293
+ readonly commandString: readonly [];
294
+ readonly positional: RegExp;
295
+ };
296
+ readonly setpriv: {
297
+ readonly valueFlags: readonly [];
298
+ readonly flags: readonly [];
299
+ readonly commandString: readonly [];
300
+ };
301
+ readonly numactl: {
302
+ readonly valueFlags: readonly [];
303
+ readonly flags: readonly [];
304
+ readonly commandString: readonly [];
305
+ };
306
+ readonly prlimit: {
307
+ readonly valueFlags: readonly [];
308
+ readonly flags: readonly [];
309
+ readonly commandString: readonly [];
310
+ };
311
+ readonly "systemd-run": {
312
+ readonly valueFlags: readonly [];
313
+ readonly flags: readonly [];
314
+ readonly commandString: readonly [];
315
+ };
316
+ readonly valgrind: {
317
+ readonly valueFlags: readonly [];
318
+ readonly flags: readonly [];
319
+ readonly commandString: readonly [];
320
+ };
321
+ readonly firejail: {
322
+ readonly valueFlags: readonly [];
323
+ readonly flags: readonly [];
324
+ readonly commandString: readonly [];
325
+ };
326
+ readonly bwrap: {
327
+ readonly valueFlags: readonly [];
328
+ readonly flags: readonly [];
329
+ readonly commandString: readonly [];
330
+ };
331
+ readonly ash: {
332
+ readonly valueFlags: readonly [];
333
+ readonly flags: readonly [];
334
+ readonly commandString: readonly [];
335
+ readonly viaShell: true;
336
+ };
337
+ readonly mksh: {
338
+ readonly valueFlags: readonly [];
339
+ readonly flags: readonly [];
340
+ readonly commandString: readonly [];
341
+ readonly viaShell: true;
342
+ };
343
+ readonly yash: {
344
+ readonly valueFlags: readonly [];
345
+ readonly flags: readonly [];
346
+ readonly commandString: readonly [];
347
+ readonly viaShell: true;
348
+ };
349
+ readonly pdksh: {
350
+ readonly valueFlags: readonly [];
351
+ readonly flags: readonly [];
352
+ readonly commandString: readonly [];
353
+ readonly viaShell: true;
354
+ };
355
+ readonly parallel: {
356
+ readonly valueFlags: readonly [];
357
+ readonly flags: readonly [];
358
+ readonly commandString: readonly [];
359
+ readonly viaShell: true;
360
+ };
361
+ readonly alias: {
362
+ readonly valueFlags: readonly [];
363
+ readonly flags: readonly [];
364
+ readonly commandString: readonly [];
365
+ readonly viaShell: true;
366
+ };
367
+ readonly mapfile: {
368
+ readonly valueFlags: readonly [];
369
+ readonly flags: readonly [];
370
+ readonly commandString: readonly [];
371
+ readonly executes: readonly ["-C"];
372
+ };
373
+ readonly readarray: {
374
+ readonly valueFlags: readonly [];
375
+ readonly flags: readonly [];
376
+ readonly commandString: readonly [];
377
+ readonly executes: readonly ["-C"];
378
+ };
269
379
  };
270
380
  export type ShellWrapperName = keyof typeof SHELL_WRAPPER_TABLE;
271
381
  /** The shape of one row (see the table's contract). */
@@ -1,30 +1,31 @@
1
+ import { declaresOption, programRows } from "../tools/fs/program-read-model.js";
1
2
  export const SHELL_WRAPPER_TABLE = {
2
3
  command: { valueFlags: [], flags: ["-p"], commandString: [] },
3
4
  builtin: { valueFlags: [], flags: [], commandString: [] },
4
5
  noglob: { valueFlags: [], flags: [], commandString: [] },
5
6
  nocorrect: { valueFlags: [], flags: [], commandString: [] },
6
7
  exec: { valueFlags: ["-a"], flags: ["-c", "-l"], commandString: [] },
7
- env: { valueFlags: ["-u", "-C", "-a", "-P", "--unset", "--chdir", "--argv0"], flags: ["-i", "-0", "-v", "--ignore-environment", "--null", "--debug", "--list-signal-handling", "--default-signal", "--ignore-signal", "--block-signal", "--help", "--version"], commandString: ["-S", "--split-string"], bareDash: true, assignments: true },
8
- sudo: { valueFlags: ["-u", "-g", "-U", "-C", "-D", "-h", "-p", "-r", "-R", "-t", "-T", "--user", "--group", "--other-user", "--close-from", "--chdir", "--host", "--prompt", "--role", "--chroot", "--type", "--command-timeout", "-a", "--auth-type"], flags: ["-A", "-b", "-E", "-H", "-i", "-K", "-k", "-l", "-n", "-P", "-S", "-s", "-V", "-v", "--askpass", "--background", "--preserve-env", "--set-home", "--login", "--remove-timestamp", "--reset-timestamp", "--list", "--non-interactive", "--preserve-groups", "--stdin", "--shell", "--version", "--validate", "--bell", "--help"], commandString: [], assignments: true },
9
- doas: { valueFlags: ["-a", "-u", "-C"], flags: ["-L", "-n", "-s"], commandString: [] },
10
- pkexec: { valueFlags: ["--user"], flags: ["--disable-internal-agent", "--keep-cwd", "--version", "--help"], commandString: [] },
8
+ env: { valueFlags: ["--argv0", "--chdir", "--unset", "-C", "-P", "-a", "-u"], flags: ["--debug", "--default-signal", "--help", "--ignore-environment", "--ignore-signal", "--list-signal-handling", "--version", "-i", "-v"], commandString: ["--split-string", "-S"], bareDash: true, assignments: true },
9
+ sudo: { valueFlags: ["--auth-type", "--chdir", "--chroot", "--close-from", "--command-timeout", "--group", "--host", "--other-user", "--prompt", "--role", "--type", "--user", "-C", "-D", "-R", "-T", "-U", "-a", "-g", "-h", "-p", "-r", "-t", "-u"], flags: ["--askpass", "--background", "--bell", "--help", "--list", "--login", "--non-interactive", "--preserve-env", "--preserve-groups", "--remove-timestamp", "--reset-timestamp", "--set-home", "--shell", "--stdin", "--validate", "--version", "-A", "-E", "-H", "-K", "-P", "-S", "-V", "-b", "-i", "-k", "-l", "-n", "-s", "-v"], commandString: [], assignments: true },
10
+ doas: { valueFlags: ["-C", "-a", "-u"], flags: ["-L", "-n", "-s"], commandString: [] },
11
+ pkexec: { valueFlags: ["--user"], flags: ["--disable-internal-agent", "--help", "--keep-cwd", "--version"], commandString: [] },
11
12
  nohup: { valueFlags: [], flags: ["--help", "--version"], commandString: [] },
12
- time: { valueFlags: ["-o", "--output", "-f", "--format"], flags: ["-p", "-a", "-v", "-q", "--append", "--portability", "--verbose", "--quiet", "--help", "--version"], commandString: [] },
13
- nice: { valueFlags: ["-n", "--adjustment"], flags: ["--help", "--version"], commandString: [] },
14
- timeout: { valueFlags: ["-k", "-s", "--kill-after", "--signal"], flags: ["-v", "--foreground", "--preserve-status", "--verbose", "--help", "--version"], commandString: [], duration: true },
15
- stdbuf: { valueFlags: ["-i", "-o", "-e", "--input", "--output", "--error"], flags: ["--help", "--version"], commandString: [] },
16
- xargs: { valueFlags: ["-n", "-L", "-P", "-I", "-d", "-s", "-a", "-E", "--max-args", "--max-procs", "--delimiter", "--max-chars", "--arg-file", "--process-slot-var"], flags: ["-0", "-r", "-t", "-x", "-p", "-o", "--null", "--no-run-if-empty", "--verbose", "--exit", "--interactive", "--open-tty", "--show-limits", "--help", "--version", "--replace", "--eof", "--max-lines"], attached: ["-i", "-l"], commandString: [] },
13
+ time: { valueFlags: ["--format", "--output", "-f", "-o"], flags: ["--append", "--help", "--portability", "--quiet", "--verbose", "--version", "-a", "-p", "-q", "-v"], commandString: [] },
14
+ nice: { valueFlags: ["--adjustment", "-n"], flags: ["--help", "--version"], commandString: [] },
15
+ timeout: { valueFlags: ["--kill-after", "--signal", "-k", "-s"], flags: ["--foreground", "--help", "--preserve-status", "--verbose", "--version", "-v"], commandString: [], duration: true },
16
+ stdbuf: { valueFlags: ["--error", "--input", "--output", "-e", "-i", "-o"], flags: ["--help", "--version"], commandString: [] },
17
+ xargs: { valueFlags: ["--arg-file", "--delimiter", "--max-args", "--max-chars", "--max-procs", "--process-slot-var", "-E", "-I", "-L", "-P", "-a", "-d", "-n", "-s"], flags: ["--eof", "--exit", "--help", "--interactive", "--max-lines", "--no-run-if-empty", "--null", "--open-tty", "--replace", "--show-limits", "--verbose", "--version", "-0", "-o", "-p", "-r", "-t", "-x"], attached: ["-i", "-l"], commandString: [] },
17
18
  watch: { valueFlags: [], flags: [], commandString: [], viaShell: true },
18
- ionice: { valueFlags: ["-c", "-n", "-p", "-P", "-u", "--class", "--classdata", "--pid", "--pgid", "--uid"], flags: ["-t", "--ignore", "-h", "--help", "-V", "--version"], commandString: [] },
19
- setsid: { valueFlags: [], flags: ["-c", "-f", "-w", "--ctty", "--fork", "--wait", "--help", "--version"], commandString: [] },
20
- taskset: { valueFlags: [], flags: ["-a", "-p", "-c", "--all-tasks", "--pid", "--cpu-list", "--help", "--version"], commandString: [], positional: /^(?:0x)?[\da-f]+$|^[\d,:-]+$/i },
21
- chrt: { valueFlags: ["-p", "--pid", "-T", "-P", "-D", "--sched-runtime", "--sched-period", "--sched-deadline"], flags: ["-b", "-f", "-i", "-o", "-r", "-d", "-m", "-a", "-R", "-v", "--batch", "--fifo", "--idle", "--other", "--rr", "--deadline", "--max", "--all-tasks", "--reset-on-fork", "--verbose", "--help", "--version"], commandString: [], positional: /^\d+$/ },
22
- strace: { valueFlags: ["-e", "-o", "-p", "-s", "-E", "-P", "-S", "-a", "-b", "-I", "-u", "-X", "-O", "-U", "--output", "--trace", "--expr", "--attach", "--string-limit", "--env", "--trace-path", "--columns", "--user", "--interruptible", "--detach-on", "--const-print-style", "--summary-sort-by", "--summary-syscall-overhead", "--summary-columns"], flags: ["-f", "-ff", "-c", "-C", "-d", "-D", "-h", "-i", "-k", "-q", "-qq", "-r", "-t", "-tt", "-ttt", "-T", "-v", "-V", "-w", "-x", "-xx", "-y", "-yy", "-z", "-Z", "-F", "--follow-forks", "--summary-only", "--summary", "--debug", "--help", "--version"], commandString: [] },
23
- ltrace: { valueFlags: ["-a", "-A", "-e", "-l", "-n", "-o", "-p", "-s", "-u", "-x", "-D", "-F", "--align", "--config", "--debug", "--indent", "--library", "--output", "--string-max", "-w", "--where"], flags: ["-c", "-C", "-f", "-i", "-L", "-r", "-S", "-t", "-tt", "-ttt", "-T", "-V", "--demangle", "--help", "--version"], commandString: [] },
24
- flock: { valueFlags: ["-w", "-E", "--timeout", "--wait", "--conflict-exit-code"], flags: ["-s", "-x", "-u", "-n", "-o", "-F", "--shared", "--exclusive", "--unlock", "--nonblock", "--nb", "--close", "--no-fork", "--verbose", "--help", "--version"], commandString: ["-c", "--command"], positional: /^/ },
25
- script: { valueFlags: [], flags: [], commandString: ["-c", "--command"], viaShell: true },
26
- unshare: { valueFlags: ["-R", "-w", "-S", "-G", "--setuid", "--setgid", "--root", "--wd", "--propagation", "--setgroups", "--monotonic", "--boottime", "--map-user", "--map-group"], flags: ["-m", "-u", "-i", "-n", "-p", "-U", "-C", "-T", "-f", "-r", "-c", "--mount", "--uts", "--ipc", "--net", "--pid", "--user", "--cgroup", "--time", "--fork", "--map-root-user", "--map-current-user", "--kill-child", "--mount-proc", "--keep-caps", "--help", "--version"], commandString: [] },
27
- nsenter: { valueFlags: ["-t", "-S", "-G", "--target", "--setuid", "--setgid"], flags: ["-a", "-m", "-u", "-i", "-n", "-p", "-U", "-C", "-T", "-r", "-w", "-F", "-Z", "--all", "--mount", "--uts", "--ipc", "--net", "--pid", "--user", "--cgroup", "--time", "--root", "--wd", "--no-fork", "--preserve-credentials", "--help", "--version"], commandString: [] },
19
+ ionice: { valueFlags: ["--class", "--classdata", "--pgid", "--pid", "--uid", "-P", "-c", "-n", "-p", "-u"], flags: ["--help", "--ignore", "--version", "-V", "-h", "-t"], commandString: [] },
20
+ setsid: { valueFlags: [], flags: ["--ctty", "--fork", "--help", "--version", "--wait", "-c", "-f", "-w"], commandString: [] },
21
+ taskset: { valueFlags: [], flags: ["--all-tasks", "--cpu-list", "--help", "--pid", "--version", "-a", "-c", "-p"], commandString: [], positional: /^(?:0x)?[\da-f]+$|^[\d,:-]+$/i },
22
+ chrt: { valueFlags: ["--pid", "--sched-deadline", "--sched-period", "--sched-runtime", "-D", "-P", "-T", "-p"], flags: ["--all-tasks", "--batch", "--deadline", "--fifo", "--help", "--idle", "--max", "--other", "--reset-on-fork", "--rr", "--verbose", "--version", "-R", "-a", "-b", "-d", "-f", "-i", "-m", "-o", "-r", "-v"], commandString: [], positional: /^\d+$/ },
23
+ strace: { valueFlags: ["--attach", "--columns", "--const-print-style", "--detach-on", "--env", "--expr", "--interruptible", "--output", "--string-limit", "--summary-columns", "--summary-sort-by", "--summary-syscall-overhead", "--trace", "--trace-path", "--user", "-E", "-I", "-O", "-P", "-S", "-U", "-X", "-a", "-b", "-e", "-o", "-p", "-s", "-u"], flags: ["--debug", "--follow-forks", "--help", "--summary", "--summary-only", "--version", "-C", "-D", "-F", "-T", "-V", "-Z", "-c", "-d", "-f", "-h", "-i", "-k", "-q", "-r", "-t", "-v", "-w", "-x", "-y", "-z"], commandString: [] },
24
+ ltrace: { valueFlags: ["--align", "--config", "--debug", "--indent", "--library", "--output", "--string-max", "--where", "-A", "-D", "-F", "-a", "-e", "-l", "-n", "-o", "-p", "-s", "-u", "-w", "-x"], flags: ["--demangle", "--help", "--version", "-C", "-L", "-S", "-T", "-V", "-c", "-f", "-i", "-r", "-t"], commandString: [] },
25
+ flock: { valueFlags: ["--conflict-exit-code", "--timeout", "--wait", "-E", "-w"], flags: ["--close", "--exclusive", "--help", "--nb", "--no-fork", "--nonblock", "--shared", "--unlock", "--verbose", "--version", "-F", "-n", "-o", "-s", "-u", "-x"], commandString: ["--command", "-c"], positional: /^/ },
26
+ script: { valueFlags: [], flags: [], commandString: ["--command", "-c"], viaShell: true },
27
+ unshare: { valueFlags: ["--boottime", "--map-group", "--map-user", "--monotonic", "--propagation", "--root", "--setgid", "--setgroups", "--setuid", "--wd", "-G", "-R", "-S", "-w"], flags: ["--cgroup", "--fork", "--help", "--ipc", "--keep-caps", "--kill-child", "--map-current-user", "--map-root-user", "--mount", "--mount-proc", "--net", "--pid", "--time", "--user", "--uts", "--version", "-C", "-T", "-U", "-c", "-f", "-i", "-m", "-n", "-p", "-r", "-u"], commandString: [] },
28
+ nsenter: { valueFlags: ["--setgid", "--setuid", "--target", "-G", "-S", "-t"], flags: ["--all", "--cgroup", "--help", "--ipc", "--mount", "--net", "--no-fork", "--pid", "--preserve-credentials", "--root", "--time", "--user", "--uts", "--version", "--wd", "-C", "-F", "-T", "-U", "-Z", "-a", "-i", "-m", "-n", "-p", "-u"], attached: ["-r", "-w"], commandString: [] },
28
29
  eval: { valueFlags: [], flags: [], commandString: [], viaShell: true },
29
30
  source: { valueFlags: [], flags: [], commandString: [], viaShell: true },
30
31
  ".": { valueFlags: [], flags: [], commandString: [], viaShell: true },
@@ -41,8 +42,27 @@ export const SHELL_WRAPPER_TABLE = {
41
42
  find: { valueFlags: [], flags: [], commandString: [], executes: ["-exec", "-execdir", "-ok", "-okdir"] },
42
43
  compgen: { valueFlags: [], flags: [], commandString: [], executes: ["-C", "-F"] },
43
44
  complete: { valueFlags: [], flags: [], commandString: [], executes: ["-C", "-F"] },
45
+ busybox: { valueFlags: [], flags: [], commandString: [] },
46
+ su: { valueFlags: [], flags: [], commandString: [], viaShell: true },
47
+ runuser: { valueFlags: [], flags: [], commandString: [], viaShell: true },
48
+ chroot: { valueFlags: [], flags: [], commandString: [], positional: /^/ },
49
+ setpriv: { valueFlags: [], flags: [], commandString: [] },
50
+ numactl: { valueFlags: [], flags: [], commandString: [] },
51
+ prlimit: { valueFlags: [], flags: [], commandString: [] },
52
+ "systemd-run": { valueFlags: [], flags: [], commandString: [] },
53
+ valgrind: { valueFlags: [], flags: [], commandString: [] },
54
+ firejail: { valueFlags: [], flags: [], commandString: [] },
55
+ bwrap: { valueFlags: [], flags: [], commandString: [] },
56
+ ash: { valueFlags: [], flags: [], commandString: [], viaShell: true },
57
+ mksh: { valueFlags: [], flags: [], commandString: [], viaShell: true },
58
+ yash: { valueFlags: [], flags: [], commandString: [], viaShell: true },
59
+ pdksh: { valueFlags: [], flags: [], commandString: [], viaShell: true },
60
+ parallel: { valueFlags: [], flags: [], commandString: [], viaShell: true },
61
+ alias: { valueFlags: [], flags: [], commandString: [], viaShell: true },
62
+ mapfile: { valueFlags: [], flags: [], commandString: [], executes: ["-C"] },
63
+ readarray: { valueFlags: [], flags: [], commandString: [], executes: ["-C"] },
44
64
  };
45
- export const VARIABLE_OPERAND_BUILTINS = new Set(["printf", "unset", "read", "mapfile", "readarray", "declare", "typeset", "local", "export", "readonly", "test", "[", "[["]);
65
+ export const VARIABLE_OPERAND_BUILTINS = new Set(programRows().filter((row) => row.operands?.rest?.kind === "binds-name" || declaresOption(row, (spec) => spec.value?.kind === "binds-name")).map((row) => row.key));
46
66
  export function evaluatesOperand(run) {
47
67
  if (!VARIABLE_OPERAND_BUILTINS.has(run[0]?.text ?? ""))
48
68
  return false;
@@ -76,8 +76,16 @@ export declare function parkedSkillApprovalRefusal(row: {
76
76
  readonly args: unknown;
77
77
  readonly boundGrantDigest?: string;
78
78
  }, args: unknown, skills: readonly SkillGrantSource[], skillToolName: string, site?: "claim" | "execution"): string | undefined;
79
- /** A resume's skills read ONCE: each definition copied with its two lists, so the parked Skill approval's binding and the
80
- * resumed leg's prepare read one value — a later edit to the caller's own objects or arrays reaches neither. */
79
+ /**
80
+ * A skill's table (`allowed-tools` / `disallowed-tools`) READ ONCE, the one reading every later reader takes instead of the host's
81
+ * value: absent (`undefined`, or `null` — a frontmatter's empty key) is no table; a list is its dense copy (by index, no iterator
82
+ * of the host's runs; a member that is not a string stays as it is); a value that is not a list, or a list whose read throws, is
83
+ * ONE entry that reads as nothing ({@link nonListValueLabel}), so each table applies the law it already has to an entry that reads
84
+ * as nothing — a deny table keeps its Skill from activating, an allow table is announced and grants nothing. A string is not spread.
85
+ */
86
+ export declare function readSkillTable(value: unknown): string[] | undefined;
87
+ /** A resume's skills read ONCE: each definition copied with its two tables ({@link readSkillTable}), so the parked Skill approval's
88
+ * binding and the resumed leg's prepare read one value — a later edit to the caller's own objects or arrays reaches neither. */
81
89
  export declare function detachSkillLists<T extends SkillGrantSource>(skills: readonly T[]): T[];
82
90
  /** Does this skill declare a list (either, non-empty)? The one test of "the Skill card is asked for this skill". */
83
91
  export declare function declaresSkillLists(skill: Pick<SkillGrantSource, "allowedTools" | "disallowedTools">): boolean;
@@ -3,7 +3,8 @@ import { parsePermissionRule } from "./permission-rules.js";
3
3
  import { mountedToolPermissionSeat } from "./mode-policy.js";
4
4
  import { inlineUntrusted } from "./untrusted-text.js";
5
5
  import { boundInputHashOf } from "./canonical-json.js";
6
- import { allowingRows, autoStripped, compileAllowEntry, compileAllowList, inertEntryPhrase, judgeAllowEntries } from "./allow-entry.js";
6
+ import { readToolNameList } from "../agents/tool-filter.js";
7
+ import { allowingRows, autoStripped, compileAllowEntry, compileAllowList, inertEntryPhrase, judgeAllowEntries, nonListValueLabel, nonStringMemberLabel, renderListEntry } from "./allow-entry.js";
7
8
  export const SKILL_GRANT_ORIGINS = Object.freeze(["model", "user", "inherited"]);
8
9
  const FROZEN_SKILL_GRANT_ORIGINS = new Set(["model", "inherited"]);
9
10
  export function skillNamedBy(args, skills) {
@@ -12,6 +13,8 @@ export function skillNamedBy(args, skills) {
12
13
  }
13
14
  function skillGrantBinding(skill) {
14
15
  const canonical = (entries) => [...new Set((entries ?? []).map((e) => {
16
+ if (typeof e !== "string")
17
+ return nonStringMemberLabel(e);
15
18
  const p = parsePermissionRule(e);
16
19
  return p.ruleContent === undefined ? p.toolName : `${p.toolName}(${p.ruleContent})`;
17
20
  }))].sort();
@@ -44,8 +47,21 @@ export function parkedSkillApprovalRefusal(row, args, skills, skillToolName, sit
44
47
  ? `${why} — refusing pre-CAS (nothing ran; the checkpoint stays pending). Decide this checkpoint as deny and re-activate it: the new card shows the current lists.`
45
48
  : `The approved Skill call was not executed: ${why}. This approval is spent — to use "${chosen}", have the model activate it again: the new card shows its lists.`;
46
49
  }
50
+ export function readSkillTable(value) {
51
+ if (value === undefined || value === null)
52
+ return undefined;
53
+ const read = readToolNameList(value);
54
+ return read.kind === "entries" ? read.entries : [nonListValueLabel(read)];
55
+ }
47
56
  export function detachSkillLists(skills) {
48
- return skills.map((s) => (typeof s === "object" && s !== null ? { ...s, ...(Array.isArray(s.allowedTools) ? { allowedTools: [...s.allowedTools] } : {}), ...(Array.isArray(s.disallowedTools) ? { disallowedTools: [...s.disallowedTools] } : {}) } : s));
57
+ return skills.map((s) => {
58
+ if (typeof s !== "object" || s === null)
59
+ return s;
60
+ const { allowedTools: rawAllowed, disallowedTools: rawDenied, ...rest } = s;
61
+ const allowedTools = readSkillTable(rawAllowed);
62
+ const disallowedTools = readSkillTable(rawDenied);
63
+ return { ...rest, ...(allowedTools !== undefined ? { allowedTools } : {}), ...(disallowedTools !== undefined ? { disallowedTools } : {}) };
64
+ });
49
65
  }
50
66
  export function declaresSkillLists(skill) {
51
67
  return (skill.allowedTools?.length ?? 0) > 0 || (skill.disallowedTools?.length ?? 0) > 0;
@@ -74,7 +90,7 @@ export function skillDenyDecision(hit) {
74
90
  action: "deny",
75
91
  message: hit.readsAsNothing !== undefined
76
92
  ? skillDenyUnreadable(hit.skill, hit.readsAsNothing, "activation").message
77
- : `the active skill "${inlineUntrusted(hit.skill, 120)}" lists this tool in disallowed-tools (${hit.entries.map((e) => inlineUntrusted(e, 200)).join(", ")}) — refused for the rest of this run`,
93
+ : `the active skill "${inlineUntrusted(hit.skill, 120)}" lists this tool in disallowed-tools (${hit.entries.map(renderListEntry).join(", ")}) — refused for the rest of this run`,
78
94
  decisionReason: "skill",
79
95
  };
80
96
  }
@@ -88,7 +104,7 @@ export function skillRowRefusal(lane, req) {
88
104
  export function skillAllowDecision(hit, updatedInput) {
89
105
  return {
90
106
  action: "allow",
91
- message: `the active skill "${inlineUntrusted(hit.skill, 120)}" lists this tool in allowed-tools (${hit.entries.map((e) => inlineUntrusted(e, 200)).join(", ")})`,
107
+ message: `the active skill "${inlineUntrusted(hit.skill, 120)}" lists this tool in allowed-tools (${hit.entries.map(renderListEntry).join(", ")})`,
92
108
  decisionReason: "skill",
93
109
  ...(updatedInput !== undefined ? { updatedInput } : {}),
94
110
  };
@@ -50,6 +50,7 @@
50
50
  * visibility probe from a model's call.
51
51
  */
52
52
  import type { ToolCallRequest, ToolCallFace, ToolPolicy } from "./tool-policy.js";
53
+ import type { CallTargetStamp } from "./effective-path-target.js";
53
54
  import { type SkillGrantLane } from "./skill-grant.js";
54
55
  import type { OrgGateVerdict, PersistedRuleAnswer } from "./hooks.js";
55
56
  /** The layers the judge consults, as named in its verdicts. */
@@ -81,6 +82,8 @@ export interface SyntheticReadLayers {
81
82
  orgRuleLane?: {
82
83
  adjudicate: (req: ToolCallRequest) => Promise<OrgGateVerdict>;
83
84
  };
85
+ /** The leg's target-reading stamp: the probe's request carries a reading of its target, as the live gate's does. */
86
+ stampCallTarget?: CallTargetStamp;
84
87
  /** The run's signal, for the engine's own layers. */
85
88
  signal?: AbortSignal;
86
89
  }
@@ -15,13 +15,15 @@ export function createSyntheticReadJudge(layers) {
15
15
  return async (call, face, budget) => {
16
16
  const deadlineAt = budget?.deadlineAt ?? Date.now() + ORG_ADJUDICATION_TIMEOUT_MS;
17
17
  const left = () => Math.max(0, Math.min(ORG_ADJUDICATION_TIMEOUT_MS, deadlineAt - Date.now()));
18
- const req = {
18
+ const probe = {
19
19
  toolName: "Read",
20
20
  args: { file_path: call.file_path, ...(call.offset !== undefined ? { offset: call.offset } : {}), ...(call.limit !== undefined ? { limit: call.limit } : {}) },
21
21
  toolCallId: syntheticReadProbeId(face),
22
22
  ...(call.cwd !== undefined ? { cwd: call.cwd } : {}),
23
23
  ...(call.face !== undefined ? { face: call.face } : {}),
24
24
  };
25
+ const stamped = layers.stampCallTarget?.(probe, layers.signal);
26
+ const req = stamped !== undefined ? await stamped : probe;
25
27
  let unanswered;
26
28
  const cannot = (layer, cause, reason) => {
27
29
  unanswered ??= { verdict: "unanswerable", layer, cause, reason };
@@ -32,10 +32,21 @@ export declare const SYSTEM_INJECTION_PRIORITIES: readonly SystemInjectionPriori
32
32
  export declare function isSystemInjectionPriority(value: unknown): value is SystemInjectionPriority;
33
33
  /** The ONE reading of a steer's priority: a parked row or an accepted input that carries none means `"next"`
34
34
  * (the default the live admission has always applied) — so a retry that spells the default and a row parked
35
- * without it are the same instruction, whichever side normalized. */
35
+ * without it are the same instruction, whichever side normalized. A tier outside the closed set throws
36
+ * (`steering.invalid_content`, the sentence names the set); `null` is such a tier, not an absent one. */
36
37
  export declare function steerPriorityOf(x: {
37
38
  readonly priority?: SystemInjectionPriority;
38
39
  }): SystemInjectionPriority;
40
+ /** The two queues a person's input rides on a live run: the `steer` lane (the running turn's next boundary) and the
41
+ * `followUp` lane (the run's would-otherwise-stop seat). They are also the two families of the stranded-input account — an
42
+ * input's account is the one of the lane it was queued on (`USER_INPUT_UNDRAINED_FAMILIES`). */
43
+ export type UserInputLane = "steer" | "followUp";
44
+ /** The ONE reading of "which lane carries this tier": `"later"` rides the follow-up lane (never folded into work in
45
+ * progress), `"next"` and `"now"` ride the steer lane (`"now"` additionally cuts the running turn). Both injection
46
+ * seats — the steer verb and the notification lane — branch on it. A parked row that carries no tier reads through
47
+ * {@link steerPriorityOf} first: `injectionLaneOf(steerPriorityOf(row))`. A tier outside the closed set throws
48
+ * (`steering.invalid_content`, the same check and sentence as {@link steerPriorityOf}). */
49
+ export declare function injectionLaneOf(priority: SystemInjectionPriority): UserInputLane;
39
50
  export interface TaskNotificationPayload {
40
51
  task_id: string;
41
52
  /** design/144 §2: `"external"` is CORE-MINTED ONLY — `TaskStream.notify()` casts it onto every
@@ -10,8 +10,20 @@ export const SYSTEM_INJECTION_PRIORITIES = ["now", "next", "later"];
10
10
  export function isSystemInjectionPriority(value) {
11
11
  return typeof value === "string" && SYSTEM_INJECTION_PRIORITIES.includes(value);
12
12
  }
13
+ function requireSystemInjectionPriority(value) {
14
+ if (isSystemInjectionPriority(value))
15
+ return value;
16
+ const shown = typeof value === "string" ? JSON.stringify(value.length > 24 ? `${value.slice(0, 24)}…` : value) : value === null ? "null" : typeof value;
17
+ const refusal = new Error(`a steer priority must be one of ${SYSTEM_INJECTION_PRIORITIES.join("/")}, got ${shown}`);
18
+ refusal.code = "steering.invalid_content";
19
+ throw refusal;
20
+ }
13
21
  export function steerPriorityOf(x) {
14
- return x.priority ?? "next";
22
+ return x.priority === undefined ? "next" : requireSystemInjectionPriority(x.priority);
23
+ }
24
+ const LANE_OF_PRIORITY = { now: "steer", next: "steer", later: "followUp" };
25
+ export function injectionLaneOf(priority) {
26
+ return LANE_OF_PRIORITY[requireSystemInjectionPriority(priority)];
15
27
  }
16
28
  const TASK_NOTIFICATION_TAGS = [
17
29
  "task-notification",