Skip to content

0.31.0

Choose a tag to compare

@github-actions github-actions released this 13 Nov 16:30
· 952 commits to master since this release
e90cf12

Agentica 0.31.0 is the first stable release since 0.30.1. It includes the changes of 0.31.0-alpha.1.

Highlights:

  • Lambdas: ->(x) { x + 1 } is a function value, and a pipe step may name a method of the value: xs |> map(f) |> sum().
  • Named arguments for any function, std/ function or builtin: check(gen, verbose: true).
  • Errors have a type: a failed Result holds an Error with a kind, message, code, details, cause and location. error("unique failed", kind: "db.constraint", code: 19) builds one and e.is_a?("db") matches a family of kinds. Builtins and std/ report kinds such as io.not_found, net.timeout, http.too_large and denied.fs.
  • private: a private line in a file or module block makes the declarations after it private, and in a struct body makes the fields after it private to the module (the struct is built only there).
  • agentica = "0.31.0" in agentica.toml names the oldest Agentica a project or package needs.
  • Builtin types live under their module: File.Info, TCP.Socket, TLS.Context, Test.Case, JSON.Value, HTTP.Request.
  • agentica lint, refs and type-at understand named arguments and error kinds.

Breaking changes:

  • export before a declaration is a parse error. A declaration is public unless it comes after private: delete the export, and put private before the declarations you want to hide. export Alias.name still re-exports.
  • A file with no private is public as a whole (it exported only what it marked before): add private before what you want to hide. An import after a re-export is CHECK-DECL-ORDER: move the imports above it.
  • Builtin and std/ errors have kinds, and == with error("same text") no longer holds. Branch on e.kind or e.is_a?("io"), not on the message.
  • error(e) in a case binds an Error, not a String: write e.message.
  • A refused --deny-* or --sandbox call returns the kind denied.env, denied.fs, denied.net or denied.run, not error.
  • Old type names are unknown: write JSON.Value and JSON.Field (not Json, JsonField), File.Info, File.Handle, Process.Output, TCP.Socket, TCP.Listener, TLS.Context, TLS.ClientOptions, TLS.ServerOptions, Test.Case, and System.Profile.measure / System.Profile.steps.
  • From the alpha: a builtin has only its Ruby name (strip, to_i, list.join, ...); the HTTP types are HTTP.Request, HTTP.Response, HTTP.Header, HTTP.ClientOptions, HTTP.ServerOptions, HTTP.Client and HTTP.Server; Error is a reserved type name; nothing chains after the end of a do block (use braces); agentica test --jobs N runs the scenarios of one file as separate jobs (use --jobs 1 when they share a port, a path or a DB); the child channel of Process.spawn_channel is a pipe per direction.

Full list: CHANGELOG.

The archives are not signed or notarized.