@a-company/paradigm 3.23.2 → 3.24.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.
Files changed (30) hide show
  1. package/dist/{accept-orchestration-ORQRKKGR.js → accept-orchestration-AAYFKS74.js} +5 -5
  2. package/dist/chunk-4UC6AQOC.js +631 -0
  3. package/dist/{chunk-YOFP72IB.js → chunk-6EQRU7WC.js} +4 -4
  4. package/dist/{chunk-K34C7NAN.js → chunk-6UV47VRD.js} +1 -1
  5. package/dist/{chunk-Z42FOOVT.js → chunk-GC6X3YM7.js} +6 -6
  6. package/dist/{chunk-C3BK3E23.js → chunk-OXG5GVDJ.js} +1 -1
  7. package/dist/{chunk-XKAFTZOZ.js → chunk-VHSTF72C.js} +1 -1
  8. package/dist/{chunk-UI3XXVJ6.js → chunk-W4VFKZVF.js} +58 -1
  9. package/dist/{graph-5VSRBRKZ.js → chunk-Z7W7HNRG.js} +2 -1
  10. package/dist/context-audit-RI4R2WRH.js +549 -0
  11. package/dist/{diff-4XJZN4OB.js → diff-QC7PWIPF.js} +5 -5
  12. package/dist/{doctor-FINKMI66.js → doctor-RVODPMHJ.js} +1 -1
  13. package/dist/graph-ERNQQQ7C.js +12 -0
  14. package/dist/index.js +64 -30
  15. package/dist/mcp.js +841 -17
  16. package/dist/{orchestrate-6XGEA655.js → orchestrate-NNNWNELP.js} +8 -8
  17. package/dist/pipeline-3G2FRAKM.js +263 -0
  18. package/dist/{probe-T77FFIAG.js → probe-SN4BNXOC.js} +2 -1
  19. package/dist/{providers-VIBWDN5D.js → providers-NKGY36QF.js} +1 -1
  20. package/dist/{shift-SW3GSODO.js → shift-G42AEUHE.js} +15 -14
  21. package/dist/{spawn-JSV2HST3.js → spawn-52PASJJL.js} +3 -3
  22. package/dist/sweep-5POCF2E4.js +934 -0
  23. package/dist/{team-YIYA4ZLX.js → team-JZHIH7H5.js} +6 -6
  24. package/dist/university-content/courses/.purpose +307 -0
  25. package/dist/university-content/plsat/.purpose +131 -0
  26. package/dist/{workspace-S5Q5LVA6.js → workspace-L27RR5MF.js} +3 -2
  27. package/package.json +1 -1
  28. package/dist/chunk-ZMN3RAIT.js +0 -564
  29. package/dist/{chunk-XNUWLW73.js → chunk-7WTOOH23.js} +0 -0
  30. package/dist/{flow-UFMPVOEM.js → flow-KZKMMXJC.js} +1 -1
@@ -2,22 +2,22 @@
2
2
  import {
3
3
  BackgroundOrchestrator,
4
4
  Orchestrator
5
- } from "./chunk-Z42FOOVT.js";
5
+ } from "./chunk-GC6X3YM7.js";
6
6
  import "./chunk-6QC3YGB6.js";
7
- import "./chunk-YOFP72IB.js";
8
- import "./chunk-XNUWLW73.js";
7
+ import "./chunk-6EQRU7WC.js";
8
+ import "./chunk-PBHIFAL4.js";
9
+ import "./chunk-7WTOOH23.js";
9
10
  import {
10
11
  loadAgentsManifest
11
12
  } from "./chunk-PMXRGPRQ.js";
12
- import "./chunk-PBHIFAL4.js";
13
- import "./chunk-6P4IFIK2.js";
14
- import "./chunk-MRENOFTR.js";
15
- import "./chunk-IRKUEJVW.js";
16
- import "./chunk-MW5DMGBB.js";
17
13
  import {
18
14
  formatCost,
19
15
  formatTokens
20
16
  } from "./chunk-5JGJACDU.js";
17
+ import "./chunk-6P4IFIK2.js";
18
+ import "./chunk-MRENOFTR.js";
19
+ import "./chunk-IRKUEJVW.js";
20
+ import "./chunk-MW5DMGBB.js";
21
21
  import "./chunk-ZXMDA7VB.js";
22
22
 
23
23
  // src/commands/team/orchestrate.ts
