@sekuire/sdk 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -71,7 +71,7 @@ export interface LLMConfig {
71
71
  base_url?: string;
72
72
  }
73
73
  export interface MemoryConfig {
74
- type: "in-memory" | "redis" | "postgres";
74
+ type: 'in-memory' | 'redis' | 'postgres';
75
75
  max_messages?: number;
76
76
  redis?: {
77
77
  url?: string;
package/dist/index.d.ts CHANGED
@@ -755,7 +755,7 @@ interface LLMConfig {
755
755
  base_url?: string;
756
756
  }
757
757
  interface MemoryConfig {
758
- type: "in-memory" | "redis" | "postgres";
758
+ type: 'in-memory' | 'redis' | 'postgres';
759
759
  max_messages?: number;
760
760
  redis?: {
761
761
  url?: string;
@@ -885,7 +885,7 @@ declare class SekuireCrypto {
885
885
  * Message format for chat conversations
886
886
  */
887
887
  interface Message {
888
- role: "system" | "user" | "assistant" | "function" | "tool";
888
+ role: 'system' | 'user' | 'assistant' | 'function' | 'tool';
889
889
  content: string | null;
890
890
  name?: string;
891
891
  tool_call_id?: string;
@@ -1071,48 +1071,8 @@ declare const llm: {
1071
1071
  }) => OllamaProvider;
1072
1072
  };
1073
1073
 
1074
- interface ActivePolicy {
1075
- policy_id: string;
1076
- workspace_id: string;
1077
- version: string;
1078
- status: string;
1079
- hash: string;
1080
- content: any;
1081
- activated_at?: string;
1082
- updated_at?: string;
1083
- signature?: string;
1084
- signing_key_id?: string;
1085
- signing_public_key?: string;
1086
- }
1087
- declare class PolicyClient {
1088
- private readonly baseUrl;
1089
- private cache;
1090
- constructor(baseUrl: string);
1091
- fetchActivePolicy(workspaceId: string): Promise<ActivePolicy>;
1092
- verify(policy: ActivePolicy): void;
1093
- }
1094
-
1095
- type ViolationHandler = (rule: string, reason: string) => void;
1096
- declare class PolicyEnforcer {
1097
- private readonly policy;
1098
- private readonly onViolation?;
1099
- private readonly override;
1100
- constructor(policy: ActivePolicy, override?: boolean, onViolation?: ViolationHandler | undefined);
1101
- enforceNetwork(domain: string, protocol: string): void;
1102
- enforceFilesystem(path: string, operation: string): void;
1103
- enforceTool(toolName: string): void;
1104
- private getCategoryPrefix;
1105
- enforceModel(model: string): void;
1106
- enforceApi(service: string): void;
1107
- enforceRateLimit(type: "request" | "token", count?: number): void;
1108
- private throw;
1109
- private warnOnly;
1110
- private matches;
1111
- private pathMatch;
1112
- }
1113
-
1114
1074
  interface MemoryMessage {
1115
- role: "user" | "assistant" | "system";
1075
+ role: 'user' | 'assistant' | 'system';
1116
1076
  content: string;
1117
1077
  timestamp: number;
1118
1078
  metadata?: Record<string, unknown>;
@@ -1188,7 +1148,7 @@ declare class RedisStorage extends BaseMemoryStorage {
1188
1148
  disconnect(): Promise<void>;
1189
1149
  }
1190
1150
 
1191
- type MemoryType = "in-memory" | "redis" | "postgres";
1151
+ type MemoryType = 'in-memory' | 'redis' | 'postgres';
1192
1152
  interface MemoryFactoryConfig {
1193
1153
  type: MemoryType;
1194
1154
  redis?: RedisConfig;
@@ -1196,6 +1156,46 @@ interface MemoryFactoryConfig {
1196
1156
  }
1197
1157
  declare function createMemoryStorage(config: MemoryFactoryConfig): MemoryStorage;
1198
1158
 
1159
+ interface ActivePolicy {
1160
+ policy_id: string;
1161
+ workspace_id: string;
1162
+ version: string;
1163
+ status: string;
1164
+ hash: string;
1165
+ content: any;
1166
+ activated_at?: string;
1167
+ updated_at?: string;
1168
+ signature?: string;
1169
+ signing_key_id?: string;
1170
+ signing_public_key?: string;
1171
+ }
1172
+ declare class PolicyClient {
1173
+ private readonly baseUrl;
1174
+ private cache;
1175
+ constructor(baseUrl: string);
1176
+ fetchActivePolicy(workspaceId: string): Promise<ActivePolicy>;
1177
+ verify(policy: ActivePolicy): void;
1178
+ }
1179
+
1180
+ type ViolationHandler = (rule: string, reason: string) => void;
1181
+ declare class PolicyEnforcer {
1182
+ private readonly policy;
1183
+ private readonly onViolation?;
1184
+ private readonly override;
1185
+ constructor(policy: ActivePolicy, override?: boolean, onViolation?: ViolationHandler | undefined);
1186
+ enforceNetwork(domain: string, protocol: string): void;
1187
+ enforceFilesystem(path: string, operation: string): void;
1188
+ enforceTool(toolName: string): void;
1189
+ private getCategoryPrefix;
1190
+ enforceModel(model: string): void;
1191
+ enforceApi(service: string): void;
1192
+ enforceRateLimit(type: "request" | "token", count?: number): void;
1193
+ private throw;
1194
+ private warnOnly;
1195
+ private matches;
1196
+ private pathMatch;
1197
+ }
1198
+
1199
1199
  /**
1200
1200
  * Options for overriding agent configuration
1201
1201
  */
@@ -1350,6 +1350,10 @@ declare abstract class SekuireServer {
1350
1350
  * Get the agent's ID
1351
1351
  */
1352
1352
  getAgentId(): string;
1353
+ /**
1354
+ * Handle incoming webhooks from other agents
1355
+ */
1356
+ handleWebhook(payload: any, signature?: string): Promise<any>;
1353
1357
  }
1354
1358
  /**
1355
1359
  * Express.js middleware for Sekuire protocol
@@ -1365,7 +1369,7 @@ interface ToolInput {
1365
1369
  }
1366
1370
  interface ToolParameter {
1367
1371
  name: string;
1368
- type: "string" | "number" | "boolean" | "object";
1372
+ type: 'string' | 'number' | 'boolean' | 'object';
1369
1373
  description: string;
1370
1374
  required: boolean;
1371
1375
  default?: string | number | boolean | object;
@@ -1375,7 +1379,7 @@ interface ToolMetadata {
1375
1379
  description: string;
1376
1380
  parameters: ToolParameter[];
1377
1381
  category?: string;
1378
- compliance_level?: "public" | "internal" | "restricted" | "system";
1382
+ compliance_level?: 'public' | 'internal' | 'restricted' | 'system';
1379
1383
  requires_approval?: boolean;
1380
1384
  }
1381
1385
  declare abstract class Tool {
@@ -1702,6 +1706,14 @@ declare class FileChmodTool extends Tool {
1702
1706
  }>;
1703
1707
  }
1704
1708
 
1709
+ declare class GoogleDocsCreateTool extends Tool {
1710
+ metadata: ToolMetadata;
1711
+ execute(input: ToolInput): Promise<{
1712
+ documentId: string;
1713
+ url: string;
1714
+ }>;
1715
+ }
1716
+
1705
1717
  declare class HttpRequestTool extends Tool {
1706
1718
  metadata: ToolMetadata;
1707
1719
  execute(input: ToolInput): Promise<string | object>;
@@ -1931,6 +1943,7 @@ declare const builtInTools: {
1931
1943
  DownloadFileTool: typeof DownloadFileTool;
1932
1944
  DnsLookupTool: typeof DnsLookupTool;
1933
1945
  PingTool: typeof PingTool;
1946
+ GoogleDocsCreateTool: typeof GoogleDocsCreateTool;
1934
1947
  JsonParseTool: typeof JsonParseTool;
1935
1948
  JsonStringifyTool: typeof JsonStringifyTool;
1936
1949
  CsvParseTool: typeof CsvParseTool;
@@ -1964,6 +1977,15 @@ declare const builtInTools: {
1964
1977
  DecryptDataTool: typeof DecryptDataTool;
1965
1978
  };
1966
1979
 
1980
+ /**
1981
+ * Create a tool for discovering other agents in the Sekuire network
1982
+ */
1983
+ declare function createDiscoveryTool(client: SekuireClient): ToolDefinition$1;
1984
+ /**
1985
+ * Create a tool for delegating tasks to other agents
1986
+ */
1987
+ declare function createDelegationTool(client: SekuireClient): ToolDefinition$1;
1988
+
1967
1989
  /**
1968
1990
  * Generate a new Ed25519 keypair for Sekuire operations
1969
1991
  */
@@ -1983,5 +2005,5 @@ declare function calculateSekuireId(params: {
1983
2005
  */
1984
2006
  declare function createSekuireClient(keyPair: KeyPair, registryUrl?: string, options?: Partial<SekuireClientConfig>): SekuireClient;
1985
2007
 
1986
- export { SekuireAgent as Agent, AgentIdentity, AnthropicProvider, ComplianceError, ComplianceMonitor, ContentPolicyError, CryptoError, FileAccessError, GoogleProvider, InMemoryStorage, NetworkComplianceError, NetworkError, OllamaProvider, OpenAIProvider, PolicyClient, PolicyEnforcer, PolicyViolationError, PostgresStorage, ProtocolError, RedisStorage, SekuireAgent$1 as SekuireAgent, SekuireAgentBuilder, SekuireClient, SekuireCrypto, SekuireError, SekuireLogger, SekuireServer, Tool, ToolPatternParser, ToolRegistry, ToolUsageError, builtInTools, calculateSekuireId, createAgent, createDefaultToolRegistry, createLLMProvider, createMemoryStorage, createSekuireClient, createSekuireExpressMiddleware, createSekuireFastifyPlugin, generateKeyPair, getAgent, getAgentConfig, getAgents, getTools$1 as getLegacyTools, getSystemPrompt, getTools, llm, loadConfig, loadSystemPrompt, loadTools, tool, tools };
2008
+ export { SekuireAgent as Agent, AgentIdentity, AnthropicProvider, ComplianceError, ComplianceMonitor, ContentPolicyError, CryptoError, FileAccessError, GoogleProvider, InMemoryStorage, NetworkComplianceError, NetworkError, OllamaProvider, OpenAIProvider, PolicyClient, PolicyEnforcer, PolicyViolationError, PostgresStorage, ProtocolError, RedisStorage, SekuireAgent$1 as SekuireAgent, SekuireAgentBuilder, SekuireClient, SekuireCrypto, SekuireError, SekuireLogger, SekuireServer, Tool, ToolPatternParser, ToolRegistry, ToolUsageError, builtInTools, calculateSekuireId, createAgent, createDefaultToolRegistry, createDelegationTool, createDiscoveryTool, createLLMProvider, createMemoryStorage, createSekuireClient, createSekuireExpressMiddleware, createSekuireFastifyPlugin, generateKeyPair, getAgent, getAgentConfig, getAgents, getTools$1 as getLegacyTools, getSystemPrompt, getTools, llm, loadConfig, loadSystemPrompt, loadTools, tool, tools };
1987
2009
  export type { ActivePolicy, ActivePolicyResponse, AgentConfig, AgentId, AgentInvokeOptions, AgentOptions, AgentResponse$1 as AgentResponse, ChatChunk, ChatOptions, ChatResponse, ComplianceConfig, ComplianceViolation, ToolDefinition as ConfigToolDefinition, CreateOrgRequest, CreateWorkspaceRequest, DisputeRequest, EventLog, EventType, HandshakeAuth, HandshakeHello, HandshakeResult, HandshakeWelcome, HexString, IdentityConfig, InviteRequest, InviteResponse, KeyPair, LLMConfig, Message as LLMMessage, LLMProvider, LLMProviderConfig, LoggerConfig$1 as LoggerConfig, Manifest, MemoryConfig, MemoryFactoryConfig, MemoryMessage, MemoryStorage, MemoryType, Message$1 as Message, OrgResponse, OrgSummary, PostgresConfig, ProjectMetadata, PublishRequest, RedisConfig, ReputationLog, ReputationResponse, SekuireAgentConfig, SekuireClientConfig, SekuireConfig, Severity, SubmitReputationRequest, ToolCall, ToolDefinition$1 as ToolDefinition, ToolInput, ToolMetadata, ToolParameter, ToolsSchema, UserContextResponse, VerificationStatus, VerifyAgentRequest, WorkspaceResponse, WorkspaceSummary };