@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,31 @@
1
+ import type { NexusSkillDefinition } from "./nexusSkills.js";
2
+ export interface NexusProjectScaffoldContext<ProjectConfig = unknown> {
3
+ homePath: string;
4
+ projectRoot: string;
5
+ worktreesRoot: string;
6
+ projectConfig: ProjectConfig;
7
+ }
8
+ export interface NexusProjectStatusContext<ProjectConfig = unknown> {
9
+ projectRoot: string;
10
+ projectConfig: ProjectConfig;
11
+ }
12
+ export interface NexusProjectTrackerLinkContext<ProjectConfig = unknown> {
13
+ projectRoot: string;
14
+ projectConfig: ProjectConfig;
15
+ trackerProjectId: string;
16
+ }
17
+ export interface NexusProjectSkillsContext<ProjectConfig = unknown> {
18
+ homePath: string;
19
+ projectRoot: string;
20
+ worktreesRoot: string;
21
+ projectConfig: ProjectConfig;
22
+ }
23
+ export type NexusSkillContribution = NexusSkillDefinition;
24
+ export interface NexusExtension<ProjectConfig = unknown, ProjectScaffoldResult = unknown, ProjectStatusResult = unknown, ProjectTrackerLinkResult = unknown> {
25
+ id: string;
26
+ name: string;
27
+ installProjectFiles?(context: NexusProjectScaffoldContext<ProjectConfig>): ProjectScaffoldResult;
28
+ projectSkills?(context: NexusProjectSkillsContext<ProjectConfig>): NexusSkillContribution[] | undefined;
29
+ projectStatus?(context: NexusProjectStatusContext<ProjectConfig>): ProjectStatusResult;
30
+ linkProjectTracker?(context: NexusProjectTrackerLinkContext<ProjectConfig>): ProjectTrackerLinkResult;
31
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,38 @@
1
+ import { type NexusAgentConfig } from "./nexusProjectConfig.js";
2
+ import type { NexusProjectReference } from "./nexusProjectRegistry.js";
3
+ export declare const devNexusHomeConfigFileName = "dev-nexus.home.json";
4
+ export declare const nexusLogsDirectoryName = "logs";
5
+ export declare const nexusGeneratedDirectoryName = "generated";
6
+ export interface NexusHomePathsConfig {
7
+ projectsRoot: string;
8
+ workspacesRoot: string;
9
+ }
10
+ export interface NexusHomeConfigBase {
11
+ version: 1;
12
+ paths: NexusHomePathsConfig;
13
+ agent?: NexusAgentConfig;
14
+ projects: NexusProjectReference[];
15
+ }
16
+ export interface CreateDefaultNexusHomeConfigBaseOptions {
17
+ projectsRoot?: string;
18
+ workspacesRoot?: string;
19
+ agent?: NexusAgentConfig;
20
+ }
21
+ export interface DefaultNexusHomePathOptions {
22
+ envVarName?: string;
23
+ directoryName?: string;
24
+ }
25
+ export interface LoadNexusHomeConfigFileOptions {
26
+ missingMessage?: string | ((configPath: string) => string);
27
+ }
28
+ type NexusHomeConfigValidator<T> = (value: unknown, homePathForDefaults: string) => T;
29
+ export declare function defaultNexusHomePath(options?: DefaultNexusHomePathOptions): string;
30
+ export declare function resolveNexusHome(homePath: string): string;
31
+ export declare function nexusHomeConfigPath(homePath: string): string;
32
+ export declare const devNexusHomeConfigPath: typeof nexusHomeConfigPath;
33
+ export declare function resolveNexusHomePath(homePath: string, value: string | undefined, fallback: string): string;
34
+ export declare function createDefaultNexusHomeConfigBase(homePath: string, options?: CreateDefaultNexusHomeConfigBaseOptions): NexusHomeConfigBase;
35
+ export declare function validateNexusHomeConfigBase(value: unknown, _homePathForDefaults?: string): NexusHomeConfigBase;
36
+ export declare function loadNexusHomeConfigFile<T>(homePath: string, validate: NexusHomeConfigValidator<T>, options?: LoadNexusHomeConfigFileOptions): T;
37
+ export declare function saveNexusHomeConfigFile<T>(homePath: string, config: T, validate: NexusHomeConfigValidator<T>): string;
38
+ export {};
@@ -0,0 +1,133 @@
1
+ import fs from "node:fs";
2
+ import os from "node:os";
3
+ import path from "node:path";
4
+ import process from "node:process";
5
+ import { NexusConfigError, validateNexusAgentConfig, } from "./nexusProjectConfig.js";
6
+ export const devNexusHomeConfigFileName = "dev-nexus.home.json";
7
+ export const nexusLogsDirectoryName = "logs";
8
+ export const nexusGeneratedDirectoryName = "generated";
9
+ function assertRecord(value, pathName) {
10
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
11
+ throw new NexusConfigError(`${pathName} must be an object`);
12
+ }
13
+ return value;
14
+ }
15
+ function requiredString(record, key, pathName) {
16
+ const value = record[key];
17
+ if (typeof value !== "string" || value.trim().length === 0) {
18
+ throw new NexusConfigError(`${pathName}.${key} must be a non-empty string`);
19
+ }
20
+ return value;
21
+ }
22
+ function optionalString(record, key, pathName) {
23
+ const value = record[key];
24
+ if (value === undefined) {
25
+ return undefined;
26
+ }
27
+ if (typeof value !== "string" || value.trim().length === 0) {
28
+ throw new NexusConfigError(`${pathName}.${key} must be a non-empty string`);
29
+ }
30
+ return value;
31
+ }
32
+ function validateNexusProjectReference(value, index) {
33
+ const pathName = `projects[${index}]`;
34
+ const record = assertRecord(value, pathName);
35
+ const trackerProjectId = optionalString(record, "vibeKanbanProjectId", pathName);
36
+ const trackerRepoId = optionalString(record, "vibeKanbanRepoId", pathName);
37
+ return {
38
+ id: requiredString(record, "id", pathName),
39
+ name: requiredString(record, "name", pathName),
40
+ projectRoot: requiredString(record, "projectRoot", pathName),
41
+ ...(trackerProjectId ? { vibeKanbanProjectId: trackerProjectId } : {}),
42
+ ...(trackerRepoId ? { vibeKanbanRepoId: trackerRepoId } : {}),
43
+ };
44
+ }
45
+ function validateNexusProjectReferences(value) {
46
+ if (!Array.isArray(value)) {
47
+ throw new NexusConfigError("projects must be an array");
48
+ }
49
+ const projects = value.map(validateNexusProjectReference);
50
+ const projectIds = new Set();
51
+ for (const project of projects) {
52
+ if (projectIds.has(project.id)) {
53
+ throw new NexusConfigError(`Project id is duplicated: ${project.id}`);
54
+ }
55
+ projectIds.add(project.id);
56
+ }
57
+ return projects;
58
+ }
59
+ export function defaultNexusHomePath(options = {}) {
60
+ const envVarName = options.envVarName ?? "DEV_NEXUS_HOME";
61
+ return (process.env[envVarName] ??
62
+ path.join(os.homedir(), options.directoryName ?? ".dev-nexus"));
63
+ }
64
+ export function resolveNexusHome(homePath) {
65
+ if (!homePath.trim()) {
66
+ throw new NexusConfigError("Nexus home path is required");
67
+ }
68
+ return path.resolve(homePath);
69
+ }
70
+ export function nexusHomeConfigPath(homePath) {
71
+ return path.join(resolveNexusHome(homePath), devNexusHomeConfigFileName);
72
+ }
73
+ export const devNexusHomeConfigPath = nexusHomeConfigPath;
74
+ export function resolveNexusHomePath(homePath, value, fallback) {
75
+ return path.resolve(homePath, value ?? fallback);
76
+ }
77
+ export function createDefaultNexusHomeConfigBase(homePath, options = {}) {
78
+ const resolvedHomePath = resolveNexusHome(homePath);
79
+ const config = {
80
+ version: 1,
81
+ paths: {
82
+ projectsRoot: resolveNexusHomePath(resolvedHomePath, options.projectsRoot, "projects"),
83
+ workspacesRoot: resolveNexusHomePath(resolvedHomePath, options.workspacesRoot, "workspaces"),
84
+ },
85
+ projects: [],
86
+ };
87
+ if (options.agent) {
88
+ config.agent = validateNexusAgentConfig(options.agent, "agent");
89
+ }
90
+ return validateNexusHomeConfigBase(config, resolvedHomePath);
91
+ }
92
+ export function validateNexusHomeConfigBase(value, _homePathForDefaults) {
93
+ const record = assertRecord(value, "config");
94
+ if (record.version !== 1) {
95
+ throw new NexusConfigError("config.version must be 1");
96
+ }
97
+ const paths = assertRecord(record.paths, "paths");
98
+ const agent = validateNexusAgentConfig(record.agent, "agent");
99
+ const config = {
100
+ version: 1,
101
+ paths: {
102
+ projectsRoot: requiredString(paths, "projectsRoot", "paths"),
103
+ workspacesRoot: requiredString(paths, "workspacesRoot", "paths"),
104
+ },
105
+ projects: validateNexusProjectReferences(record.projects),
106
+ };
107
+ if (agent) {
108
+ config.agent = agent;
109
+ }
110
+ return config;
111
+ }
112
+ function missingHomeConfigMessage(configPath, options) {
113
+ if (typeof options.missingMessage === "function") {
114
+ return options.missingMessage(configPath);
115
+ }
116
+ return (options.missingMessage ??
117
+ `DevNexus home is not initialized: ${configPath}`);
118
+ }
119
+ export function loadNexusHomeConfigFile(homePath, validate, options = {}) {
120
+ const resolvedHomePath = resolveNexusHome(homePath);
121
+ const configPath = nexusHomeConfigPath(resolvedHomePath);
122
+ if (!fs.existsSync(configPath)) {
123
+ throw new NexusConfigError(missingHomeConfigMessage(configPath, options));
124
+ }
125
+ return validate(JSON.parse(fs.readFileSync(configPath, "utf8").replace(/^\uFEFF/, "")), resolvedHomePath);
126
+ }
127
+ export function saveNexusHomeConfigFile(homePath, config, validate) {
128
+ const resolvedHomePath = resolveNexusHome(homePath);
129
+ const configPath = nexusHomeConfigPath(resolvedHomePath);
130
+ fs.mkdirSync(path.dirname(configPath), { recursive: true });
131
+ fs.writeFileSync(configPath, `${JSON.stringify(validate(config, resolvedHomePath), null, 2)}\n`, "utf8");
132
+ return configPath;
133
+ }
@@ -0,0 +1,31 @@
1
+ import type { GitRunner } from "./gitWorktreeService.js";
2
+ export declare const devNexusMcpProtocolVersion = "2024-11-05";
3
+ type JsonRpcId = string | number | null;
4
+ export interface JsonRpcRequest {
5
+ jsonrpc?: "2.0";
6
+ id?: JsonRpcId;
7
+ method: string;
8
+ params?: unknown;
9
+ }
10
+ export interface McpTool {
11
+ name: string;
12
+ description: string;
13
+ inputSchema: Record<string, unknown>;
14
+ }
15
+ export interface DevNexusMcpToolContext {
16
+ now?: () => Date | string;
17
+ gitRunner?: GitRunner;
18
+ currentPath?: string;
19
+ }
20
+ export interface DevNexusMcpToolResult {
21
+ content: Array<{
22
+ type: "text";
23
+ text: string;
24
+ }>;
25
+ isError?: boolean;
26
+ }
27
+ export declare function listDevNexusMcpTools(): McpTool[];
28
+ export declare function callDevNexusMcpTool(name: string, argsValue: unknown, context?: DevNexusMcpToolContext): Promise<DevNexusMcpToolResult>;
29
+ export declare function handleDevNexusMcpJsonRpcMessage(message: JsonRpcRequest): Promise<unknown | undefined>;
30
+ export declare function runDevNexusMcpStdioServer(): Promise<void>;
31
+ export {};