@@ -0,0 +1,263 @@
1
+ #!/usr/bin/env node
2
+ import "./chunk-ZXMDA7VB.js";
3
+
4
+ // src/commands/pipeline/index.ts
5
+ import chalk from "chalk";
6
+
7
+ // src/core/pipeline-utils.ts
8
+ import * as fs from "fs";
9
+ import * as path from "path";
10
+ import * as yaml from "js-yaml";
11
+
12
+ // src/core/pipeline-types.ts
13
+ var DEFAULT_TEMPLATES = {
14
+ "add-feature": {
15
+ gates: { specify: "manual", plan: "manual", task: "auto", implement: "sentinel", validate: "sentinel" },
16
+ description: "Standard feature addition with manual spec/plan review"
17
+ },
18
+ "bug-fix": {
19
+ gates: { specify: "auto", plan: "auto", task: "auto", implement: "sentinel", validate: "sentinel" },
20
+ description: "Quick bug fix with automated gates except validation"
21
+ },
22
+ "security-change": {
23
+ gates: { specify: "manual", plan: "manual", task: "manual", implement: "manual", validate: "manual" },
24
+ description: "Security-sensitive change with all-manual gates"
25
+ },
26
+ "refactor": {
27
+ gates: { specify: "auto", plan: "manual", task: "auto", implement: "sentinel", validate: "sentinel" },
28
+ description: "Code refactoring with manual plan review"
29
+ }
30
+ };
31
+ var STAGE_ORDER = ["specify", "plan", "task", "implement", "validate"];
32
+ var PIPELINE_DIR = ".paradigm/pipeline";
33
+
34
+ // src/core/pipeline-utils.ts
35
+ function slugify(name) {
36
+ return name.toLowerCase().replace(/[^a-z0-9-]+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
37
+ }
38
+ function loadPipeline(projectDir, feature) {
39
+ const slug = slugify(feature);
40
+ const filePath = path.join(projectDir, PIPELINE_DIR, `${slug}.yaml`);
41
+ if (!fs.existsSync(filePath)) return null;
42
+ return yaml.load(fs.readFileSync(filePath, "utf8"));
43
+ }
44
+ function savePipeline(projectDir, pipeline) {
45
+ const slug = slugify(pipeline.feature);
46
+ const dir = path.join(projectDir, PIPELINE_DIR);
47
+ if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
48
+ const filePath = path.join(dir, `${slug}.yaml`);
49
+ fs.writeFileSync(filePath, yaml.dump(pipeline, { lineWidth: 120 }), "utf8");
50
+ return filePath;
51
+ }
52
+ function listPipelines(projectDir) {
53
+ const dir = path.join(projectDir, PIPELINE_DIR);
54
+ if (!fs.existsSync(dir)) return [];
55
+ return fs.readdirSync(dir).filter((f) => f.endsWith(".yaml") && !f.startsWith("completed")).map((f) => {
56
+ try {
57
+ return yaml.load(fs.readFileSync(path.join(dir, f), "utf8"));
58
+ } catch {
59
+ return null;
60
+ }
61
+ }).filter(Boolean);
62
+ }
63
+ function createPipeline(feature, gateConfig, template) {
64
+ const stages = {
65
+ specify: { status: "pending" },
66
+ plan: { status: "pending" },
67
+ task: { status: "pending" },
68
+ implement: { status: "pending" },
69
+ validate: { status: "pending" }
70
+ };
71
+ stages.specify.status = "in-progress";
72
+ return {
73
+ version: "1.0",
74
+ feature: slugify(feature),
75
+ created: (/* @__PURE__ */ new Date()).toISOString(),
76
+ current_stage: "specify",
77
+ gate_config: gateConfig,
78
+ template,
79
+ stages
80
+ };
81
+ }
82
+ function getNextStage(current) {
83
+ const idx = STAGE_ORDER.indexOf(current);
84
+ return idx < STAGE_ORDER.length - 1 ? STAGE_ORDER[idx + 1] : null;
85
+ }
86
+ function archivePipeline(projectDir, pipeline) {
87
+ const slug = slugify(pipeline.feature);
88
+ const completedDir = path.join(projectDir, PIPELINE_DIR, "completed");
89
+ if (!fs.existsSync(completedDir)) fs.mkdirSync(completedDir, { recursive: true });
90
+ const destPath = path.join(completedDir, `${slug}.yaml`);
91
+ fs.writeFileSync(destPath, yaml.dump(pipeline, { lineWidth: 120 }), "utf8");
92
+ const activePath = path.join(projectDir, PIPELINE_DIR, `${slug}.yaml`);
93
+ if (fs.existsSync(activePath)) fs.unlinkSync(activePath);
94
+ }
95
+
96
+ // src/commands/pipeline/index.ts
97
+ async function pipelineStartCommand(description, options) {
98
+ const projectDir = process.cwd();
99
+ const template = options.template || "add-feature";
100
+ let gateConfig;
101
+ if (options.gates) {
102
+ const parts = options.gates.split(",");
103
+ if (parts.length !== 5) {
104
+ console.error(
105
+ chalk.red("--gates requires 5 comma-separated modes: specify,plan,task,implement,validate")
106
+ );
107
+ process.exit(1);
108
+ }
109
+ gateConfig = {
110
+ specify: parts[0],
111
+ plan: parts[1],
112
+ task: parts[2],
113
+ implement: parts[3],
114
+ validate: parts[4]
115
+ };
116
+ } else {
117
+ const tmpl = DEFAULT_TEMPLATES[template];
118
+ if (!tmpl) {
119
+ console.error(
120
+ chalk.red(
121
+ `Unknown template: ${template}. Available: ${Object.keys(DEFAULT_TEMPLATES).join(", ")}`
122
+ )
123
+ );
124
+ process.exit(1);
125
+ }
126
+ gateConfig = tmpl.gates;
127
+ }
128
+ const pipeline = createPipeline(description, gateConfig, template);
129
+ const filePath = savePipeline(projectDir, pipeline);
130
+ console.log(chalk.green(`Pipeline created: ${pipeline.feature}`));
131
+ console.log(chalk.gray(`Template: ${template}`));
132
+ console.log(
133
+ chalk.gray(`Gates: ${STAGE_ORDER.map((s) => `${s}=${gateConfig[s]}`).join(", ")}`)
134
+ );
135
+ console.log(chalk.gray(`File: ${filePath}`));
136
+ console.log(chalk.cyan(`
137
+ Current stage: specify (in-progress)`));
138
+ }
139
+ async function pipelineStatusCommand(feature) {
140
+ const projectDir = process.cwd();
141
+ if (feature) {
142
+ const pipeline = loadPipeline(projectDir, feature);
143
+ if (!pipeline) {
144
+ console.error(chalk.red(`Pipeline not found: ${feature}`));
145
+ process.exit(1);
146
+ }
147
+ displayPipelineStatus(pipeline);
148
+ } else {
149
+ const pipelines = listPipelines(projectDir);
150
+ if (pipelines.length === 0) {
151
+ console.log(chalk.gray("No active pipelines"));
152
+ return;
153
+ }
154
+ for (const p of pipelines) {
155
+ displayPipelineStatus(p);
156
+ console.log();
157
+ }
158
+ }
159
+ }
160
+ function displayPipelineStatus(pipeline) {
161
+ console.log(chalk.bold(`Pipeline: ${pipeline.feature}`));
162
+ console.log(chalk.gray(`Created: ${pipeline.created}`));
163
+ if (pipeline.template) console.log(chalk.gray(`Template: ${pipeline.template}`));
164
+ console.log();
165
+ for (const stage of STAGE_ORDER) {
166
+ const state = pipeline.stages[stage];
167
+ const gate = pipeline.gate_config[stage];
168
+ const isCurrent = pipeline.current_stage === stage;
169
+ const icon = state.status === "approved" ? "+" : state.status === "in-progress" ? ">" : state.status === "blocked" ? "x" : ".";
170
+ const color = state.status === "approved" ? chalk.green : state.status === "in-progress" ? chalk.cyan : state.status === "blocked" ? chalk.red : chalk.gray;
171
+ console.log(
172
+ color(
173
+ ` ${icon} ${stage.padEnd(12)} [${gate}] ${state.status}${isCurrent ? " <- current" : ""}`
174
+ )
175
+ );
176
+ if (state.artifact) console.log(chalk.gray(` Artifact: ${state.artifact}`));
177
+ if (state.symbols_touched?.length)
178
+ console.log(chalk.gray(` Symbols: ${state.symbols_touched.join(", ")}`));
179
+ }
180
+ }
181
+ async function pipelineAdvanceCommand(feature) {
182
+ const projectDir = process.cwd();
183
+ const pipeline = loadPipeline(projectDir, feature);
184
+ if (!pipeline) {
185
+ console.error(chalk.red(`Pipeline not found: ${feature}`));
186
+ process.exit(1);
187
+ }
188
+ const current = pipeline.current_stage;
189
+ const gateMode = pipeline.gate_config[current];
190
+ const next = getNextStage(current);
191
+ pipeline.stages[current].status = "approved";
192
+ pipeline.stages[current].approved_at = (/* @__PURE__ */ new Date()).toISOString();
193
+ if (gateMode === "auto") {
194
+ pipeline.stages[current].auto_passed_at = (/* @__PURE__ */ new Date()).toISOString();
195
+ }
196
+ if (next) {
197
+ pipeline.current_stage = next;
198
+ pipeline.stages[next].status = "in-progress";
199
+ savePipeline(projectDir, pipeline);
200
+ console.log(chalk.green(`Stage '${current}' approved. Advanced to '${next}'.`));
201
+ } else {
202
+ savePipeline(projectDir, pipeline);
203
+ archivePipeline(projectDir, pipeline);
204
+ console.log(chalk.green(`Pipeline '${pipeline.feature}' completed and archived.`));
205
+ }
206
+ }
207
+ async function pipelineConfigureCommand(feature, options) {
208
+ const projectDir = process.cwd();
209
+ const pipeline = loadPipeline(projectDir, feature);
210
+ if (!pipeline) {
211
+ console.error(chalk.red(`Pipeline not found: ${feature}`));
212
+ process.exit(1);
213
+ }
214
+ const stage = options.stage;
215
+ if (!STAGE_ORDER.includes(stage)) {
216
+ console.error(chalk.red(`Invalid stage: ${options.stage}`));
217
+ process.exit(1);
218
+ }
219
+ const gate = options.gate;
220
+ if (!["auto", "manual", "sentinel"].includes(gate)) {
221
+ console.error(chalk.red(`Invalid gate mode: ${options.gate}. Use: auto, manual, sentinel`));
222
+ process.exit(1);
223
+ }
224
+ const old = pipeline.gate_config[stage];
225
+ pipeline.gate_config[stage] = gate;
226
+ savePipeline(projectDir, pipeline);
227
+ console.log(chalk.green(`Gate for '${stage}' changed: ${old} -> ${gate}`));
228
+ if (options.reason) console.log(chalk.gray(`Reason: ${options.reason}`));
229
+ }
230
+ async function pipelineAbortCommand(feature) {
231
+ const projectDir = process.cwd();
232
+ const pipeline = loadPipeline(projectDir, feature);
233
+ if (!pipeline) {
234
+ console.error(chalk.red(`Pipeline not found: ${feature}`));
235
+ process.exit(1);
236
+ }
237
+ archivePipeline(projectDir, pipeline);
238
+ console.log(chalk.yellow(`Pipeline '${pipeline.feature}' aborted and archived.`));
239
+ }
240
+ async function pipelineListCommand() {
241
+ const projectDir = process.cwd();
242
+ const pipelines = listPipelines(projectDir);
243
+ if (pipelines.length === 0) {
244
+ console.log(chalk.gray("No active pipelines."));
245
+ return;
246
+ }
247
+ console.log(chalk.bold(`Active Pipelines (${pipelines.length}):
248
+ `));
249
+ for (const p of pipelines) {
250
+ const completedStages = STAGE_ORDER.filter((s) => p.stages[s].status === "approved").length;
251
+ console.log(
252
+ ` ${chalk.cyan(p.feature)} -- stage ${completedStages}/${STAGE_ORDER.length} (${p.current_stage})`
253
+ );
254
+ }
255
+ }
256
+ export {
257
+ pipelineAbortCommand,
258
+ pipelineAdvanceCommand,
259
+ pipelineConfigureCommand,
260
+ pipelineListCommand,
261
+ pipelineStartCommand,
262
+ pipelineStatusCommand
263
+ };
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  generateFlowIndex,
4
4
  generateNavigator
5
- } from "./chunk-UI3XXVJ6.js";
5
+ } from "./chunk-W4VFKZVF.js";
6
6
  import {
7
7
  generateScanIndex,
8
8
  serializeScanIndex
@@ -12,6 +12,7 @@ import {
12
12
  } from "./chunk-6P4IFIK2.js";
13
13
  import "./chunk-MRENOFTR.js";
14
14
  import "./chunk-IRKUEJVW.js";
15
+ import "./chunk-Z7W7HNRG.js";
15
16
  import {
16
17
  parseParadigmConfig
17
18
  } from "./chunk-YO6DVTL7.js";
@@ -4,7 +4,7 @@ import {
4
4
  getBestProvider,
5
5
  getConfiguredProvider,
6
6
  setConfiguredProvider
7
- } from "./chunk-XNUWLW73.js";
7
+ } from "./chunk-7WTOOH23.js";
8
8
  import "./chunk-ZXMDA7VB.js";
