@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.
- package/CHANGELOG.md +418 -1
- package/dist/agents/extra-tool-names.d.ts +65 -0
- package/dist/agents/extra-tool-names.js +124 -0
- package/dist/agents/subagent.d.ts +17 -5
- package/dist/agents/subagent.js +65 -38
- package/dist/agents/tool-filter.d.ts +82 -5
- package/dist/agents/tool-filter.js +134 -4
- package/dist/core/agent-config-dir.d.ts +20 -0
- package/dist/core/agent-config-dir.js +49 -0
- package/dist/core/agent-definition.d.ts +2 -2
- package/dist/core/allow-entry.d.ts +30 -4
- package/dist/core/allow-entry.js +32 -5
- package/dist/core/ask-origin.d.ts +23 -4
- package/dist/core/ask-origin.js +11 -5
- package/dist/core/checkpoint-store.d.ts +41 -4
- package/dist/core/decision-receipt.js +1 -1
- package/dist/core/effective-path-target.d.ts +143 -10
- package/dist/core/effective-path-target.js +113 -9
- package/dist/core/engine-notice.d.ts +25 -3
- package/dist/core/engine-notice.js +12 -6
- package/dist/core/gate-fold.js +3 -0
- package/dist/core/gate-lanes.js +11 -3
- package/dist/core/gate-outcome.d.ts +5 -0
- package/dist/core/gate-outcome.js +2 -0
- package/dist/core/governance-codes.d.ts +3 -1
- package/dist/core/governance-codes.js +3 -0
- package/dist/core/hooks.d.ts +5 -0
- package/dist/core/memory-engine/content-origin.d.ts +0 -34
- package/dist/core/memory-engine/content-origin.js +9 -4
- package/dist/core/memory-engine/layout.d.ts +5 -1
- package/dist/core/memory-engine/layout.js +1 -0
- package/dist/core/path-rule-binding.d.ts +65 -0
- package/dist/core/path-rule-binding.js +99 -0
- package/dist/core/permission-rule-model.d.ts +47 -18
- package/dist/core/permission-rule-model.js +38 -42
- package/dist/core/permission-rule-provider.d.ts +7 -0
- package/dist/core/permission-rule-provider.js +10 -3
- package/dist/core/permission-rule-store.d.ts +8 -0
- package/dist/core/permission-rule-store.js +6 -2
- package/dist/core/permission-rule-sync.js +2 -2
- package/dist/core/permission-rules.d.ts +22 -36
- package/dist/core/permission-rules.js +50 -40
- package/dist/core/real-approval.d.ts +9 -6
- package/dist/core/real-approval.js +5 -5
- package/dist/core/runner/child-tree.d.ts +110 -0
- package/dist/core/runner/child-tree.js +107 -0
- package/dist/core/runner/construction-doors.d.ts +5 -0
- package/dist/core/runner/construction-doors.js +6 -0
- package/dist/core/runner/contracts.d.ts +54 -2
- package/dist/core/runner/permission-rule-lanes.d.ts +34 -25
- package/dist/core/runner/permission-rule-lanes.js +18 -12
- package/dist/core/runner/persisted-path-rows.d.ts +31 -7
- package/dist/core/runner/persisted-path-rows.js +31 -12
- package/dist/core/runner/prepare-ask-lane.d.ts +6 -0
- package/dist/core/runner/prepare-ask-lane.js +4 -2
- package/dist/core/runner/prepare-config-doors.js +3 -1
- package/dist/core/runner/prepare-execution-env.d.ts +5 -2
- package/dist/core/runner/prepare-execution-env.js +11 -3
- package/dist/core/runner/prepare-gate-stations.d.ts +6 -0
- package/dist/core/runner/prepare-gate-stations.js +3 -1
- package/dist/core/runner/prepare-hands-readface.d.ts +8 -4
- package/dist/core/runner/prepare-hands-readface.js +6 -6
- package/dist/core/runner/prepare-inherited-gate.d.ts +8 -1
- package/dist/core/runner/prepare-inherited-gate.js +8 -2
- package/dist/core/runner/prepare-listings.d.ts +4 -4
- package/dist/core/runner/prepare-listings.js +2 -22
- package/dist/core/runner/prepare-park-ask.d.ts +5 -0
- package/dist/core/runner/prepare-park-ask.js +6 -4
- package/dist/core/runner/prepare-policy-chain.d.ts +16 -2
- package/dist/core/runner/prepare-policy-chain.js +14 -5
- package/dist/core/runner/prepare-suspend-saga.d.ts +10 -0
- package/dist/core/runner/prepare-suspend-saga.js +7 -1
- package/dist/core/runner/prepare-task.js +41 -18
- package/dist/core/runner/prepare-turn-wiring.d.ts +2 -0
- package/dist/core/runner/prepare-turn-wiring.js +2 -1
- package/dist/core/runner/prepare-workspace-restore.d.ts +3 -0
- package/dist/core/runner/prepare-workspace-restore.js +1 -0
- package/dist/core/runner/resume-apply.js +17 -3
- package/dist/core/runner/resume-checkpoint-screen.js +13 -0
- package/dist/core/runner/resume-policy-outcome.js +2 -1
- package/dist/core/runner/run-leg.js +5 -1
- package/dist/core/runner/run-notification-lane.js +2 -2
- package/dist/core/runner/runtask.d.ts +2 -0
- package/dist/core/runner/runtask.js +4 -2
- package/dist/core/runner/stream-steer-verb.js +2 -2
- package/dist/core/runner/sub-agent-deny-lists.d.ts +32 -0
- package/dist/core/runner/sub-agent-deny-lists.js +121 -0
- package/dist/core/runner/synthetic-tools.d.ts +1 -1
- package/dist/core/runner/synthetic-tools.js +3 -2
- package/dist/core/runner/write-protection-station.d.ts +3 -2
- package/dist/core/runner/write-protection-station.js +1 -0
- package/dist/core/runner-deps.d.ts +14 -0
- package/dist/core/sensitive-path-policy.d.ts +8 -0
- package/dist/core/sensitive-path-policy.js +18 -2
- package/dist/core/session-policy-store.d.ts +6 -2
- package/dist/core/session-policy-store.js +2 -1
- package/dist/core/shell-wrapper-projection.d.ts +11 -0
- package/dist/core/shell-wrapper-projection.js +56 -0
- package/dist/core/shell-wrapper-table.d.ts +144 -34
- package/dist/core/shell-wrapper-table.js +40 -20
- package/dist/core/skill-grant.d.ts +10 -2
- package/dist/core/skill-grant.js +20 -4
- package/dist/core/synthetic-read-verdict.d.ts +3 -0
- package/dist/core/synthetic-read-verdict.js +3 -1
- package/dist/core/task-notification.d.ts +12 -1
- package/dist/core/task-notification.js +13 -1
- package/dist/core/task-spec.d.ts +5 -3
- package/dist/core/tool-catalog-entries.d.ts +21 -0
- package/dist/core/tool-catalog-entries.js +9 -0
- package/dist/core/tool-policy.d.ts +45 -12
- package/dist/core/tool-policy.js +18 -20
- package/dist/core/tool-spec.d.ts +23 -4
- package/dist/core/types.d.ts +1 -1
- package/dist/core/types.js +1 -1
- package/dist/core/write-protect.d.ts +4 -0
- package/dist/core/write-protect.js +30 -9
- package/dist/index.d.ts +10 -6
- package/dist/index.js +9 -5
- package/dist/orchestration/run-spec.js +8 -7
- package/dist/orchestration/workflow.js +3 -2
- package/dist/shell/lex.d.ts +7 -0
- package/dist/shell/lex.js +17 -0
- package/dist/tools/fs/bash-program-position.d.ts +8 -87
- package/dist/tools/fs/bash-program-position.js +33 -69
- package/dist/tools/fs/bash-readonly-classifier.d.ts +17 -444
- package/dist/tools/fs/bash-readonly-classifier.js +169 -1225
- package/dist/tools/fs/index.d.ts +3 -2
- package/dist/tools/fs/program-read-model.d.ts +694 -0
- package/dist/tools/fs/program-read-model.js +1252 -0
- package/dist/tools/fs/program-read-model.rows.d.ts +18 -0
- package/dist/tools/fs/program-read-model.rows.js +613 -0
- package/dist/tools/fs/read-deny-home.d.ts +19 -1
- package/dist/tools/fs/read-deny-home.js +62 -24
- package/dist/tools/fs/read-deny.d.ts +54 -14
- package/dist/tools/fs/read-deny.js +104 -50
- package/dist/tools/fs/removal-targets.d.ts +83 -0
- package/dist/tools/fs/removal-targets.js +236 -0
- package/dist/tools/fs/safety.d.ts +3 -0
- package/dist/tools/fs/safety.js +10 -3
- package/dist/tools/fs/shell-read-argv.d.ts +85 -0
- package/dist/tools/fs/shell-read-argv.js +386 -0
- package/dist/tools/fs/shell-read-bindings.d.ts +273 -0
- package/dist/tools/fs/shell-read-bindings.js +746 -0
- package/dist/tools/fs/shell-read-check.js +23 -15
- package/dist/tools/fs/shell-read-establish.js +79 -5
- package/dist/tools/fs/shell-read-judge.d.ts +11 -1
- package/dist/tools/fs/shell-read-judge.js +9 -1
- package/dist/tools/fs/shell-read-plan.d.ts +31 -7
- package/dist/tools/fs/shell-read-plan.js +299 -393
- package/dist/tools/fs/shell-read-word.d.ts +29 -26
- package/dist/tools/fs/shell-read-word.js +30 -38
- package/dist/tools/fs/shell-read-write-targets.d.ts +15 -37
- package/dist/tools/fs/shell-read-write-targets.js +83 -136
- package/dist/tools/fs/shell-reentry-text.d.ts +38 -6
- package/dist/tools/fs/shell-reentry-text.js +90 -53
- package/package.json +1 -1
- package/test/export-surface.snapshot.json +49 -3
- package/wire-changes/core@7.45.0.json +1084 -0
- 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.
|
|
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 ["
|
|
60
|
-
readonly flags: readonly ["
|
|
61
|
-
readonly commandString: readonly ["-
|
|
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 ["-
|
|
67
|
-
readonly flags: readonly ["
|
|
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 ["-
|
|
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", "--
|
|
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 ["
|
|
88
|
-
readonly flags: readonly ["
|
|
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 ["
|
|
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 ["-
|
|
98
|
-
readonly flags: readonly ["
|
|
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 ["
|
|
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 ["-
|
|
109
|
-
readonly flags: readonly ["
|
|
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 ["
|
|
121
|
-
readonly flags: readonly ["
|
|
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 ["
|
|
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 ["-
|
|
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 ["
|
|
137
|
-
readonly flags: readonly ["-
|
|
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 ["
|
|
143
|
-
readonly flags: readonly ["
|
|
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 ["
|
|
148
|
-
readonly flags: readonly ["
|
|
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 ["-
|
|
153
|
-
readonly flags: readonly ["
|
|
154
|
-
readonly commandString: readonly ["
|
|
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 ["
|
|
163
|
+
readonly commandString: readonly ["--command", "-c"];
|
|
161
164
|
readonly viaShell: true;
|
|
162
165
|
};
|
|
163
166
|
readonly unshare: {
|
|
164
|
-
readonly valueFlags: readonly ["
|
|
165
|
-
readonly flags: readonly ["
|
|
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 ["
|
|
170
|
-
readonly flags: readonly ["
|
|
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: ["
|
|
8
|
-
sudo: { valueFlags: ["-
|
|
9
|
-
doas: { valueFlags: ["-
|
|
10
|
-
pkexec: { valueFlags: ["--user"], flags: ["--disable-internal-agent", "--
|
|
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: ["
|
|
13
|
-
nice: { valueFlags: ["
|
|
14
|
-
timeout: { valueFlags: ["-
|
|
15
|
-
stdbuf: { valueFlags: ["
|
|
16
|
-
xargs: { valueFlags: ["-
|
|
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: ["
|
|
19
|
-
setsid: { valueFlags: [], flags: ["
|
|
20
|
-
taskset: { valueFlags: [], flags: ["-
|
|
21
|
-
chrt: { valueFlags: ["
|
|
22
|
-
strace: { valueFlags: ["
|
|
23
|
-
ltrace: { valueFlags: ["
|
|
24
|
-
flock: { valueFlags: ["-
|
|
25
|
-
script: { valueFlags: [], flags: [], commandString: ["
|
|
26
|
-
unshare: { valueFlags: ["
|
|
27
|
-
nsenter: { valueFlags: ["
|
|
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(
|
|
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
|
-
/**
|
|
80
|
-
*
|
|
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;
|
package/dist/core/skill-grant.js
CHANGED
|
@@ -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 {
|
|
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) =>
|
|
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(
|
|
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(
|
|
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
|
|
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
|
|
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",
|