@evref-bl/dev-nexus 0.1.0-alpha.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 (100) hide show
  1. package/README.md +677 -0
  2. package/dist/browserOpener.d.ts +9 -0
  3. package/dist/browserOpener.js +47 -0
  4. package/dist/cli.d.ts +18 -0
  5. package/dist/cli.js +2374 -0
  6. package/dist/gitWorktreeService.d.ts +57 -0
  7. package/dist/gitWorktreeService.js +157 -0
  8. package/dist/index.d.ts +47 -0
  9. package/dist/index.js +47 -0
  10. package/dist/nexusAgentMcpConfig.d.ts +30 -0
  11. package/dist/nexusAgentMcpConfig.js +228 -0
  12. package/dist/nexusAutomation.d.ts +103 -0
  13. package/dist/nexusAutomation.js +390 -0
  14. package/dist/nexusAutomationAgentLaunch.d.ts +148 -0
  15. package/dist/nexusAutomationAgentLaunch.js +855 -0
  16. package/dist/nexusAutomationAgentProfile.d.ts +39 -0
  17. package/dist/nexusAutomationAgentProfile.js +103 -0
  18. package/dist/nexusAutomationAgentSurface.d.ts +62 -0
  19. package/dist/nexusAutomationAgentSurface.js +90 -0
  20. package/dist/nexusAutomationCommandExecutor.d.ts +29 -0
  21. package/dist/nexusAutomationCommandExecutor.js +251 -0
  22. package/dist/nexusAutomationConfig.d.ts +114 -0
  23. package/dist/nexusAutomationConfig.js +547 -0
  24. package/dist/nexusAutomationEnqueue.d.ts +37 -0
  25. package/dist/nexusAutomationEnqueue.js +128 -0
  26. package/dist/nexusAutomationRunOnce.d.ts +91 -0
  27. package/dist/nexusAutomationRunOnce.js +586 -0
  28. package/dist/nexusAutomationScheduler.d.ts +50 -0
  29. package/dist/nexusAutomationScheduler.js +196 -0
  30. package/dist/nexusAutomationStatus.d.ts +55 -0
  31. package/dist/nexusAutomationStatus.js +462 -0
  32. package/dist/nexusAutomationTarget.d.ts +19 -0
  33. package/dist/nexusAutomationTarget.js +33 -0
  34. package/dist/nexusAutomationTargetCycle.d.ts +90 -0
  35. package/dist/nexusAutomationTargetCycle.js +282 -0
  36. package/dist/nexusAutomationTargetReport.d.ts +136 -0
  37. package/dist/nexusAutomationTargetReport.js +504 -0
  38. package/dist/nexusAutomationWorktreeSetup.d.ts +89 -0
  39. package/dist/nexusAutomationWorktreeSetup.js +661 -0
  40. package/dist/nexusCoordination.d.ts +198 -0
  41. package/dist/nexusCoordination.js +1018 -0
  42. package/dist/nexusExtension.d.ts +31 -0
  43. package/dist/nexusExtension.js +1 -0
  44. package/dist/nexusHomeConfig.d.ts +38 -0
  45. package/dist/nexusHomeConfig.js +133 -0
  46. package/dist/nexusMcpServer.d.ts +31 -0
  47. package/dist/nexusMcpServer.js +1036 -0
  48. package/dist/nexusPluginCapabilities.d.ts +197 -0
  49. package/dist/nexusPluginCapabilities.js +201 -0
  50. package/dist/nexusProjectConfig.d.ts +95 -0
  51. package/dist/nexusProjectConfig.js +880 -0
  52. package/dist/nexusProjectHomeService.d.ts +121 -0
  53. package/dist/nexusProjectHomeService.js +171 -0
  54. package/dist/nexusProjectLifecycle.d.ts +62 -0
  55. package/dist/nexusProjectLifecycle.js +205 -0
  56. package/dist/nexusProjectOperations.d.ts +101 -0
  57. package/dist/nexusProjectOperations.js +296 -0
  58. package/dist/nexusProjectRegistry.d.ts +42 -0
  59. package/dist/nexusProjectRegistry.js +91 -0
  60. package/dist/nexusProjectScaffold.d.ts +25 -0
  61. package/dist/nexusProjectScaffold.js +61 -0
  62. package/dist/nexusProjectTemplate.d.ts +34 -0
  63. package/dist/nexusProjectTemplate.js +354 -0
  64. package/dist/nexusSkills.d.ts +134 -0
  65. package/dist/nexusSkills.js +647 -0
  66. package/dist/nexusWorkerContextBundle.d.ts +142 -0
  67. package/dist/nexusWorkerContextBundle.js +375 -0
  68. package/dist/processSupervisor.d.ts +89 -0
  69. package/dist/processSupervisor.js +440 -0
  70. package/dist/vibeKanbanApi.d.ts +11 -0
  71. package/dist/vibeKanbanApi.js +14 -0
  72. package/dist/vibeKanbanAuth.d.ts +25 -0
  73. package/dist/vibeKanbanAuth.js +101 -0
  74. package/dist/vibeKanbanBoardAdapter.d.ts +36 -0
  75. package/dist/vibeKanbanBoardAdapter.js +196 -0
  76. package/dist/vibeKanbanMcpConfig.d.ts +36 -0
  77. package/dist/vibeKanbanMcpConfig.js +191 -0
  78. package/dist/vibeKanbanProjectAdapter.d.ts +39 -0
  79. package/dist/vibeKanbanProjectAdapter.js +113 -0
  80. package/dist/vibeKanbanWorkspaceSetup.d.ts +1 -0
  81. package/dist/vibeKanbanWorkspaceSetup.js +96 -0
  82. package/dist/workItemService.d.ts +60 -0
  83. package/dist/workItemService.js +163 -0
  84. package/dist/workTrackingGitHubProvider.d.ts +71 -0
  85. package/dist/workTrackingGitHubProvider.js +663 -0
  86. package/dist/workTrackingGitLabProvider.d.ts +62 -0
  87. package/dist/workTrackingGitLabProvider.js +523 -0
  88. package/dist/workTrackingJiraProvider.d.ts +67 -0
  89. package/dist/workTrackingJiraProvider.js +652 -0
  90. package/dist/workTrackingLocalProvider.d.ts +49 -0
  91. package/dist/workTrackingLocalProvider.js +463 -0
  92. package/dist/workTrackingProviderService.d.ts +21 -0
  93. package/dist/workTrackingProviderService.js +117 -0
  94. package/dist/workTrackingTypes.d.ts +202 -0
  95. package/dist/workTrackingTypes.js +1 -0
  96. package/dist/workTrackingVibeProvider.d.ts +35 -0
  97. package/dist/workTrackingVibeProvider.js +119 -0
  98. package/dist/worktreeExecutionMetadata.d.ts +76 -0
  99. package/dist/worktreeExecutionMetadata.js +239 -0
  100. package/package.json +37 -0