9
9
 
10
10
  // src/commands/team/providers.ts
@@ -1,47 +1,48 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  teamInitCommand
4
- } from "./chunk-XKAFTZOZ.js";
5
- import "./chunk-Z42FOOVT.js";
4
+ } from "./chunk-VHSTF72C.js";
5
+ import "./chunk-GC6X3YM7.js";
6
6
  import "./chunk-6QC3YGB6.js";
7
- import "./chunk-YOFP72IB.js";
8
- import "./chunk-XNUWLW73.js";
7
+ import "./chunk-6EQRU7WC.js";
8
+ import "./chunk-PBHIFAL4.js";
9
+ import "./chunk-7WTOOH23.js";
9
10
  import {
10
11
  agentsConfigured
11
12
  } from "./chunk-PMXRGPRQ.js";
12
- import "./chunk-PBHIFAL4.js";
13
13
  import {
14
14
  hooksInstallCommand
15
15
  } from "./chunk-DS5QY37M.js";
16
16
  import {
17
17
  detectProjectRole
18
- } from "./chunk-C3BK3E23.js";
18
+ } from "./chunk-OXG5GVDJ.js";
19
+ import {
20
+ doctorCommand
21
+ } from "./chunk-4UC6AQOC.js";
22
+ import "./chunk-5JGJACDU.js";
19
23
  import {
20
24
  initCommand
21
- } from "./chunk-K34C7NAN.js";
25
+ } from "./chunk-6UV47VRD.js";
22
26
  import {
23
27
  detectDiscipline
24
28
  } from "./chunk-CHSHON3O.js";
