harn-vm 0.10.162

Async bytecode virtual machine for the Harn programming language
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
fn main(harness: Harness) {
  return tool_define(tool_registry(), "verify", "Verify the active task", {
    input_schema: {type: "object", properties: {reason: {type: "string"}}, additionalProperties: false},
    returns: {type: "object"},
    prepare: { args -> return {{preparation}} },
    handler: { args ->
      const binding = tool_invocation_binding()
      const operation = binding.operation
      const result = harness.process.run({program: "sh", args: ["-c", operation.command], cwd: operation.cwd})
      if !result.success { throw {category: "timeout", message: "transient verifier failure"} }
      return {schema: "harn.agent_tool_handler_result.v2", outcome: "ok", text: result.stdout,
        data: {command: operation.command, cwd: operation.cwd, success: result.success}}
    },
  })
}