All checks were successful
release-tag / release-image (push) Successful in 2m32s
150 lines
6.1 KiB
Go
150 lines
6.1 KiB
Go
package sourceagent
|
|
|
|
import "time"
|
|
|
|
const SchemaVersion = 1
|
|
|
|
type Agent struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
Enabled bool `json:"enabled"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
LastSeen time.Time `json:"last_seen,omitempty"`
|
|
LastError string `json:"last_error,omitempty"`
|
|
Version string `json:"version,omitempty"`
|
|
TaskCount int `json:"task_count,omitempty"`
|
|
Capabilities []string `json:"capabilities,omitempty"`
|
|
Controller DockerControllerStatus `json:"controller,omitempty"`
|
|
}
|
|
|
|
type Task struct {
|
|
ID string `json:"id"`
|
|
AgentID string `json:"agent_id"`
|
|
Name string `json:"name"`
|
|
Type string `json:"type"`
|
|
URL string `json:"url"`
|
|
Enabled bool `json:"enabled"`
|
|
PollInterval string `json:"poll_interval"`
|
|
Categories []string `json:"categories,omitempty"`
|
|
MaxItems int `json:"max_items,omitempty"`
|
|
Config map[string]string `json:"config,omitempty"`
|
|
CreatedAt time.Time `json:"created_at,omitempty"`
|
|
UpdatedAt time.Time `json:"updated_at,omitempty"`
|
|
}
|
|
|
|
type AgentPerformance struct {
|
|
SpeedMode bool `json:"speed_mode"`
|
|
CPUWorkers int `json:"cpu_tasks"`
|
|
}
|
|
|
|
type RemoteConfig struct {
|
|
SchemaVersion int `json:"schema_version"`
|
|
Agent Agent `json:"agent"`
|
|
Tasks []Task `json:"tasks"`
|
|
Performance AgentPerformance `json:"performance"`
|
|
IssuedAt time.Time `json:"issued_at"`
|
|
}
|
|
|
|
type Document struct {
|
|
ExternalID string `json:"external_id,omitempty"`
|
|
URL string `json:"url"`
|
|
CanonicalURL string `json:"canonical_url,omitempty"`
|
|
Title string `json:"title"`
|
|
PublishedAt time.Time `json:"published_at,omitempty"`
|
|
DiscoveredAt time.Time `json:"discovered_at,omitempty"`
|
|
Language string `json:"language,omitempty"`
|
|
ContentType string `json:"content_type,omitempty"`
|
|
Text string `json:"text"`
|
|
ContentSHA256 string `json:"content_sha256,omitempty"`
|
|
SourceName string `json:"source_name,omitempty"`
|
|
SourceBaseURL string `json:"source_base_url,omitempty"`
|
|
Categories []string `json:"categories,omitempty"`
|
|
Metadata map[string]any `json:"metadata,omitempty"`
|
|
}
|
|
|
|
type IngestBatch struct {
|
|
SchemaVersion int `json:"schema_version"`
|
|
AgentID string `json:"agent_id,omitempty"`
|
|
TaskID string `json:"task_id"`
|
|
Documents []Document `json:"documents"`
|
|
}
|
|
|
|
type IngestResult struct {
|
|
Accepted int `json:"accepted"`
|
|
Duplicates int `json:"duplicates"`
|
|
Rejected int `json:"rejected"`
|
|
BatchID string `json:"batch_id"`
|
|
}
|
|
|
|
type Heartbeat struct {
|
|
AgentID string `json:"agent_id,omitempty"`
|
|
Version string `json:"version,omitempty"`
|
|
Status string `json:"status,omitempty"`
|
|
LastRunAt time.Time `json:"last_run_at,omitempty"`
|
|
LastError string `json:"last_error,omitempty"`
|
|
TasksChecked int `json:"tasks_checked,omitempty"`
|
|
Documents int `json:"documents,omitempty"`
|
|
Metadata map[string]any `json:"metadata,omitempty"`
|
|
}
|
|
|
|
type InboxDocument struct {
|
|
ID string `json:"id"`
|
|
AgentID string `json:"agent_id"`
|
|
TaskID string `json:"task_id"`
|
|
Document Document `json:"document"`
|
|
Status string `json:"status"`
|
|
Relevance float64 `json:"relevance,omitempty"`
|
|
MatchedNodeID string `json:"matched_node_id,omitempty"`
|
|
ProactiveState string `json:"proactive_state,omitempty"`
|
|
ProactiveAttempts int `json:"proactive_attempts,omitempty"`
|
|
MaterializedNodeID string `json:"materialized_node_id,omitempty"`
|
|
ReceivedAt time.Time `json:"received_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
Metadata map[string]any `json:"metadata,omitempty"`
|
|
}
|
|
|
|
type InboxStats struct {
|
|
Total int `json:"total"`
|
|
Received int `json:"received"`
|
|
Processing int `json:"processing"`
|
|
Candidate int `json:"candidate"`
|
|
Archived int `json:"archived"`
|
|
Materialized int `json:"materialized"`
|
|
Used int `json:"used"`
|
|
SecurityQueued int `json:"security_queued"`
|
|
SecurityProcessing int `json:"security_processing"`
|
|
SecurityRejected int `json:"security_rejected"`
|
|
}
|
|
|
|
type SecurityLifecycle struct {
|
|
InboxID string `json:"inbox_id"`
|
|
RunID string `json:"run_id"`
|
|
Title string `json:"title"`
|
|
Status string `json:"status"`
|
|
ProactiveState string `json:"proactive_state"`
|
|
Outcome string `json:"outcome"`
|
|
LastError string `json:"last_error,omitempty"`
|
|
MaterializedNodeID string `json:"materialized_node_id,omitempty"`
|
|
StartedAt time.Time `json:"started_at,omitempty"`
|
|
CompletedAt time.Time `json:"completed_at,omitempty"`
|
|
DurationMS int64 `json:"duration_ms,omitempty"`
|
|
Confidence float64 `json:"confidence,omitempty"`
|
|
Severity string `json:"severity,omitempty"`
|
|
EventType string `json:"event_type,omitempty"`
|
|
NodesCreated uint64 `json:"nodes_created,omitempty"`
|
|
NodesUpdated uint64 `json:"nodes_updated,omitempty"`
|
|
NodesDeleted uint64 `json:"nodes_deleted,omitempty"`
|
|
EdgesCreated uint64 `json:"edges_created,omitempty"`
|
|
EdgesUpdated uint64 `json:"edges_updated,omitempty"`
|
|
EdgesDeleted uint64 `json:"edges_deleted,omitempty"`
|
|
VectorsCreated uint64 `json:"vectors_created,omitempty"`
|
|
VectorsUpdated uint64 `json:"vectors_updated,omitempty"`
|
|
VectorsDeleted uint64 `json:"vectors_deleted,omitempty"`
|
|
}
|
|
|
|
type ScoredDocument struct {
|
|
InboxDocument
|
|
QueryScore float64 `json:"query_score"`
|
|
}
|