repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | /** |
| #2 | * CLAWD Convex Client |
| #3 | * |
| #4 | * Lightweight HTTP client for the automaton to communicate with |
| #5 | * the CLAWD Convex backend for agent tracking, heartbeats, and |
| #6 | * key-value data storage. |
| #7 | * |
| #8 | * Uses the Convex HTTP actions defined in convex/clawd/http.ts. |
| #9 | * No external dependencies needed — just uses fetch. |
| #10 | */ |
| #11 | export interface ConvexClientOptions { |
| #12 | /** Base URL of the Convex deployment (e.g. https://giddy-dragon-7.convex.site) */ |
| #13 | siteUrl: string; |
| #14 | /** Optional agent identifier */ |
| #15 | agentId?: string; |
| #16 | } |
| #17 | /** |
| #18 | * Result of registering an agent. |
| #19 | */ |
| #20 | export interface RegisterResult { |
| #21 | registered: boolean; |
| #22 | agentId: string; |
| #23 | firstSeen: number; |
| #24 | } |
| #25 | /** |
| #26 | * Result of recording a heartbeat. |
| #27 | */ |
| #28 | export interface HeartbeatResult { |
| #29 | recorded: boolean; |
| #30 | timestamp: number; |
| #31 | } |
| #32 | /** |
| #33 | * Result of storing data. |
| #34 | */ |
| #35 | export interface DataResult { |
| #36 | stored: boolean; |
| #37 | key: string; |
| #38 | updatedAt: number; |
| #39 | } |
| #40 | /** |
| #41 | * Agent data entry returned from Convex. |
| #42 | */ |
| #43 | export interface AgentDataEntry { |
| #44 | _id: string; |
| #45 | agentId: string; |
| #46 | key: string; |
| #47 | value: string; |
| #48 | contentType?: string; |
| #49 | tags?: string[]; |
| #50 | updatedAt: number; |
| #51 | _creationTime: number; |
| #52 | } |
| #53 | /** |
| #54 | * Agent info returned from Convex. |
| #55 | */ |
| #56 | export interface AgentInfo { |
| #57 | _id: string; |
| #58 | agentId: string; |
| #59 | name: string; |
| #60 | installMethod: string; |
| #61 | active: boolean; |
| #62 | firstSeen: number; |
| #63 | lastSeen: number; |
| #64 | metadata?: string; |
| #65 | address?: string; |
| #66 | source?: string; |
| #67 | tags?: string[]; |
| #68 | latestHeartbeat?: { |
| #69 | state?: string; |
| #70 | creditsCents?: number; |
| #71 | uptimeSeconds?: number; |
| #72 | timestamp?: number; |
| #73 | tier?: string; |
| #74 | }; |
| #75 | } |
| #76 | /** |
| #77 | * Creates a CLAWD Convex client for the automaton. |
| #78 | */ |
| #79 | export declare function createConvexClient(options: ConvexClientOptions): { |
| #80 | registerAgent: (params: { |
| #81 | agentId: string; |
| #82 | name: string; |
| #83 | installMethod?: string; |
| #84 | source?: string; |
| #85 | metadata?: string; |
| #86 | address?: string; |
| #87 | tags?: string[]; |
| #88 | }) => Promise<RegisterResult>; |
| #89 | sendHeartbeat: (params: { |
| #90 | agentId: string; |
| #91 | state?: string; |
| #92 | creditsCents?: number; |
| #93 | usdcBalance?: number; |
| #94 | uptimeSeconds?: number; |
| #95 | version?: string; |
| #96 | sandboxId?: string; |
| #97 | turnCount?: number; |
| #98 | skillCount?: number; |
| #99 | tier?: string; |
| #100 | statusPayload?: Record<string, any>; |
| #101 | }) => Promise<HeartbeatResult>; |
| #102 | setData: (params: { |
| #103 | agentId: string; |
| #104 | key: string; |
| #105 | value: string; |
| #106 | contentType?: string; |
| #107 | tags?: string[]; |
| #108 | }) => Promise<DataResult>; |
| #109 | getData: (params: { |
| #110 | agentId: string; |
| #111 | key: string; |
| #112 | }) => Promise<AgentDataEntry | null>; |
| #113 | listData: (params: { |
| #114 | agentId: string; |
| #115 | }) => Promise<Array<{ |
| #116 | key: string; |
| #117 | contentType?: string; |
| #118 | tags?: string[]; |
| #119 | updatedAt: number; |
| #120 | valuePreview: string; |
| #121 | }>>; |
| #122 | getAgent: (params: { |
| #123 | agentId: string; |
| #124 | }) => Promise<AgentInfo | null>; |
| #125 | listAgents: (params?: { |
| #126 | activeOnly?: boolean; |
| #127 | }) => Promise<AgentInfo[]>; |
| #128 | }; |
| #129 | export type ConvexAgentClient = ReturnType<typeof createConvexClient>; |
| #130 | //# sourceMappingURL=convex-client.d.ts.map |