From 6c246a7165cce6483e66488de3c9db7441d1d7fd Mon Sep 17 00:00:00 2001 From: Virgil Date: Mon, 30 Mar 2026 00:20:03 +0000 Subject: [PATCH] docs(ax): add remaining usage examples Co-Authored-By: Virgil --- pkg/agentic/prep.go | 2 ++ pkg/agentic/prep_example_test.go | 6 ++++++ pkg/lib/lib.go | 5 ++++- pkg/lib/lib_example_test.go | 11 +++++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/pkg/agentic/prep.go b/pkg/agentic/prep.go index 4c6ae0c..e18b6e0 100644 --- a/pkg/agentic/prep.go +++ b/pkg/agentic/prep.go @@ -19,6 +19,8 @@ import ( ) // AgentOptions configures the agentic service. +// +// opts := agentic.AgentOptions{} type AgentOptions struct{} // PrepSubsystem provides agentic MCP tools for workspace orchestration. diff --git a/pkg/agentic/prep_example_test.go b/pkg/agentic/prep_example_test.go index 664aade..dff47d2 100644 --- a/pkg/agentic/prep_example_test.go +++ b/pkg/agentic/prep_example_test.go @@ -4,6 +4,12 @@ package agentic import core "dappco.re/go/core" +func ExampleAgentOptions() { + opts := AgentOptions{} + core.Println(opts == AgentOptions{}) + // Output: true +} + func ExamplePrepInput() { input := PrepInput{Repo: "go-io", Issue: 42} core.Println(input.Repo, input.Issue) diff --git a/pkg/lib/lib.go b/pkg/lib/lib.go index 382493b..912c222 100644 --- a/pkg/lib/lib.go +++ b/pkg/lib/lib.go @@ -197,6 +197,10 @@ func Persona(path string) core.Result { // --- Workspace Templates --- // WorkspaceData is the data passed to workspace templates. +// +// data := &lib.WorkspaceData{ +// Repo: "go-io", Task: "fix tests", Agent: "codex", BuildCmd: "go build ./...", +// } type WorkspaceData struct { Repo string Branch string @@ -288,7 +292,6 @@ func ListPersonas() []string { return a.AsSlice() } - // listNamesRecursive walks an embed tree via Data.ListNames. // Directories are recursed into. Files are added as slugs (extension stripped by ListNames). // A name can be both a file AND a directory (e.g. code/review.md + code/review/). diff --git a/pkg/lib/lib_example_test.go b/pkg/lib/lib_example_test.go index d230bcf..8e32fe3 100644 --- a/pkg/lib/lib_example_test.go +++ b/pkg/lib/lib_example_test.go @@ -82,6 +82,17 @@ func ExampleTaskBundle() { // true } +func ExampleWorkspaceData() { + data := &WorkspaceData{ + Repo: "go-io", + Task: "fix tests", + Agent: "codex", + BuildCmd: "go build ./...", + } + core.Println(data.Repo, data.Agent, data.BuildCmd) + // Output: go-io codex go build ./... +} + func ExampleExtractWorkspace() { dir := (&core.Fs{}).NewUnrestricted().TempDir("example-ws") defer (&core.Fs{}).NewUnrestricted().DeleteAll(dir)