Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ To use a local version of this library from source in another project, edit the
directive. This can be done through the CLI with the following:

```sh
$ go mod edit -replace github.com/sst/opencode-sdk-go=/path/to/opencode-sdk-go
$ go mod edit -replace github.com/anomalyco/opencode-sdk-go=/path/to/opencode-sdk-go
```

## Running tests
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Opencode Go API Library

<a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go"><img src="https://pkg.go.dev/badge/github.com/sst/opencode-sdk-go.svg" alt="Go Reference"></a>
<a href="https://pkg.go.dev/github.com/anomalyco/opencode-sdk-go"><img src="https://pkg.go.dev/badge/github.com/anomalyco/opencode-sdk-go.svg" alt="Go Reference"></a>

The Opencode Go library provides convenient access to the [Opencode REST API](https://opencode.ai/docs)
from applications written in Go.
Expand All @@ -13,7 +13,7 @@ It is generated with [Stainless](https://www.stainless.com/).

```go
import (
"github.com/sst/opencode-sdk-go" // imported as opencode
"github.com/anomalyco/opencode-sdk-go" // imported as opencode
)
```

Expand All @@ -24,7 +24,7 @@ Or to pin the version:
<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/sst/opencode-sdk-go@v0.19.2'
go get -u 'github.com/anomalyco/opencode-sdk-go@v0.19.2'
```

<!-- x-release-please-end -->
Expand All @@ -44,7 +44,7 @@ import (
"context"
"fmt"

"github.com/sst/opencode-sdk-go"
"github.com/anomalyco/opencode-sdk-go"
)

func main() {
Expand Down Expand Up @@ -150,7 +150,7 @@ client.Session.List(context.TODO(), ...,
)
```

See the [full list of request options](https://pkg.go.dev/github.com/sst/opencode-sdk-go/option).
See the [full list of request options](https://pkg.go.dev/github.com/anomalyco/opencode-sdk-go/option).

### Pagination

Expand Down Expand Up @@ -356,7 +356,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an [issue](https://www.github.com/sst/opencode-sdk-go/issues) with questions, bugs, or suggestions.
We are keen for your feedback; please open an [issue](https://www.github.com/anomalyco/opencode-sdk-go/issues) with questions, bugs, or suggestions.

## Contributing

Expand Down
10 changes: 5 additions & 5 deletions agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"net/url"
"slices"

"github.com/sst/opencode-sdk-go/internal/apijson"
"github.com/sst/opencode-sdk-go/internal/apiquery"
"github.com/sst/opencode-sdk-go/internal/param"
"github.com/sst/opencode-sdk-go/internal/requestconfig"
"github.com/sst/opencode-sdk-go/option"
"github.com/anomalyco/opencode-sdk-go/internal/apijson"
"github.com/anomalyco/opencode-sdk-go/internal/apiquery"
"github.com/anomalyco/opencode-sdk-go/internal/param"
"github.com/anomalyco/opencode-sdk-go/internal/requestconfig"
"github.com/anomalyco/opencode-sdk-go/option"
)

// AgentService contains methods and other services that help with interacting with
Expand Down
6 changes: 3 additions & 3 deletions agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"os"
"testing"

"github.com/sst/opencode-sdk-go"
"github.com/sst/opencode-sdk-go/internal/testutil"
"github.com/sst/opencode-sdk-go/option"
"github.com/anomalyco/opencode-sdk-go"
"github.com/anomalyco/opencode-sdk-go/internal/testutil"
"github.com/anomalyco/opencode-sdk-go/option"
)

func TestAgentListWithOptionalParams(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions aliases.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
package opencode

import (
"github.com/sst/opencode-sdk-go/internal/apierror"
"github.com/sst/opencode-sdk-go/shared"
"github.com/anomalyco/opencode-sdk-go/internal/apierror"
"github.com/anomalyco/opencode-sdk-go/shared"
)

type Error = apierror.Error
Expand Down
192 changes: 96 additions & 96 deletions api.md

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"net/url"
"slices"

"github.com/sst/opencode-sdk-go/internal/apijson"
"github.com/sst/opencode-sdk-go/internal/apiquery"
"github.com/sst/opencode-sdk-go/internal/param"
"github.com/sst/opencode-sdk-go/internal/requestconfig"
"github.com/sst/opencode-sdk-go/option"
"github.com/anomalyco/opencode-sdk-go/internal/apijson"
"github.com/anomalyco/opencode-sdk-go/internal/apiquery"
"github.com/anomalyco/opencode-sdk-go/internal/param"
"github.com/anomalyco/opencode-sdk-go/internal/requestconfig"
"github.com/anomalyco/opencode-sdk-go/option"
)

// AppService contains methods and other services that help with interacting with
Expand Down
6 changes: 3 additions & 3 deletions app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"os"
"testing"

"github.com/sst/opencode-sdk-go"
"github.com/sst/opencode-sdk-go/internal/testutil"
"github.com/sst/opencode-sdk-go/option"
"github.com/anomalyco/opencode-sdk-go"
"github.com/anomalyco/opencode-sdk-go/internal/testutil"
"github.com/anomalyco/opencode-sdk-go/option"
)

func TestAppLogWithOptionalParams(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"os"
"slices"

"github.com/sst/opencode-sdk-go/internal/requestconfig"
"github.com/sst/opencode-sdk-go/option"
"github.com/anomalyco/opencode-sdk-go/internal/requestconfig"
"github.com/anomalyco/opencode-sdk-go/option"
)

// Client creates a struct with services and top level methods that help with
Expand Down
6 changes: 3 additions & 3 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"testing"
"time"

"github.com/sst/opencode-sdk-go"
"github.com/sst/opencode-sdk-go/internal"
"github.com/sst/opencode-sdk-go/option"
"github.com/anomalyco/opencode-sdk-go"
"github.com/anomalyco/opencode-sdk-go/internal"
"github.com/anomalyco/opencode-sdk-go/option"
)

type closureTransport struct {
Expand Down
10 changes: 5 additions & 5 deletions command.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"net/url"
"slices"

"github.com/sst/opencode-sdk-go/internal/apijson"
"github.com/sst/opencode-sdk-go/internal/apiquery"
"github.com/sst/opencode-sdk-go/internal/param"
"github.com/sst/opencode-sdk-go/internal/requestconfig"
"github.com/sst/opencode-sdk-go/option"
"github.com/anomalyco/opencode-sdk-go/internal/apijson"
"github.com/anomalyco/opencode-sdk-go/internal/apiquery"
"github.com/anomalyco/opencode-sdk-go/internal/param"
"github.com/anomalyco/opencode-sdk-go/internal/requestconfig"
"github.com/anomalyco/opencode-sdk-go/option"
)

// CommandService contains methods and other services that help with interacting
Expand Down
6 changes: 3 additions & 3 deletions command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"os"
"testing"

"github.com/sst/opencode-sdk-go"
"github.com/sst/opencode-sdk-go/internal/testutil"
"github.com/sst/opencode-sdk-go/option"
"github.com/anomalyco/opencode-sdk-go"
"github.com/anomalyco/opencode-sdk-go/internal/testutil"
"github.com/anomalyco/opencode-sdk-go/option"
)

func TestCommandListWithOptionalParams(t *testing.T) {
Expand Down
12 changes: 6 additions & 6 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (
"reflect"
"slices"

"github.com/sst/opencode-sdk-go/internal/apijson"
"github.com/sst/opencode-sdk-go/internal/apiquery"
"github.com/sst/opencode-sdk-go/internal/param"
"github.com/sst/opencode-sdk-go/internal/requestconfig"
"github.com/sst/opencode-sdk-go/option"
"github.com/sst/opencode-sdk-go/shared"
"github.com/anomalyco/opencode-sdk-go/internal/apijson"
"github.com/anomalyco/opencode-sdk-go/internal/apiquery"
"github.com/anomalyco/opencode-sdk-go/internal/param"
"github.com/anomalyco/opencode-sdk-go/internal/requestconfig"
"github.com/anomalyco/opencode-sdk-go/option"
"github.com/anomalyco/opencode-sdk-go/shared"
"github.com/tidwall/gjson"
)

Expand Down
6 changes: 3 additions & 3 deletions config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"os"
"testing"

"github.com/sst/opencode-sdk-go"
"github.com/sst/opencode-sdk-go/internal/testutil"
"github.com/sst/opencode-sdk-go/option"
"github.com/anomalyco/opencode-sdk-go"
"github.com/anomalyco/opencode-sdk-go/internal/testutil"
"github.com/anomalyco/opencode-sdk-go/option"
)

func TestConfigGetWithOptionalParams(t *testing.T) {
Expand Down
14 changes: 7 additions & 7 deletions event.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import (
"reflect"
"slices"

"github.com/sst/opencode-sdk-go/internal/apijson"
"github.com/sst/opencode-sdk-go/internal/apiquery"
"github.com/sst/opencode-sdk-go/internal/param"
"github.com/sst/opencode-sdk-go/internal/requestconfig"
"github.com/sst/opencode-sdk-go/option"
"github.com/sst/opencode-sdk-go/packages/ssestream"
"github.com/sst/opencode-sdk-go/shared"
"github.com/anomalyco/opencode-sdk-go/internal/apijson"
"github.com/anomalyco/opencode-sdk-go/internal/apiquery"
"github.com/anomalyco/opencode-sdk-go/internal/param"
"github.com/anomalyco/opencode-sdk-go/internal/requestconfig"
"github.com/anomalyco/opencode-sdk-go/option"
"github.com/anomalyco/opencode-sdk-go/packages/ssestream"
"github.com/anomalyco/opencode-sdk-go/shared"
"github.com/tidwall/gjson"
)

Expand Down
4 changes: 2 additions & 2 deletions field.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package opencode

import (
"github.com/sst/opencode-sdk-go/internal/param"
"github.com/anomalyco/opencode-sdk-go/internal/param"
"io"
)

// F is a param field helper used to initialize a [param.Field] generic struct.
// This helps specify null, zero values, and overrides, as well as normal values.
// You can read more about this in our [README].
//
// [README]: https://pkg.go.dev/github.com/sst/opencode-sdk-go#readme-request-fields
// [README]: https://pkg.go.dev/github.com/anomalyco/opencode-sdk-go#readme-request-fields
func F[T any](value T) param.Field[T] { return param.Field[T]{Value: value, Present: true} }

// Null is a param field helper which explicitly sends null to the API.
Expand Down
10 changes: 5 additions & 5 deletions file.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"net/url"
"slices"

"github.com/sst/opencode-sdk-go/internal/apijson"
"github.com/sst/opencode-sdk-go/internal/apiquery"
"github.com/sst/opencode-sdk-go/internal/param"
"github.com/sst/opencode-sdk-go/internal/requestconfig"
"github.com/sst/opencode-sdk-go/option"
"github.com/anomalyco/opencode-sdk-go/internal/apijson"
"github.com/anomalyco/opencode-sdk-go/internal/apiquery"
"github.com/anomalyco/opencode-sdk-go/internal/param"
"github.com/anomalyco/opencode-sdk-go/internal/requestconfig"
"github.com/anomalyco/opencode-sdk-go/option"
)

// FileService contains methods and other services that help with interacting with
Expand Down
6 changes: 3 additions & 3 deletions file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"os"
"testing"

"github.com/sst/opencode-sdk-go"
"github.com/sst/opencode-sdk-go/internal/testutil"
"github.com/sst/opencode-sdk-go/option"
"github.com/anomalyco/opencode-sdk-go"
"github.com/anomalyco/opencode-sdk-go/internal/testutil"
"github.com/anomalyco/opencode-sdk-go/option"
)

