scriptling

package
v0.23.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAILibrary

func GetAILibrary(aiClient ai.Client) *object.Library

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

func GetGroupsLibrary(client *apiclient.ApiClient, userId string) *object.Library

GetGroupsLibrary returns the groups management library for scriptling

func GetIntAsUint16

func GetIntAsUint16(args []object.Object, index int, name string) (uint16, object.Object)

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

func GetPermissionLibrary(client *apiclient.ApiClient) *object.Library

GetPermissionLibrary returns the permission constants library for scriptling

func GetRolesLibrary

func GetRolesLibrary(client *apiclient.ApiClient, userId string) *object.Library

GetRolesLibrary returns the roles management library for scriptling

func GetSkillsLibrary

func GetSkillsLibrary(client *apiclient.ApiClient, userId string) *object.Library

func GetSpacesLibrary

func GetSpacesLibrary(client *apiclient.ApiClient, userId string) *object.Library

GetSpacesLibrary returns the spaces helper library for scriptling (local/remote environments)

func GetTemplatesLibrary

func GetTemplatesLibrary(client *apiclient.ApiClient, userId string) *object.Library

GetTemplatesLibrary returns the templates management library for scriptling

func GetUsersLibrary

func GetUsersLibrary(client *apiclient.ApiClient, userId string) *object.Library

GetUsersLibrary returns the users management library for scriptling

func GetVarsLibrary

func GetVarsLibrary(client *apiclient.ApiClient, userId string) *object.Library

GetVarsLibrary returns the template variables management library for scriptling

func GetVolumesLibrary

func GetVolumesLibrary(client *apiclient.ApiClient, userId string) *object.Library

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL