Documentation
¶
Index ¶
- func GetAILibrary(aiClient ai.Client) *object.Library
- func GetGroupsLibrary(client *apiclient.ApiClient, userId string) *object.Library
- func GetIntAsUint16(args []object.Object, index int, name string) (uint16, object.Object)
- func GetMCPToolsLibrary(client *apiclient.ApiClient, mcpParams map[string]object.Object) *object.Library
- func GetPermissionLibrary(client *apiclient.ApiClient) *object.Library
- func GetRolesLibrary(client *apiclient.ApiClient, userId string) *object.Library
- func GetSkillsLibrary(client *apiclient.ApiClient, userId string) *object.Library
- func GetSpacesLibrary(client *apiclient.ApiClient, userId string) *object.Library
- func GetTemplatesLibrary(client *apiclient.ApiClient, userId string) *object.Library
- func GetUsersLibrary(client *apiclient.ApiClient, userId string) *object.Library
- func GetVarsLibrary(client *apiclient.ApiClient, userId string) *object.Library
- func GetVolumesLibrary(client *apiclient.ApiClient, userId string) *object.Library
- func SetDefaultModel(model string)
- type MCPLibrary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAILibrary ¶
GetAILibrary returns the knot.ai library for scriptling environments. It exposes:
- Client() - returns the pre-configured AI client
- get_default_model() - returns the server-configured default model name
In all environments (MCP, local, remote, streaming), the aiClient connects to the server's OpenAI-compatible endpoint with the X-Knot-Passthrough header. The MCPServerContext middleware handles per-user tool discovery and execution. Scripts can pass model="" to use the server's default model, or specify any model explicitly.
When aiClient is nil, Client() will return an error.
func GetGroupsLibrary ¶
GetGroupsLibrary returns the groups management library for scriptling
func GetIntAsUint16 ¶
GetIntAsUint16 safely extracts an integer argument at the given index and converts to uint16. Returns the uint16 value and nil error on success, or 0 and error object on failure.
func GetMCPToolsLibrary ¶
func GetMCPToolsLibrary(client *apiclient.ApiClient, mcpParams map[string]object.Object) *object.Library
GetMCPToolsLibrary returns the MCP tools library for scriptling (used in local/remote environments) This provides only tool access functions that communicate with the server via API calls
func GetPermissionLibrary ¶
GetPermissionLibrary returns the permission constants library for scriptling
func GetRolesLibrary ¶
GetRolesLibrary returns the roles management library for scriptling
func GetSkillsLibrary ¶
func GetSpacesLibrary ¶
GetSpacesLibrary returns the spaces helper library for scriptling (local/remote environments)
func GetTemplatesLibrary ¶
GetTemplatesLibrary returns the templates management library for scriptling
func GetUsersLibrary ¶
GetUsersLibrary returns the users management library for scriptling
func GetVarsLibrary ¶
GetVarsLibrary returns the template variables management library for scriptling
func GetVolumesLibrary ¶
GetVolumesLibrary returns the volumes management library for scriptling
func SetDefaultModel ¶
func SetDefaultModel(model string)
SetDefaultModel sets the default model name for the AI library. Called from server startup with the configured chat model.
Types ¶
type MCPLibrary ¶
type MCPLibrary struct {
// contains filtered or unexported fields
}
MCPLibrary is the exported type for accessing the result
func GetMCPLibraryInstance ¶
func GetMCPLibraryInstance(client *apiclient.ApiClient, mcpParams map[string]object.Object) *MCPLibrary
GetMCPLibraryInstance creates a new MCP library instance that can be used to retrieve results
func (*MCPLibrary) GetLibrary ¶
func (m *MCPLibrary) GetLibrary() *object.Library
GetLibrary returns the scriptling library
func (*MCPLibrary) GetResult ¶
func (m *MCPLibrary) GetResult() *string
GetResult returns the stored result from mcp.return_* functions