@almadar/agent 1.6.4 → 2.0.0
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.
- package/LICENSE +21 -72
- package/README.md +25 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -1
- package/dist/workspace/index.js +39 -0
- package/dist/workspace/index.js.map +1 -1
- package/package.json +9 -8
- package/dist/agent/index.d.ts +0 -13
- package/dist/api-types-CXrq-fts.d.ts +0 -561
- package/dist/event-transformer/index.d.ts +0 -125
- package/dist/firestore-checkpointer-CkNKXoun.d.ts +0 -184
- package/dist/index-DW3F-Ihx.d.ts +0 -2501
- package/dist/index-DZn69no8.d.ts +0 -1014
- package/dist/index.d.ts +0 -1679
- package/dist/orbital-subagent-BdFuf77p.d.ts +0 -1436
- package/dist/persistence/index.d.ts +0 -201
- package/dist/tools/index.d.ts +0 -8
- package/dist/types.d.ts +0 -170
- package/dist/workspace/index.d.ts +0 -355
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import { S as SessionMetadata, e as SessionRecord, b as FirestoreDb, d as Session } from '../firestore-checkpointer-CkNKXoun.js';
|
|
2
|
-
export { F as FirestoreCheckpointer, a as FirestoreCheckpointerOptions, c as FirestoreTimestamp, P as PersistenceMode } from '../firestore-checkpointer-CkNKXoun.js';
|
|
3
|
-
import { BaseStore, Operation, OperationResults } from '@langchain/langgraph-checkpoint';
|
|
4
|
-
import '@langchain/core/runnables';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* In-Memory Persistence Backend
|
|
8
|
-
*
|
|
9
|
-
* Provides in-memory session metadata storage for development.
|
|
10
|
-
* Data is lost on process restart.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* In-memory session metadata store.
|
|
15
|
-
*/
|
|
16
|
-
declare class MemorySessionBackend {
|
|
17
|
-
private sessions;
|
|
18
|
-
/**
|
|
19
|
-
* Store session metadata.
|
|
20
|
-
*/
|
|
21
|
-
store(threadId: string, metadata: SessionMetadata): void;
|
|
22
|
-
/**
|
|
23
|
-
* Get session metadata.
|
|
24
|
-
*/
|
|
25
|
-
get(threadId: string): SessionMetadata | undefined;
|
|
26
|
-
/**
|
|
27
|
-
* Delete session metadata.
|
|
28
|
-
*/
|
|
29
|
-
delete(threadId: string): boolean;
|
|
30
|
-
/**
|
|
31
|
-
* List all sessions.
|
|
32
|
-
*/
|
|
33
|
-
list(): SessionRecord[];
|
|
34
|
-
/**
|
|
35
|
-
* Check if a session exists.
|
|
36
|
-
*/
|
|
37
|
-
has(threadId: string): boolean;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Firestore Session Store for DeepAgent
|
|
42
|
-
*
|
|
43
|
-
* Provides persistent session storage for skill-based agents.
|
|
44
|
-
* Sessions are stored in Firestore and persist across server restarts.
|
|
45
|
-
*
|
|
46
|
-
* IMPORTANT: This module does NOT import firebase-admin directly.
|
|
47
|
-
* The Firestore `db` instance must be injected via constructor options.
|
|
48
|
-
*/
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Options for FirestoreSessionStore.
|
|
52
|
-
*/
|
|
53
|
-
interface FirestoreSessionStoreOptions {
|
|
54
|
-
/**
|
|
55
|
-
* Firestore instance. Required — injected by consumer.
|
|
56
|
-
*/
|
|
57
|
-
db: FirestoreDb;
|
|
58
|
-
/**
|
|
59
|
-
* Collection name for sessions.
|
|
60
|
-
* @default 'agent_sessions'
|
|
61
|
-
*/
|
|
62
|
-
collection?: string;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Firestore-backed session store for skill agents.
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* ```typescript
|
|
69
|
-
* const sessionStore = new FirestoreSessionStore({ db: getFirestore() });
|
|
70
|
-
*
|
|
71
|
-
* await sessionStore.save({
|
|
72
|
-
* threadId: 'abc-123',
|
|
73
|
-
* skill: 'kflow-generating-m',
|
|
74
|
-
* workDir: '/tmp/workspace',
|
|
75
|
-
* createdAt: new Date(),
|
|
76
|
-
* lastActivityAt: new Date(),
|
|
77
|
-
* });
|
|
78
|
-
*
|
|
79
|
-
* const session = await sessionStore.get('abc-123');
|
|
80
|
-
* ```
|
|
81
|
-
*/
|
|
82
|
-
declare class FirestoreSessionStore {
|
|
83
|
-
private db;
|
|
84
|
-
private collection;
|
|
85
|
-
constructor(options: FirestoreSessionStoreOptions);
|
|
86
|
-
/**
|
|
87
|
-
* Save a session.
|
|
88
|
-
*/
|
|
89
|
-
save(session: Session): Promise<void>;
|
|
90
|
-
/**
|
|
91
|
-
* Get a session by thread ID.
|
|
92
|
-
*/
|
|
93
|
-
get(threadId: string): Promise<Session | null>;
|
|
94
|
-
/**
|
|
95
|
-
* Update session's last activity timestamp.
|
|
96
|
-
*/
|
|
97
|
-
touch(threadId: string): Promise<void>;
|
|
98
|
-
/**
|
|
99
|
-
* Delete a session.
|
|
100
|
-
*/
|
|
101
|
-
delete(threadId: string): Promise<void>;
|
|
102
|
-
/**
|
|
103
|
-
* List sessions, optionally filtered by user ID.
|
|
104
|
-
*/
|
|
105
|
-
list(options?: {
|
|
106
|
-
userId?: string;
|
|
107
|
-
limit?: number;
|
|
108
|
-
}): Promise<Session[]>;
|
|
109
|
-
/**
|
|
110
|
-
* Delete expired sessions (older than specified hours).
|
|
111
|
-
*/
|
|
112
|
-
deleteExpired(maxAgeHours?: number): Promise<number>;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Firestore Store for LangGraph
|
|
117
|
-
*
|
|
118
|
-
* Custom implementation of BaseStore using Firebase Firestore.
|
|
119
|
-
* This provides persistent key-value storage for agent memories.
|
|
120
|
-
*
|
|
121
|
-
* IMPORTANT: This module does NOT import firebase-admin directly.
|
|
122
|
-
* The Firestore `db` instance must be injected via constructor options.
|
|
123
|
-
*/
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Options for FirestoreStore.
|
|
127
|
-
*/
|
|
128
|
-
interface FirestoreStoreOptions {
|
|
129
|
-
/**
|
|
130
|
-
* Firestore instance. Required — injected by consumer.
|
|
131
|
-
*/
|
|
132
|
-
db: FirestoreDb;
|
|
133
|
-
/**
|
|
134
|
-
* Collection name for store items.
|
|
135
|
-
* @default 'agent_memories'
|
|
136
|
-
*/
|
|
137
|
-
collection?: string;
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Firestore-backed store for LangGraph agent memories.
|
|
141
|
-
*
|
|
142
|
-
* Provides persistent key-value storage that can be shared across threads.
|
|
143
|
-
* Items are organized by hierarchical namespaces.
|
|
144
|
-
*
|
|
145
|
-
* @example
|
|
146
|
-
* ```typescript
|
|
147
|
-
* import { getFirestore } from 'firebase-admin/firestore';
|
|
148
|
-
*
|
|
149
|
-
* const store = new FirestoreStore({
|
|
150
|
-
* db: getFirestore(),
|
|
151
|
-
* collection: 'agent_memories',
|
|
152
|
-
* });
|
|
153
|
-
*
|
|
154
|
-
* // Store a memory
|
|
155
|
-
* await store.put(['agent', 'patterns'], 'schema-best-practices', {
|
|
156
|
-
* content: 'Always validate schemas before saving',
|
|
157
|
-
* });
|
|
158
|
-
*
|
|
159
|
-
* // Retrieve a memory
|
|
160
|
-
* const item = await store.get(['agent', 'patterns'], 'schema-best-practices');
|
|
161
|
-
* ```
|
|
162
|
-
*/
|
|
163
|
-
declare class FirestoreStore extends BaseStore {
|
|
164
|
-
private db;
|
|
165
|
-
private collection;
|
|
166
|
-
constructor(options: FirestoreStoreOptions);
|
|
167
|
-
/**
|
|
168
|
-
* Create document ID from namespace and key.
|
|
169
|
-
*/
|
|
170
|
-
private makeDocId;
|
|
171
|
-
/**
|
|
172
|
-
* Create namespace key for querying.
|
|
173
|
-
*/
|
|
174
|
-
private makeNamespaceKey;
|
|
175
|
-
/**
|
|
176
|
-
* Execute multiple operations in a batch.
|
|
177
|
-
*/
|
|
178
|
-
batch<Op extends Operation[]>(operations: Op): Promise<OperationResults<Op>>;
|
|
179
|
-
/**
|
|
180
|
-
* Get an item by namespace and key.
|
|
181
|
-
*/
|
|
182
|
-
private getItem;
|
|
183
|
-
/**
|
|
184
|
-
* Put an item.
|
|
185
|
-
*/
|
|
186
|
-
private putItem;
|
|
187
|
-
/**
|
|
188
|
-
* Delete an item.
|
|
189
|
-
*/
|
|
190
|
-
private deleteItem;
|
|
191
|
-
/**
|
|
192
|
-
* Search for items.
|
|
193
|
-
*/
|
|
194
|
-
private searchItems;
|
|
195
|
-
/**
|
|
196
|
-
* List namespaces.
|
|
197
|
-
*/
|
|
198
|
-
private listNamespacesItems;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
export { FirestoreDb, FirestoreSessionStore, type FirestoreSessionStoreOptions, FirestoreStore, type FirestoreStoreOptions, MemorySessionBackend, Session, SessionMetadata, SessionRecord };
|
package/dist/tools/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { a as DomainOrbitalCompleteCallback, D as DomainOrbitalEventCallback, b as DomainOrbitalSpec, c as DomainOrbitalToolOptions, O as OrbitalCompleteCallback, d as OrbitalRequirements, e as OrbitalSubagentToolOptions, S as SubagentEventCallback, f as createConstructCombinedDomainTool, g as createDomainOrbitalTools, h as createGenerateOrbitalDomainTool, i as createOrbitalSubagentTool, j as createSubagentEventWrapper } from '../orbital-subagent-BdFuf77p.js';
|
|
2
|
-
export { B as BatchCompleteCallback, S as BatchSubagentEventCallback, G as GitHubToolsConfig, s as OrbitalBatchSubagentToolOptions, t as OrchestratedFixingOptions, u as OrchestratedFixingResult, w as OrchestratedGenerationOptions, x as OrchestratedGenerationResult, T as TraitCompleteCallback, d as TraitEventCallback, e as TraitSpec, f as TraitSubagentToolOptions, g as createAgentTools, h as createApplyChunkTool, i as createCombineSchemasTool, y as createComplexityCheckTool, j as createExecuteTool, k as createExtractChunkTool, l as createFinishTaskTool, m as createGenerateSchemaTool, z as createGitHubTools, C as createGitHubToolsArray, D as createOrbitalBatchSubagentTool, E as createOrchestratedFixingTool, F as createOrchestratedGenerationTool, n as createQuerySchemaStructureTool, o as createSchemaChunkingTools, p as createTraitEventWrapper, q as createTraitSubagentTool, r as createValidateSchemaTool, H as createValidateTool, v as validateCommandPaths } from '../index-DW3F-Ihx.js';
|
|
3
|
-
import '@langchain/core/tools';
|
|
4
|
-
import 'zod';
|
|
5
|
-
import '@almadar/llm';
|
|
6
|
-
import '../api-types-CXrq-fts.js';
|
|
7
|
-
import '@almadar/core/types';
|
|
8
|
-
import '@almadar/core';
|
package/dist/types.d.ts
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { FullOrbitalUnit, OrbitalSchema, OrbitalDefinition } from '@almadar/core/types';
|
|
2
|
-
import { LLMClient } from '@almadar/llm';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @almadar/agent Types
|
|
6
|
-
*
|
|
7
|
-
* Core types for the agent package.
|
|
8
|
-
*
|
|
9
|
-
* LLM access is provided by @almadar/llm (imported directly).
|
|
10
|
-
* Skill prompts are provided by @almadar/skills (imported directly).
|
|
11
|
-
*
|
|
12
|
-
* Only builder-specific modules that don't exist as almadar packages
|
|
13
|
-
* use dependency injection via AgentDependencies.
|
|
14
|
-
*
|
|
15
|
-
* @packageDocumentation
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Options for combining orbitals into a schema.
|
|
20
|
-
*/
|
|
21
|
-
interface CombinerOptions {
|
|
22
|
-
name: string;
|
|
23
|
-
description?: string;
|
|
24
|
-
version?: string;
|
|
25
|
-
theme?: string;
|
|
26
|
-
defaultRoute?: string;
|
|
27
|
-
validate?: boolean;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Result from combining orbitals.
|
|
31
|
-
*/
|
|
32
|
-
interface CombinerResult {
|
|
33
|
-
success: boolean;
|
|
34
|
-
schema?: OrbitalSchema;
|
|
35
|
-
error?: string;
|
|
36
|
-
stats?: {
|
|
37
|
-
totalOrbitals: number;
|
|
38
|
-
totalEntities: number;
|
|
39
|
-
totalPages: number;
|
|
40
|
-
totalTraits: number;
|
|
41
|
-
};
|
|
42
|
-
validation?: {
|
|
43
|
-
valid: boolean;
|
|
44
|
-
errors: Array<{
|
|
45
|
-
code: string;
|
|
46
|
-
path: string;
|
|
47
|
-
message: string;
|
|
48
|
-
}>;
|
|
49
|
-
warnings: Array<{
|
|
50
|
-
code: string;
|
|
51
|
-
path: string;
|
|
52
|
-
message: string;
|
|
53
|
-
}>;
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Function signature for combining orbitals.
|
|
58
|
-
*/
|
|
59
|
-
type CombineOrbitalsFn = (orbitals: FullOrbitalUnit[], options: CombinerOptions) => CombinerResult;
|
|
60
|
-
/**
|
|
61
|
-
* Result from converting domain language to schema.
|
|
62
|
-
*/
|
|
63
|
-
interface DomainConversionResult {
|
|
64
|
-
success: boolean;
|
|
65
|
-
schema?: OrbitalSchema;
|
|
66
|
-
errors?: Array<{
|
|
67
|
-
message: string;
|
|
68
|
-
}>;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Function signature for converting domain text to schema.
|
|
72
|
-
*/
|
|
73
|
-
type ConvertDomainToSchemaFn = (domainText: string, baseSchema: {
|
|
74
|
-
name: string;
|
|
75
|
-
orbitals: unknown[];
|
|
76
|
-
}) => DomainConversionResult;
|
|
77
|
-
/**
|
|
78
|
-
* Log entry from orbital generation.
|
|
79
|
-
*/
|
|
80
|
-
interface GenerationLog {
|
|
81
|
-
level: 'info' | 'warn' | 'error' | 'debug';
|
|
82
|
-
message: string;
|
|
83
|
-
data?: Record<string, unknown>;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Result from orbital generation.
|
|
87
|
-
*/
|
|
88
|
-
interface OrbitalGenerationResult {
|
|
89
|
-
orbital: unknown;
|
|
90
|
-
fingerprint?: string;
|
|
91
|
-
usedTemplate?: boolean;
|
|
92
|
-
usage?: {
|
|
93
|
-
totalTokens: number;
|
|
94
|
-
inputTokens?: number;
|
|
95
|
-
outputTokens?: number;
|
|
96
|
-
};
|
|
97
|
-
validation?: {
|
|
98
|
-
valid: boolean;
|
|
99
|
-
errors?: Array<{
|
|
100
|
-
code: string;
|
|
101
|
-
path: string;
|
|
102
|
-
message: string;
|
|
103
|
-
}>;
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Options for orbital generation.
|
|
108
|
-
*/
|
|
109
|
-
interface OrbitalGenerationOptions {
|
|
110
|
-
validate?: boolean;
|
|
111
|
-
requirements?: {
|
|
112
|
-
entities?: string[];
|
|
113
|
-
states?: string[];
|
|
114
|
-
events?: string[];
|
|
115
|
-
guards?: string[];
|
|
116
|
-
pages?: string[];
|
|
117
|
-
effects?: string[];
|
|
118
|
-
rawRequirements?: string[];
|
|
119
|
-
};
|
|
120
|
-
onLog?: (log: GenerationLog) => void;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Function signature for generating a full orbital.
|
|
124
|
-
* Accepts LLMClient from @almadar/llm directly.
|
|
125
|
-
*/
|
|
126
|
-
type GenerateFullOrbitalFn = (client: LLMClient, orbital: OrbitalDefinition, options?: OrbitalGenerationOptions) => Promise<OrbitalGenerationResult>;
|
|
127
|
-
/**
|
|
128
|
-
* @deprecated AgentDependencies is no longer needed. All functions are now
|
|
129
|
-
* internal to @almadar/agent. Import them directly:
|
|
130
|
-
* - combineOrbitals from '@almadar/agent'
|
|
131
|
-
* - convertDomainToSchema from '@almadar/agent'
|
|
132
|
-
* - generateFullOrbital from '@almadar/agent'
|
|
133
|
-
*
|
|
134
|
-
* @example Old (deprecated):
|
|
135
|
-
* ```typescript
|
|
136
|
-
* const deps: AgentDependencies = { ... };
|
|
137
|
-
* const tools = createAgentTools('/workspace', deps);
|
|
138
|
-
* ```
|
|
139
|
-
*
|
|
140
|
-
* @example New:
|
|
141
|
-
* ```typescript
|
|
142
|
-
* import { createAgentTools } from '@almadar/agent';
|
|
143
|
-
* const tools = createAgentTools('/workspace');
|
|
144
|
-
* ```
|
|
145
|
-
*/
|
|
146
|
-
interface AgentDependencies {
|
|
147
|
-
/**
|
|
148
|
-
* @deprecated Use combineOrbitals from '@almadar/agent' instead
|
|
149
|
-
*/
|
|
150
|
-
combineOrbitals: CombineOrbitalsFn;
|
|
151
|
-
/**
|
|
152
|
-
* @deprecated Use convertDomainToSchema from '@almadar/agent' instead
|
|
153
|
-
*/
|
|
154
|
-
convertDomainToSchema: ConvertDomainToSchemaFn;
|
|
155
|
-
/**
|
|
156
|
-
* @deprecated Use generateFullOrbital from '@almadar/agent' instead
|
|
157
|
-
*/
|
|
158
|
-
generateFullOrbital: GenerateFullOrbitalFn;
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Subagent configuration.
|
|
162
|
-
* Compatible with the deepagents library SubAgent type.
|
|
163
|
-
*/
|
|
164
|
-
interface SubAgent {
|
|
165
|
-
name: string;
|
|
166
|
-
description: string;
|
|
167
|
-
systemPrompt: string;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
export type { AgentDependencies, CombineOrbitalsFn, CombinerOptions, CombinerResult, ConvertDomainToSchemaFn, DomainConversionResult, GenerateFullOrbitalFn, GenerationLog, OrbitalGenerationOptions, OrbitalGenerationResult, SubAgent };
|