Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/0xjeffro/astroclaw
/ functions
Functions
765 in github.com/0xjeffro/astroclaw
⨍
Functions
765
◇
Types & classes
189
↓ 3 callers
Function
makeMemoryArgs
(content string)
pkg/tool/memory_test.go:25
↓ 3 callers
Function
runMigrations
runMigrations reads SQL files from the migrations/ directory (bundled with this Lambda via CDK's bundling configuration), splits each file into indivi
deploy/aws/lambda/migrate/main.go:147
↓ 3 callers
Method
setHeaders
(req *http.Request)
main.go:206
↓ 3 callers
Function
stripHTML
stripHTML removes all HTML tags and normalizes whitespace.
pkg/tool/websearch/ddg.go:186
↓ 3 callers
Function
stubSecret
stubSecret is the test-side getSecret function passed into newRouter. It returns the same 32-byte secret used by pkg/auth tests.
pkg/api/handlers_test.go:129
↓ 3 callers
Method
summarizeSingle
summarizeSingle sends messages to the LLM for summarization. If the request is too long (prompt-too-long error), it retries by dropping the oldest 20%
pkg/agent/context.go:268
↓ 3 callers
Function
truncate
(s string, maxChars int)
pkg/agent/prompt.go:164
↓ 3 callers
Function
truncateBytes
truncateBytes truncates a string to at most maxBytes, backing up to the nearest UTF-8 character boundary to avoid splitting multi-byte chars.
pkg/tool/webfetch/webfetch.go:234
↓ 2 callers
Method
ChatStream
(ctx context.Context, msgs []Message, tools []Tool)
pkg/provider/provider.go:50
↓ 2 callers
Method
GetSkillFromWorkspace
GetSkillFromWorkspace returns the (author, name) skill installed in the given workspace, or an error if not installed.
pkg/app/skills/service.go:42
↓ 2 callers
Method
GetSystemDataKey
===================================================================== System scope ===================================================================
pkg/app/passwords/db/queries.sql.go:78
↓ 2 callers
Method
GetSystemSetting
(ctx context.Context, name string)
pkg/api/handlers.go:29
↓ 2 callers
Method
GetUser
(ctx context.Context, id string)
pkg/api/handlers.go:40
↓ 2 callers
Method
GetUserDataKey
===================================================================== User scope =====================================================================
pkg/app/passwords/db/queries.sql.go:118
↓ 2 callers
Method
GetWorkspaceDataKey
===================================================================== Workspace scope ================================================================
pkg/app/passwords/db/queries.sql.go:158
↓ 2 callers
Function
Handler
Handler returns an http.HandlerFunc that upgrades the request to a WebSocket, authenticates it, registers the connection on both the Bus (for Bus.Send
pkg/cloud/wsbus/inprocess/handler.go:34
↓ 2 callers
Method
List
List returns a copy of the registry's tools.
pkg/tool/tool.go:36
↓ 2 callers
Method
ListSessionMembers
(ctx context.Context, sessionID string)
pkg/api/reply.go:21
↓ 2 callers
Method
ListSessionsByWorkspace
(ctx context.Context, workspaceID string)
pkg/api/handlers.go:21
↓ 2 callers
Function
MemoryFromDB
(m db.AppNotesMemory, messageIDs []string)
pkg/app/notes/types.go:19
↓ 2 callers
Method
Name
()
pkg/tool/tool.go:7
↓ 2 callers
Function
New
New returns a Client that talks to baseURL (e.g. "https://api.example.com"). The default HTTP timeout is 30s for the API and 15 minutes for reply call
pkg/client/client.go:39
↓ 2 callers
Function
NewDuckDuckGoProvider
()
pkg/tool/websearch/ddg.go:51
↓ 2 callers
Function
NewFromContext
NewFromContext creates an Agent with an existing conversation context, used when restoring a session. contextMessages is the Agent's compressed workin
pkg/agent/agent.go:33
↓ 2 callers
Function
NewOpenAI
(apiKey, model string)
pkg/provider/openai.go:16
↓ 2 callers
Function
NewService
(pool *pgxpool.Pool)
pkg/app/agents/service.go:17
↓ 2 callers
Function
OpenBucket
OpenBucket dispatches to a gocloud.dev/blob driver by URL scheme. Supported URLs: s3://<bucket>?region=<region> AWS S3 or any S3-compatible (Seaweed
pkg/cloud/blob.go:31
↓ 2 callers
Method
Register
(ctx context.Context, connID, userID, workspaceID string)
pkg/cloud/wsbus/wsbus.go:43
↓ 2 callers
Method
Send
Send writes payload to the connection identified by connID. Returns wsbus.ErrConnGone if the connection is not tracked; the caller typically responds
pkg/cloud/wsbus/inprocess/bus.go:45
↓ 2 callers
Function
ToProviderMessages
ToProviderMessages converts store messages to provider messages for feeding into Agent. Agent doesn't know about store types.
pkg/app/chat/utils.go:17
↓ 2 callers
Method
Token
Token returns the current bearer token, or "" if no Login has succeeded and SetToken has not been called.
pkg/client/client.go:60
↓ 2 callers
Method
UpsertSystemCredential
(ctx context.Context, name, description, value string)
pkg/app/passwords/service.go:92
↓ 2 callers
Method
WithTx
(tx pgx.Tx)
pkg/app/chat/db/db.go:28
↓ 2 callers
Method
WithTx
(tx pgx.Tx)
pkg/app/passwords/db/db.go:28
↓ 2 callers
Method
WithTx
(tx pgx.Tx)
pkg/app/system/db/db.go:28
↓ 2 callers
Function
bearerToken
(r *http.Request)
pkg/auth/middleware.go:32
↓ 2 callers
Method
doAt
doAt is the shared HTTP roundtrip implementation. It encodes the body, attaches the bearer token, sends the request via the supplied client, and maps
pkg/client/client.go:74
↓ 2 callers
Method
doFetch
doFetch performs an HTTP GET with the given User-Agent and returns the response and body. The response body is limited to maxResponseBytes.
pkg/tool/webfetch/webfetch.go:145
↓ 2 callers
Method
doRequest
(req *http.Request)
tui/backend.go:134
↓ 2 callers
Function
extractDDGURL
extractDDGURL extracts the actual URL from DuckDuckGo's redirect wrapper. DuckDuckGo wraps URLs like: //duckduckgo.com/l/?uddg=<encoded_url>&rut=... I
pkg/tool/websearch/ddg.go:150
↓ 2 callers
Function
fallbackSummary
fallbackSummary creates a crude summary when LLM summarization fails. Takes the first 10% of each message (min 200 runes) and joins with " | ".
pkg/agent/context.go:359
↓ 2 callers
Function
formatFetchResult
formatFetchResult builds the final text returned to the agent.
pkg/tool/webfetch/webfetch.go:252
↓ 2 callers
Function
formatMessage
(msg chatMessage)
tui/model.go:533
↓ 2 callers
Function
formatResults
(query string, results []SearchResult)
pkg/tool/websearch/websearch.go:121
↓ 2 callers
Function
isContextLengthError
isContextLengthError checks if an error is a context-length / prompt-too-long error. Matches against known error strings from both providers: OpenAI:
pkg/agent/context.go:345
↓ 2 callers
Function
listenWS
listenWS returns a Bubble Tea command that reads WebSocket messages in a goroutine and sends them to the TUI as wsEventMsg. Bubble Tea commands are fu
tui/ws.go:49
↓ 2 callers
Method
loadSystemDataKey
===================================================================== Data key cache loaders (read-only) =============================================
pkg/app/passwords/service.go:362
↓ 2 callers
Method
loadUserDataKey
(ctx context.Context, userID string)
pkg/app/passwords/service.go:406
↓ 2 callers
Method
loadWorkspaceDataKey
(ctx context.Context, workspaceID string)
pkg/app/passwords/service.go:384
↓ 2 callers
Function
looksLikeHTML
looksLikeHTML checks if the content starts with common HTML markers.
pkg/tool/webfetch/webfetch.go:246
↓ 2 callers
Function
newGCM
newGCM constructs a GCM cipher around an AES block cipher keyed with dataKey. It is shared by EncryptAESGCM and DecryptAESGCM.
pkg/crypto/aes.go:60
↓ 2 callers
Function
pingWS
pingWS sends a WebSocket ping every 5 minutes to prevent API Gateway's 10-minute idle timeout. Returns a wsPingMsg to schedule the next ping. https://
tui/ws.go:36
↓ 2 callers
Method
postTo
(ctx context.Context, baseURL, path string, body []byte)
main.go:185
↓ 2 callers
Method
postTo
(ctx context.Context, baseURL, path string, body []byte)
tui/backend.go:125
↓ 2 callers
Function
queryColumns
queryColumns returns all user-defined columns from information_schema, sorted by table name and column name for deterministic comparison.
deploy/aws/lambda/migrate/main_test.go:131
↓ 2 callers
Function
queryConstraints
queryConstraints returns all table constraints from information_schema.
deploy/aws/lambda/migrate/main_test.go:180
↓ 2 callers
Function
queryIndexes
queryIndexes returns all user-defined indexes from pg_indexes.
deploy/aws/lambda/migrate/main_test.go:156
↓ 2 callers
Method
readFile
readFile reads a single file from the skill's storage directory. TODO: add a size limit (io.LimitReader) so a huge file doesn't eat all Lambda memory.
pkg/tool/skills/load_skill.go:128
↓ 2 callers
Function
run
Run does the actual work and returns an exit code. Separated from main so testscript can invoke it in-process without killing the test binary.
cmd/astroclaw/main.go:18
↓ 2 callers
Method
setHeaders
(req *http.Request)
tui/backend.go:150
↓ 2 callers
Function
toProviderTools
toProviderTools converts tool.Tool (internal, contains Run function) into provider.Tool (serializable, sent to LLM). The Run function is stripped beca
pkg/agent/agent.go:211
↓ 2 callers
Method
untrack
untrack removes a connection. Idempotent; called on client disconnect and when Registry.Register fails after upgrade.
pkg/cloud/wsbus/inprocess/bus.go:67
↓ 1 callers
Method
AddMembership
Memberships
pkg/app/system/service.go:250
↓ 1 callers
Method
AddMemorySource
(ctx context.Context, arg AddMemorySourceParams)
pkg/app/notes/db/queries.sql.go:22
↓ 1 callers
Method
AddSessionAgent
Child tables (messages, members, agents) are scoped by session_id. Access control is enforced by first looking up the session with workspace_id.
pkg/app/chat/db/queries.sql.go:27
↓ 1 callers
Method
AddSessionMember
(ctx context.Context, arg AddSessionMemberParams)
pkg/app/chat/db/queries.sql.go:43
↓ 1 callers
Method
Approval
()
pkg/tool/tool.go:11
↓ 1 callers
Method
AttachAgentToWorkspace
(ctx context.Context, agentID, workspaceID string)
pkg/app/agents/service.go:74
↓ 1 callers
Method
Chat
Chat sends a message to a session and waits for the final reply. The reply Lambda streams intermediate state via WebSocket; Chat ignores that stream a
pkg/client/client.go:248
↓ 1 callers
Method
ChatStream
(ctx context.Context, msgs []Message, tools []Tool)
pkg/provider/anthropic.go:27
↓ 1 callers
Method
ChatStream
(ctx context.Context, msgs []Message, tools []Tool)
pkg/provider/openai.go:21
↓ 1 callers
Function
ConnectionFromDB
(c db.AppSystemConnection)
pkg/app/system/types.go:116
↓ 1 callers
Method
CreateAgent
CreateAgent creates an agent profile and attaches it to the given workspace in a single transaction.
pkg/app/agents/service.go:23
↓ 1 callers
Method
CreateAgentProfile
(ctx context.Context, arg CreateAgentProfileParams)
pkg/app/agents/db/queries.sql.go:39
↓ 1 callers
Method
CreateConnection
Connections TODO: reconsider whether a connection should be bound to a workspace. Slack/Discord style is one connection per user, with workspace_id ca
pkg/app/system/db/queries.sql.go:48
↓ 1 callers
Method
CreateMemoryForUser
(ctx context.Context, arg CreateMemoryForUserParams)
pkg/app/notes/db/queries.sql.go:40
↓ 1 callers
Method
CreateMessage
(ctx context.Context, arg CreateMessageParams)
pkg/app/chat/db/queries.sql.go:65
↓ 1 callers
Method
CreateSession
CreateSession creates a new chat session in the given workspace owned by userID and attached to one or more agents.
pkg/client/client.go:228
↓ 1 callers
Method
CreateSession
(ctx context.Context, arg CreateSessionParams)
pkg/app/chat/db/queries.sql.go:110
↓ 1 callers
Method
CreateUser
Users
pkg/app/system/service.go:64
↓ 1 callers
Method
CreateWSConnectRecord
Connections
pkg/app/system/service.go:298
↓ 1 callers
Method
CreateWorkspace
Workspaces
pkg/app/system/service.go:182
↓ 1 callers
Method
DeleteConnection
(ctx context.Context, connectionID string)
pkg/app/system/db/queries.sql.go:106
↓ 1 callers
Method
DeleteUserPassword
(ctx context.Context, userID string)
pkg/app/system/db/queries.sql.go:115
↓ 1 callers
Method
DeleteWSConnectRecord
(ctx context.Context, connectionID string)
pkg/app/system/service.go:306
↓ 1 callers
Method
Description
()
pkg/tool/tool.go:8
↓ 1 callers
Method
FormatUserMemoryForPrompt
FormatUserMemoryForPrompt FormatForPrompt returns the memories that agent X has recorded about user Y as a single string for injection into the system
pkg/app/notes/service.go:68
↓ 1 callers
Method
FullName
FullName returns the "author/name" identifier for this skill.
pkg/app/skills/types.go:23
↓ 1 callers
Method
GetAdminID
(ctx context.Context)
main.go:97
↓ 1 callers
Method
GetAgentFromWorkspace
(ctx context.Context, workspaceID, id string)
pkg/app/agents/service.go:51
↓ 1 callers
Method
GetConnectionsByUser
(ctx context.Context, userID string)
pkg/app/system/service.go:310
↓ 1 callers
Method
GetMembership
(ctx context.Context, userID, workspaceID string)
pkg/app/system/service.go:265
↓ 1 callers
Method
GetSession
(ctx context.Context, id string)
pkg/app/chat/service.go:106
↓ 1 callers
Method
GetSessionInWorkspace
(ctx context.Context, workspaceID, id string)
main.go:67
↓ 1 callers
Method
GetUserByEmail
(ctx context.Context, email string)
pkg/app/system/service.go:109
↓ 1 callers
Method
GetUserPasswordHash
User Passwords
pkg/app/system/db/queries.sql.go:231
↓ 1 callers
Method
GetUserSetting
User scope
pkg/app/settings/service.go:60
↓ 1 callers
Method
InstallSkill
InstallSkill records a skill installation in the given workspace. The metadata is snapshotted at install time so the agent doesn't need to call the re
pkg/app/skills/service.go:24
↓ 1 callers
Method
ListAgentsByWorkspace
(ctx context.Context, workspaceID string)
pkg/app/agents/service.go:62
↓ 1 callers
Method
ListMemoriesByAgentAndUser
(ctx context.Context, arg ListMemoriesByAgentAndUserParams)
pkg/app/notes/db/queries.sql.go:112
← previous
next →
101–200 of 765, ranked by callers