@quantiya/codevibe-core 2.0.52 → 2.0.54

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.
@@ -0,0 +1,59 @@
1
+ import * as React from 'react';
2
+ export interface MarkdownViewProps {
3
+ content: string;
4
+ source?: 'planner' | 'shell';
5
+ terminalWidth?: number;
6
+ }
7
+ interface InlineSpan {
8
+ text: string;
9
+ bold?: boolean;
10
+ italic?: boolean;
11
+ code?: boolean;
12
+ strikethrough?: boolean;
13
+ color?: string;
14
+ }
15
+ /** Tokenize inline markdown into styled spans, respecting word-boundary emphasis rules. */
16
+ export declare function parseInlineSpans(text: string): InlineSpan[];
17
+ /** Render inline spans into Ink Text elements. */
18
+ export declare function renderInlineSpans(spans: InlineSpan[], keyPrefix: string): React.ReactElement[];
19
+ type BlockType = {
20
+ kind: 'agent-header';
21
+ agent: string;
22
+ title: string;
23
+ } | {
24
+ kind: 'heading';
25
+ level: number;
26
+ text: string;
27
+ } | {
28
+ kind: 'code-block';
29
+ lang?: string;
30
+ code: string;
31
+ } | {
32
+ kind: 'table';
33
+ headers: string[];
34
+ rows: string[][];
35
+ } | {
36
+ kind: 'list-item';
37
+ ordered: boolean;
38
+ bullet: string;
39
+ text: string;
40
+ } | {
41
+ kind: 'blockquote';
42
+ text: string;
43
+ } | {
44
+ kind: 'divider';
45
+ } | {
46
+ kind: 'paragraph';
47
+ lines: string[];
48
+ };
49
+ /** Check if a line is a markdown table separator (e.g. `|---|---|` or `---|---`). Linear validation without backtracking (R1-F1). */
50
+ export declare function isTableSeparator(line: string): boolean;
51
+ /** Check if text contains multi-line rich markdown structures (headings, code blocks, tables, blockquotes, lists, bold). */
52
+ export declare function isRichMarkdown(text: string): boolean;
53
+ /** Parse markdown text into structured blocks. */
54
+ export declare function parseMarkdownBlocks(content: string): BlockType[];
55
+ /** Calculate the visual display width of a string, taking into account wide characters, CJK, and emoji. */
56
+ export declare function getVisualWidth(text: string): number;
57
+ /** Main MarkdownView component. */
58
+ export declare function MarkdownView(props: MarkdownViewProps): React.ReactElement;
59
+ export {};
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ export declare function WizardSelectItem({ isSelected, label, }: {
3
+ isSelected?: boolean;
4
+ label: string;
5
+ }): React.ReactElement;
6
+ export declare function WizardSelectIndicator({ isSelected, }: {
7
+ isSelected?: boolean;
8
+ }): React.ReactElement;
@@ -0,0 +1,23 @@
1
+ export interface GitExecResult {
2
+ stdout: string;
3
+ stderr?: string;
4
+ }
5
+ export type GitExecFileFn = (file: string, args: readonly string[], options: {
6
+ cwd: string;
7
+ env?: NodeJS.ProcessEnv;
8
+ timeout?: number;
9
+ encoding?: string;
10
+ }) => Promise<GitExecResult>;
11
+ export interface ExecuteGitStatusSummaryOptions {
12
+ cwd: string;
13
+ prompt: string;
14
+ hasActiveTask: boolean;
15
+ execFileFn?: GitExecFileFn;
16
+ }
17
+ export declare const GIT_QUERY_PATTERN: RegExp;
18
+ /**
19
+ * Safely format code blocks using collision-safe backtick fences (R2-F3).
20
+ * If the content contains triple backticks or more, emits a fence with length > max backticks in content.
21
+ */
22
+ export declare function formatFencedCodeBlock(content: string, lang?: string): string;
23
+ export declare function executeGitStatusSummary(options: ExecuteGitStatusSummaryOptions): Promise<string | null>;
@@ -22,6 +22,7 @@ import { AdvisoryAttachmentJournal } from './advisory-attachment-journal';
22
22
  import type { ImageAttachment } from './types';
23
23
  import { type GateDecisionSubmitDeps, type GroupDecisionSubmitDeps } from './gate-decision-submit';
24
24
  import { type WorkspaceOutcomeSinkTap } from './workspace-terminal-coordinator';
25
+ export { executeGitStatusSummary } from './git-status-summary';
25
26
  import { type ContinuationCliResult, type ContinuationCliDeps } from './slash-routes/continuation';
