mirror of
https://github.com/KeygraphHQ/shannon.git
synced 2026-08-23 19:52:33 +02:00
- Add DI container (src/services/) with AgentExecutionService, ConfigLoaderService, and ExploitationCheckerService — pure domain logic with no Temporal dependencies - Introduce Result<T, E> type and ErrorCode enum for code-based error classification in classifyErrorForTemporal, replacing scattered string matching - Consolidate billing/spending cap detection into utils/billing-detection.ts with shared pattern lists across message-handlers, claude-executor, and error-handling - Extract LogStream abstraction for append-only logging with backpressure, used by both AgentLogger and WorkflowLogger - Simplify activities.ts from inline lifecycle logic to thin wrappers delegating to services, with heartbeat and error classification - Expand config-parser with human-readable AJV errors, security validation, and rule type-specific checks
61 lines
1.1 KiB
TypeScript
61 lines
1.1 KiB
TypeScript
// Copyright (C) 2025 Keygraph, Inc.
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU Affero General Public License version 3
|
|
// as published by the Free Software Foundation.
|
|
|
|
/**
|
|
* Configuration type definitions
|
|
*/
|
|
|
|
export type RuleType =
|
|
| 'path'
|
|
| 'subdomain'
|
|
| 'domain'
|
|
| 'method'
|
|
| 'header'
|
|
| 'parameter';
|
|
|
|
export interface Rule {
|
|
description: string;
|
|
type: RuleType;
|
|
url_path: string;
|
|
}
|
|
|
|
export interface Rules {
|
|
avoid?: Rule[];
|
|
focus?: Rule[];
|
|
}
|
|
|
|
export type LoginType = 'form' | 'sso' | 'api' | 'basic';
|
|
|
|
export interface SuccessCondition {
|
|
type: 'url' | 'cookie' | 'element' | 'redirect';
|
|
value: string;
|
|
}
|
|
|
|
export interface Credentials {
|
|
username: string;
|
|
password: string;
|
|
totp_secret?: string;
|
|
}
|
|
|
|
export interface Authentication {
|
|
login_type: LoginType;
|
|
login_url: string;
|
|
credentials: Credentials;
|
|
login_flow: string[];
|
|
success_condition: SuccessCondition;
|
|
}
|
|
|
|
export interface Config {
|
|
rules?: Rules;
|
|
authentication?: Authentication;
|
|
}
|
|
|
|
export interface DistributedConfig {
|
|
avoid: Rule[];
|
|
focus: Rule[];
|
|
authentication: Authentication | null;
|
|
}
|