Documentation
¶
Index ¶
- func GetScenarioEndpointPath(scenario typ.RuleScenario) string
- type HTTPEndpointConfig
- type HTTPTBClient
- func (c *HTTPTBClient) GetClaudeCodeEnv(ctx context.Context) ([]string, error)
- func (c *HTTPTBClient) GetClaudeCodeSettingsPathForProfile(ctx context.Context, profileID string) (string, error)
- func (c *HTTPTBClient) GetDataDir() string
- func (c *HTTPTBClient) GetHTTPEndpointForScenario(_ context.Context, scenario typ.RuleScenario) (*HTTPEndpointConfig, error)
- type MockTBClient
- func (m *MockTBClient) GetClaudeCodeEnv(ctx context.Context) ([]string, error)
- func (m *MockTBClient) GetClaudeCodeSettingsPathForProfile(ctx context.Context, profileID string) (string, error)
- func (m *MockTBClient) GetDataDir() string
- func (m *MockTBClient) GetHTTPEndpointForScenario(ctx context.Context, scenario typ.RuleScenario) (*HTTPEndpointConfig, error)
- type TBClient
- type TBClientImpl
- func (c *TBClientImpl) ClaudeCodeDefaultModel() string
- func (c *TBClientImpl) GetClaudeCodeEnv(ctx context.Context) ([]string, error)
- func (c *TBClientImpl) GetClaudeCodeSettingsPathForProfile(ctx context.Context, profileID string) (string, error)
- func (c *TBClientImpl) GetDataDir() string
- func (c *TBClientImpl) GetHTTPEndpointForScenario(ctx context.Context, scenario typ.RuleScenario) (*HTTPEndpointConfig, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetScenarioEndpointPath ¶ added in v0.260903.1
func GetScenarioEndpointPath(scenario typ.RuleScenario) string
GetScenarioEndpointPath returns the endpoint path for a scenario. Exported because the HTTP client also needs it.
Types ¶
type HTTPEndpointConfig ¶
HTTPEndpointConfig represents HTTP endpoint configuration for a scenario.
type HTTPTBClient ¶ added in v0.260903.1
type HTTPTBClient struct {
// contains filtered or unexported fields
}
HTTPTBClient implements TBClient via HTTP calls to the tingly-box management API. Use this when the consumer runs in a separate process from the server.
func NewHTTPTBClient ¶ added in v0.260903.1
func NewHTTPTBClient(baseURL, userToken, modelToken string) *HTTPTBClient
NewHTTPTBClient creates an HTTP-based TBClient. baseURL is the server root (scheme + host + port, no trailing slash). userToken authenticates management API calls; modelToken is the gateway API key returned in env vars.
func (*HTTPTBClient) GetClaudeCodeEnv ¶ added in v0.260903.1
func (c *HTTPTBClient) GetClaudeCodeEnv(ctx context.Context) ([]string, error)
func (*HTTPTBClient) GetClaudeCodeSettingsPathForProfile ¶ added in v0.260903.1
func (*HTTPTBClient) GetDataDir ¶ added in v0.260903.1
func (c *HTTPTBClient) GetDataDir() string
func (*HTTPTBClient) GetHTTPEndpointForScenario ¶ added in v0.260903.1
func (c *HTTPTBClient) GetHTTPEndpointForScenario(_ context.Context, scenario typ.RuleScenario) (*HTTPEndpointConfig, error)
type MockTBClient ¶
MockTBClient is a mock implementation of TBClient interface for testing.
func (*MockTBClient) GetClaudeCodeEnv ¶ added in v0.260531.1
func (m *MockTBClient) GetClaudeCodeEnv(ctx context.Context) ([]string, error)
func (*MockTBClient) GetClaudeCodeSettingsPathForProfile ¶ added in v0.260723.1
func (*MockTBClient) GetDataDir ¶
func (m *MockTBClient) GetDataDir() string
func (*MockTBClient) GetHTTPEndpointForScenario ¶
func (m *MockTBClient) GetHTTPEndpointForScenario(ctx context.Context, scenario typ.RuleScenario) (*HTTPEndpointConfig, error)
type TBClient ¶
type TBClient interface {
// GetClaudeCodeEnv returns the environment variables (KEY=VALUE) that point
// the Claude Code CLI at the tingly-box gateway's claude_code scenario.
GetClaudeCodeEnv(ctx context.Context) ([]string, error)
// GetClaudeCodeSettingsPathForProfile materializes a Claude Code profile's
// settings.json and returns its path for the --settings CLI flag.
// Returns ("", nil) for an empty profileID.
GetClaudeCodeSettingsPathForProfile(ctx context.Context, profileID string) (string, error)
// GetHTTPEndpointForScenario returns HTTP endpoint configuration for a scenario.
GetHTTPEndpointForScenario(ctx context.Context, scenario typ.RuleScenario) (*HTTPEndpointConfig, error)
// GetDataDir returns the data directory path for storing sessions and other data.
GetDataDir() string
}
TBClient defines the interface for remote control interactions with the tingly-box server. Both an in-memory implementation (TBClientImpl, for in-process use) and an HTTP implementation (HTTPTBClient, for out-of-process use) satisfy this interface.
type TBClientImpl ¶
type TBClientImpl struct {
// contains filtered or unexported fields
}
TBClientImpl implements TBClient via direct in-memory config access. Use this when the consumer runs in the same process as the server.
func NewTBClient ¶
func NewTBClient(cfg *serverconfig.Config) *TBClientImpl
NewTBClient creates a new in-memory TB client instance.
func (*TBClientImpl) ClaudeCodeDefaultModel ¶ added in v1.261022.1
func (c *TBClientImpl) ClaudeCodeDefaultModel() string
ClaudeCodeDefaultModel is the request model Claude Code is pointed at by default (ANTHROPIC_MODEL in GetClaudeCodeEnv): the claude_code scenario's default tier, which its routing rules resolve.
func (*TBClientImpl) GetClaudeCodeEnv ¶ added in v0.260531.1
func (c *TBClientImpl) GetClaudeCodeEnv(ctx context.Context) ([]string, error)
GetClaudeCodeEnv builds the env vars needed to route the Claude Code CLI through the local tingly-box gateway.
func (*TBClientImpl) GetClaudeCodeSettingsPathForProfile ¶ added in v0.260723.1
func (c *TBClientImpl) GetClaudeCodeSettingsPathForProfile(ctx context.Context, profileID string) (string, error)
GetClaudeCodeSettingsPathForProfile materializes the profiled scenario settings file and returns its path for the --settings CLI flag.
func (*TBClientImpl) GetDataDir ¶
func (c *TBClientImpl) GetDataDir() string
GetDataDir returns the data directory path for storing sessions and other data.
func (*TBClientImpl) GetHTTPEndpointForScenario ¶
func (c *TBClientImpl) GetHTTPEndpointForScenario(ctx context.Context, scenario typ.RuleScenario) (*HTTPEndpointConfig, error)
GetHTTPEndpointForScenario returns HTTP endpoint configuration for a scenario.