@almadar/agent 1.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 +72 -0
- package/dist/agent/index.d.ts +250 -0
- package/dist/agent/index.js +6038 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/api-types-BW_58thJ.d.ts +557 -0
- package/dist/event-transformer/index.d.ts +125 -0
- package/dist/event-transformer/index.js +350 -0
- package/dist/event-transformer/index.js.map +1 -0
- package/dist/firestore-checkpointer-DxbQ10ve.d.ts +184 -0
- package/dist/index.d.ts +742 -0
- package/dist/index.js +9392 -0
- package/dist/index.js.map +1 -0
- package/dist/orbital-subagent-BsQBhKzi.d.ts +1424 -0
- package/dist/persistence/index.d.ts +201 -0
- package/dist/persistence/index.js +489 -0
- package/dist/persistence/index.js.map +1 -0
- package/dist/prompts/index.d.ts +23 -0
- package/dist/prompts/index.js +126 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/tools/index.d.ts +2143 -0
- package/dist/tools/index.js +5783 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/types.d.ts +170 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +102 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
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 };
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
|
package/package.json
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@almadar/agent",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "AI agent infrastructure for Almadar orbital schema generation",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
},
|
|
14
|
+
"./types": {
|
|
15
|
+
"import": "./dist/types.js",
|
|
16
|
+
"types": "./dist/types.d.ts"
|
|
17
|
+
},
|
|
18
|
+
"./tools": {
|
|
19
|
+
"import": "./dist/tools/index.js",
|
|
20
|
+
"types": "./dist/tools/index.d.ts"
|
|
21
|
+
},
|
|
22
|
+
"./prompts": {
|
|
23
|
+
"import": "./dist/prompts/index.js",
|
|
24
|
+
"types": "./dist/prompts/index.d.ts"
|
|
25
|
+
},
|
|
26
|
+
"./agent": {
|
|
27
|
+
"import": "./dist/agent/index.js",
|
|
28
|
+
"types": "./dist/agent/index.d.ts"
|
|
29
|
+
},
|
|
30
|
+
"./persistence": {
|
|
31
|
+
"import": "./dist/persistence/index.js",
|
|
32
|
+
"types": "./dist/persistence/index.d.ts"
|
|
33
|
+
},
|
|
34
|
+
"./event-transformer": {
|
|
35
|
+
"import": "./dist/event-transformer/index.js",
|
|
36
|
+
"types": "./dist/event-transformer/index.d.ts"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist"
|
|
41
|
+
],
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"uuid": "^9.0.0",
|
|
47
|
+
"zod": "^3.22.0",
|
|
48
|
+
"@almadar/core": "1.0.1",
|
|
49
|
+
"@almadar/integrations": "1.0.0",
|
|
50
|
+
"@almadar/patterns": "1.0.1",
|
|
51
|
+
"@almadar/skills": "1.0.0",
|
|
52
|
+
"@almadar/llm": "1.0.0",
|
|
53
|
+
"@almadar/std": "1.0.1"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"@langchain/core": ">=0.2.0",
|
|
57
|
+
"@langchain/langgraph": ">=0.2.0",
|
|
58
|
+
"@langchain/langgraph-checkpoint": ">=1.0.0",
|
|
59
|
+
"deepagents": ">=1.3.0"
|
|
60
|
+
},
|
|
61
|
+
"peerDependenciesMeta": {
|
|
62
|
+
"@langchain/core": {
|
|
63
|
+
"optional": false
|
|
64
|
+
},
|
|
65
|
+
"@langchain/langgraph": {
|
|
66
|
+
"optional": false
|
|
67
|
+
},
|
|
68
|
+
"@langchain/langgraph-checkpoint": {
|
|
69
|
+
"optional": false
|
|
70
|
+
},
|
|
71
|
+
"deepagents": {
|
|
72
|
+
"optional": false
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@langchain/core": "^0.3.0",
|
|
77
|
+
"@langchain/langgraph": "^0.2.0",
|
|
78
|
+
"@langchain/langgraph-checkpoint": "^1.0.0",
|
|
79
|
+
"@types/uuid": "^9.0.0",
|
|
80
|
+
"deepagents": "^1.3.1",
|
|
81
|
+
"tsup": "^8.0.0",
|
|
82
|
+
"typescript": "^5.4.0"
|
|
83
|
+
},
|
|
84
|
+
"repository": {
|
|
85
|
+
"type": "git",
|
|
86
|
+
"url": "https://github.com/almadar-io/almadar.git",
|
|
87
|
+
"directory": "packages/almadar-agent"
|
|
88
|
+
},
|
|
89
|
+
"license": "MIT",
|
|
90
|
+
"keywords": [
|
|
91
|
+
"almadar",
|
|
92
|
+
"orbital",
|
|
93
|
+
"agent",
|
|
94
|
+
"deepagent",
|
|
95
|
+
"schema-generation"
|
|
96
|
+
],
|
|
97
|
+
"scripts": {
|
|
98
|
+
"build": "tsup",
|
|
99
|
+
"build:watch": "tsup --watch",
|
|
100
|
+
"typecheck": "tsc --noEmit"
|
|
101
|
+
}
|
|
102
|
+
}
|