@forwardimpact/pathway 0.25.21 → 0.25.24

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.
Files changed (50) hide show
  1. package/bin/fit-pathway.js +117 -325
  2. package/package.json +2 -2
  3. package/src/commands/agent-io.js +1 -1
  4. package/src/commands/agent.js +25 -23
  5. package/src/commands/behaviour.js +7 -7
  6. package/src/commands/build-bundle.js +88 -0
  7. package/src/commands/build-packs.js +566 -0
  8. package/src/commands/build.js +27 -84
  9. package/src/commands/command-factory.js +2 -2
  10. package/src/commands/discipline.js +7 -7
  11. package/src/commands/driver.js +8 -8
  12. package/src/commands/index.js +0 -1
  13. package/src/commands/interview.js +4 -4
  14. package/src/commands/job.js +24 -18
  15. package/src/commands/level.js +7 -7
  16. package/src/commands/progress.js +4 -4
  17. package/src/commands/questions.js +10 -8
  18. package/src/commands/skill.js +10 -10
  19. package/src/commands/stage.js +7 -7
  20. package/src/commands/tool.js +6 -6
  21. package/src/commands/track.js +7 -7
  22. package/src/css/pages/agent-builder.css +48 -0
  23. package/src/formatters/interview/shared.js +6 -4
  24. package/src/formatters/progress/shared.js +9 -20
  25. package/src/formatters/questions/yaml.js +1 -1
  26. package/src/formatters/skill/shared.js +9 -2
  27. package/src/formatters/track/shared.js +4 -1
  28. package/src/index.html +1 -1
  29. package/src/lib/cli-command.js +33 -33
  30. package/src/lib/cli-output.js +9 -189
  31. package/src/pages/agent-builder-install.js +118 -0
  32. package/src/pages/agent-builder-preview.js +3 -3
  33. package/src/pages/agent-builder.js +23 -1
  34. package/src/pages/progress.js +3 -3
  35. package/src/pages/skill.js +5 -2
  36. package/src/commands/init.js +0 -64
  37. package/src/lib/job-cache.js +0 -89
  38. package/starter/behaviours/systems_thinking.yaml +0 -32
  39. package/starter/capabilities/delivery.yaml +0 -105
  40. package/starter/capabilities/reliability.yaml +0 -72
  41. package/starter/disciplines/software_engineering.yaml +0 -46
  42. package/starter/drivers.yaml +0 -10
  43. package/starter/framework.yaml +0 -49
  44. package/starter/levels.yaml +0 -39
  45. package/starter/questions/behaviours/.gitkeep +0 -0
  46. package/starter/questions/capabilities/.gitkeep +0 -0
  47. package/starter/questions/skills/.gitkeep +0 -0
  48. package/starter/stages.yaml +0 -21
  49. package/starter/tracks/forward_deployed.yaml +0 -33
  50. package/starter/tracks/platform.yaml +0 -33
@@ -11,17 +11,17 @@
11
11
  * By default, outputs to console. Use --output to write files.
12
12
  *
13
13
  * Usage:
14
- * bunx pathway agent <discipline> [--track=<track>]
15
- * bunx pathway agent <discipline> --track=<track> --stage=plan
16
- * bunx pathway agent <discipline> --track=<track> --output=./agents
17
- * bunx pathway agent <discipline> [--track=<track>] --skills # Plain list of skill IDs
18
- * bunx pathway agent <discipline> [--track=<track>] --tools # Plain list of tool names
19
- * bunx pathway agent --list
14
+ * npx fit-pathway agent <discipline> [--track=<track>]
15
+ * npx fit-pathway agent <discipline> --track=<track> --stage=plan
16
+ * npx fit-pathway agent <discipline> --track=<track> --output=./agents
17
+ * npx fit-pathway agent <discipline> [--track=<track>] --skills # Plain list of skill IDs
18
+ * npx fit-pathway agent <discipline> [--track=<track>] --tools # Plain list of tool names
19
+ * npx fit-pathway agent --list
20
20
  *