func TestFileListWithOptionalParams(t *testing.T) {
Expand Down
10 changes: 5 additions & 5 deletions find.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"net/url"
"slices"

"github.com/sst/opencode-sdk-go/internal/apijson"
"github.com/sst/opencode-sdk-go/internal/apiquery"
"github.com/sst/opencode-sdk-go/internal/param"
"github.com/sst/opencode-sdk-go/internal/requestconfig"
"github.com/sst/opencode-sdk-go/option"
"github.com/anomalyco/opencode-sdk-go/internal/apijson"
"github.com/anomalyco/opencode-sdk-go/internal/apiquery"
"github.com/anomalyco/opencode-sdk-go/internal/param"
"github.com/anomalyco/opencode-sdk-go/internal/requestconfig"
"github.com/anomalyco/opencode-sdk-go/option"
)

// FindService contains methods and other services that help with interacting with
Expand Down
6 changes: 3 additions & 3 deletions find_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"os"
"testing"

"github.com/sst/opencode-sdk-go"
"github.com/sst/opencode-sdk-go/internal/testutil"
"github.com/sst/opencode-sdk-go/option"
"github.com/anomalyco/opencode-sdk-go"
"github.com/anomalyco/opencode-sdk-go/internal/testutil"
"github.com/anomalyco/opencode-sdk-go/option"
)