25
29
  import {
26
30
  indexCommand
27
- } from "./chunk-UI3XXVJ6.js";
31
+ } from "./chunk-W4VFKZVF.js";
28
32
  import "./chunk-AK5M6KJB.js";
29
33
  import "./chunk-6P4IFIK2.js";
30
34
  import "./chunk-MRENOFTR.js";
31
35
  import "./chunk-IRKUEJVW.js";
36
+ import "./chunk-Z7W7HNRG.js";
32
37
  import {
33
38
  syncCommand
34
39
  } from "./chunk-RP6TZYGE.js";
35
- import "./chunk-MW5DMGBB.js";
36
- import {
37
- doctorCommand
38
- } from "./chunk-ZMN3RAIT.js";
39
40
  import "./chunk-KB4XJWE3.js";
40
41
  import "./chunk-YO6DVTL7.js";
41
42
  import {
42
43
  log
43
44
  } from "./chunk-4NCFWYGG.js";
44
- import "./chunk-5JGJACDU.js";
45
+ import "./chunk-MW5DMGBB.js";
45
46
  import "./chunk-ZXMDA7VB.js";
46
47
 
47
48
  // src/commands/shift.ts
@@ -251,7 +252,7 @@ workspace: "${relPath}"
251
252
  if (configForWs.workspace) {
252
253
  spinner.start("Step 3b/6: Reindexing workspace members...");
253
254
  try {
254
- const { workspaceReindexCommand } = await import("./workspace-S5Q5LVA6.js");
255
+ const { workspaceReindexCommand } = await import("./workspace-L27RR5MF.js");
255
256
  await workspaceReindexCommand({ quiet: true });
256
257
  spinner.succeed(chalk.green("Workspace members reindexed"));
257
258
  } catch (e) {
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  AgentSpawner
4
- } from "./chunk-YOFP72IB.js";
4
+ } from "./chunk-6EQRU7WC.js";
5
+ import "./chunk-PBHIFAL4.js";
5
6
  import {
6
7
  getBestProvider
7
- } from "./chunk-XNUWLW73.js";
8
+ } from "./chunk-7WTOOH23.js";
8
9
  import {
9
10
  loadAgentsManifest
10
11
  } from "./chunk-PMXRGPRQ.js";
11
- import "./chunk-PBHIFAL4.js";
12
12
  import {
13
13
  formatTokens
14
14
  } from "./chunk-5JGJACDU.js";