@agentctx/types
@agentctx/types
Section titled “@agentctx/types”Standalone type definitions package. Use this when you only need CTX types without the full runtime.
Installation
Section titled “Installation”npm install @agentctx/typesCore Types
Section titled “Core Types”Operators
Section titled “Operators”type CTXOperator = '?' | '!' | '>' | '+' | '~' | '-' | '^';| Operator | Name | Purpose |
|---|---|---|
? | Search | Fuzzy search in a plane |
! | Lookup | Exact ID lookup |
> | Execute | Call a tool |
+ | Write | Store data |
~ | Update | Modify existing data |
- | Delete | Remove data |
^ | Delegate | Dispatch to another agent |
Planes
Section titled “Planes”type CTXPlane = 'k' | 't' | 's' | 'm' | 'a' | 'i' | 'l';| Plane | Name |
|---|---|
k | Knowledge |
t | Tools |
s | Skills |
m | Memory |
a | Agents |
i | Inspection |
l | LLM |
CTXStatement
Section titled “CTXStatement”interface CTXStatement { operator: CTXOperator; plane: CTXPlane; verb?: CTXVerb; decorator?: CTXDecorator; target: string; filters: CTXFilter[]; payload?: CTXPayload; raw: string;}CTXFilter
Section titled “CTXFilter”interface CTXFilter { type: 'tag' | 'time' | 'limit' | 'project' | 'format'; value: string;}GatewayResult
Section titled “GatewayResult”interface GatewayResult { ok: boolean; op: string; ms: number; data: unknown; error?: string; code?: string;}CTXParseError
Section titled “CTXParseError”interface CTXParseErrorData { code: string; // e.g., 'INVALID_OPERATOR' position: number; found: string; expected?: string;}Error Codes
Section titled “Error Codes”| Code | Cause |
|---|---|
INVALID_OPERATOR | Character at position 0 is not a valid operator |
INVALID_PLANE | Character at position 1 is not a valid plane |
INVALID_COMBO | Operator×plane combination not allowed |
MAX_INPUT_EXCEEDED | Input exceeds 65KB limit |
MAX_DEPTH_EXCEEDED | Nesting exceeds 16 levels |
BANNED_KEY | __proto__, constructor, or prototype in keys |
MIXED_SCRIPT | Homograph attack detected in tags |
See Also
Section titled “See Also”- @agentctx/core — full runtime with types
- Formal Specification — complete grammar