@karmaniverous/jeeves-watcher 0.18.4 → 0.18.5
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.
|
@@ -10,7 +10,7 @@ import Ajv from 'ajv';
|
|
|
10
10
|
import addFormats from 'ajv-formats';
|
|
11
11
|
import picomatch from 'picomatch';
|
|
12
12
|
import { deserialize, serialize } from 'node:v8';
|
|
13
|
-
import { normalizeWatchPaths, extractWatchPathStrings, inferenceRuleSchema, jeevesWatcherConfigSchema } from '@karmaniverous/jeeves-watcher-core';
|
|
13
|
+
import { normalizeWatchPaths, extractWatchPathStrings, vcsAuthorConfigSchema, inferenceRuleSchema, jeevesWatcherConfigSchema } from '@karmaniverous/jeeves-watcher-core';
|
|
14
14
|
import { execFile } from 'node:child_process';
|
|
15
15
|
import { promisify } from 'node:util';
|
|
16
16
|
import { homedir } from 'node:os';
|
|
@@ -3052,6 +3052,22 @@ async function initRepo(rootPath) {
|
|
|
3052
3052
|
await execFileAsync('git', ['init'], { cwd: rootPath });
|
|
3053
3053
|
}
|
|
3054
3054
|
}
|
|
3055
|
+
/**
|
|
3056
|
+
* Configure local git identity for a repository.
|
|
3057
|
+
* Sets repo-level (not global) user.name and user.email.
|
|
3058
|
+
*
|
|
3059
|
+
* @param rootPath - Directory of the git repository.
|
|
3060
|
+
* @param name - Author name for commits.
|
|
3061
|
+
* @param email - Author email for commits.
|
|
3062
|
+
*/
|
|
3063
|
+
async function configureRepoIdentity(rootPath, name, email) {
|
|
3064
|
+
await execFileAsync('git', ['config', '--local', 'user.name', name], {
|
|
3065
|
+
cwd: rootPath,
|
|
3066
|
+
});
|
|
3067
|
+
await execFileAsync('git', ['config', '--local', 'user.email', email], {
|
|
3068
|
+
cwd: rootPath,
|
|
3069
|
+
});
|
|
3070
|
+
}
|
|
3055
3071
|
/**
|
|
3056
3072
|
* Ensure a .gitignore file exists at rootPath with all always-on entries.
|
|
3057
3073
|
* Creates the file if missing. Appends only entries not already present.
|
|
@@ -3266,7 +3282,15 @@ async function initVcs(config, logger) {
|
|
|
3266
3282
|
initializedRoots.add(root);
|
|
3267
3283
|
await initRepo(root);
|
|
3268
3284
|
await ensureGitignore(root);
|
|
3285
|
+
// Resolve author identity: per-path → root-level → schema defaults.
|
|
3286
|
+
const defaults = vcsAuthorConfigSchema.parse({});
|
|
3287
|
+
const pathAuthor = entry.vcs?.author;
|
|
3288
|
+
const rootAuthor = config.vcs.author;
|
|
3289
|
+
const authorName = pathAuthor?.name ?? rootAuthor?.name ?? defaults.name;
|
|
3290
|
+
const authorEmail = pathAuthor?.email ?? rootAuthor?.email ?? defaults.email;
|
|
3291
|
+
await configureRepoIdentity(root, authorName, authorEmail);
|
|
3269
3292
|
logger.info({ root }, 'VCS initialized for watch root');
|
|
3293
|
+
logger.debug({ root, authorName, authorEmail }, 'VCS author identity configured');
|
|
3270
3294
|
}
|
|
3271
3295
|
return true;
|
|
3272
3296
|
}
|
|
@@ -224,7 +224,7 @@ async function startFromConfig(configPath, descriptor) {
|
|
|
224
224
|
const config = await loadConfig(resolvedPath);
|
|
225
225
|
// Dynamic import breaks the circular dependency between this module
|
|
226
226
|
// and app/index.ts (which defines JeevesWatcher and re-exports startFromConfig).
|
|
227
|
-
const { JeevesWatcher } = await import('./index-
|
|
227
|
+
const { JeevesWatcher } = await import('./index-CaibsSrT.js');
|
|
228
228
|
const app = new JeevesWatcher(config, resolvedPath, descriptor);
|
|
229
229
|
installShutdownHandlers(() => app.stop());
|
|
230
230
|
await app.start();
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { join, dirname, resolve, relative, extname, basename, isAbsolute, sep } from 'node:path';
|
|
2
2
|
import { createConfigQueryHandler as createConfigQueryHandler$1, createStatusHandler, createConfigApplyHandler, substituteEnvVars, DEFAULT_PORTS, getBindAddress, postJson, fetchJson, getPackageVersion } from '@karmaniverous/jeeves';
|
|
3
|
-
import { extractWatchPathStrings, inferenceRuleSchema, jeevesWatcherConfigSchema, normalizeWatchPaths, LOGGING_DEFAULTS, API_DEFAULTS, EMBEDDING_DEFAULTS, CONFIG_WATCH_DEFAULTS, WATCH_DEFAULTS, ROOT_DEFAULTS, INIT_CONFIG_TEMPLATE, DEFAULT_PORT as DEFAULT_PORT$1, PLUGIN_PACKAGE, SERVICE_PACKAGE, COMPONENT_NAME } from '@karmaniverous/jeeves-watcher-core';
|
|
3
|
+
import { extractWatchPathStrings, inferenceRuleSchema, jeevesWatcherConfigSchema, normalizeWatchPaths, vcsAuthorConfigSchema, LOGGING_DEFAULTS, API_DEFAULTS, EMBEDDING_DEFAULTS, CONFIG_WATCH_DEFAULTS, WATCH_DEFAULTS, ROOT_DEFAULTS, INIT_CONFIG_TEMPLATE, DEFAULT_PORT as DEFAULT_PORT$1, PLUGIN_PACKAGE, SERVICE_PACKAGE, COMPONENT_NAME } from '@karmaniverous/jeeves-watcher-core';
|
|
4
4
|
export { apiConfigSchema, configWatchConfigSchema, embeddingConfigSchema, inferenceRuleSchema, jeevesWatcherConfigSchema, loggingConfigSchema, vectorStoreConfigSchema, watchConfigSchema } from '@karmaniverous/jeeves-watcher-core';
|
|
5
5
|
import Fastify from 'fastify';
|
|
6
6
|
import { readdir, stat, readFile, writeFile, mkdir, appendFile, access, rm } from 'node:fs/promises';
|
|
@@ -4642,6 +4642,22 @@ async function initRepo(rootPath) {
|
|
|
4642
4642
|
await execFileAsync('git', ['init'], { cwd: rootPath });
|
|
4643
4643
|
}
|
|
4644
4644
|
}
|
|
4645
|
+
/**
|
|
4646
|
+
* Configure local git identity for a repository.
|
|
4647
|
+
* Sets repo-level (not global) user.name and user.email.
|
|
4648
|
+
*
|
|
4649
|
+
* @param rootPath - Directory of the git repository.
|
|
4650
|
+
* @param name - Author name for commits.
|
|
4651
|
+
* @param email - Author email for commits.
|
|
4652
|
+
*/
|
|
4653
|
+
async function configureRepoIdentity(rootPath, name, email) {
|
|
4654
|
+
await execFileAsync('git', ['config', '--local', 'user.name', name], {
|
|
4655
|
+
cwd: rootPath,
|
|
4656
|
+
});
|
|
4657
|
+
await execFileAsync('git', ['config', '--local', 'user.email', email], {
|
|
4658
|
+
cwd: rootPath,
|
|
4659
|
+
});
|
|
4660
|
+
}
|
|
4645
4661
|
/**
|
|
4646
4662
|
* Ensure a .gitignore file exists at rootPath with all always-on entries.
|
|
4647
4663
|
* Creates the file if missing. Appends only entries not already present.
|
|
@@ -5402,7 +5418,15 @@ async function initVcs(config, logger) {
|
|
|
5402
5418
|
initializedRoots.add(root);
|
|
5403
5419
|
await initRepo(root);
|
|
5404
5420
|
await ensureGitignore(root);
|
|
5421
|
+
// Resolve author identity: per-path → root-level → schema defaults.
|
|
5422
|
+
const defaults = vcsAuthorConfigSchema.parse({});
|
|
5423
|
+
const pathAuthor = entry.vcs?.author;
|
|
5424
|
+
const rootAuthor = config.vcs.author;
|
|
5425
|
+
const authorName = pathAuthor?.name ?? rootAuthor?.name ?? defaults.name;
|
|
5426
|
+
const authorEmail = pathAuthor?.email ?? rootAuthor?.email ?? defaults.email;
|
|
5427
|
+
await configureRepoIdentity(root, authorName, authorEmail);
|
|
5405
5428
|
logger.info({ root }, 'VCS initialized for watch root');
|
|
5429
|
+
logger.debug({ root, authorName, authorEmail }, 'VCS author identity configured');
|
|
5406
5430
|
}
|
|
5407
5431
|
return true;
|
|
5408
5432
|
}
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@commander-js/extra-typings": "^14.0.0",
|
|
11
11
|
"@karmaniverous/jeeves": "^0.5.12",
|
|
12
|
-
"@karmaniverous/jeeves-watcher-core": "^0.2.
|
|
12
|
+
"@karmaniverous/jeeves-watcher-core": "^0.2.2",
|
|
13
13
|
"@karmaniverous/jsonmap": "^2.1.1",
|
|
14
14
|
"@langchain/textsplitters": "*",
|
|
15
15
|
"@qdrant/js-client-rest": "*",
|
|
@@ -149,5 +149,5 @@
|
|
|
149
149
|
},
|
|
150
150
|
"type": "module",
|
|
151
151
|
"types": "dist/index.d.ts",
|
|
152
|
-
"version": "0.18.
|
|
152
|
+
"version": "0.18.5"
|
|
153
153
|
}
|