@dynamicagents/plugins 0.16.1 → 0.18.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.
@@ -1,3 +1,42 @@
1
1
  import type { ToolSet } from "ai";
2
2
  import type { ComputerContext } from "./context.js";
3
+ /**
4
+ * The container's shell, as Computer's `exec` tool.
5
+ *
6
+ * **The tool is upstream's, and deliberately not wrapped past the advisory
7
+ * gate.** Its schema, its description, its truncation and its result shape are
8
+ * `@cloudflare/computer`'s, so the model sees the same `exec` everywhere that
9
+ * package's tools are installed and this plugin has no second dialect to keep in
10
+ * step. What that costs, each of it accepted rather than overlooked:
11
+ *
12
+ * - **Truncation keeps the tail, not both ends.** Upstream cuts each stream to
13
+ * its last lines, so a failure printed early in a long build is gone from what
14
+ * the model reads. The exit code still reports it, and the model's recourse is
15
+ * a narrower command.
16
+ * - **The description promises a file this workspace does not write.** Upstream
17
+ * tells the model that truncated output is saved where `read` and `grep` can
18
+ * open it. That holds for a Workspace whose runtime saves it; this one reports
19
+ * no saved path, so the reply names none and the sentence is unfulfilled.
20
+ * Nothing can be set to turn it off: the sentence is built into the generated
21
+ * description.
22
+ * - **A command stopped at the time limit or cancelled reads as a plain
23
+ * failure.** Upstream's result has somewhere for an exit code and somewhere
24
+ * for an error, and nowhere for the difference between a command that outran
25
+ * its limit, one whose call was cancelled, and one that simply failed.
26
+ * {@link file://./client.ts CommandResult.status} still carries it for the log
27
+ * line below, which is the only place it is read.
28
+ *
29
+ * What stays this plugin's, because neither belongs to a tool:
30
+ *
31
+ * - **The advisory gate**, below: a command waits out a running install, is
32
+ * refused while something transient makes it pointless, and carries a note
33
+ * about anything permanent. {@link file://./gate.ts ExecGate} is the contract.
34
+ * - **How the container runs a command**, in
35
+ * {@link file://./sandbox.ts sandboxClient}: the launch-and-cancel handshake,
36
+ * the time limit, and the shell transcript. A configured shell merges the two
37
+ * streams onto one of them, so `stderr` arrives empty and the whole transcript
38
+ * is in `stdout` — see {@link file://./shell.ts withShellTranscript} for why a
39
+ * model reading output wants that, and why the plugin's context block rather
40
+ * than the tool description is where the model is told.
41
+ */
3
42
  export declare function execTools(ctx: ComputerContext): ToolSet;