@@ -0,0 +1,128 @@
1
+ import path from "node:path";
2
+ import { selectNexusAutomationWorkItem } from "./nexusAutomation.js";
3
+ import { loadProjectConfig, } from "./nexusProjectConfig.js";
4
+ import { resolvePrimaryProjectComponent, } from "./nexusProjectLifecycle.js";
5
+ import { createWorkTrackerProvider, } from "./workTrackingProviderService.js";
6
+ export class NexusAutomationEnqueueError extends Error {
7
+ constructor(message) {
8
+ super(message);
9
+ this.name = "NexusAutomationEnqueueError";
10
+ }
11
+ }
12
+ export async function enqueueNexusAutomationWorkItem(options) {
13
+ const projectRoot = path.resolve(requiredNonEmptyString(options.projectRoot, "projectRoot"));
14
+ const projectConfig = loadProjectConfig(projectRoot);
15
+ const automationConfig = projectConfig.automation;
16
+ if (!automationConfig?.enabled) {
17
+ throw new NexusAutomationEnqueueError("Project automation is not enabled");
18
+ }
19
+ const primaryComponent = resolvePrimaryProjectComponent(projectRoot, projectConfig);
20
+ if (!primaryComponent.workTracking) {
21
+ throw new NexusAutomationEnqueueError("Primary component work tracking is not configured");
22
+ }
23
+ const sourceRoot = primaryComponent.sourceRoot;
24
+ const status = resolveEnqueueStatus(automationConfig, options.status);
25
+ const labels = resolveSelectorStrings("labels", automationConfig.selector.labels, options.labels);
26
+ const assignees = resolveSelectorStrings("assignees", automationConfig.selector.assignees, options.assignees);
27
+ assertNoExcludedLabels(labels, automationConfig.selector.excludeLabels);
28
+ assertSearchMatches(automationConfig, options.title, options.description ?? null);
29
+ const provider = resolveProvider({
30
+ options,
31
+ projectRoot,
32
+ sourceRoot,
33
+ projectConfig,
34
+ component: primaryComponent,
35
+ });
36
+ const workItem = await provider.createWorkItem({
37
+ projectRoot,
38
+ title: requiredNonEmptyString(options.title, "title"),
39
+ description: options.description,
40
+ status,
41
+ labels,
42
+ assignees,
43
+ milestone: options.milestone,
44
+ });
45
+ if (!selectNexusAutomationWorkItem([workItem], automationConfig)) {
46
+ throw new NexusAutomationEnqueueError(`Created work item ${workItem.id} did not match the automation selector`);
47
+ }
48
+ return {
49
+ projectRoot,
50
+ sourceRoot,
51
+ projectConfig,
52
+ automationConfig,
53
+ workItem,
54
+ };
55
+ }
56
+ function resolveProvider(options) {
57
+ const workTracking = options.component.workTracking;
58
+ if (!workTracking) {
59
+ throw new NexusAutomationEnqueueError("Primary component work tracking is not configured");
60
+ }
61
+ if (options.options.provider) {
62
+ return options.options.provider;
63
+ }
64
+ if (options.options.providerFactory) {
65
+ return options.options.providerFactory({
66
+ projectRoot: options.projectRoot,
67
+ sourceRoot: options.sourceRoot,
68
+ projectConfig: options.projectConfig,
69
+ component: options.component,
70
+ workTracking,
71
+ });
72
+ }
73
+ return createWorkTrackerProvider(workTracking, {
74
+ ...options.options.providerOptions,
75
+ projectRoot: options.projectRoot,
76
+ now: options.options.now,
77
+ });
78
+ }
79
+ function resolveEnqueueStatus(config, requested) {
80
+ if (requested) {
81
+ if (!config.selector.statuses.includes(requested)) {
82
+ throw new NexusAutomationEnqueueError(`--status must match automation selector statuses: ${config.selector.statuses.join(", ")}`);
83
+ }
84
+ return requested;
85
+ }
86
+ const status = config.selector.statuses[0];
87
+ if (!status) {
88
+ throw new NexusAutomationEnqueueError("Automation selector must include at least one status");
89
+ }
90
+ return status;
91
+ }
92
+ function resolveSelectorStrings(name, selectorValues, requestedValues) {
93
+ const values = [...selectorValues, ...(requestedValues ?? [])];
94
+ const seen = new Set();
95
+ const result = [];
96
+ for (const value of values) {
97
+ const normalized = requiredNonEmptyString(value, name);
98
+ const key = normalized.toLowerCase();
99
+ if (!seen.has(key)) {
100
+ seen.add(key);
101
+ result.push(normalized);
102
+ }
103
+ }
104
+ return result;
105
+ }
106
+ function assertNoExcludedLabels(labels, excludedLabels) {
107
+ const labelSet = new Set(labels.map((label) => label.toLowerCase()));
108
+ const conflicts = excludedLabels.filter((label) => labelSet.has(label.toLowerCase()));
109
+ if (conflicts.length > 0) {
110
+ throw new NexusAutomationEnqueueError(`labels conflict with automation selector exclusions: ${conflicts.join(", ")}`);
111
+ }
112
+ }
113
+ function assertSearchMatches(config, title, description) {
114
+ const search = config.selector.search?.trim().toLowerCase();
115
+ if (!search) {
116
+ return;
117
+ }
118
+ const haystack = [title, description ?? ""].join("\n").toLowerCase();
119
+ if (!haystack.includes(search)) {
120
+ throw new NexusAutomationEnqueueError("title or description must match automation selector search");
121
+ }
122
+ }
123
+ function requiredNonEmptyString(value, name) {
124
+ if (typeof value !== "string" || value.trim().length === 0) {
125
+ throw new NexusAutomationEnqueueError(`${name} must be a non-empty string`);
126
+ }
127
+ return value.trim();
128
+ }
@@ -0,0 +1,91 @@
1
+ import { type GitRunner, type PrepareGitWorktreeResult } from "./gitWorktreeService.js";
2
+ import { type AcquireNexusAutomationRunLockResult, type NexusAutomationRunLedger, type NexusAutomationRunStatus } from "./nexusAutomation.js";
3
+ import type { NexusAutomationConfig } from "./nexusAutomationConfig.js";
4
+ import { type NexusAutomationPluginDependencyProjection, type NexusAutomationWorktreeSetupResult } from "./nexusAutomationWorktreeSetup.js";
5
+ import { type NexusProjectConfig } from "./nexusProjectConfig.js";
6
+ import { type ResolvedNexusProjectComponent } from "./nexusProjectLifecycle.js";
7
+ import { type WorktreeExecutionMetadata, type WorktreePublicationDecisionInput, type WorktreeVerificationInput } from "./worktreeExecutionMetadata.js";
8
+ import { type CreateWorkTrackerProviderOptions } from "./workTrackingProviderService.js";
9
+ import type { WorkComment, WorkItem, WorkTrackerProvider, WorkTrackingConfig } from "./workTrackingTypes.js";
10
+ export type NexusAutomationExecutorStatus = "completed" | "failed" | "blocked";
11
+ export interface NexusAutomationExecutorInput {
12
+ runId: string;
13
+ startedAt: string;
14
+ projectRoot: string;
15
+ sourceRoot: string;
16
+ projectConfig: NexusProjectConfig;
17
+ automationConfig: NexusAutomationConfig;
18
+ workItem: WorkItem;
19
+ worktree: PrepareGitWorktreeResult;
20
+ setup: NexusAutomationWorktreeSetupResult;
21
+ }
22
+ export interface NexusAutomationExecutorResult {
23
+ status?: NexusAutomationExecutorStatus;
24
+ summary?: string | null;
25
+ commitIds?: string[];
26
+ verification?: WorktreeVerificationInput[];
27
+ publicationDecision?: WorktreePublicationDecisionInput;
28
+ error?: string | null;
29
+ }
30
+ export type NexusAutomationExecutor = (input: NexusAutomationExecutorInput) => NexusAutomationExecutorResult | Promise<NexusAutomationExecutorResult>;
31
+ export interface NexusAutomationProviderContext {
32
+ projectRoot: string;
33
+ sourceRoot: string;
34
+ projectConfig: NexusProjectConfig;
35
+ component?: ResolvedNexusProjectComponent;
36
+ workTracking: WorkTrackingConfig;
37
+ }
38
+ export type NexusAutomationWorkTrackerProviderFactory = (context: NexusAutomationProviderContext) => WorkTrackerProvider;
39
+ export type NexusAutomationPreflightStatus = "passed" | "failed";
40
+ export interface NexusAutomationPreflightCheck {
41
+ name: string;
42
+ status: NexusAutomationPreflightStatus;
43
+ message: string;
44
+ }
45
+ export interface RunNexusAutomationOnceOptions {
46
+ projectRoot: string;
47
+ homePath?: string;
48
+ runId?: string;
49
+ owner?: string | null;
50
+ branchName?: string;
51
+ worktreeName?: string;
52
+ baseRef?: string | null;
53
+ provider?: WorkTrackerProvider;
54
+ providerFactory?: NexusAutomationWorkTrackerProviderFactory;
55
+ providerOptions?: CreateWorkTrackerProviderOptions;
56
+ gitRunner?: GitRunner;
57
+ now?: () => Date | string;
58
+ executor: NexusAutomationExecutor;
59
+ }
60
+ export interface RunNexusAutomationOnceResult {
61
+ runId: string;
62
+ projectRoot: string;
63
+ sourceRoot: string | null;
64
+ projectConfig: NexusProjectConfig;
65
+ automationConfig: NexusAutomationConfig | null;
66
+ status: NexusAutomationRunStatus;
67
+ summary: string;
68
+ ledger: NexusAutomationRunLedger | null;
69
+ lock: AcquireNexusAutomationRunLockResult | null;
70
+ preflight: NexusAutomationPreflightCheck[];
71
+ workItem: WorkItem | null;
72
+ worktree: PrepareGitWorktreeResult | null;
73
+ setup: NexusAutomationWorktreeSetupResult | null;
74
+ execution: WorktreeExecutionMetadata | null;
75
+ comments: WorkComment[];
76
+ updatedWorkItem: WorkItem | null;
77
+ }
78
+ export declare class NexusAutomationRunOnceError extends Error {
79
+ constructor(message: string);
80
+ }
81
+ export declare function runNexusAutomationOnce(options: RunNexusAutomationOnceOptions): Promise<RunNexusAutomationOnceResult>;
82
+ export declare function preflightNexusAutomationRunOnce(options: {
83
+ projectRoot: string;
84
+ sourceRoot: string;
85
+ projectConfig: NexusProjectConfig;
86
+ component: ResolvedNexusProjectComponent;
87
+ automationConfig: NexusAutomationConfig;
88
+ provider: WorkTrackerProvider;
89
+ pluginDependencyProjections?: NexusAutomationPluginDependencyProjection[];
90
+ }): NexusAutomationPreflightCheck[];
91
+ export declare function generateNexusAutomationRunId(now?: () => Date | string): string;