/** * Core types for Signet */ export interface LlmUsage { readonly inputTokens: number | null; readonly outputTokens: number | null; readonly cacheReadTokens: number | null; readonly cacheCreationTokens: number | null; readonly totalCost: number | null; readonly totalDurationMs: number | null; } export interface LlmGenerateResult { readonly text: string; readonly usage: LlmUsage | null; } export interface LlmGenerateOptions { readonly timeoutMs?: number; readonly maxTokens?: number; readonly temperature?: number; readonly signal?: AbortSignal; readonly responseFormat?: "json"; readonly think?: boolean; } export interface LlmProvider { readonly name: string; generate(prompt: string, opts?: LlmGenerateOptions): Promise; generateWithUsage?(prompt: string, opts?: LlmGenerateOptions): Promise; available(): Promise; } /** * Controls which agents' memories are visible on read. * - "isolated": only own memories * - "shared": all global memories + own private * - { type: "group" }: global memories from group members + own private */ export type ReadPolicy = "isolated" | "shared" | { readonly type: "group"; readonly group: string; }; /** A named agent entry in the roster. */ export interface AgentDefinition { readonly name: string; readonly model?: string; readonly harnesses?: readonly string[]; /** Skills allowlist. Omit or empty string[] = all skills. */ readonly skills?: readonly string[]; /** Relative path to agent's SOUL.md (defaults to root SOUL.md). */ readonly personality?: string; readonly memory?: { readonly read_policy?: ReadPolicy; }; } export interface AgentManifest { version: number; schema: string; agent: { name: string; description?: string; created: string; updated: string; }; owner?: { address?: string; localId?: string; ens?: string; name?: string; }; agents?: { readonly roster: readonly AgentDefinition[]; }; harnesses?: string[]; embedding?: { provider: "native" | "llama-cpp" | "ollama" | "openai" | "local"; model: string; dimensions: number; base_url?: string; api_key?: string; }; search?: { alpha: number; top_k: number; min_score: number; }; memory?: { database: string; vectors?: string; session_budget?: number; decay_rate?: number; pipelineV2?: Partial; dreaming?: Partial; }; trust?: { verification: "none" | "erc8128" | "gpg" | "did" | "registry"; registry?: string; }; services?: { openclaw?: { restart_command?: string; }; }; home?: { spotlightEntity?: string; }; auth?: { method: "none" | "erc8128" | "gpg" | "did"; chainId?: number; mode?: "local" | "team" | "hybrid"; defaultTokenTtlSeconds?: number; sessionTokenTtlSeconds?: number; login?: { password?: { username?: string; passwordHash?: string | null; }; sso?: { enabled?: boolean; }; saml?: { enabled?: boolean; }; }; rateLimits?: Record; }; capabilities?: string[] | { memory?: { enabled?: boolean; autoInject?: boolean; memoryHead?: boolean; }; secrets?: { enabled?: boolean; }; identity?: { mode?: "managed" | "off"; }; }; harnessCompatibility?: string[]; } export interface Agent { manifest: AgentManifest; soul: string; memory: string; dbPath: string; } export interface AgentConfig { basePath?: string; dbPath?: string; autoSync?: boolean; embeddings?: { provider: "native" | "llama-cpp" | "ollama" | "openai" | "local"; model?: string; dimensions?: number; }; } export declare const PIPELINE_FLAGS: readonly ["enabled", "paused", "shadowMode", "mutationsFrozen", "graph.enabled", "traversal.enabled", "reranker.enabled", "autonomous.enabled", "autonomous.frozen", "autonomous.allowUpdateDelete", "telemetryEnabled"]; export type PipelineFlag = (typeof PIPELINE_FLAGS)[number]; export interface PipelineEscalationConfig { readonly maxNewEntitiesPerChunk: number; readonly maxNewAttributesPerEntity: number; readonly level2MaxEntities: number; } export interface PipelineCommandConfig { readonly bin: string; readonly args: ReadonlyArray; readonly cwd?: string; readonly env?: Readonly>; } export interface ProviderRateLimitConfig { readonly maxCallsPerHour?: number; readonly burstSize?: number; readonly waitTimeoutMs?: number; } export declare const DEFAULT_PROVIDER_RATE_LIMIT: Required; export interface PipelineExtractionConfig { readonly provider: "none" | "acpx" | "llama-cpp" | "ollama" | "claude-code" | "opencode" | "codex" | "anthropic" | "openrouter" | "openai-compatible" | "command"; readonly fallbackProvider?: "llama-cpp" | "ollama" | "none"; readonly allowRemoteProviders?: boolean; readonly model: string; readonly strength: "low" | "medium" | "high"; readonly endpoint?: string; readonly timeout: number; readonly minConfidence: number; readonly structuredOutput?: boolean; readonly command?: PipelineCommandConfig; readonly escalation?: PipelineEscalationConfig; readonly rateLimit?: ProviderRateLimitConfig; } export interface PipelineWorkerConfig { readonly pollMs: number; readonly maxRetries: number; readonly leaseTimeoutMs: number; readonly maxLoadPerCpu: number; readonly overloadBackoffMs: number; readonly maxLlmConcurrency: number; /** Run extraction pipeline in a dedicated worker thread (default: false). */ readonly threadedExtraction: boolean; } export interface PipelineClaudeCodeConfig { /** Allow daemon-spawned Claude Code calls to inherit ambient Anthropic API-key env vars. */ readonly allowApiKeyEnv: boolean; readonly maxBudgetUsd?: number; readonly cooldownMs: number; } export interface PipelineGraphConfig { readonly enabled: boolean; readonly extractionWritesEnabled?: boolean; readonly boostWeight: number; readonly boostTimeoutMs: number; } export interface PipelineTraversalConfig { readonly enabled: boolean; readonly primary: boolean; readonly maxAspectsPerEntity: number; readonly maxAttributesPerAspect: number; readonly maxDependencyHops: number; readonly minDependencyStrength: number; readonly maxBranching: number; readonly maxTraversalPaths: number; readonly minConfidence: number; readonly timeoutMs: number; readonly boostWeight: number; readonly constraintBudgetChars: number; } export interface PipelineRerankerConfig { readonly enabled: boolean; readonly model: string; readonly useExtractionModel: boolean; readonly topN: number; readonly timeoutMs: number; } export interface PipelineAutonomousConfig { readonly enabled: boolean; readonly frozen: boolean; readonly allowUpdateDelete: boolean; readonly maintenanceIntervalMs: number; readonly maintenanceMode: "observe" | "execute"; } export interface PipelineRepairConfig { readonly reembedCooldownMs: number; readonly reembedHourlyBudget: number; readonly requeueCooldownMs: number; readonly requeueHourlyBudget: number; readonly dedupCooldownMs: number; readonly dedupHourlyBudget: number; readonly dedupSemanticThreshold: number; readonly dedupBatchSize: number; } export interface PipelineDocumentsConfig { readonly workerIntervalMs: number; readonly chunkSize: number; readonly chunkOverlap: number; readonly maxContentBytes: number; } export interface PipelineGuardrailsConfig { readonly maxContentChars: number; readonly chunkTargetChars: number; readonly recallTruncateChars: number; readonly contextBudgetChars?: number; } export interface PipelineTelemetryConfig { readonly posthogHost: string; readonly posthogApiKey: string; readonly flushIntervalMs: number; readonly flushBatchSize: number; readonly retentionDays: number; readonly memorySearchQaEnabled: boolean; } export interface PipelineContinuityConfig { readonly enabled: boolean; readonly promptInterval: number; readonly timeIntervalMs: number; readonly maxCheckpointsPerSession: number; readonly retentionDays: number; readonly recoveryBudgetChars: number; } export interface PipelineSubagentsConfig { readonly inheritContext: boolean; readonly tailChars: number; } export interface PipelineWriteGateConfig { readonly enabled: boolean; readonly threshold: number; readonly continuityDiscount: number; } export interface PipelineDurabilityConfig { readonly enabled: boolean; } export interface PipelineV2Config { readonly enabled: boolean; readonly paused: boolean; readonly shadowMode: boolean; readonly mutationsFrozen: boolean; readonly semanticContradictionEnabled: boolean; readonly semanticContradictionTimeoutMs: number; readonly telemetryEnabled: boolean; readonly allowRemoteProviders?: boolean; readonly extraction: PipelineExtractionConfig; readonly worker: PipelineWorkerConfig; readonly claudeCode: PipelineClaudeCodeConfig; readonly graph: PipelineGraphConfig; readonly traversal?: PipelineTraversalConfig; readonly reranker: PipelineRerankerConfig; readonly autonomous: PipelineAutonomousConfig; readonly repair: PipelineRepairConfig; readonly documents: PipelineDocumentsConfig; readonly guardrails: PipelineGuardrailsConfig; readonly telemetry: PipelineTelemetryConfig; readonly continuity: PipelineContinuityConfig; readonly subagents?: PipelineSubagentsConfig; readonly embeddingTracker: PipelineEmbeddingTrackerConfig; readonly synthesis: PipelineSynthesisConfig; readonly procedural: PipelineProceduralConfig; readonly structural: PipelineStructuralConfig; readonly feedback: PipelineFeedbackConfig; readonly significance?: PipelineSignificanceConfig; readonly writeGate?: PipelineWriteGateConfig; readonly durability?: PipelineDurabilityConfig; readonly modelRegistry: PipelineModelRegistryConfig; readonly hints?: PipelineHintsConfig; readonly reflections: PipelineReflectionsConfig; } export interface ModelRegistryEntry { readonly id: string; readonly provider: string; readonly label: string; readonly tier: "high" | "mid" | "low"; readonly deprecated: boolean; } export interface PipelineModelRegistryConfig { readonly enabled: boolean; readonly refreshIntervalMs: number; } export interface PipelineEmbeddingTrackerConfig { readonly enabled: boolean; readonly pollMs: number; readonly batchSize: number; } export interface PipelineSynthesisConfig { readonly enabled: boolean; readonly provider: "none" | "acpx" | "llama-cpp" | "ollama" | "claude-code" | "codex" | "opencode" | "anthropic" | "openrouter" | "openai-compatible"; readonly model: string; readonly endpoint?: string; readonly timeout: number; readonly maxTokens: number; readonly idleGapMinutes: number; readonly structuredOutput?: boolean; readonly rateLimit?: ProviderRateLimitConfig; } export interface PipelineProceduralConfig { readonly enabled: boolean; readonly decayRate: number; readonly minImportance: number; readonly importanceOnInstall: number; readonly enrichOnInstall: boolean; readonly enrichMinDescription: number; readonly reconcileIntervalMs: number; } export interface PipelineStructuralConfig { readonly enabled: boolean; readonly classifyBatchSize: number; readonly dependencyBatchSize: number; readonly pollIntervalMs: number; readonly synthesisEnabled: boolean; readonly synthesisIntervalMs: number; readonly synthesisTopEntities: number; readonly synthesisMaxFacts: number; readonly synthesisMaxStallMs: number; readonly supersessionEnabled: boolean; readonly supersessionSweepEnabled: boolean; readonly supersessionSemanticFallback: boolean; readonly supersessionMinConfidence: number; } export interface PipelineFeedbackConfig { readonly enabled: boolean; readonly ftsWeightDelta: number; readonly maxAspectWeight: number; readonly minAspectWeight: number; readonly decayEnabled: boolean; readonly decayRate: number; readonly staleDays: number; readonly decayIntervalSessions: number; } export interface PipelineSignificanceConfig { readonly enabled: boolean; readonly minTurns: number; readonly minEntityOverlap: number; readonly noveltyThreshold: number; } export interface PipelineHintsConfig { readonly enabled: boolean; readonly max: number; readonly timeout: number; readonly maxTokens: number; readonly poll: number; } export interface PipelineReflectionsConfig { readonly enabled: boolean; readonly model: string; readonly timeout: number; readonly maxTokens: number; readonly schedule: string; readonly timeWindowHours: number; readonly maxMemories: number; readonly maxSummaries: number; } export interface DreamingConfig { readonly enabled: boolean; readonly tokenThreshold: number; readonly timeout: number; readonly maxInputTokens: number; readonly maxOutputTokens: number; readonly backfillOnFirstRun: boolean; } export declare const MEMORY_TYPES: readonly ["fact", "preference", "decision", "rationale", "daily-log", "episodic", "procedural", "semantic", "system"]; export type MemoryType = (typeof MEMORY_TYPES)[number]; export declare const EXTRACTION_STATUSES: readonly ["none", "pending", "completed", "failed"]; export type ExtractionStatus = (typeof EXTRACTION_STATUSES)[number]; export declare const JOB_STATUSES: readonly ["pending", "leased", "completed", "failed", "dead"]; export type JobStatus = (typeof JOB_STATUSES)[number]; export declare const HISTORY_EVENTS: readonly ["created", "updated", "deleted", "recovered", "merged", "none", "split"]; export type HistoryEvent = (typeof HISTORY_EVENTS)[number]; export declare const DECISION_ACTIONS: readonly ["add", "update", "delete", "none"]; export type DecisionAction = (typeof DECISION_ACTIONS)[number]; export declare const TASK_HARNESSES: readonly ["claude-code", "opencode", "codex"]; export type TaskHarness = (typeof TASK_HARNESSES)[number]; export declare const TASK_RUN_STATUSES: readonly ["pending", "running", "completed", "failed"]; export type TaskRunStatus = (typeof TASK_RUN_STATUSES)[number]; export interface ScheduledTask { readonly id: string; readonly name: string; readonly prompt: string; readonly cronExpression: string; readonly harness: TaskHarness; readonly workingDirectory: string | null; readonly enabled: boolean; readonly lastRunAt: string | null; readonly nextRunAt: string | null; readonly createdAt: string; readonly updatedAt: string; } export interface TaskRun { readonly id: string; readonly taskId: string; readonly status: TaskRunStatus; readonly startedAt: string; readonly completedAt: string | null; readonly exitCode: number | null; readonly stdout: string | null; readonly stderr: string | null; readonly error: string | null; } export interface Memory { id: string; type: MemoryType; category?: string; content: string; confidence: number; sourceId?: string; sourceType?: string; sourcePath?: string; runtimePath?: string; idempotencyKey?: string; tags: string[]; createdAt: string; updatedAt: string; updatedBy: string; vectorClock: Record; version: number; manualOverride: boolean; contentHash?: string; normalizedContent?: string; isDeleted?: boolean; deletedAt?: string; pinned?: boolean; importance?: number; extractionStatus?: ExtractionStatus; embeddingModel?: string; extractionModel?: string; updateCount?: number; accessCount?: number; lastAccessed?: string; who?: string; } export interface Conversation { id: string; sessionId: string; harness: string; startedAt: string; endedAt?: string; summary?: string; topics: string[]; decisions: string[]; createdAt: string; updatedAt: string; updatedBy: string; vectorClock: Record; version: number; manualOverride: boolean; } export interface Embedding { id: string; contentHash: string; vector: Float32Array; dimensions: number; sourceType: string; sourceId: string; chunkText: string; createdAt: string; } export interface MemoryHistory { id: string; memoryId: string; event: HistoryEvent; oldContent?: string; newContent?: string; changedBy: string; reason?: string; metadata?: string; createdAt: string; actorType?: string; sessionId?: string; requestId?: string; } export interface MemoryJob { id: string; memoryId: string; jobType: string; status: JobStatus; payload?: string; result?: string; attempts: number; maxAttempts: number; leasedAt?: string; completedAt?: string; failedAt?: string; error?: string; createdAt: string; updatedAt: string; } export interface Entity { id: string; name: string; canonicalName?: string; entityType: string; agentId: string; description?: string; mentions?: number; pinned?: boolean; pinnedAt?: string | null; status?: OntologyRowStatus; archivedAt?: string | null; archivedBy?: string | null; archiveReason?: string | null; proposalId?: string | null; proposalEvidence?: readonly unknown[]; createdAt: string; updatedAt: string; } export interface EntityAlias { readonly id: string; readonly entityId: string; readonly agentId: string; readonly alias: string; readonly canonicalAlias: string; readonly confidence: number; readonly source: string | null; readonly status: OntologyRowStatus; readonly createdAt: string; readonly updatedAt: string; } export interface Relation { id: string; sourceEntityId: string; targetEntityId: string; relationType: string; strength: number; mentions?: number; confidence?: number; metadata?: string; createdAt: string; updatedAt?: string; } export interface MemoryEntityMention { memoryId: string; entityId: string; mentionText?: string; confidence?: number; createdAt?: string; } export interface ExtractedFact { readonly content: string; readonly type: MemoryType; readonly confidence: number; } export interface ExtractedEntity { readonly source: string; readonly sourceType?: string; readonly relationship: string; readonly target: string; readonly targetType?: string; readonly confidence: number; } export interface ExtractionResult { readonly facts: readonly ExtractedFact[]; readonly entities: readonly ExtractedEntity[]; readonly warnings: readonly string[]; } export interface DecisionProposal { readonly action: DecisionAction; readonly targetMemoryId?: string; readonly confidence: number; readonly reason: string; } export interface DecisionResult { readonly proposals: readonly DecisionProposal[]; readonly warnings: readonly string[]; } export declare const ENTITY_TYPES: readonly ["person", "project", "system", "tool", "concept", "skill", "task", "source", "artifact", "agent", "policy", "action", "workflow", "event", "object_type", "interface", "observation", "claim_slot", "claim_value", "unknown"]; export type EntityType = (typeof ENTITY_TYPES)[number]; export declare const ATTRIBUTE_KINDS: readonly ["attribute", "constraint"]; export type AttributeKind = (typeof ATTRIBUTE_KINDS)[number]; export declare const ATTRIBUTE_STATUSES: readonly ["active", "superseded", "deleted"]; export type AttributeStatus = (typeof ATTRIBUTE_STATUSES)[number]; export declare const ONTOLOGY_ROW_STATUSES: readonly ["active", "archived"]; export type OntologyRowStatus = (typeof ONTOLOGY_ROW_STATUSES)[number]; export declare const DEPENDENCY_TYPES: readonly ["uses", "requires", "owned_by", "owns", "blocks", "informs", "maintains", "implements", "built", "depends_on", "related_to", "learned_from", "teaches", "knows", "assumes", "supports_claim", "authored_by", "links_to", "contains", "contains_note", "contradicts", "supersedes", "part_of", "produced_artifact", "precedes", "follows", "triggers", "may_execute", "requires_approval_from", "impacts", "produces", "consumes"]; export type DependencyType = (typeof DEPENDENCY_TYPES)[number]; export declare const DEPENDENCY_DESCRIPTIONS: Record; export declare const TASK_STATUSES: readonly ["open", "in_progress", "blocked", "done", "cancelled"]; export type TaskStatus = (typeof TASK_STATUSES)[number]; export declare const ONTOLOGY_PROPOSAL_STATUSES: readonly ["pending", "applied", "rejected", "failed"]; export type OntologyProposalStatus = (typeof ONTOLOGY_PROPOSAL_STATUSES)[number]; export declare const EPISTEMIC_ASSERTION_PREDICATES: readonly ["claims", "believes", "observed", "decided", "prefers", "denies", "questions"]; export type EpistemicAssertionPredicate = (typeof EPISTEMIC_ASSERTION_PREDICATES)[number]; export declare const EPISTEMIC_ASSERTION_STATUSES: readonly ["active", "archived", "superseded"]; export type EpistemicAssertionStatus = (typeof EPISTEMIC_ASSERTION_STATUSES)[number]; export declare const ONTOLOGY_PROPOSAL_OPERATIONS: readonly ["create_entity", "add_claim_value", "set_claim_value", "rename_entity", "archive_entity", "create_aspect", "rename_aspect", "archive_aspect", "archive_claim_value", "restore_claim_version", "create_link", "update_link", "archive_link", "merge_entities", "supersede_claim_value", "create_policy", "create_action_type", "create_interface", "attach_interface"]; export type OntologyProposalOperation = (typeof ONTOLOGY_PROPOSAL_OPERATIONS)[number]; export interface OntologyProposal { readonly id: string; readonly agentId: string; readonly operation: string; readonly status: OntologyProposalStatus; readonly payload: Readonly>; readonly confidence: number; readonly rationale: string; readonly evidence: readonly unknown[]; readonly risk: string | null; readonly sourceKind: string | null; readonly sourceId: string | null; readonly sourcePath: string | null; readonly sourceRoot: string | null; readonly createdBy: string; readonly appliedBy: string | null; readonly rejectedBy: string | null; readonly result: Readonly> | null; readonly createdAt: string; readonly updatedAt: string; readonly appliedAt: string | null; readonly rejectedAt: string | null; } export interface EntityAspect { readonly id: string; readonly entityId: string; readonly agentId: string; readonly name: string; readonly canonicalName: string; readonly weight: number; readonly status?: OntologyRowStatus; readonly archivedAt?: string | null; readonly archivedBy?: string | null; readonly archiveReason?: string | null; readonly proposalId?: string | null; readonly proposalEvidence?: readonly unknown[]; readonly createdAt: string; readonly updatedAt: string; } export interface EntityAttribute { readonly id: string; readonly aspectId: string; readonly agentId: string; readonly memoryId: string | null; readonly kind: AttributeKind; readonly content: string; readonly normalizedContent: string; readonly groupKey: string | null; readonly claimKey: string | null; readonly confidence: number; readonly importance: number; readonly status: AttributeStatus; readonly supersededBy: string | null; readonly version?: number; readonly versionRootId?: string | null; readonly previousAttributeId?: string | null; readonly archivedAt?: string | null; readonly archivedBy?: string | null; readonly archiveReason?: string | null; readonly sourceKind: string | null; readonly sourceId: string | null; readonly sourcePath: string | null; readonly sourceRoot: string | null; readonly proposalId: string | null; readonly proposalEvidence: readonly unknown[]; readonly createdAt: string; readonly updatedAt: string; } export interface EntityDependency { readonly id: string; readonly sourceEntityId: string; readonly targetEntityId: string; readonly agentId: string; readonly aspectId: string | null; readonly dependencyType: DependencyType; readonly strength: number; readonly confidence: number; readonly reason: string | null; readonly status?: OntologyRowStatus; readonly archivedAt?: string | null; readonly archivedBy?: string | null; readonly archiveReason?: string | null; readonly sourceKind: string | null; readonly sourceId: string | null; readonly sourcePath: string | null; readonly sourceRoot: string | null; readonly proposalId: string | null; readonly proposalEvidence: readonly unknown[]; readonly createdAt: string; readonly updatedAt: string; } export interface EpistemicAssertion { readonly id: string; readonly agentId: string; readonly subjectEntityId: string; readonly subjectEntityName: string | null; readonly claimAttributeId: string | null; readonly predicate: EpistemicAssertionPredicate; readonly content: string; readonly normalizedContent: string; readonly speaker: string | null; readonly assertedAt: string; readonly confidence: number; readonly evidence: readonly unknown[]; readonly sourceKind: string | null; readonly sourceId: string | null; readonly sourcePath: string | null; readonly sourceRoot: string | null; readonly status: EpistemicAssertionStatus; readonly supersedesAssertionId: string | null; readonly archivedAt: string | null; readonly archivedBy: string | null; readonly archiveReason: string | null; readonly createdBy: string; readonly createdAt: string; readonly updatedAt: string; } export interface TaskMeta { readonly entityId: string; readonly agentId: string; readonly status: TaskStatus; readonly expiresAt: string | null; readonly retentionUntil: string | null; readonly completedAt: string | null; readonly updatedAt: string; } //# sourceMappingURL=types.d.ts.map