@vibecompass/vibecompass 0.13.1 → 0.15.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.
package/src/sync.js CHANGED
@@ -4,6 +4,11 @@ import { sha256Text } from './hash.js';
4
4
  import { writeStateManifest } from './manifest.js';
5
5
  import { withMemoryRootLock } from './serialization.js';
6
6
  import { parseSimpleYaml } from './simple-yaml.js';
7
+ import {
8
+ credentialStoreOptionsFrom,
9
+ formatMissingCredentialError,
10
+ resolveSyncCredential,
11
+ } from './credential-store.js';
7
12
  import {
8
13
  buildSyncStateWithCursor,
9
14
  readSyncCursor,
@@ -465,12 +470,14 @@ async function loadSyncContext(options, environment) {
465
470
  throw new Error('Hosted sync commands require sync.api_url, sync.project_id, and sync.credential_env_var in project.yaml (or a named target under sync.targets).');
466
471
  }
467
472
 
468
- const credential = normalizeOptionalString((environment.env ?? process.env)[binding.credentialEnvVar]);
473
+ // D-355: env var override first, then the local credential store
474
+ // (keychain or per-user file). The resolved value is used only as the
475
+ // bearer credential and never written anywhere.
476
+ const resolution = await resolveSyncCredential(binding, credentialStoreOptionsFrom(environment));
477
+ const credential = resolution.credential;
469
478
  if (!credential) {
470
479
  throw new Error(
471
- `Hosted sync command requires ${binding.credentialEnvVar}. New terminals do not inherit one-off exports: `
472
- + `re-export it (export ${binding.credentialEnvVar}="<sync token>") or persist it in your shell profile (~/.zshenv or ~/.bashrc). `
473
- + 'Lost the token? Rotate it on the hosted dashboard under Setup -> Hosted sync, then export the new value.',
480
+ formatMissingCredentialError(binding, { action: 'This hosted sync command', detail: resolution.detail }),
474
481
  );
475
482
  }
476
483
 
@@ -485,6 +492,7 @@ async function loadSyncContext(options, environment) {
485
492
  manifestPath,
486
493
  fetch: fetchImpl,
487
494
  credential,
495
+ credentialSource: resolution.source,
488
496
  apiUrl: binding.apiUrl,
489
497
  projectId: binding.projectId,
490
498
  syncTarget: binding.target,
@@ -7,7 +7,8 @@ export const WORKFLOW_REGISTRY = [
7
7
  detailPath: 'context.md',
8
8
  summary: 'Builder/reviewer lane lifecycle, handoffs, planning mode, and close-out.',
9
9
  promptCommands: [
10
- { trigger: 'start session', summary: 'builder role trigger' },
10
+ { trigger: 'start session', summary: 'builder role trigger; opens a new named lane — if a lane is already active, resume it with `continue session` instead of opening a duplicate' },
11
+ { trigger: 'continue session', summary: 'builder resumes an already-open lane with `vibecompass continue-session [<lane-id>]` (D-353); with multiple active lanes name the lane explicitly: `continue session <lane-id>` — the agent presents the lane inventory and asks rather than guessing' },
11
12
  { trigger: 'join as reviewer', summary: 'reviewer role trigger' },
12
13
  { trigger: 'planning mode', summary: 'optional prompt-level mode for scoping work before implementation' },
13
14
  { trigger: 'review handoff', summary: 'reviewer reads the selected lane handoff and appends findings; with multiple active lanes name the lane explicitly: `review handoff <lane-id>`' },