26
27
  import { loadReviewerWizardData } from './slash-routes/reviewers';
27
28
  import { createShellEventEmitter } from './emit-shell-event';
@@ -30,7 +31,7 @@ import { type BrainstormPanelActiveAgent } from './brainstorm-quorum';
30
31
  import { type RunAuditBrowserResult } from './audit-runner';
31
32
  import { type RunFlagCommandResult } from './flag-command';
32
33
  import { Tier } from './types';
33
- import type { ConversationEntry, DurableGateResolution, PendingClarification } from './types';
34
+ import type { ConversationEntry, DurableGateResolution, PendingApplyConflict, PendingClarification } from './types';
34
35
  import { type GatePromptEnvelope, type DecryptedReviewSummaryInput } from './gate-prompts';
35
36
  import type { Event, UpdateEventStatusInput } from '../types/events';
36
37
  import { type StructuralSummaryGenerator } from '../structural-summary';
@@ -305,7 +306,7 @@ export interface TeamTapEvent {
305
306
  }
306
307
  export { processMarkers, withRoleMarker } from './process-markers';
307
308
  export { emitShellEvent, createShellEventEmitter, type ShellEventEmit, type NewEventTypeKind, } from './emit-shell-event';
308
- export { pickMode, type ModeSelectionDeps, } from './mode-selection';
309
+ export { pickMode, shouldRenderPlain, type ModeSelectionDeps, } from './mode-selection';
309
310
  export { readStickyPreference, writeStickyPreference, stickyPreferenceFilePath, } from './sticky-preference';
310
311
  export { deriveWorkspaceId, deriveRepoId, normalizeRepoRelativePath, contextStoreDir, loadContextStore, writeContextStore, writeRepoState, loadRepoState, type RepoStateRecord, gcContextStore, computeSummaryInputHash, probeFreshness, ensureFreshContextStore, mintContextRef, resolveContextRef, sliceSummary, type ContextRef, type SliceSelector, type SliceSelectorEntry, type ContextStoreMetadata, type ContextStoreEntry, type ResolvedContextSlice, type FreshnessProbeResult, type EnsureFreshResult, type EnsureFreshDeps, } from './context-store';
311
312
  export { CONTEXT_SESSION_PSEUDO_TASK_NAMESPACE, deriveSessionPseudoTaskId, auditPartitionTaskIdFor, appendContextItem, flushContextItems, readContextItems, readVerifiedContextItems, verifyContextItemChain, buildContextItemWireRow, decryptContextItemWireRow, projectItemsForRole, labelPermitsRole, projectRepoStateForDispatch, appendRepoStateItem, composeDispatchContextBlock, contextItemsLogPath, isTransientContextItem, DISPATCH_CONTEXT_MAX_CHARS, NON_GIT_REPO_STATE_MAX_AGE_MS, type ContextItem, type ContextItemDraft, type ContextItemKind, type ContextItemAuthor, type ContextItemSensitivity, type ContextItemProjectionRole, type ContextItemValidity, type ContextItemWireRow, type RepoStateBody, type RepoStateProjection, type ChainVerificationResult, type VerifiedContextItemsResult, } from './context-items';
@@ -742,6 +743,13 @@ export declare function reissueTeamFromRetainedSpec(deps: {
742
743
  }, taskGroupId: string, options?: {
743
744
  retryOf?: string;
744
745
  }): Promise<void>;
746
+ /**
747
+ * Format a human-readable rejection advisory from a failed startTask attempt,
748
+ * propagating any specific error reason (such as admission freeze or budget)
749
+ * from the backend rather than an opaque generic failure.
750
+ * Sanitizes terminal escapes, redacts absolute paths, and caps display length.
751
+ */
752
+ export declare function formatStartTaskRejection(errorOrLoop: unknown): string;
745
753
  /**
746
754
  * PHASE-590 §3.D — the `team_decompose` routing path. Runs the local decomposer,
747
755
  * shape-checks (the schema is applied inside the decomposer parse) +
@@ -1134,6 +1142,19 @@ export declare function serializeShellSubmissions(handler: (text: string, images
1134
1142
  */
1135
1143
  export declare function buildContinuationActionDeps(args: RunOrchestrationShellArgs, store: OrchestrationStore): Partial<ContinuationCliDeps>;
1136
1144
  export declare function shouldSuppressStructuralContextRefresh(args: RunOrchestrationShellArgs): boolean;
