@deep-process/core 1.0.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.
@@ -0,0 +1,39 @@
1
+ export interface ProcessConfig {
2
+ installed: boolean;
3
+ version: string;
4
+ }
5
+ export interface ToolConfig {
6
+ enabled: boolean;
7
+ files: string[];
8
+ }
9
+ export interface DeepProcessConfig {
10
+ version: string;
11
+ packageVersion: string;
12
+ installation: {
13
+ scope: 'project' | 'global';
14
+ processDir: string;
15
+ };
16
+ processes: Record<string, ProcessConfig>;
17
+ tools: Record<string, ToolConfig>;
18
+ }
19
+ /**
20
+ * Get the config file path for a given project root.
21
+ */
22
+ export declare function getConfigPath(projectRoot: string): string;
23
+ /**
24
+ * Read the deep-process config from disk.
25
+ */
26
+ export declare function readConfig(projectRoot: string): DeepProcessConfig | null;
27
+ /**
28
+ * Write the deep-process config to disk.
29
+ */
30
+ export declare function writeConfig(projectRoot: string, config: DeepProcessConfig): void;
31
+ /**
32
+ * Create a new default config.
33
+ */
34
+ export declare function createConfig(scope: 'project' | 'global', processDir: string, packageVersion: string): DeepProcessConfig;
35
+ /**
36
+ * Check if a config file exists.
37
+ */
38
+ export declare function configExists(projectRoot: string): boolean;
39
+ //# sourceMappingURL=config-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-manager.d.ts","sourceRoot":"","sources":["../src/config-manager.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE;QACZ,KAAK,EAAE,SAAS,GAAG,QAAQ,CAAC;QAC5B,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACzC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CACnC;AAID;;GAEG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI,CAMxE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAIhF;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,SAAS,GAAG,QAAQ,EAC3B,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,GACrB,iBAAiB,CAQnB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAEzD"}
@@ -0,0 +1,47 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import { parse as parseYaml, stringify as stringifyYaml } from 'yaml';
4
+ const CONFIG_FILENAME = 'deep-process.config.yaml';
5
+ /**
6
+ * Get the config file path for a given project root.
7
+ */
8
+ export function getConfigPath(projectRoot) {
9
+ return path.join(projectRoot, CONFIG_FILENAME);
10
+ }
11
+ /**
12
+ * Read the deep-process config from disk.
13
+ */
14
+ export function readConfig(projectRoot) {
15
+ const configPath = getConfigPath(projectRoot);
16
+ if (!fs.existsSync(configPath))
17
+ return null;
18
+ const content = fs.readFileSync(configPath, 'utf-8');
19
+ return parseYaml(content);
20
+ }
21
+ /**
22
+ * Write the deep-process config to disk.
23
+ */
24
+ export function writeConfig(projectRoot, config) {
25
+ const configPath = getConfigPath(projectRoot);
26
+ const content = stringifyYaml(config, { lineWidth: 120 });
27
+ fs.writeFileSync(configPath, content, 'utf-8');
28
+ }
29
+ /**
30
+ * Create a new default config.
31
+ */
32
+ export function createConfig(scope, processDir, packageVersion) {
33
+ return {
34
+ version: '1.0.0',
35
+ packageVersion,
36
+ installation: { scope, processDir },
37
+ processes: {},
38
+ tools: {},
39
+ };
40
+ }
41
+ /**
42
+ * Check if a config file exists.
43
+ */
44
+ export function configExists(projectRoot) {
45
+ return fs.existsSync(getConfigPath(projectRoot));
46
+ }
47
+ //# sourceMappingURL=config-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-manager.js","sourceRoot":"","sources":["../src/config-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAuBtE,MAAM,eAAe,GAAG,0BAA0B,CAAC;AAEnD;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,WAAmB;IAC/C,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;AACjD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,WAAmB;IAC5C,MAAM,UAAU,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;IAC9C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;QAAE,OAAO,IAAI,CAAC;IAE5C,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACrD,OAAO,SAAS,CAAC,OAAO,CAAsB,CAAC;AACjD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,WAAmB,EAAE,MAAyB;IACxE,MAAM,UAAU,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;IAC9C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC;IAC1D,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AACjD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAC1B,KAA2B,EAC3B,UAAkB,EAClB,cAAsB;IAEtB,OAAO;QACL,OAAO,EAAE,OAAO;QAChB,cAAc;QACd,YAAY,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE;QACnC,SAAS,EAAE,EAAE;QACb,KAAK,EAAE,EAAE;KACV,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,WAAmB;IAC9C,OAAO,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC;AACnD,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { type ProcessManifest } from './process-registry.js';
2
+ /**
3
+ * Copy process files from bundled processes/ to the target directory.
4
+ * Returns the number of files copied.
5
+ */
6
+ export declare function copyProcessFiles(manifest: ProcessManifest, targetBaseDir: string): number;
7
+ /**
8
+ * Remove a process directory from the installation.
9
+ */
10
+ export declare function removeProcessFiles(processId: string, targetBaseDir: string): void;
11
+ //# sourceMappingURL=file-copier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-copier.d.ts","sourceRoot":"","sources":["../src/file-copier.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE9E;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,eAAe,EACzB,aAAa,EAAE,MAAM,GACpB,MAAM,CASR;AA8CD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI,CAKjF"}
@@ -0,0 +1,68 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import { getProcessesDir } from './process-registry.js';
4
+ /**
5
+ * Copy process files from bundled processes/ to the target directory.
6
+ * Returns the number of files copied.
7
+ */
8
+ export function copyProcessFiles(manifest, targetBaseDir) {
9
+ const sourceDir = path.join(getProcessesDir(), manifest.id);
10
+ const targetDir = path.join(targetBaseDir, manifest.id);
11
+ if (!fs.existsSync(sourceDir)) {
12
+ throw new Error(`Process source not found: ${sourceDir}`);
13
+ }
14
+ return copyDirRecursive(sourceDir, targetDir, manifest.excludeFromInstall ?? []);
15
+ }
16
+ /**
17
+ * Recursively copy a directory, excluding files matching exclude patterns.
18
+ */
19
+ function copyDirRecursive(src, dest, excludePatterns) {
20
+ fs.mkdirSync(dest, { recursive: true });
21
+ let count = 0;
22
+ const entries = fs.readdirSync(src, { withFileTypes: true });
23
+ for (const entry of entries) {
24
+ const srcPath = path.join(src, entry.name);
25
+ const destPath = path.join(dest, entry.name);
26
+ const relativePath = path.relative(src, srcPath);
27
+ if (shouldExclude(relativePath, excludePatterns))
28
+ continue;
29
+ if (entry.name === 'manifest.yaml')
30
+ continue; // Don't copy manifest to user project
31
+ if (entry.isDirectory()) {
32
+ count += copyDirRecursive(srcPath, destPath, excludePatterns);
33
+ }
34
+ else {
35
+ fs.copyFileSync(srcPath, destPath);
36
+ count++;
37
+ }
38
+ }
39
+ return count;
40
+ }
41
+ /**
42
+ * Simple glob-like exclude check.
43
+ * Supports patterns like "docs/**" and exact matches.
44
+ */
45
+ function shouldExclude(relativePath, patterns) {
46
+ const normalized = relativePath.replace(/\\/g, '/');
47
+ for (const pattern of patterns) {
48
+ if (pattern.endsWith('/**')) {
49
+ const prefix = pattern.slice(0, -3);
50
+ if (normalized.startsWith(prefix + '/') || normalized === prefix)
51
+ return true;
52
+ }
53
+ else if (normalized === pattern) {
54
+ return true;
55
+ }
56
+ }
57
+ return false;
58
+ }
59
+ /**
60
+ * Remove a process directory from the installation.
61
+ */
62
+ export function removeProcessFiles(processId, targetBaseDir) {
63
+ const targetDir = path.join(targetBaseDir, processId);
64
+ if (fs.existsSync(targetDir)) {
65
+ fs.rmSync(targetDir, { recursive: true, force: true });
66
+ }
67
+ }
68
+ //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AAE,SAAS,CAAC,CAAC;IACtD,IAAI,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC7B,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACzD,CAAC;AACH,CAAC"}
@@ -0,0 +1,7 @@
1
+ export * from './process-registry.js';
2
+ export * from './config-manager.js';
3
+ export * from './path-resolver.js';
4
+ export * from './template-engine.js';
5
+ export * from './file-copier.js';
6
+ export * from './version-manager.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AAGrC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,sBAAsB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,11 @@
1
+ // Loaders and registry
2
+ export * from './process-registry.js';
3
+ export * from './config-manager.js';
4
+ // Generators and resolvers
5
+ export * from './path-resolver.js';
6
+ export * from './template-engine.js';
7
+ // File operations
8
+ export * from './file-copier.js';
9
+ // Version management
10
+ export * from './version-manager.js';
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uBAAuB;AACvB,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AAEpC,2BAA2B;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AAErC,kBAAkB;AAClB,cAAc,kBAAkB,CAAC;AAEjC,qBAAqB;AACrB,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { ProcessManifest } from './process-registry.js';
2
+ export interface PathContext {
3
+ scope: 'project' | 'global';
4
+ processDir: string;
5
+ globalDir: string;
6
+ projectRoot: string;
7
+ }
8
+ /**
9
+ * Resolve the base directory where processes are installed.
10
+ */
11
+ export declare function resolveProcessBaseDir(ctx: PathContext): string;
12
+ /**
13
+ * Build template variables for a given process.
14
+ * These get substituted into command templates via {{var}}.
15
+ */
16
+ export declare function buildTemplateVars(manifest: ProcessManifest, ctx: PathContext): Record<string, string>;
17
+ //# sourceMappingURL=path-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-resolver.d.ts","sourceRoot":"","sources":["../src/path-resolver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,WAAW,GAAG,MAAM,CAK9D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,eAAe,EAAE,GAAG,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAwBrG"}
@@ -0,0 +1,38 @@
1
+ import path from 'node:path';
2
+ /**
3
+ * Resolve the base directory where processes are installed.
4
+ */
5
+ export function resolveProcessBaseDir(ctx) {
6
+ if (ctx.scope === 'global') {
7
+ return ctx.globalDir;
8
+ }
9
+ return path.join(ctx.projectRoot, ctx.processDir);
10
+ }
11
+ /**
12
+ * Build template variables for a given process.
13
+ * These get substituted into command templates via {{var}}.
14
+ */
15
+ export function buildTemplateVars(manifest, ctx) {
16
+ const baseDir = ctx.scope === 'global'
17
+ ? ctx.globalDir
18
+ : ctx.processDir;
19
+ const processPath = path.posix.join(baseDir, manifest.id);
20
+ return {
21
+ id: manifest.id,
22
+ name: manifest.name,
23
+ agentName: manifest.agentName,
24
+ description: manifest.description,
25
+ shortDescription: manifest.shortDescription,
26
+ version: manifest.version,
27
+ slashCommand: manifest.slashCommand,
28
+ workflowPath: path.posix.join(processPath, manifest.workflowFile),
29
+ firstStepPath: path.posix.join(processPath, manifest.firstStepFile),
30
+ firstStepLabel: manifest.firstStepLabel,
31
+ agentInstruction: manifest.agentInstruction,
32
+ githubAgentTools: manifest.githubAgentTools.map(t => ` - ${t}`).join('\n'),
33
+ args: '{{args}}', // Gemini placeholder — kept literally
34
+ input: '{{input}}', // Cursor placeholder — kept literally
35
+ tripleInput: '{{{ input }}}', // Continue.dev placeholder — kept literally
36
+ };
37
+ }
38
+ //# sourceMappingURL=path-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-resolver.js","sourceRoot":"","sources":["../src/path-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAU7B;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAgB;IACpD,IAAI,GAAG,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC3B,OAAO,GAAG,CAAC,SAAS,CAAC;IACvB,CAAC;IACD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;AACpD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAyB,EAAE,GAAgB;IAC3E,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,KAAK,QAAQ;QACpC,CAAC,CAAC,GAAG,CAAC,SAAS;QACf,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC;IAEnB,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;IAE1D,OAAO;QACL,EAAE,EAAE,QAAQ,CAAC,EAAE;QACf,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,SAAS,EAAE,QAAQ,CAAC,SAAS;QAC7B,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB;QAC3C,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,YAAY,EAAE,QAAQ,CAAC,YAAY;QACnC,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,YAAY,CAAC;QACjE,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,aAAa,CAAC;QACnE,cAAc,EAAE,QAAQ,CAAC,cAAc;QACvC,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB;QAC3C,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAC3E,IAAI,EAAE,UAAU,EAAU,sCAAsC;QAChE,KAAK,EAAE,WAAW,EAAQ,sCAAsC;QAChE,WAAW,EAAE,eAAe,EAAE,4CAA4C;KAC3E,CAAC;AACJ,CAAC"}
@@ -0,0 +1,28 @@
1
+ export interface ProcessManifest {
2
+ id: string;
3
+ name: string;
4
+ version: string;
5
+ description: string;
6
+ shortDescription: string;
7
+ workflowFile: string;
8
+ firstStepFile: string;
9
+ firstStepLabel: string;
10
+ agentName: string;
11
+ agentInstruction: string;
12
+ githubAgentTools: string[];
13
+ slashCommand: string;
14
+ excludeFromInstall?: string[];
15
+ }
16
+ /**
17
+ * Get the directory where bundled processes live (inside the npm package).
18
+ */
19
+ export declare function getProcessesDir(): string;
20
+ /**
21
+ * Read all process manifests from the bundled processes directory.
22
+ */
23
+ export declare function loadAllManifests(): ProcessManifest[];
24
+ /**
25
+ * Load a single process manifest by ID.
26
+ */
27
+ export declare function loadManifest(processId: string): ProcessManifest | undefined;
28
+ //# sourceMappingURL=process-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-registry.d.ts","sourceRoot":"","sources":["../src/process-registry.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAGxC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,eAAe,EAAE,CAoBpD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAM3E"}
@@ -0,0 +1,43 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import { parse as parseYaml } from 'yaml';
4
+ /**
5
+ * Get the directory where bundled processes live (inside the npm package).
6
+ */
7
+ export function getProcessesDir() {
8
+ // When running from dist/, processes are at the package root
9
+ return path.resolve(import.meta.dirname, '..', '..', 'processes');
10
+ }
11
+ /**
12
+ * Read all process manifests from the bundled processes directory.
13
+ */
14
+ export function loadAllManifests() {
15
+ const processesDir = getProcessesDir();
16
+ if (!fs.existsSync(processesDir)) {
17
+ return [];
18
+ }
19
+ const entries = fs.readdirSync(processesDir, { withFileTypes: true });
20
+ const manifests = [];
21
+ for (const entry of entries) {
22
+ if (!entry.isDirectory())
23
+ continue;
24
+ const manifestPath = path.join(processesDir, entry.name, 'manifest.yaml');
25
+ if (!fs.existsSync(manifestPath))
26
+ continue;
27
+ const content = fs.readFileSync(manifestPath, 'utf-8');
28
+ const data = parseYaml(content);
29
+ manifests.push(data);
30
+ }
31
+ return manifests.sort((a, b) => a.id.localeCompare(b.id));
32
+ }
33
+ /**
34
+ * Load a single process manifest by ID.
35
+ */
36
+ export function loadManifest(processId) {
37
+ const manifestPath = path.join(getProcessesDir(), processId, 'manifest.yaml');
38
+ if (!fs.existsSync(manifestPath))
39
+ return undefined;
40
+ const content = fs.readFileSync(manifestPath, 'utf-8');
41
+ return parseYaml(content);
42
+ }
43
+ //# sourceMappingURL=process-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-registry.js","sourceRoot":"","sources":["../src/process-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAkB1C;;GAEG;AACH,MAAM,UAAU,eAAe;IAC7B,6DAA6D;IAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;AACpE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IACvC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QACjC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,YAAY,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IACtE,MAAM,SAAS,GAAsB,EAAE,CAAC;IAExC,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;YAAE,SAAS;QACnC,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QAC1E,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC;YAAE,SAAS;QAE3C,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACvD,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAoB,CAAC;QACnD,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,SAAiB;IAC5C,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;IAC9E,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC;QAAE,OAAO,SAAS,CAAC;IAEnD,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IACvD,OAAO,SAAS,CAAC,OAAO,CAAoB,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Simple {{var}} template engine.
3
+ * Replaces all {{variableName}} occurrences with values from the context object.
4
+ */
5
+ export declare function renderTemplate(template: string, context: Record<string, string>): string;
6
+ //# sourceMappingURL=template-engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-engine.d.ts","sourceRoot":"","sources":["../src/template-engine.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAOxF"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Simple {{var}} template engine.
3
+ * Replaces all {{variableName}} occurrences with values from the context object.
4
+ */
5
+ export function renderTemplate(template, context) {
6
+ return template.replace(/\{\{(\w+)\}\}/g, (match, key) => {
7
+ if (key in context) {
8
+ return context[key];
9
+ }
10
+ return match; // Leave unresolved placeholders as-is
11
+ });
12
+ }
13
+ //# sourceMappingURL=template-engine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-engine.js","sourceRoot":"","sources":["../src/template-engine.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,QAAgB,EAAE,OAA+B;IAC9E,OAAO,QAAQ,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC,KAAK,EAAE,GAAW,EAAE,EAAE;QAC/D,IAAI,GAAG,IAAI,OAAO,EAAE,CAAC;YACnB,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;QACtB,CAAC;QACD,OAAO,KAAK,CAAC,CAAC,sCAAsC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { DeepProcessConfig } from './config-manager.js';
2
+ import type { ProcessManifest } from './process-registry.js';
3
+ export interface UpdateInfo {
4
+ processId: string;
5
+ currentVersion: string;
6
+ availableVersion: string;
7
+ needsUpdate: boolean;
8
+ reason: 'version' | 'missing' | 'up-to-date';
9
+ }
10
+ /**
11
+ * Compare installed versions against available versions.
12
+ * Also detects missing process directories (manually deleted).
13
+ */
14
+ export declare function checkForUpdates(config: DeepProcessConfig, manifests: ProcessManifest[], projectRoot: string): UpdateInfo[];
15
+ //# sourceMappingURL=version-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version-manager.d.ts","sourceRoot":"","sources":["../src/version-manager.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,YAAY,CAAC;CAC9C;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,iBAAiB,EACzB,SAAS,EAAE,eAAe,EAAE,EAC5B,WAAW,EAAE,MAAM,GAClB,UAAU,EAAE,CAuBd"}
@@ -0,0 +1,27 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ /**
4
+ * Compare installed versions against available versions.
5
+ * Also detects missing process directories (manually deleted).
6
+ */
7
+ export function checkForUpdates(config, manifests, projectRoot) {
8
+ const results = [];
9
+ for (const manifest of manifests) {
10
+ const installed = config.processes[manifest.id];
11
+ if (!installed?.installed)
12
+ continue;
13
+ // Check if process directory actually exists on disk
14
+ const processDir = path.join(projectRoot, config.installation.processDir, manifest.id);
15
+ const dirMissing = !fs.existsSync(processDir);
16
+ const versionChanged = installed.version !== manifest.version;
17
+ results.push({
18
+ processId: manifest.id,
19
+ currentVersion: installed.version,
20
+ availableVersion: manifest.version,
21
+ needsUpdate: versionChanged || dirMissing,
22
+ reason: dirMissing ? 'missing' : versionChanged ? 'version' : 'up-to-date',
23
+ });
24
+ }
25
+ return results;
26
+ }
27
+ //# sourceMappingURL=version-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version-manager.js","sourceRoot":"","sources":["../src/version-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAY7B;;;GAGG;AACH,MAAM,UAAU,eAAe,CAC7B,MAAyB,EACzB,SAA4B,EAC5B,WAAmB;IAEnB,MAAM,OAAO,GAAiB,EAAE,CAAC;IAEjC,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAChD,IAAI,CAAC,SAAS,EAAE,SAAS;YAAE,SAAS;QAEpC,qDAAqD;QACrD,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;QACvF,MAAM,UAAU,GAAG,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAE9C,MAAM,cAAc,GAAG,SAAS,CAAC,OAAO,KAAK,QAAQ,CAAC,OAAO,CAAC;QAE9D,OAAO,CAAC,IAAI,CAAC;YACX,SAAS,EAAE,QAAQ,CAAC,EAAE;YACtB,cAAc,EAAE,SAAS,CAAC,OAAO;YACjC,gBAAgB,EAAE,QAAQ,CAAC,OAAO;YAClC,WAAW,EAAE,cAAc,IAAI,UAAU;YACzC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY;SAC3E,CAAC,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@deep-process/core",
3
+ "version": "1.0.0",
4
+ "description": "Core utilities and loaders for deep-process packages",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "files": [
9
+ "dist/"
10
+ ],
11
+ "scripts": {
12
+ "build": "tsc",
13
+ "dev": "tsc --watch"
14
+ },
15
+ "author": "Deep Process Contributors",
16
+ "license": "MIT",
17
+ "dependencies": {
18
+ "yaml": "^2.4.0"
19
+ },
20
+ "devDependencies": {
21
+ "@types/node": "^22.0.0",
22
+ "typescript": "^5.4.0"
23
+ }
24
+ }