@vibecompass/vibecompass 0.1.0 → 0.2.1

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/src/setup.js CHANGED
@@ -40,6 +40,10 @@ export async function resolveInitCliOptions(options, environment = {}) {
40
40
  throw new Error('init requires --session-working-on when --start-session is used without guided setup.');
41
41
  }
42
42
 
43
+ if (resolved.startSession && !resolved.sessionId) {
44
+ throw new Error('init requires --session-id when --start-session is used.');
45
+ }
46
+
43
47
  return {
44
48
  initOptions: {
45
49
  rootDir: resolved.rootDir,
@@ -62,6 +66,7 @@ export async function resolveInitCliOptions(options, environment = {}) {
62
66
  guidedSummary,
63
67
  sessionPlan: resolved.startSession
64
68
  ? {
69
+ sessionId: resolved.sessionId,
65
70
  workingOn: resolved.sessionWorkingOn,
66
71
  }
67
72
  : null,
@@ -278,6 +283,15 @@ async function completeGuidedInitOptions(options, environment) {
278
283
  if (!resolved.sessionWorkingOn) {
279
284
  resolved.sessionWorkingOn = await askInput(prompter, 'What are you working on?');
280
285
  }
286
+
287
+ if (!resolved.sessionId) {
288
+ resolved.sessionId = await askInput(prompter, 'Session lane id', {
289
+ defaultValue: suggestLaneId(resolved.sessionWorkingOn),
290
+ validate(value) {
291
+ return validateLaneIdForPrompt(value);
292
+ },
293
+ });
294
+ }
281
295
  }
282
296
 
283
297
  if (resolved.closeSessionGitPublish === undefined && (resolved.bootstrap.workflow || resolved.startSession)) {
@@ -669,6 +683,46 @@ function suggestRepoId(value) {
669
683
  return slug || 'repo';
670
684
  }
671
685
 
686
+ function suggestLaneId(value) {
687
+ const slug = String(value ?? '')
688
+ .toLowerCase()
689
+ .replace(/[^a-z0-9]+/g, '-')
690
+ .replace(/^-+|-+$/g, '')
691
+ .slice(0, 63)
692
+ .replace(/-+$/g, '');
693
+
694
+ return slug.length >= 3 ? slug : 'builder-session';
695
+ }
696
+
697
+ function validateLaneIdForPrompt(value) {
698
+ if (!/^[a-z0-9][a-z0-9-]{1,62}[a-z0-9]$/.test(value)) {
699
+ return 'Lane id must be 3-64 lowercase letters, numbers, or hyphens, and must start and end with a letter or number.';
700
+ }
701
+
702
+ if ([
703
+ 'active',
704
+ 'current',
705
+ 'default',
706
+ 'false',
707
+ 'handoff',
708
+ 'index',
709
+ 'new',
710
+ 'no',
711
+ 'null',
712
+ 'off',
713
+ 'on',
714
+ 'sessions',
715
+ 'state',
716
+ 'true',
717
+ 'wip',
718
+ 'yes',
719
+ ].includes(value)) {
720
+ return `Lane id "${value}" is reserved.`;
721
+ }
722
+
723
+ return null;
724
+ }
725
+
672
726
  function getRepoDirectoryHints(repo) {
673
727
  const hints = new Set();
674
728
 
package/src/workflow.js CHANGED
@@ -77,7 +77,7 @@ export function buildWorkflowMetadata(existingMetadata, overrides = {}) {
77
77
  export function buildCloseSessionGuidance(workflowSettings) {
78
78
  const guidance = [];
79
79
 
80
- guidance.push('Reviewer handback stays in sessions/wip.md and sessions/handoff.md before close-session runs.');
80
+ guidance.push('Reviewer handback stays in the selected sessions/active/<lane-id>/wip.md and handoff.md before close-session runs.');
81
81
 
82
82
  if (workflowSettings.closeSession.refreshArchitectureDocs) {
83
83
  guidance.push('Refresh any relevant architecture docs before finalizing the session.');