@forwardimpact/pathway 0.25.20 → 0.25.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forwardimpact/pathway",
3
- "version": "0.25.20",
3
+ "version": "0.25.22",
4
4
  "description": "Career progression web app and CLI for exploring roles and generating agent teams",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -32,11 +32,11 @@ import {
32
32
  deriveReferenceLevel,
33
33
  deriveAgentSkills,
34
34
  generateSkillMarkdown,
35
- deriveToolkit,
36
35
  getDisciplineAbbreviation,
37
36
  toKebabCase,
38
37
  interpolateTeamInstructions,
39
- } from "@forwardimpact/libskill";
38
+ } from "@forwardimpact/libskill/agent";
39
+ import { deriveToolkit } from "@forwardimpact/libskill/toolkit";
40
40
  import { formatAgentProfile } from "../formatters/agent/profile.js";
41
41
  import { formatError, formatSuccess } from "../lib/cli-output.js";
42
42
  import { toolkitToPlainList } from "../formatters/toolkit/markdown.js";
@@ -94,7 +94,7 @@ function showAgentSummary(data, agentData, skillsWithAgent) {
94
94
  * @param {Object} agentData - Agent-specific data
95
95
  * @returns {Array<{discipline: Object, track: Object, humanDiscipline: Object, humanTrack: Object}>}
96
96
  */
97
- function findValidCombinations(data, agentData) {
97
+ export function findValidCombinations(data, agentData) {
98
98
  const pairs = [];
99
99
  for (const discipline of agentData.disciplines) {
100
100
  for (const track of agentData.tracks) {
@@ -237,10 +237,10 @@ function resolveAgentEntities(data, agentData, disciplineId, trackId) {
237
237
  * @param {Object} humanDiscipline
238
238
  */
239
239
  function printTeamInstructions(agentTrack, humanDiscipline) {
240
- const teamInstructions = interpolateTeamInstructions(
240
+ const teamInstructions = interpolateTeamInstructions({
241
241
  agentTrack,
242
242
  humanDiscipline,
243
- );
243
+ });
244
244
  if (teamInstructions) {
245
245
  console.log("# Team Instructions (CLAUDE.md)\n");
246
246
  console.log(teamInstructions.trim());
@@ -287,10 +287,10 @@ async function handleSingleStage({
287
287
  return;
288
288
  }
289
289
 
290
- const teamInstructions = interpolateTeamInstructions(
290
+ const teamInstructions = interpolateTeamInstructions({
291
291
  agentTrack,
292
292
  humanDiscipline,
293
- );
293
+ });
294
294
  await writeTeamInstructions(teamInstructions, baseDir);
295
295
  await writeProfile(profile, baseDir, agentTemplate);
296
296
  await generateClaudeCodeSettings(baseDir, agentData.claudeCodeSettings);
@@ -331,7 +331,9 @@ async function handleAllStages({
331
331
  const skillFiles = derivedSkills
332
332
  .map((derived) => skillsWithAgent.find((s) => s.id === derived.skillId))
333
333
  .filter((skill) => skill?.agent)
334
- .map((skill) => generateSkillMarkdown(skill, data.stages));
334
+ .map((skill) =>
335
+ generateSkillMarkdown({ skillData: skill, stages: data.stages }),
336
+ );
335
337
 
336
338
  for (const profile of profiles) {
337
339
  const errors = validateAgentProfile(profile);
@@ -373,10 +375,10 @@ async function handleAllStages({
373
375
  return;
374
376
  }
375
377
 
376
- const teamInstructions = interpolateTeamInstructions(
378
+ const teamInstructions = interpolateTeamInstructions({
377
379
  agentTrack,
378
380
  humanDiscipline,
379
- );
381
+ });
380
382
  await writeTeamInstructions(teamInstructions, baseDir);
381
383
  for (const profile of profiles) {
382
384
  await writeProfile(profile, baseDir, agentTemplate);
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Bundle generation for Pathway distribution.
3
+ *
4
+ * Emits `bundle.tar.gz` and `install.sh` alongside the static site so
5
+ * engineers can install `@forwardimpact/pathway` globally via
6
+ * `curl -fsSL <site>/install.sh | bash`. Invoked from build.js when
7
+ * `framework.distribution.siteUrl` is configured.
8
+ */
9
+
10
+ import { cp, mkdir, rm, readFile, writeFile } from "fs/promises";
11
+ import { join } from "path";
12
+ import { execFileSync } from "child_process";
13
+ import Mustache from "mustache";
14
+
15
+ /**
16
+ * Generate distribution bundle (bundle.tar.gz + install.sh)
17
+ * @param {Object} params
18
+ * @param {string} params.outputDir - Build output directory
19
+ * @param {string} params.dataDir - Source data directory
20
+ * @param {string} params.siteUrl - Base URL for the published site
21
+ * @param {Object} params.framework - Framework configuration
22
+ * @param {string} params.version - Pathway package version
23
+ * @param {string} params.templatesDir - Absolute path to pathway/templates
24
+ */
25
+ export async function generateBundle({
26
+ outputDir,
27
+ dataDir,
28
+ siteUrl,
29
+ framework,
30
+ version,
31
+ templatesDir,
32
+ }) {
33
+ console.log("📦 Generating distribution bundle...");
34
+
35
+ const frameworkTitle = framework.title || "Engineering Pathway";
36
+
37
+ // 1. Create temporary bundle directory
38
+ const bundleDir = join(outputDir, "_bundle");
39
+ await mkdir(bundleDir, { recursive: true });
40
+
41
+ // 2. Generate minimal package.json for the bundle
42
+ const bundlePkg = {
43
+ name: "fit-pathway-local",
44
+ version: version,
45
+ private: true,
46
+ dependencies: {
47
+ "@forwardimpact/pathway": `^${version}`,
48
+ },
49
+ };
50
+ await writeFile(
51
+ join(bundleDir, "package.json"),
52
+ JSON.stringify(bundlePkg, null, 2) + "\n",
53
+ );
54
+ console.log(` ✓ package.json (pathway ^${version})`);
55
+
56
+ // 3. Copy data files into bundle
57
+ await cp(dataDir, join(bundleDir, "data"), {
58
+ recursive: true,
59
+ dereference: true,
60
+ });
61
+ console.log(" ✓ data/");
62
+
63
+ // 4. Create tar.gz from the bundle directory
64
+ execFileSync("tar", [
65
+ "-czf",
66
+ join(outputDir, "bundle.tar.gz"),
67
+ "-C",
68
+ outputDir,
69
+ "_bundle",
70
+ ]);
71
+ console.log(" ✓ bundle.tar.gz");
72
+
73
+ // 5. Clean up temporary bundle directory
74
+ await rm(bundleDir, { recursive: true });
75
+
76
+ // 6. Render install.sh from template
77
+ const templatePath = join(templatesDir, "install.template.sh");
78
+ const template = await readFile(templatePath, "utf8");
79
+ const installScript = Mustache.render(template, {
80
+ siteUrl: siteUrl.replace(/\/$/, ""),
81
+ version,
82
+ frameworkTitle,
83
+ });
84
+ await writeFile(join(outputDir, "install.sh"), installScript, {
85
+ mode: 0o755,
86
+ });
87
+ console.log(" ✓ install.sh");
88
+ }
@@ -0,0 +1,392 @@
1
+ /**
2
+ * Pack generation for Pathway distribution.
3
+ *
4
+ * Emits one pre-built agent/skill pack per valid discipline/track combination
5
+ * and two discovery manifests (`.well-known/agent-skills/index.json` for
6
+ * `npx skills` and `apm.yml` for Microsoft APM). See
7
+ * specs/320-pathway-ecosystem-distribution for context.
8
+ *
9
+ * Invoked from build.js after the distribution bundle has been generated.
10
+ */
11
+
12
+ import { mkdir, rm, readFile, writeFile } from "fs/promises";
13
+ import { join } from "path";
14
+ import { execFileSync } from "child_process";
15
+ import { createHash } from "crypto";
16
+
17
+ import { createDataLoader } from "@forwardimpact/map/loader";
18
+ import { createTemplateLoader } from "@forwardimpact/libtemplate";
19
+ import {
20
+ generateStageAgentProfile,
21
+ deriveReferenceLevel,
22
+ deriveAgentSkills,
23
+ generateSkillMarkdown,
24
+ interpolateTeamInstructions,
25
+ getDisciplineAbbreviation,
26
+ toKebabCase,
27
+ } from "@forwardimpact/libskill/agent";
28
+
29
+ import { formatAgentProfile } from "../formatters/agent/profile.js";
30
+ import {
31
+ formatAgentSkill,
32
+ formatInstallScript,
33
+ formatReference,
34
+ } from "../formatters/agent/skill.js";
35
+ import { findValidCombinations } from "./agent.js";
36
+
37
+ /**
38
+ * Slugify a string for use as a package name.
39
+ * @param {string} text
40
+ * @returns {string}
41
+ */
42
+ function slugify(text) {
43
+ return text
44
+ .toLowerCase()
45
+ .replace(/[^a-z0-9]+/g, "-")
46
+ .replace(/^-+|-+$/g, "");
47
+ }
48
+
49
+ /**
50
+ * Stringify a JSON value with object keys sorted recursively.
51
+ * Produces deterministic output for digest stability.
52
+ * @param {unknown} value
53
+ * @returns {string}
54
+ */
55
+ function stringifySorted(value) {
56
+ const seen = new WeakSet();
57
+ const sort = (v) => {
58
+ if (v === null || typeof v !== "object") return v;
59
+ if (seen.has(v)) throw new Error("Cannot stringify circular structure");
60
+ seen.add(v);
61
+ if (Array.isArray(v)) return v.map(sort);
62
+ const out = {};
63
+ for (const key of Object.keys(v).sort()) out[key] = sort(v[key]);
64
+ return out;
65
+ };
66
+ return JSON.stringify(sort(value), null, 2) + "\n";
67
+ }
68
+
69
+ /**
70
+ * Escape a YAML scalar double-quoted value.
71
+ * @param {string} text
72
+ * @returns {string}
73
+ */
74
+ function yamlQuote(text) {
75
+ return `"${String(text).replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
76
+ }
77
+
78
+ /**
79
+ * Write a single pack's files to disk under the staging directory.
80
+ * Calls the formatters directly (silent, no console output).
81
+ * @param {Object} params
82
+ * @returns {Promise<void>}
83
+ */
84
+ async function writePackFiles({
85
+ packDir,
86
+ profiles,
87
+ skillFiles,
88
+ teamInstructions,
89
+ agentTemplate,
90
+ skillTemplates,
91
+ claudeCodeSettings,
92
+ }) {
93
+ const claudeDir = join(packDir, ".claude");
94
+ const agentsDir = join(claudeDir, "agents");
95
+ const skillsDir = join(claudeDir, "skills");
96
+
97
+ await mkdir(agentsDir, { recursive: true });
98
+ await mkdir(skillsDir, { recursive: true });
99
+
100
+ for (const profile of profiles) {
101
+ const profilePath = join(agentsDir, profile.filename);
102
+ await writeFile(
103
+ profilePath,
104
+ formatAgentProfile(profile, agentTemplate),
105
+ "utf-8",
106
+ );
107
+ }
108
+
109
+ for (const skill of skillFiles) {
110
+ const skillDir = join(skillsDir, skill.dirname);
111
+ await mkdir(skillDir, { recursive: true });
112
+
113
+ await writeFile(
114
+ join(skillDir, "SKILL.md"),
115
+ formatAgentSkill(skill, skillTemplates.skill),
116
+ "utf-8",
117
+ );
118
+
119
+ if (skill.installScript) {
120
+ const scriptsDir = join(skillDir, "scripts");
121
+ await mkdir(scriptsDir, { recursive: true });
122
+ await writeFile(
123
+ join(scriptsDir, "install.sh"),
124
+ formatInstallScript(skill, skillTemplates.install),
125
+ { mode: 0o755 },
126
+ );
127
+ }
128
+
129
+ if (skill.implementationReference) {
130
+ const refsDir = join(skillDir, "references");
131
+ await mkdir(refsDir, { recursive: true });
132
+ await writeFile(
133
+ join(refsDir, "REFERENCE.md"),
134
+ formatReference(skill, skillTemplates.reference),
135
+ "utf-8",
136
+ );
137
+ }
138
+ }
139
+
140
+ if (teamInstructions) {
141
+ await writeFile(
142
+ join(claudeDir, "CLAUDE.md"),
143
+ teamInstructions.trim() + "\n",
144
+ "utf-8",
145
+ );
146
+ }
147
+
148
+ // Claude Code settings — matches the CLI path's generateClaudeCodeSettings
149
+ // output format (no merge with existing files since the staging dir starts
150
+ // empty).
151
+ const settings = { ...(claudeCodeSettings || {}) };
152
+ await writeFile(
153
+ join(claudeDir, "settings.json"),
154
+ JSON.stringify(settings, null, 2) + "\n",
155
+ "utf-8",
156
+ );
157
+ }
158
+
159
+ /**
160
+ * Derive profiles, skills, and team instructions for a single combination.
161
+ * @param {Object} params
162
+ * @returns {{profiles: Array, skillFiles: Array, teamInstructions: string|null}}
163
+ */
164
+ function derivePackContent({
165
+ discipline,
166
+ track,
167
+ humanDiscipline,
168
+ humanTrack,
169
+ data,
170
+ agentData,
171
+ skillsWithAgent,
172
+ level,
173
+ }) {
174
+ const stageParams = {
175
+ discipline: humanDiscipline,
176
+ track: humanTrack,
177
+ level,
178
+ skills: skillsWithAgent,
179
+ behaviours: data.behaviours,
180
+ agentBehaviours: agentData.behaviours,
181
+ agentDiscipline: discipline,
182
+ agentTrack: track,
183
+ stages: data.stages,
184
+ };
185
+
186
+ const profiles = data.stages.map((stage) =>
187
+ generateStageAgentProfile({ ...stageParams, stage }),
188
+ );
189
+
190
+ const derivedSkills = deriveAgentSkills({
191
+ discipline: humanDiscipline,
192
+ track: humanTrack,
193
+ level,
194
+ skills: skillsWithAgent,
195
+ });
196
+
197
+ const skillFiles = derivedSkills
198
+ .map((derived) => skillsWithAgent.find((s) => s.id === derived.skillId))
199
+ .filter((skill) => skill?.agent)
200
+ .map((skill) =>
201
+ generateSkillMarkdown({ skillData: skill, stages: data.stages }),
202
+ );
203
+
204
+ const teamInstructions = interpolateTeamInstructions({
205
+ agentTrack: track,
206
+ humanDiscipline,
207
+ });
208
+
209
+ return { profiles, skillFiles, teamInstructions };
210
+ }
211
+
212
+ /**
213
+ * Archive a staged pack directory as a deterministic tar.gz and return its
214
+ * sha256 digest.
215
+ * @param {string} packDir - Staging directory containing the pack files
216
+ * @param {string} archivePath - Destination path for the tar.gz
217
+ * @returns {Promise<string>} sha256 digest string (e.g. "sha256:abc...")
218
+ */
219
+ async function archivePack(packDir, archivePath) {
220
+ execFileSync("tar", [
221
+ "-czf",
222
+ archivePath,
223
+ "--sort=name",
224
+ "--mtime=1970-01-01",
225
+ "--owner=0",
226
+ "--group=0",
227
+ "--numeric-owner",
228
+ "-C",
229
+ packDir,
230
+ ".",
231
+ ]);
232
+
233
+ const bytes = await readFile(archivePath);
234
+ return "sha256:" + createHash("sha256").update(bytes).digest("hex");
235
+ }
236
+
237
+ /**
238
+ * Write the `npx skills` discovery manifest.
239
+ * @param {string} outputDir
240
+ * @param {Array<{name: string, description: string, url: string, digest: string}>} packs
241
+ * @param {string} version
242
+ */
243
+ async function writeSkillsManifest(outputDir, packs, version) {
244
+ const wellKnownDir = join(outputDir, ".well-known", "agent-skills");
245
+ await mkdir(wellKnownDir, { recursive: true });
246
+ const manifest = {
247
+ $schema: "https://schemas.agentskills.io/discovery/0.2.0/schema.json",
248
+ skills: packs.map((pack) => ({
249
+ description: pack.description,
250
+ digest: pack.digest,
251
+ name: pack.name,
252
+ type: "archive",
253
+ url: pack.url,
254
+ version,
255
+ })),
256
+ };
257
+ await writeFile(
258
+ join(wellKnownDir, "index.json"),
259
+ stringifySorted(manifest),
260
+ "utf-8",
261
+ );
262
+ }
263
+
264
+ /**
265
+ * Write the Microsoft APM manifest at the site root.
266
+ * @param {string} outputDir
267
+ * @param {Array<{name: string, description: string, url: string, digest: string}>} packs
268
+ * @param {string} version
269
+ * @param {string} frameworkTitle
270
+ */
271
+ async function writeApmManifest(outputDir, packs, version, frameworkTitle) {
272
+ const lines = [
273
+ `name: ${slugify(frameworkTitle)}`,
274
+ `version: ${version}`,
275
+ `description: ${yamlQuote(`${frameworkTitle} agent teams for Claude Code`)}`,
276
+ "",
277
+ "skills:",
278
+ ];
279
+ for (const pack of packs) {
280
+ lines.push(` - name: ${pack.name}`);
281
+ lines.push(` description: ${yamlQuote(pack.description)}`);
282
+ lines.push(` version: ${version}`);
283
+ lines.push(` url: ${yamlQuote(pack.url)}`);
284
+ lines.push(` digest: ${yamlQuote(pack.digest)}`);
285
+ }
286
+ lines.push("");
287
+ await writeFile(join(outputDir, "apm.yml"), lines.join("\n"), "utf-8");
288
+ }
289
+
290
+ /**
291
+ * Generate pre-built agent/skill packs for installation through ecosystem
292
+ * tools like `npx skills` and Microsoft APM. One pack per valid
293
+ * discipline/track combination.
294
+ *
295
+ * @param {Object} params
296
+ * @param {string} params.outputDir - Build output directory
297
+ * @param {string} params.dataDir - Source data directory
298
+ * @param {string} params.siteUrl - Base URL for the published site
299
+ * @param {Object} params.framework - Framework configuration
300
+ * @param {string} params.version - Pathway package version
301
+ * @param {string} params.templatesDir - Absolute path to pathway/templates
302
+ */
303
+ export async function generatePacks({
304
+ outputDir,
305
+ dataDir,
306
+ siteUrl,
307
+ framework,
308
+ version,
309
+ templatesDir,
310
+ }) {
311
+ console.log("📦 Generating agent/skill packs...");
312
+
313
+ const normalizedSiteUrl = siteUrl.replace(/\/$/, "");
314
+ const frameworkTitle = framework.title || "Engineering Pathway";
315
+
316
+ const loader = createDataLoader();
317
+ const templateLoader = createTemplateLoader(templatesDir);
318
+
319
+ const data = await loader.loadAllData(dataDir);
320
+ const agentData = await loader.loadAgentData(dataDir);
321
+ const skillsWithAgent = await loader.loadSkillsWithAgentData(dataDir);
322
+
323
+ const level = deriveReferenceLevel(data.levels);
324
+
325
+ const agentTemplate = templateLoader.load("agent.template.md", dataDir);
326
+ const skillTemplates = {
327
+ skill: templateLoader.load("skill.template.md", dataDir),
328
+ install: templateLoader.load("skill-install.template.sh", dataDir),
329
+ reference: templateLoader.load("skill-reference.template.md", dataDir),
330
+ };
331
+
332
+ const stagingDir = join(outputDir, "_packs");
333
+ const packsDir = join(outputDir, "packs");
334
+ await mkdir(stagingDir, { recursive: true });
335
+ await mkdir(packsDir, { recursive: true });
336
+
337
+ const combinations = findValidCombinations(data, agentData);
338
+ if (combinations.length === 0) {
339
+ console.log(" (no valid discipline/track combinations — skipping)");
340
+ await rm(stagingDir, { recursive: true, force: true });
341
+ return;
342
+ }
343
+
344
+ const packs = [];
345
+
346
+ for (const combination of combinations) {
347
+ const { discipline, track, humanDiscipline, humanTrack } = combination;
348
+ const abbrev = getDisciplineAbbreviation(discipline.id);
349
+ const agentName = `${abbrev}-${toKebabCase(track.id)}`;
350
+ const specName = humanDiscipline.specialization || humanDiscipline.name;
351
+ const description = `${specName} (${humanTrack.name}) — agent team`;
352
+
353
+ const { profiles, skillFiles, teamInstructions } = derivePackContent({
354
+ ...combination,
355
+ data,
356
+ agentData,
357
+ skillsWithAgent,
358
+ level,
359
+ });
360
+
361
+ const packDir = join(stagingDir, agentName);
362
+ await writePackFiles({
363
+ packDir,
364
+ profiles,
365
+ skillFiles,
366
+ teamInstructions,
367
+ agentTemplate,
368
+ skillTemplates,
369
+ claudeCodeSettings: agentData.claudeCodeSettings,
370
+ });
371
+
372
+ const archivePath = join(packsDir, `${agentName}.tar.gz`);
373
+ const digest = await archivePack(packDir, archivePath);
374
+
375
+ packs.push({
376
+ name: agentName,
377
+ description,
378
+ url: `${normalizedSiteUrl}/packs/${agentName}.tar.gz`,
379
+ digest,
380
+ });
381
+
382
+ console.log(` ✓ packs/${agentName}.tar.gz`);
383
+ }
384
+
385
+ await rm(stagingDir, { recursive: true, force: true });
386
+
387
+ await writeSkillsManifest(outputDir, packs, version);
388
+ console.log(" ✓ .well-known/agent-skills/index.json");
389
+
390
+ await writeApmManifest(outputDir, packs, version, frameworkTitle);
391
+ console.log(" ✓ apm.yml");
392
+ }
@@ -3,26 +3,20 @@
3
3
  *
4
4
  * Generates a static site from the Engineering Pathway data.
5
5
  * Copies all necessary files (HTML, JS, CSS) and data to an output directory.
6
- * Optionally generates a distribution bundle (bundle.tar.gz + install.sh)
7
- * for local installs by individual engineers.
6
+ * Optionally delegates to build-bundle and build-packs to produce the
7
+ * distribution surfaces (bundle.tar.gz + install.sh for the curl|bash flow,
8
+ * and agent/skill packs for ecosystem tools like `npx skills` and APM) when
9
+ * `framework.distribution.siteUrl` is configured.
8
10
  */
9
11
 
10
- import {
11
- cp,
12
- mkdir,
13
- rm,
14
- access,
15
- realpath,
16
- readFile,
17
- writeFile,
18
- } from "fs/promises";
12
+ import { cp, mkdir, rm, access, realpath, writeFile } from "fs/promises";
19
13
  import { readFileSync } from "fs";
20
14
  import { join, dirname, relative, resolve } from "path";
21
15
  import { fileURLToPath } from "url";
22
- import { execFileSync } from "child_process";
23
- import Mustache from "mustache";
24
16
  import { createIndexGenerator } from "@forwardimpact/map/index-generator";
25
17
  import { createDataLoader } from "@forwardimpact/map/loader";
18
+ import { generateBundle } from "./build-bundle.js";
19
+ import { generatePacks } from "./build-packs.js";
26
20
 
27
21
  const __filename = fileURLToPath(import.meta.url);
28
22
  const __dirname = dirname(__filename);
@@ -201,10 +195,26 @@ ${framework.emojiIcon} Generating ${framework.title} static site...
201
195
  );
202
196
  console.log(` ✓ version.json (${version})`);
203
197
 
204
- // Generate distribution bundle if siteUrl is configured
198
+ // Generate distribution surfaces if siteUrl is configured
205
199
  const siteUrl = options.url || framework.distribution?.siteUrl;
206
200
  if (siteUrl) {
207
- await generateBundle({ outputDir, dataDir, siteUrl, framework });
201
+ const templatesDir = join(appDir, "..", "templates");
202
+ await generateBundle({
203
+ outputDir,
204
+ dataDir,
205
+ siteUrl,
206
+ framework,
207
+ version,
208
+ templatesDir,
209
+ });
210
+ await generatePacks({
211
+ outputDir,
212
+ dataDir,
213
+ siteUrl,
214
+ framework,
215
+ version,
216
+ templatesDir,
217
+ });
208
218
  }
209
219
 
210
220
  // Show summary
@@ -212,7 +222,7 @@ ${framework.emojiIcon} Generating ${framework.title} static site...
212
222
  ✅ Site generated successfully!
213
223
 
214
224
  Output: ${outputDir}
215
- ${siteUrl ? `\nDistribution:\n ${outputDir}/bundle.tar.gz\n ${outputDir}/install.sh\n` : ""}
225
+ ${siteUrl ? `\nDistribution:\n ${outputDir}/bundle.tar.gz\n ${outputDir}/install.sh\n ${outputDir}/packs/ (agent/skill packs)\n ${outputDir}/.well-known/agent-skills/index.json\n ${outputDir}/apm.yml\n` : ""}
216
226
  To serve locally:
217
227
  cd ${relative(process.cwd(), outputDir) || "."}
218
228
  bunx serve .
@@ -228,70 +238,3 @@ function getPathwayVersion() {
228
238
  const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
229
239
  return pkg.version;
230
240
  }
231
-
232
- /**
233
- * Generate distribution bundle (bundle.tar.gz + install.sh)
234
- * @param {Object} params
235
- * @param {string} params.outputDir - Build output directory
236
- * @param {string} params.dataDir - Source data directory
237
- * @param {string} params.siteUrl - Base URL for the published site
238
- * @param {Object} params.framework - Framework configuration
239
- */
240
- async function generateBundle({ outputDir, dataDir, siteUrl, framework }) {
241
- console.log("📦 Generating distribution bundle...");
242
-
243
- const version = getPathwayVersion();
244
- const frameworkTitle = framework.title || "Engineering Pathway";
245
-
246
- // 1. Create temporary bundle directory
247
- const bundleDir = join(outputDir, "_bundle");
248
- await mkdir(bundleDir, { recursive: true });
249
-
250
- // 2. Generate minimal package.json for the bundle
251
- const bundlePkg = {
252
- name: "fit-pathway-local",
253
- version: version,
254
- private: true,
255
- dependencies: {
256
- "@forwardimpact/pathway": `^${version}`,
257
- },
258
- };
259
- await writeFile(
260
- join(bundleDir, "package.json"),
261
- JSON.stringify(bundlePkg, null, 2) + "\n",
262
- );
263
- console.log(` ✓ package.json (pathway ^${version})`);
264
-
265
- // 3. Copy data files into bundle
266
- await cp(dataDir, join(bundleDir, "data"), {
267
- recursive: true,
268
- dereference: true,
269
- });
270
- console.log(" ✓ data/");
271
-
272
- // 4. Create tar.gz from the bundle directory
273
- execFileSync("tar", [
274
- "-czf",
275
- join(outputDir, "bundle.tar.gz"),
276
- "-C",
277
- outputDir,
278
- "_bundle",
279
- ]);
280
- console.log(" ✓ bundle.tar.gz");
281
-
282
- // 5. Clean up temporary bundle directory
283
- await rm(bundleDir, { recursive: true });
284
-
285
- // 6. Render install.sh from template
286
- const templatePath = join(appDir, "..", "templates", "install.template.sh");
287
- const template = await readFile(templatePath, "utf8");
288
- const installScript = Mustache.render(template, {
289
- siteUrl: siteUrl.replace(/\/$/, ""),
290
- version,
291
- frameworkTitle,
292
- });
293
- await writeFile(join(outputDir, "install.sh"), installScript, {
294
- mode: 0o755,
295
- });
296
- console.log(" ✓ install.sh");
297
- }