func TestFindFilesWithOptionalParams(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/sst/opencode-sdk-go
module github.com/anomalyco/opencode-sdk-go

go 1.22
go 1.25

require (
github.com/tidwall/gjson v1.14.4
Expand Down
2 changes: 1 addition & 1 deletion internal/apierror/apierror.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/http"
"net/http/httputil"

"github.com/sst/opencode-sdk-go/internal/apijson"
"github.com/anomalyco/opencode-sdk-go/internal/apijson"
)

// Error represents an error that originates from the API, i.e. when a request is
Expand Down
2 changes: 1 addition & 1 deletion internal/apiform/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"sync"
"time"

"github.com/sst/opencode-sdk-go/internal/param"
"github.com/anomalyco/opencode-sdk-go/internal/param"
)

var encoders sync.Map // map[encoderEntry]encoderFunc
Expand Down
2 changes: 1 addition & 1 deletion internal/apijson/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

"github.com/tidwall/sjson"

"github.com/sst/opencode-sdk-go/internal/param"
"github.com/anomalyco/opencode-sdk-go/internal/param"
)

var encoders sync.Map // map[encoderEntry]encoderFunc
Expand Down
2 changes: 1 addition & 1 deletion internal/apijson/field_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"
"time"

"github.com/sst/opencode-sdk-go/internal/param"
"github.com/anomalyco/opencode-sdk-go/internal/param"
)

type Struct struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/apiquery/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"sync"
"time"

"github.com/sst/opencode-sdk-go/internal/param"
"github.com/anomalyco/opencode-sdk-go/internal/param"
)

var encoders sync.Map // map[reflect.Type]encoderFunc
Expand Down
10 changes: 5 additions & 5 deletions internal/requestconfig/requestconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import (
"strings"
"time"

"github.com/sst/opencode-sdk-go/internal"
"github.com/sst/opencode-sdk-go/internal/apierror"
"github.com/sst/opencode-sdk-go/internal/apiform"
"github.com/sst/opencode-sdk-go/internal/apiquery"
"github.com/sst/opencode-sdk-go/internal/param"
"github.com/anomalyco/opencode-sdk-go/internal"
"github.com/anomalyco/opencode-sdk-go/internal/apierror"
"github.com/anomalyco/opencode-sdk-go/internal/apiform"
"github.com/anomalyco/opencode-sdk-go/internal/apiquery"
"github.com/anomalyco/opencode-sdk-go/internal/param"
)

func getDefaultHeaders() map[string]string {
Expand Down
Loading