@plimsollmark/client 0.18.0 → 0.19.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/README.md +12 -1
- package/dist/mastra.d.ts +1 -0
- package/dist/sandboxes.d.ts +2 -0
- package/dist/sandboxes.js +4 -0
- package/dist/tool.d.ts +1 -0
- package/dist/tool.js +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -115,6 +115,12 @@ call. A call without a key (no thread, no run) always runs fresh: one sandbox sh
|
|
|
115
115
|
across conversations would show one user another's files. A language the daemon's image
|
|
116
116
|
cannot run is refused before anything is sent.
|
|
117
117
|
|
|
118
|
+
Each tool answer also includes `isolation` and `recordSha256`. The client checks
|
|
119
|
+
the run record before returning, then gives the tool the checked record's SHA-256.
|
|
120
|
+
The digest names that record; it is not a signature or a proof that the guest
|
|
121
|
+
computed honestly. See the [Trigger.dev feature and deployment guide](https://github.com/plimsollmark/plimsoll/blob/main/docs/trigger-dev.md)
|
|
122
|
+
for the three properties together.
|
|
123
|
+
|
|
118
124
|
Closing a sandbox checks the daemon's count of calls against the chain the client saw; a
|
|
119
125
|
mismatch means the daemon counted a call the client has no answer for (one that ended in an
|
|
120
126
|
abort, a timeout, a dropped connection or a proxy's error), or, if none did, that someone
|
|
@@ -147,7 +153,7 @@ import { plimsollCodeSandbox } from "@plimsollmark/client/trigger";
|
|
|
147
153
|
|
|
148
154
|
const sandbox = plimsollCodeSandbox({
|
|
149
155
|
client: () => new PlimsollClient({ baseUrl: process.env.PLIMSOLL_URL!, token: process.env.PLIMSOLL_TOKEN }),
|
|
150
|
-
minimumIsolation: "
|
|
156
|
+
minimumIsolation: "kernel",
|
|
151
157
|
});
|
|
152
158
|
|
|
153
159
|
export const codeChat = chat.agent({
|
|
@@ -162,6 +168,11 @@ export const codeChat = chat.agent({
|
|
|
162
168
|
|
|
163
169
|
The full example, with a test that drives real turns through Trigger.dev's `mockChatAgent`:
|
|
164
170
|
[examples/trigger-chat](https://github.com/plimsollmark/plimsoll/tree/main/examples/trigger-chat/).
|
|
171
|
+
Its source uses a `container` floor for local development. The
|
|
172
|
+
[deployable sister starter](https://github.com/plimsollmark/plimsoll-trigger-starter)
|
|
173
|
+
uses `kernel` by default. Hostile production code needs the verified kernel or
|
|
174
|
+
VM tier; choose `vm` when the threat model requires a VM boundary, accepting
|
|
175
|
+
that current VM providers cannot keep cells.
|
|
165
176
|
|
|
166
177
|
What the hooks cannot cover: a run that dies without reaching `onChatSuspend` or
|
|
167
178
|
`onComplete` (its process killed, a crash) leaves its sandbox open until the add-on's idle
|
package/dist/mastra.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export declare function plimsollExecuteCode(opts: PlimsollExecuteCodeOptions): {
|
|
|
20
20
|
filesPersist: boolean;
|
|
21
21
|
freshSandbox?: true | undefined;
|
|
22
22
|
isolation: string;
|
|
23
|
+
recordSha256: string;
|
|
23
24
|
}, unknown, unknown, import("@mastra/core/tools").ToolExecutionContext<unknown, unknown, unknown>, "executeCode", unknown>;
|
|
24
25
|
/** Closes a user's thread's sandbox, e.g. when the conversation ends. */
|
|
25
26
|
dispose: (threadId: string, resourceId: string) => Promise<void>;
|
package/dist/sandboxes.d.ts
CHANGED
|
@@ -86,6 +86,8 @@ export type ExecuteCodeOutput = {
|
|
|
86
86
|
freshSandbox?: true;
|
|
87
87
|
/** The tier the code ran behind: configuration and provider evidence, not attestation. */
|
|
88
88
|
isolation: string;
|
|
89
|
+
/** SHA-256 of the run record checked by the client before this result was returned. */
|
|
90
|
+
recordSha256: string;
|
|
89
91
|
};
|
|
90
92
|
/** @internal A fresh call on a daemon without projects: the code as a snippet, its last value printed. Node and QuickJS alike. */
|
|
91
93
|
export declare function snippetRunner(code: string): string;
|
package/dist/sandboxes.js
CHANGED
|
@@ -200,6 +200,7 @@ export class CodeSandboxes {
|
|
|
200
200
|
filesPersist: !ended,
|
|
201
201
|
...(first ? { freshSandbox: true } : {}),
|
|
202
202
|
isolation: r.isolation,
|
|
203
|
+
recordSha256: r.record.sha256,
|
|
203
204
|
};
|
|
204
205
|
}
|
|
205
206
|
catch (e) {
|
|
@@ -261,6 +262,7 @@ export class CodeSandboxes {
|
|
|
261
262
|
stateKept: false,
|
|
262
263
|
filesPersist: false,
|
|
263
264
|
isolation: r.isolation,
|
|
265
|
+
recordSha256: r.record.sha256,
|
|
264
266
|
};
|
|
265
267
|
}
|
|
266
268
|
const runner = RUNNERS[language];
|
|
@@ -276,6 +278,7 @@ export class CodeSandboxes {
|
|
|
276
278
|
stateKept: false,
|
|
277
279
|
filesPersist: false,
|
|
278
280
|
isolation: r.isolation,
|
|
281
|
+
recordSha256: r.record.sha256,
|
|
279
282
|
};
|
|
280
283
|
}
|
|
281
284
|
return {
|
|
@@ -283,6 +286,7 @@ export class CodeSandboxes {
|
|
|
283
286
|
stateKept: false,
|
|
284
287
|
filesPersist: false,
|
|
285
288
|
isolation: r.isolation,
|
|
289
|
+
recordSha256: r.record.sha256,
|
|
286
290
|
};
|
|
287
291
|
}
|
|
288
292
|
#session(key) {
|
package/dist/tool.d.ts
CHANGED
package/dist/tool.js
CHANGED
|
@@ -14,7 +14,8 @@ export function executeCodeDescription(languages = DEFAULT_LANGUAGES) {
|
|
|
14
14
|
"this call's interpreter had just started, so nothing earlier calls defined exists and has to be rebuilt; freshSandbox means no file from " +
|
|
15
15
|
"earlier calls is there either. " +
|
|
16
16
|
"To give the code data, such as another tool's output, pass it in files rather than pasting it into the code; the code reads each file by its relative path. " +
|
|
17
|
-
"Files written to the working directory can still be there on the next call when filesPersist is true; freshSandbox on that call says they are not."
|
|
17
|
+
"Files written to the working directory can still be there on the next call when filesPersist is true; freshSandbox on that call says they are not. " +
|
|
18
|
+
"The result also reports the isolation tier and the SHA-256 of the run record the client checked.");
|
|
18
19
|
}
|
|
19
20
|
/** The tool's input schema for the languages it offers. */
|
|
20
21
|
export function executeCodeInput(languages = DEFAULT_LANGUAGES) {
|
|
@@ -46,4 +47,5 @@ export const executeCodeOutput = z.object({
|
|
|
46
47
|
filesPersist: z.boolean(),
|
|
47
48
|
freshSandbox: z.literal(true).optional(),
|
|
48
49
|
isolation: z.string(),
|
|
50
|
+
recordSha256: z.string().regex(/^[0-9a-f]{64}$/),
|
|
49
51
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plimsollmark/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "TypeScript client for plimsolld, with Trigger.dev and Mastra executeCode add-ons",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/plimsollmark/plimsoll/tree/main/clients/typescript#readme",
|