@opensoha/contracts 0.1.21 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.21",
2
+ "version": "0.1.22",
3
3
  "schemas": {
4
4
  "plugins/plugin-manifest.schema.json": {
5
5
  "rootRequired": ["id", "name", "publisher", "type", "version"],
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.21",
2
+ "version": "0.1.22",
3
3
  "generatedFrom": "openapi/soha-api.yaml",
4
4
  "entries": [
5
5
  {
@@ -16,7 +16,7 @@ import (
16
16
  "time"
17
17
  )
18
18
 
19
- const defaultUserAgent = "opensoha-contracts/0.1.21"
19
+ const defaultUserAgent = "opensoha-contracts/0.1.22"
20
20
 
21
21
  type Client struct {
22
22
  BaseURL string
@@ -6749,6 +6749,27 @@ func (e NetworkPolicyPath) Valid() bool {
6749
6749
  }
6750
6750
  }
6751
6751
 
6752
+ // Defines values for NetworkProxyEngine.
6753
+ const (
6754
+ NetworkProxyEngineMihomo NetworkProxyEngine = "mihomo"
6755
+ NetworkProxyEngineSingBox NetworkProxyEngine = "sing-box"
6756
+ NetworkProxyEngineV2Ray NetworkProxyEngine = "v2ray"
6757
+ )
6758
+
6759
+ // Valid indicates whether the value is a known member of the NetworkProxyEngine enum.
6760
+ func (e NetworkProxyEngine) Valid() bool {
6761
+ switch e {
6762
+ case NetworkProxyEngineMihomo:
6763
+ return true
6764
+ case NetworkProxyEngineSingBox:
6765
+ return true
6766
+ case NetworkProxyEngineV2Ray:
6767
+ return true
6768
+ default:
6769
+ return false
6770
+ }
6771
+ }
6772
+
6752
6773
  // Defines values for NetworkResourceKind.
6753
6774
  const (
6754
6775
  NetworkResourceKindCIDR NetworkResourceKind = "cidr"
@@ -23027,6 +23048,16 @@ type NetworkPolicySubjects struct {
23027
23048
  Users []string `json:"users"`
23028
23049
  }
23029
23050
 
23051
+ // NetworkProxyConfigurationInput defines model for NetworkProxyConfigurationInput.
23052
+ type NetworkProxyConfigurationInput struct {
23053
+ Content string `json:"content,omitempty"`
23054
+ Enabled bool `json:"enabled"`
23055
+ ExpectedRevision int64 `json:"expectedRevision"`
23056
+ }
23057
+
23058
+ // NetworkProxyEngine defines model for NetworkProxyEngine.
23059
+ type NetworkProxyEngine string
23060
+
23030
23061
  // NetworkProxyFlowSummary defines model for NetworkProxyFlowSummary.
23031
23062
  type NetworkProxyFlowSummary struct {
23032
23063
  ActiveConnections int64 `json:"activeConnections"`
@@ -23041,6 +23072,14 @@ type NetworkProxyFlowSummary struct {
23041
23072
  UploadBytes int64 `json:"uploadBytes"`
23042
23073
  }
23043
23074
 
23075
+ // NetworkProxyInstanceInput defines model for NetworkProxyInstanceInput.
23076
+ type NetworkProxyInstanceInput struct {
23077
+ Engine NetworkProxyEngine `json:"engine"`
23078
+ Host string `json:"host,omitempty"`
23079
+ ID string `json:"id"`
23080
+ Name string `json:"name"`
23081
+ }
23082
+
23044
23083
  // NetworkResource defines model for NetworkResource.
23045
23084
  type NetworkResource struct {
23046
23085
  CreatedAt time.Time `json:"createdAt"`
@@ -5,6 +5,36 @@ import (
5
5
  "testing"
6
6
  )
7
7
 
8
+ func TestNetworkProxyInputsRemainInGoSDK(t *testing.T) {
9
+ for _, input := range []struct {
10
+ raw string
11
+ value any
12
+ }{
13
+ {`{"id":"proxy-a","name":"Proxy A","engine":"mihomo","host":"host-a"}`, &NetworkProxyInstanceInput{}},
14
+ {`{"expectedRevision":3,"enabled":false,"content":"mode: rule"}`, &NetworkProxyConfigurationInput{}},
15
+ } {
16
+ if err := json.Unmarshal([]byte(input.raw), input.value); err != nil {
17
+ t.Fatal(err)
18
+ }
19
+ encoded, err := json.Marshal(input.value)
20
+ if err != nil {
21
+ t.Fatal(err)
22
+ }
23
+ var before, after map[string]any
24
+ if err := json.Unmarshal([]byte(input.raw), &before); err != nil {
25
+ t.Fatal(err)
26
+ }
27
+ if err := json.Unmarshal(encoded, &after); err != nil {
28
+ t.Fatal(err)
29
+ }
30
+ for name, value := range before {
31
+ if after[name] != value {
32
+ t.Fatalf("%s changed during round trip: %s", name, encoded)
33
+ }
34
+ }
35
+ }
36
+ }
37
+
8
38
  func TestToolInvocationResultPreservesAbsentVersion(t *testing.T) {
9
39
  for _, input := range []string{
10
40
  `{"toolName":"legacy","riskLevel":"read","requiresApproval":false,"result":"success"}`,
@@ -61730,7 +61730,7 @@
61730
61730
  "info": {
61731
61731
  "description": "Public OpenSoha core API contract. This first contract focuses on stable cross-repository boundaries: auth, health, runner-facing control-plane callbacks, AI Gateway, and MCP capability discovery.\n",
61732
61732
  "title": "Soha API",
61733
- "version": "0.1.21"
61733
+ "version": "0.1.22"
61734
61734
  },
61735
61735
  "openapi": "3.1.0",
61736
61736
  "paths": {
@@ -1,7 +1,7 @@
1
1
  openapi: 3.1.0
2
2
  info:
3
3
  title: Soha API
4
- version: 0.1.21
4
+ version: 0.1.22
5
5
  description: >
6
6
  Public OpenSoha core API contract. This first contract focuses on stable
7
7
  cross-repository boundaries: auth, health, runner-facing control-plane
@@ -5,9 +5,9 @@ package openapi
5
5
  import _ "embed"
6
6
 
7
7
  const (
8
- Version = "0.1.21"
9
- YAMLSHA256 = "4f6a18c89a70f8ce91f27eb8d52eb49a7f5e4db38dc7de27eaa0efceac1c33fe"
10
- JSONSHA256 = "5e3ba8e83879359042b4df47658cb2df7e67a7bcc941ab2507155a1555c93d25"
8
+ Version = "0.1.22"
9
+ YAMLSHA256 = "5b0140f7820051bcbce9d2b2c0cd875b087a308f71dfdf1701d9052942c464ff"
10
+ JSONSHA256 = "e120a0bb9308d25baac4778d8535b11ea29bb5558ce2eebe35bde87c1c2f2724"
11
11
  )
12
12
 
13
13
  //go:embed soha-api.yaml
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensoha/contracts",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "private": false,
5
5
  "description": "Shared OpenSoha API, agent, MCP, skill, event, and auth contracts.",
6
6
  "license": "Apache-2.0",