@christianmaf80/agentic-workflow 1.14.0-beta.6 → 1.14.0-beta.7

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.
@@ -53,16 +53,16 @@ export async function initCommand(options = {}) {
53
53
  await cleanupLegacyMcpConfig(cwd);
54
54
  sCleanup.stop('Local environment cleaned.');
55
55
  const s = spinner();
56
- s.start('Installing Agentic Core into .agent...');
56
+ s.start('Scaffolding .agent (core referenced from node_modules)...');
57
57
  try {
58
58
  // Resolve absolute path to core package in node_modules
59
59
  const corePath = (await resolveInstalledCorePath(cwd)) ?? await resolveCorePath();
60
- // Replace existing .agent with a clean install from core
60
+ // Replace existing .agent with a clean scaffold
61
61
  await fs.rm(agentDir, { recursive: true, force: true });
62
62
  await fs.mkdir(agentDir, { recursive: true });
63
- await copyCoreToAgent(corePath, agentDir);
63
+ await scaffoldAgentWorkspace(corePath, agentDir, cwd);
64
64
  s.stop('Configuration complete.');
65
- note(`Core located at: ${corePath}\nCore files installed into .agent.`, 'Installed');
65
+ note(`Core located at: ${corePath}\nLocal .agent scaffold created; core stays in node_modules.`, 'Installed');
66
66
  outro('Agentic System initialized successfully.');
67
67
  }
68
68
  catch (error) {
@@ -85,22 +85,191 @@ async function cleanupLegacyMcpConfig(cwd) {
85
85
  // Ignore if missing or not removable.
86
86
  }
87
87
  }
88
- async function copyCoreToAgent(corePath, agentDir) {
89
- const entries = [
90
- 'index.md',
88
+ function normalizeRelativePath(p) {
89
+ const posixPath = p.split(path.sep).join('/');
90
+ return posixPath.length === 0 ? '.' : posixPath;
91
+ }
92
+ async function scaffoldAgentWorkspace(corePath, agentDir, cwd) {
93
+ const coreRoot = normalizeRelativePath(path.relative(cwd, corePath));
94
+ const coreIndex = path.posix.join(coreRoot, 'index.md');
95
+ const coreRulesIndex = path.posix.join(coreRoot, 'rules/index.md');
96
+ const coreWorkflowsIndex = path.posix.join(coreRoot, 'workflows/index.md');
97
+ const coreTemplatesIndex = path.posix.join(coreRoot, 'templates/index.md');
98
+ const coreArtifactsIndex = path.posix.join(coreRoot, 'artifacts/index.md');
99
+ const rootIndex = `---
100
+ id: agent.index
101
+ owner: architect-agent
102
+ version: 1.0.0
103
+ severity: PERMANENT
104
+ description: Punto de entrada global del sistema .agent (core referenciado desde node_modules).
105
+ ---
106
+
107
+ # INDEX — .agent (Root)
108
+
109
+ ## Objetivo
110
+ Este fichero define los dominios principales del sistema \`.agent\` y referencia el core instalado.
111
+ Las extensiones locales viven en \`.agent/*\` y no duplican ficheros del core.
112
+
113
+ ## Patron de indices y alias
114
+ - Primero cargar el Root Index local.
115
+ - Los dominios principales apuntan al core instalado (node_modules).
116
+ - Los \`local_index\` son para extensiones del proyecto.
117
+
118
+ ## Aliases (YAML)
119
+ \`\`\`yaml
120
+ agent:
121
+ version: 1.0.0
122
+ core:
123
+ root: ${coreRoot}
124
+ index: ${coreIndex}
125
+
126
+ domains:
127
+ workflows:
128
+ index: ${coreWorkflowsIndex}
129
+ local_index: .agent/workflows/index.md
130
+
131
+ artifacts:
132
+ index: ${coreArtifactsIndex}
133
+ local_index: .agent/artifacts/index.md
134
+
135
+ templates:
136
+ index: ${coreTemplatesIndex}
137
+ local_index: .agent/templates/index.md
138
+
139
+ rules:
140
+ index: ${coreRulesIndex}
141
+ local_index: .agent/rules/index.md
142
+ \`\`\`
143
+ `;
144
+ const rulesIndex = `---
145
+ id: rules.local.index
146
+ owner: architect-agent
147
+ version: 1.0.0
148
+ severity: RECOMMENDED
149
+ ---
150
+
151
+ # INDEX — Rules (Local)
152
+
153
+ ## Objetivo
154
+ Indice local para reglas personalizadas del proyecto. No duplicar reglas del core.
155
+
156
+ ## Aliases (YAML)
157
+ \`\`\`yaml
158
+ rules:
159
+ local:
160
+ constitution:
161
+ index: .agent/rules/constitution/index.md
162
+ roles:
163
+ index: .agent/rules/roles/index.md
164
+ \`\`\`
165
+ `;
166
+ const rulesConstitutionIndex = `---
167
+ id: rules.constitution.local.index
168
+ owner: architect-agent
169
+ version: 1.0.0
170
+ severity: RECOMMENDED
171
+ ---
172
+
173
+ # INDEX — Rules / Constitution (Local)
174
+
175
+ ## Objetivo
176
+ Indice local de constituciones del proyecto. No duplicar reglas del core.
177
+
178
+ ## Aliases (YAML)
179
+ \`\`\`yaml
180
+ constitution: {}
181
+ \`\`\`
182
+ `;
183
+ const rulesRolesIndex = `---
184
+ id: rules.roles.local.index
185
+ owner: architect-agent
186
+ version: 1.0.0
187
+ severity: RECOMMENDED
188
+ ---
189
+
190
+ # INDEX — Rules / Roles (Local)
191
+
192
+ ## Objetivo
193
+ Indice local de roles del proyecto. No duplicar roles del core.
194
+
195
+ ## Aliases (YAML)
196
+ \`\`\`yaml
197
+ roles: {}
198
+ \`\`\`
199
+ `;
200
+ const workflowsIndex = `---
201
+ id: workflows.local.index
202
+ owner: architect-agent
203
+ version: 1.0.0
204
+ severity: RECOMMENDED
205
+ ---
206
+
207
+ # INDEX — Workflows (Local)
208
+
209
+ ## Objetivo
210
+ Indice local de workflows del proyecto. No duplicar workflows del core.
211
+
212
+ ## Aliases (YAML)
213
+ \`\`\`yaml
214
+ workflows: {}
215
+ \`\`\`
216
+ `;
217
+ const templatesIndex = `---
218
+ id: templates.local.index
219
+ owner: architect-agent
220
+ version: 1.0.0
221
+ severity: RECOMMENDED
222
+ ---
223
+
224
+ # INDEX — Templates (Local)
225
+
226
+ ## Objetivo
227
+ Indice local de templates del proyecto. No duplicar templates del core.
228
+
229
+ ## Aliases (YAML)
230
+ \`\`\`yaml
231
+ templates: {}
232
+ \`\`\`
233
+ `;
234
+ const artifactsIndex = `---
235
+ id: artifacts.local.index
236
+ owner: architect-agent
237
+ version: 1.0.0
238
+ severity: RECOMMENDED
239
+ ---
240
+
241
+ # INDEX — Artifacts (Local)
242
+
243
+ ## Objetivo
244
+ Indice local de artifacts generados por el proyecto.
245
+
246
+ ## Aliases (YAML)
247
+ \`\`\`yaml
248
+ artifacts:
249
+ local:
250
+ dir: .agent/artifacts
251
+ candidate: .agent/artifacts/candidate
252
+ \`\`\`
253
+ `;
254
+ const dirs = [
91
255
  'rules',
256
+ 'rules/constitution',
257
+ 'rules/roles',
92
258
  'workflows',
93
259
  'templates',
94
260
  'artifacts',
261
+ 'artifacts/candidate',
95
262
  ];
96
- for (const entry of entries) {
97
- const srcPath = path.join(corePath, entry);
98
- const destPath = path.join(agentDir, entry);
99
- try {
100
- await fs.cp(srcPath, destPath, { recursive: true });
101
- }
102
- catch {
103
- // Skip missing entries in core.
104
- }
263
+ for (const dir of dirs) {
264
+ await fs.mkdir(path.join(agentDir, dir), { recursive: true });
105
265
  }
266
+ await Promise.all([
267
+ fs.writeFile(path.join(agentDir, 'index.md'), rootIndex),
268
+ fs.writeFile(path.join(agentDir, 'rules', 'index.md'), rulesIndex),
269
+ fs.writeFile(path.join(agentDir, 'rules', 'constitution', 'index.md'), rulesConstitutionIndex),
270
+ fs.writeFile(path.join(agentDir, 'rules', 'roles', 'index.md'), rulesRolesIndex),
271
+ fs.writeFile(path.join(agentDir, 'workflows', 'index.md'), workflowsIndex),
272
+ fs.writeFile(path.join(agentDir, 'templates', 'index.md'), templatesIndex),
273
+ fs.writeFile(path.join(agentDir, 'artifacts', 'index.md'), artifactsIndex),
274
+ ]);
106
275
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@christianmaf80/agentic-workflow",
3
- "version": "1.14.0-beta.6",
3
+ "version": "1.14.0-beta.7",
4
4
  "description": "Portable agentic workflow orchestration system with strict identity and gate discipline",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",