@karmaniverous/jeeves-watcher 0.6.7 → 0.6.9
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.
- package/dist/cli/jeeves-watcher/index.js +13 -5
- package/dist/index.js +8 -3
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
2
3
|
import { Command } from '@commander-js/extra-typings';
|
|
3
4
|
import { readdir, stat, writeFile, rm, readFile, mkdir } from 'node:fs/promises';
|
|
4
5
|
import { resolve, dirname, join, extname, basename, relative } from 'node:path';
|
|
@@ -1992,11 +1993,16 @@ function mergeAndValidateConfig(currentConfig, submittedPartial) {
|
|
|
1992
1993
|
function wrapHandler(fn, logger, label) {
|
|
1993
1994
|
return async (request, reply) => {
|
|
1994
1995
|
try {
|
|
1995
|
-
|
|
1996
|
+
const result = await fn(request, reply);
|
|
1997
|
+
if (!reply.sent) {
|
|
1998
|
+
void reply.send(result);
|
|
1999
|
+
}
|
|
1996
2000
|
}
|
|
1997
2001
|
catch (error) {
|
|
1998
2002
|
logger.error({ err: normalizeError(error) }, `${label} failed`);
|
|
1999
|
-
|
|
2003
|
+
if (!reply.sent) {
|
|
2004
|
+
void reply.status(500).send({ error: 'Internal server error' });
|
|
2005
|
+
}
|
|
2000
2006
|
}
|
|
2001
2007
|
};
|
|
2002
2008
|
}
|
|
@@ -3097,7 +3103,7 @@ const CONFIG_WATCH_DEFAULTS = {
|
|
|
3097
3103
|
/** Default API values. */
|
|
3098
3104
|
const API_DEFAULTS = {
|
|
3099
3105
|
host: '127.0.0.1',
|
|
3100
|
-
port:
|
|
3106
|
+
port: 1936,
|
|
3101
3107
|
};
|
|
3102
3108
|
/** Default logging values. */
|
|
3103
3109
|
const LOGGING_DEFAULTS = {
|
|
@@ -5683,7 +5689,7 @@ async function runApiCommand(options) {
|
|
|
5683
5689
|
/** Default API host for CLI commands. */
|
|
5684
5690
|
const DEFAULT_HOST = '127.0.0.1';
|
|
5685
5691
|
/** Default API port for CLI commands. */
|
|
5686
|
-
const DEFAULT_PORT = '
|
|
5692
|
+
const DEFAULT_PORT = '1936';
|
|
5687
5693
|
|
|
5688
5694
|
/**
|
|
5689
5695
|
* @module cli/jeeves-watcher/withApiOptions
|
|
@@ -6071,10 +6077,12 @@ async function writeJsonFile(path, data) {
|
|
|
6071
6077
|
*
|
|
6072
6078
|
* jeeves-watcher CLI entrypoint.
|
|
6073
6079
|
*/
|
|
6080
|
+
const require$1 = createRequire(import.meta.url);
|
|
6081
|
+
const { version } = require$1('../../../package.json');
|
|
6074
6082
|
const cli = new Command()
|
|
6075
6083
|
.name('jeeves-watcher')
|
|
6076
6084
|
.description('Filesystem watcher that keeps a Qdrant vector store in sync with document changes')
|
|
6077
|
-
.version(
|
|
6085
|
+
.version(version);
|
|
6078
6086
|
cli
|
|
6079
6087
|
.command('start')
|
|
6080
6088
|
.description('Start the filesystem watcher')
|
package/dist/index.js
CHANGED
|
@@ -1684,11 +1684,16 @@ function mergeAndValidateConfig(currentConfig, submittedPartial) {
|
|
|
1684
1684
|
function wrapHandler(fn, logger, label) {
|
|
1685
1685
|
return async (request, reply) => {
|
|
1686
1686
|
try {
|
|
1687
|
-
|
|
1687
|
+
const result = await fn(request, reply);
|
|
1688
|
+
if (!reply.sent) {
|
|
1689
|
+
void reply.send(result);
|
|
1690
|
+
}
|
|
1688
1691
|
}
|
|
1689
1692
|
catch (error) {
|
|
1690
1693
|
logger.error({ err: normalizeError(error) }, `${label} failed`);
|
|
1691
|
-
|
|
1694
|
+
if (!reply.sent) {
|
|
1695
|
+
void reply.status(500).send({ error: 'Internal server error' });
|
|
1696
|
+
}
|
|
1692
1697
|
}
|
|
1693
1698
|
};
|
|
1694
1699
|
}
|
|
@@ -3095,7 +3100,7 @@ const CONFIG_WATCH_DEFAULTS = {
|
|
|
3095
3100
|
/** Default API values. */
|
|
3096
3101
|
const API_DEFAULTS = {
|
|
3097
3102
|
host: '127.0.0.1',
|
|
3098
|
-
port:
|
|
3103
|
+
port: 1936,
|
|
3099
3104
|
};
|
|
3100
3105
|
/** Default logging values. */
|
|
3101
3106
|
const LOGGING_DEFAULTS = {
|
package/package.json
CHANGED