1145
+ /**
1146
+ * P46a C3 — "Retry as a new task": start a NEW linked task (`retryOf`) on a
1147
+ * fresh snapshot from the stashed retry brief (the original request + the
1148
+ * files changed since + the reviewed contents). It runs the full quorum and
1149
+ * needs the user's approval again; the failed original stays `apply_failed`.
1150
+ * Mirrors the `/task` START (same TASK_LIFECYCLE row). Returns the line to show
1151
+ * (the starting line, or why the retry could not start); the caller renders it.
1152
+ */
1153
+ export declare function dispatchApplyConflictRetry(deps: {
1154
+ store: OrchestrationStore;
1155
+ quorumLoop: RunOrchestrationShellArgs['quorumLoop'];
1156
+ menu: PendingApplyConflict;
1157
+ }): Promise<string>;
1137
1158
  /**
1138
1159
  * Tokenize a command line string respecting single/double quotes and backslash escapes.
1139
1160
  * Returns tokens array or error if unclosed quote / trailing escape.
@@ -22,3 +22,14 @@ export declare function pickMode(tier: Tier, deps?: ModeSelectionDeps): Promise<
22
22
  * `pickMode()` and get this. Tests override via the optional 2nd arg.
23
23
  */
24
24
  export declare function defaultDeps(): ModeSelectionDeps;
25
+ /**
26
+ * Shared plain-render predicate across readline and Ink UI components.
27
+ * Returns true if ANSI escape sequences and decorative colors should be suppressed.
28
+ * Respects:
29
+ * - NO_COLOR convention (non-empty environment variable disables color)
30
+ * - TERM=dumb
31
+ * - FORCE_COLOR=0
32
+ * - CODEVIBE_NO_TUI=1
33
+ * - Non-TTY stdout
34
+ */
35
+ export declare function shouldRenderPlain(): boolean;
@@ -798,6 +798,10 @@ export declare class QuorumLoop {
798
798
  private readonly taskLeaseHeartbeatsInFlight;
799
799
  /** Tasks whose next automatic revise round must start a fresh review baseline. */
800
800
  private readonly reviewScopeResetTasks;
801
+ /** Last error message from a failed startTask call, kept for shell advisory display. */
802
+ private lastStartError;
803
+ /** Retrieve the last error message from a rejected or failed startTask call. */
804
+ getLastStartError(): string | null;
801
805
  /** Non-terminal tasks for which `/review-reset` may arm the next revise round. */
802
806
  private readonly reviewScopeResetEligibleTasks;
803
807
  private taskEpoch;
@@ -0,0 +1,37 @@
1
+ export declare const THEME: {
2
+ brand: string;
3
+ brandLight: string;
4
+ brandGlow: string;
5
+ conductor: string;
6
+ conductorTag: string;
7
+ claude: string;
8
+ codex: string;
9
+ antigravity: string;
10
+ gemini: string;
11
+ pass: string;
12
+ revise: string;
13
+ block: string;
14
+ pending: string;
15
+ running: string;
16
+ actionApprove: string;
17
+ actionInspect: string;
18
+ actionReject: string;
19
+ actionRestart: string;
20
+ actionAbort: string;
21
+ textPrimary: string | undefined;
22
+ textSecondary: string | undefined;
23
+ textMuted: string | undefined;
24
+ textDim: string | undefined;
25
+ borderSubtle: string;
26
+ borderAccent: string;
27
+ };
28
+ /**
29
+ * Shared Ink color policy: returns undefined when plain mode is active
30
+ * (NO_COLOR, TERM=dumb, FORCE_COLOR=0, CODEVIBE_NO_TUI=1, or non-TTY),
31
+ * suppressing ANSI color escape sequences entirely.
32
+ */
33
+ export declare function colorOrPlain(color: string | undefined): string | undefined;
34
+ /** Normalize agent/model kind to signature brand color (or undefined in plain mode). */
35
+ export declare function getAgentBrandColor(agentKind: string | undefined): string | undefined;
36
+ /** Normalize verdict/status to status color (or undefined in plain mode). */
37
+ export declare function getVerdictStatusColor(status: string | undefined): string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantiya/codevibe-core",
3
- "version": "2.0.52",
3
+ "version": "2.0.54",
4
4
  "description": "Core library for CodeVibe plugins - shared keychain, crypto, AppSync, and auth functionality",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -38,6 +38,7 @@
38
38
  "parse5": "^7.3.0",
39
39
  "react": "^19.2.0",
40
40
  "react-devtools-core": "^6.1.2",
41
+ "string-width": "^8.2.0",
41
42
  "ulid": "^3.0.0",
42
43
  "uuid": "^11.1.1",
43
44
  "ws": "^8.14.0",