@framers/agentos 0.7.2 → 0.7.3

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.
@@ -0,0 +1,180 @@
1
+ /**
2
+ * @fileoverview SoulLoader — load agent identity from SOUL.md (and companion files)
3
+ * into an `IPersonaDefinition`. Mirrors the OpenClaw/aaronjmars-soul.md convention:
4
+ * personality lives in markdown (with YAML frontmatter for structured config),
5
+ * not JSON.
6
+ *
7
+ * **The 6-file workspace pattern** (per agent):
8
+ *
9
+ * ~/.agentos/agents/<agent-id>/
10
+ * ├── SOUL.md identity, values, tone, hard limits (REQUIRED)
11
+ * ├── STYLE.md voice, syntax, vocabulary patterns (optional)
12
+ * ├── IDENTITY.md display card: name, role, agent-ID, avatar (optional, derived from SOUL frontmatter when absent)
13
+ * ├── AGENTS.md procedural rules: workflows, file access (optional)
14
+ * ├── MEMORY.md long-term facts; daily logs at memory/YYYY-MM-DD.md (auto-managed)
15
+ * └── examples/ good-outputs.md + bad-outputs.md (optional)
16
+ *
17
+ * **SOUL.md format** — markdown with YAML frontmatter:
18
+ *
19
+ * ---
20
+ * name: Aria
21
+ * agentId: support-bot
22
+ * role: Customer support for Meridian SaaS
23
+ * hexaco:
24
+ * honestyHumility: 0.8
25
+ * emotionality: 0.6
26
+ * extraversion: 0.7
27
+ * agreeableness: 0.85
28
+ * conscientiousness: 0.9
29
+ * openness: 0.65
30
+ * voice:
31
+ * provider: elevenlabs
32
+ * voiceId: rachel-warm
33
+ * defaultMood: helpful_engaged
34
+ * hardLimits:
35
+ * - Never share internal pricing formulas
36
+ * - Always recommend a human review for refunds > €100
37
+ * ---
38
+ *
39
+ * ## Who You Are
40
+ *
41
+ * You are Aria, the customer support agent for Meridian SaaS...
42
+ *
43
+ * **Loading order at agent boot:**
44
+ *
45
+ * 1. SOUL.md → injected as the FIRST system message (the "character sheet")
46
+ * 2. STYLE.md → appended as second system message if present
47
+ * 3. AGENTS.md → session-start procedures executed if defined
48
+ * 4. MEMORY.md → loaded into long-term memory store
49
+ * 5. examples/ → fed to emergent calibration (if enabled)
50
+ *
51
+ * @module @framers/agentos/cognition/substrate/personas/SoulLoader
52
+ */
53
+ import type { IPersonaDefinition } from './IPersonaDefinition.js';
54
+ /**
55
+ * Result of loading a soul workspace. The `personaDefinition` is suitable for
56
+ * passing to `PersonaOverlayManager` or wiring into AgentOptions; the raw
57
+ * `soulContent` and companion-file contents are available for the runtime
58
+ * to inject as system messages.
59
+ */
60
+ export interface LoadedSoul {
61
+ /** Persona definition derived from SOUL.md frontmatter + body. */
62
+ personaDefinition: IPersonaDefinition;
63
+ /** Raw SOUL.md prose body (frontmatter stripped). Inject as first system message. */
64
+ soulContent: string;
65
+ /** Raw STYLE.md content if present. Inject as second system message. */
66
+ styleContent?: string;
67
+ /** Raw IDENTITY.md content if present. Used for display surfaces. */
68
+ identityContent?: string;
69
+ /** Raw AGENTS.md content if present. Procedural rules / workflow definitions. */
70
+ agentsContent?: string;
71
+ /** Raw MEMORY.md seed content if present. Loaded into long-term memory. */
72
+ memoryContent?: string;
73
+ /** Path to the agent's workspace dir (where MEMORY.md daily logs accumulate). */
74
+ workspaceDir: string;
75
+ /** Frontmatter parsed from SOUL.md — useful for inspection/debugging. */
76
+ frontmatter: SoulFrontmatter;
77
+ }
78
+ /**
79
+ * YAML frontmatter shape parsed from SOUL.md. All fields optional —
80
+ * a soul file can be pure prose if structured config isn't needed.
81
+ */
82
+ export interface SoulFrontmatter {
83
+ /** Display name of the agent. e.g. "Aria". */
84
+ name?: string;
85
+ /** Stable identifier used for routing in multi-agent setups. */
86
+ agentId?: string;
87
+ /** One-line role description. e.g. "Customer support for Meridian SaaS". */
88
+ role?: string;
89
+ /** HEXACO trait scores (0.0-1.0). Maps to PersonalityMutationStore + PersonaDriftMechanism. */
90
+ hexaco?: HEXACOScores;
91
+ /** Voice config for TTS output. Maps to PersonaVoiceConfig. */
92
+ voice?: {
93
+ provider?: string;
94
+ voiceId?: string;
95
+ languageCode?: string;
96
+ };
97
+ /** Default mood at session start. e.g. "helpful_engaged". */
98
+ defaultMood?: string;
99
+ /** Allowed mood transitions. Subset of agentos GMI moods. */
100
+ allowedMoods?: string[];
101
+ /**
102
+ * Hard behavioral limits. Each entry becomes a "Never X" rule appended
103
+ * to the system prompt and a guardrail check in PersonaOverlayManager.
104
+ */
105
+ hardLimits?: string[];
106
+ /** Avatar config for visual surfaces. Maps to PersonaAvatarConfig. */
107
+ avatar?: {
108
+ type?: string;
109
+ sourceUrl?: string;
110
+ descriptionForGeneration?: string;
111
+ };
112
+ /** Free-form structured fields any consumer can read. */
113
+ metadata?: Record<string, unknown>;
114
+ }
115
+ /**
116
+ * HEXACO personality model scores. All values 0.0-1.0.
117
+ * See {@link https://hexaco.org/} for the trait reference.
118
+ */
119
+ export interface HEXACOScores {
120
+ /** Sincerity, fairness, modesty, low entitlement. */
121
+ honestyHumility?: number;
122
+ /** Anxiety, sensitivity to fear, sentimentality. */
123
+ emotionality?: number;
124
+ /** Sociability, expressiveness, social self-esteem. */
125
+ extraversion?: number;
126
+ /** Forgiveness, gentleness, flexibility, patience. */
127
+ agreeableness?: number;
128
+ /** Organization, diligence, prudence, perfectionism. */
129
+ conscientiousness?: number;
130
+ /** Aesthetic appreciation, inquisitiveness, creativity, unconventionality. */
131
+ openness?: number;
132
+ }
133
+ /**
134
+ * Options for `loadSoul()`.
135
+ */
136
+ export interface SoulLoaderOptions {
137
+ /**
138
+ * Either a workspace directory (containing SOUL.md and friends) OR a
139
+ * direct path to a SOUL.md file. If a directory, all 6 standard files
140
+ * are scanned.
141
+ */
142
+ source: string;
143
+ /**
144
+ * If true, throw when SOUL.md is missing. Default true — a soul without
145
+ * SOUL.md is not a soul.
146
+ */
147
+ requireSoul?: boolean;
148
+ }
149
+ /**
150
+ * Load a soul workspace. Reads SOUL.md (required) plus any of the optional
151
+ * companion files (STYLE.md, IDENTITY.md, AGENTS.md, MEMORY.md). Returns
152
+ * a `LoadedSoul` with both the parsed `IPersonaDefinition` and the raw
153
+ * markdown bodies for the runtime to inject as system messages.
154
+ *
155
+ * @example
156
+ * ```ts
157
+ * import { loadSoul } from '../../../cognition/substrate/personas/SoulLoader';
158
+ *
159
+ * const soul = await loadSoul({ source: '~/.agentos/agents/aria' });
160
+ *
161
+ * agent({
162
+ * provider: 'anthropic',
163
+ * instructions: soul.soulContent, // SOUL.md prose as system prompt
164
+ * persona: soul.personaDefinition, // structured fields (HEXACO, voice, mood)
165
+ * });
166
+ * ```
167
+ */
168
+ export declare function loadSoul(options: SoulLoaderOptions): Promise<LoadedSoul>;
169
+ /**
170
+ * Convert SoulFrontmatter + markdown body into an IPersonaDefinition that
171
+ * the existing PersonaOverlayManager and persona overlays can consume.
172
+ */
173
+ export declare function frontmatterToPersona(frontmatter: SoulFrontmatter, soulBody: string, styleBody?: string): IPersonaDefinition;
174
+ /**
175
+ * Render a persona definition (typically loaded from JSON or constructed
176
+ * programmatically) as a SOUL.md file. Useful for migration from the
177
+ * legacy JSON-only persona format and for `agent({ soul: { autoGenerate: ... } })`.
178
+ */
179
+ export declare function renderSoulMarkdown(persona: IPersonaDefinition): string;
180
+ //# sourceMappingURL=SoulLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SoulLoader.d.ts","sourceRoot":"","sources":["../../../../src/cognition/substrate/personas/SoulLoader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAKH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,kEAAkE;IAClE,iBAAiB,EAAE,kBAAkB,CAAC;IACtC,qFAAqF;IACrF,WAAW,EAAE,MAAM,CAAC;IACpB,wEAAwE;IACxE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iFAAiF;IACjF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C;IACvB,wDAAwD;IACxD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,CAuD9E;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,eAAe,EAC5B,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,MAAM,GACjB,kBAAkB,CAgDpB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,CA8BtE"}
@@ -0,0 +1,262 @@
1
+ /**
2
+ * @fileoverview SoulLoader — load agent identity from SOUL.md (and companion files)
3
+ * into an `IPersonaDefinition`. Mirrors the OpenClaw/aaronjmars-soul.md convention:
4
+ * personality lives in markdown (with YAML frontmatter for structured config),
5
+ * not JSON.
6
+ *
7
+ * **The 6-file workspace pattern** (per agent):
8
+ *
9
+ * ~/.agentos/agents/<agent-id>/
10
+ * ├── SOUL.md identity, values, tone, hard limits (REQUIRED)
11
+ * ├── STYLE.md voice, syntax, vocabulary patterns (optional)
12
+ * ├── IDENTITY.md display card: name, role, agent-ID, avatar (optional, derived from SOUL frontmatter when absent)
13
+ * ├── AGENTS.md procedural rules: workflows, file access (optional)
14
+ * ├── MEMORY.md long-term facts; daily logs at memory/YYYY-MM-DD.md (auto-managed)
15
+ * └── examples/ good-outputs.md + bad-outputs.md (optional)
16
+ *
17
+ * **SOUL.md format** — markdown with YAML frontmatter:
18
+ *
19
+ * ---
20
+ * name: Aria
21
+ * agentId: support-bot
22
+ * role: Customer support for Meridian SaaS
23
+ * hexaco:
24
+ * honestyHumility: 0.8
25
+ * emotionality: 0.6
26
+ * extraversion: 0.7
27
+ * agreeableness: 0.85
28
+ * conscientiousness: 0.9
29
+ * openness: 0.65
30
+ * voice:
31
+ * provider: elevenlabs
32
+ * voiceId: rachel-warm
33
+ * defaultMood: helpful_engaged
34
+ * hardLimits:
35
+ * - Never share internal pricing formulas
36
+ * - Always recommend a human review for refunds > €100
37
+ * ---
38
+ *
39
+ * ## Who You Are
40
+ *
41
+ * You are Aria, the customer support agent for Meridian SaaS...
42
+ *
43
+ * **Loading order at agent boot:**
44
+ *
45
+ * 1. SOUL.md → injected as the FIRST system message (the "character sheet")
46
+ * 2. STYLE.md → appended as second system message if present
47
+ * 3. AGENTS.md → session-start procedures executed if defined
48
+ * 4. MEMORY.md → loaded into long-term memory store
49
+ * 5. examples/ → fed to emergent calibration (if enabled)
50
+ *
51
+ * @module @framers/agentos/cognition/substrate/personas/SoulLoader
52
+ */
53
+ import * as fs from 'node:fs/promises';
54
+ import * as path from 'node:path';
55
+ import matter from 'gray-matter';
56
+ /**
57
+ * Load a soul workspace. Reads SOUL.md (required) plus any of the optional
58
+ * companion files (STYLE.md, IDENTITY.md, AGENTS.md, MEMORY.md). Returns
59
+ * a `LoadedSoul` with both the parsed `IPersonaDefinition` and the raw
60
+ * markdown bodies for the runtime to inject as system messages.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * import { loadSoul } from '../../../cognition/substrate/personas/SoulLoader';
65
+ *
66
+ * const soul = await loadSoul({ source: '~/.agentos/agents/aria' });
67
+ *
68
+ * agent({
69
+ * provider: 'anthropic',
70
+ * instructions: soul.soulContent, // SOUL.md prose as system prompt
71
+ * persona: soul.personaDefinition, // structured fields (HEXACO, voice, mood)
72
+ * });
73
+ * ```
74
+ */
75
+ export async function loadSoul(options) {
76
+ const requireSoul = options.requireSoul ?? true;
77
+ const resolvedSource = expandHome(options.source);
78
+ // Determine if source is a file or a directory
79
+ const stats = await fs.stat(resolvedSource).catch(() => null);
80
+ if (!stats) {
81
+ throw new Error(`Soul source does not exist: ${resolvedSource}`);
82
+ }
83
+ let workspaceDir;
84
+ let soulPath;
85
+ if (stats.isDirectory()) {
86
+ workspaceDir = resolvedSource;
87
+ soulPath = path.join(workspaceDir, 'SOUL.md');
88
+ }
89
+ else {
90
+ workspaceDir = path.dirname(resolvedSource);
91
+ soulPath = resolvedSource;
92
+ }
93
+ // Read SOUL.md (required unless explicitly opted out)
94
+ let soulRaw = null;
95
+ try {
96
+ soulRaw = await fs.readFile(soulPath, 'utf-8');
97
+ }
98
+ catch {
99
+ if (requireSoul) {
100
+ throw new Error(`SOUL.md not found at ${soulPath}`);
101
+ }
102
+ }
103
+ // Parse frontmatter + body
104
+ const parsed = soulRaw ? matter(soulRaw) : { data: {}, content: '' };
105
+ const frontmatter = parsed.data;
106
+ const soulContent = parsed.content.trim();
107
+ // Read optional companion files
108
+ const styleContent = await readOptional(path.join(workspaceDir, 'STYLE.md'));
109
+ const identityContent = await readOptional(path.join(workspaceDir, 'IDENTITY.md'));
110
+ const agentsContent = await readOptional(path.join(workspaceDir, 'AGENTS.md'));
111
+ const memoryContent = await readOptional(path.join(workspaceDir, 'MEMORY.md'));
112
+ // Build IPersonaDefinition from frontmatter + soul body
113
+ const personaDefinition = frontmatterToPersona(frontmatter, soulContent, styleContent);
114
+ return {
115
+ personaDefinition,
116
+ soulContent,
117
+ styleContent,
118
+ identityContent,
119
+ agentsContent,
120
+ memoryContent,
121
+ workspaceDir,
122
+ frontmatter,
123
+ };
124
+ }
125
+ /**
126
+ * Convert SoulFrontmatter + markdown body into an IPersonaDefinition that
127
+ * the existing PersonaOverlayManager and persona overlays can consume.
128
+ */
129
+ export function frontmatterToPersona(frontmatter, soulBody, styleBody) {
130
+ const baseSystemPrompt = [soulBody, styleBody && `## Style\n\n${styleBody}`]
131
+ .filter(Boolean)
132
+ .join('\n\n')
133
+ .trim();
134
+ const definition = {
135
+ id: frontmatter.agentId ?? slugify(frontmatter.name ?? 'unnamed-agent'),
136
+ name: frontmatter.name ?? 'Unnamed Agent',
137
+ description: frontmatter.role ?? '',
138
+ version: '1.0.0',
139
+ baseSystemPrompt,
140
+ personalityTraits: frontmatter.hexaco
141
+ ? {
142
+ honestyHumility: frontmatter.hexaco.honestyHumility,
143
+ emotionality: frontmatter.hexaco.emotionality,
144
+ extraversion: frontmatter.hexaco.extraversion,
145
+ agreeableness: frontmatter.hexaco.agreeableness,
146
+ conscientiousness: frontmatter.hexaco.conscientiousness,
147
+ openness: frontmatter.hexaco.openness,
148
+ }
149
+ : undefined,
150
+ moodAdaptation: frontmatter.defaultMood
151
+ ? {
152
+ enabled: true,
153
+ defaultMood: frontmatter.defaultMood,
154
+ allowedMoods: frontmatter.allowedMoods,
155
+ }
156
+ : undefined,
157
+ voiceConfig: frontmatter.voice
158
+ ? {
159
+ provider: frontmatter.voice.provider,
160
+ voiceId: frontmatter.voice.voiceId,
161
+ languageCode: frontmatter.voice.languageCode,
162
+ }
163
+ : undefined,
164
+ avatarConfig: frontmatter.avatar
165
+ ? {
166
+ type: frontmatter.avatar.type,
167
+ sourceUrl: frontmatter.avatar.sourceUrl,
168
+ descriptionForGeneration: frontmatter.avatar.descriptionForGeneration,
169
+ }
170
+ : undefined,
171
+ hardLimits: frontmatter.hardLimits,
172
+ metadata: frontmatter.metadata,
173
+ };
174
+ return definition;
175
+ }
176
+ /**
177
+ * Render a persona definition (typically loaded from JSON or constructed
178
+ * programmatically) as a SOUL.md file. Useful for migration from the
179
+ * legacy JSON-only persona format and for `agent({ soul: { autoGenerate: ... } })`.
180
+ */
181
+ export function renderSoulMarkdown(persona) {
182
+ const fm = {
183
+ name: persona.name,
184
+ agentId: persona.id,
185
+ role: persona.description,
186
+ hexaco: persona.personalityTraits,
187
+ voice: persona.voiceConfig
188
+ ? {
189
+ provider: persona.voiceConfig.provider,
190
+ voiceId: persona.voiceConfig.voiceId,
191
+ languageCode: persona.voiceConfig.languageCode,
192
+ }
193
+ : undefined,
194
+ defaultMood: persona.moodAdaptation?.defaultMood,
195
+ allowedMoods: persona.moodAdaptation?.allowedMoods,
196
+ hardLimits: persona.hardLimits,
197
+ avatar: persona.avatarConfig
198
+ ? {
199
+ type: persona.avatarConfig.type,
200
+ sourceUrl: persona.avatarConfig.sourceUrl,
201
+ descriptionForGeneration: persona.avatarConfig.descriptionForGeneration,
202
+ }
203
+ : undefined,
204
+ metadata: persona.metadata,
205
+ };
206
+ // baseSystemPrompt may be a string, template object, or content array.
207
+ // Normalize to a single string for the markdown body.
208
+ const body = stringifyBaseSystemPrompt(persona.baseSystemPrompt);
209
+ return matter.stringify(body, fm);
210
+ }
211
+ /**
212
+ * Coerce the polymorphic `baseSystemPrompt` field to a single markdown string.
213
+ * Handles plain strings, template objects ({ template, variables }), and
214
+ * content arrays ({ content, priority }[]).
215
+ */
216
+ function stringifyBaseSystemPrompt(prompt) {
217
+ if (!prompt)
218
+ return '';
219
+ if (typeof prompt === 'string')
220
+ return prompt;
221
+ if (Array.isArray(prompt)) {
222
+ return prompt
223
+ .slice()
224
+ .sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0))
225
+ .map((entry) => entry.content)
226
+ .join('\n\n');
227
+ }
228
+ // Template object
229
+ return prompt.template;
230
+ }
231
+ /**
232
+ * Helper: read a file if it exists, otherwise return undefined.
233
+ */
234
+ async function readOptional(filepath) {
235
+ try {
236
+ const content = await fs.readFile(filepath, 'utf-8');
237
+ return content.trim();
238
+ }
239
+ catch {
240
+ return undefined;
241
+ }
242
+ }
243
+ /**
244
+ * Helper: expand a leading `~/` to the user's home directory.
245
+ */
246
+ function expandHome(p) {
247
+ if (p.startsWith('~/') || p === '~') {
248
+ const home = process.env.HOME || process.env.USERPROFILE || '';
249
+ return path.join(home, p.slice(2));
250
+ }
251
+ return p;
252
+ }
253
+ /**
254
+ * Helper: convert a name to a kebab-case identifier.
255
+ */
256
+ function slugify(name) {
257
+ return name
258
+ .toLowerCase()
259
+ .replace(/[^a-z0-9]+/g, '-')
260
+ .replace(/^-+|-+$/g, '');
261
+ }
262
+ //# sourceMappingURL=SoulLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SoulLoader.js","sourceRoot":"","sources":["../../../../src/cognition/substrate/personas/SoulLoader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAEH,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,MAAM,MAAM,aAAa,CAAC;AA8FjC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,OAA0B;IACvD,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,IAAI,CAAC;IAChD,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAElD,+CAA+C;IAC/C,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IAC9D,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,+BAA+B,cAAc,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,IAAI,YAAoB,CAAC;IACzB,IAAI,QAAgB,CAAC;IAErB,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;QACxB,YAAY,GAAG,cAAc,CAAC;QAC9B,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IAChD,CAAC;SAAM,CAAC;QACN,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QAC5C,QAAQ,GAAG,cAAc,CAAC;IAC5B,CAAC;IAED,sDAAsD;IACtD,IAAI,OAAO,GAAkB,IAAI,CAAC;IAClC,IAAI,CAAC;QACH,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,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE,CAAC;QAC/D,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;GAEG;AACH,SAAS,OAAO,CAAC,IAAY;IAC3B,OAAO,IAAI;SACR,WAAW,EAAE;SACb,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@framers/agentos",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "description": "AgentOS — open-source TypeScript runtime for autonomous AI agents. Unified graph orchestration, cognitive memory, runtime tool generation, multi-tier guardrails, voice pipeline, and 21 LLM providers.",
5
5
  "homepage": "https://agentos.sh",
6
6
  "repository": {