CodeJob
Defined in: agents/src/code-driver.ts:7
Properties
Section titled “Properties”cpuMs: number;Defined in: agents/src/code-driver.ts:23
Cumulative execution time in milliseconds, excluding asynchronous host waits.
deadline
Section titled “deadline”deadline: number;Defined in: agents/src/code-driver.ts:25
Absolute wall deadline in epoch milliseconds, including admission and tool waits.
memoryBytes
Section titled “memoryBytes”memoryBytes: number;Defined in: agents/src/code-driver.ts:19
Maximum guest heap allocation in bytes.
script
Section titled “script”script: string;Defined in: agents/src/code-driver.ts:9
SDK-built JavaScript. Its value must be a string or a promise of a JSON envelope string.
signal
Section titled “signal”signal: AbortSignal;Defined in: agents/src/code-driver.ts:27
The SDK aborts its tool calls when this job ends. Cancellation cannot undo an effect.
stackBytes
Section titled “stackBytes”stackBytes: number;Defined in: agents/src/code-driver.ts:21
Maximum guest stack in bytes. A driver may refuse an unsafe size.
Methods
Section titled “Methods”call()
Section titled “call()”call(name, input): Promise<string>;Defined in: agents/src/code-driver.ts:15
Exposed as __pk_call(name, input). Both arguments and the reply are strings. The SDK checks tool names, JSON, byte limits, permissions and call budgets. Return an error envelope for tool failures, not a rejected promise. Never retried.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
name |
string |
input |
string |
Returns
Section titled “Returns”Promise<string>
log(text): void;Defined in: agents/src/code-driver.ts:17
Exposed as __pk_log(text). The SDK caps and records the text.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
text |
string |
Returns
Section titled “Returns”void