21
21
  * Examples:
22
- * bunx pathway agent software_engineering --track=platform
23
- * bunx pathway agent software_engineering --track=platform --stage=plan
24
- * bunx pathway agent software_engineering --track=platform --output=./agents
22
+ * npx fit-pathway agent software_engineering --track=platform
23
+ * npx fit-pathway agent software_engineering --track=platform --stage=plan
24
+ * npx fit-pathway agent software_engineering --track=platform --output=./agents
25
25
  */
26
26
 
27
27
  import { createDataLoader } from "@forwardimpact/map/loader";
@@ -32,13 +32,13 @@ 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
- import { formatError, formatSuccess } from "../lib/cli-output.js";
41
+ import { formatError, formatSuccess } from "@forwardimpact/libcli";
42
42
  import { toolkitToPlainList } from "../formatters/toolkit/markdown.js";
43
43
  import {
44
44
  generateClaudeCodeSettings,
@@ -82,9 +82,9 @@ function showAgentSummary(data, agentData, skillsWithAgent) {
82
82
  );
83
83
  console.log(`Stages: ${data.stages.length} available`);
84
84
  console.log(`\nValid combinations: ${validCombinations}`);
85
- console.log(`\nRun 'bunx pathway agent --list' for all combinations`);
85
+ console.log(`\nRun 'npx fit-pathway agent --list' for all combinations`);
86
86
  console.log(
87
- `Run 'bunx pathway agent <discipline> <track>' to generate files\n`,
87
+ `Run 'npx fit-pathway agent <discipline> <track>' to generate files\n`,
88
88
  );
89
89
  }
90
90
 
@@ -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) {
@@ -158,7 +158,7 @@ function listAgentCombinationsVerbose(data, agentData) {
158
158
 
159
159
  console.log("\n## Valid combinations:\n");
160
160
  for (const { discipline, track } of findValidCombinations(data, agentData)) {
161
- console.log(` bunx pathway agent ${discipline.id} ${track.id}`);
161
+ console.log(` npx fit-pathway agent ${discipline.id} ${track.id}`);
162
162
  }
163
163
 
164
164
  console.log("\n## Available stages:\n");
@@ -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);
@@ -4,15 +4,15 @@
4
4
  * Handles behaviour summary, listing, and detail display in the terminal.
5
5
  *
6
6
  * Usage:
7
- * bunx pathway behaviour # Summary with stats
8
- * bunx pathway behaviour --list # IDs only (for piping)
9
- * bunx pathway behaviour <id> # Detail view
10
- * bunx pathway behaviour --validate # Validation checks
7
+ * npx fit-pathway behaviour # Summary with stats
8
+ * npx fit-pathway behaviour --list # IDs only (for piping)
9
+ * npx fit-pathway behaviour <id> # Detail view
10
+ * npx fit-pathway behaviour --validate # Validation checks
11
11
  */
12
12
 
13
13
  import { createEntityCommand } from "./command-factory.js";
14
14
  import { behaviourToMarkdown } from "../formatters/behaviour/markdown.js";
15
- import { formatTable } from "../lib/cli-output.js";
15
+ import { formatTable } from "@forwardimpact/libcli";
16
16
 
17
17
  /**
18
18
  * Format behaviour list item for --list output
@@ -43,8 +43,8 @@ function formatSummary(behaviours, data) {
43
43
 
44
44
  console.log(formatTable(["ID", "Name", "Drivers"], rows));
45
45
  console.log(`\nTotal: ${behaviours.length} behaviours`);
46
- console.log(`\nRun 'bunx pathway behaviour --list' for IDs and names`);
47
- console.log(`Run 'bunx pathway behaviour <id>' for details\n`);
46
+ console.log(`\nRun 'npx fit-pathway behaviour --list' for IDs and names`);
47
+ console.log(`Run 'npx fit-pathway behaviour <id>' for details\n`);
48
48
  }
49
49
 
50
50
  /**
@@ -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
+ }