@karmaniverous/jeeves-meta 0.13.1 → 0.13.3

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.
@@ -12,15 +12,15 @@ import require$$2 from 'events';
12
12
  import vm from 'vm';
13
13
  import { z } from 'zod';
14
14
  import * as commander from 'commander';
15
- import { homedir, tmpdir } from 'node:os';
16
15
  import { execSync } from 'node:child_process';
16
+ import { homedir, tmpdir } from 'node:os';
17
17
  import { fileURLToPath } from 'node:url';
18
18
  import { readFile, unlink, mkdir, writeFile, copyFile } from 'node:fs/promises';
19
19
  import pino from 'pino';
20
20
  import Handlebars from 'handlebars';
21
+ import process$1 from 'node:process';
21
22
  import { Cron } from 'croner';
22
23
  import Fastify from 'fastify';
23
- import process$1 from 'node:process';
24
24
 
25
25
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
26
26
 
@@ -7651,35 +7651,6 @@ const jeevesComponentDescriptorSchema = z.object({
7651
7651
  function getEffectiveServiceName(descriptor) {
7652
7652
  return descriptor.serviceName ?? `jeeves-${descriptor.name}`;
7653
7653
  }
7654
- /**
7655
- * Fetch JSON from a URL, throwing on non-OK responses.
7656
- *
7657
- * @param url - URL to fetch.
7658
- * @param init - Optional `fetch` init options.
7659
- * @returns Parsed JSON response body.
7660
- * @throws Error with `HTTP {status}: {body}` message on non-OK responses.
7661
- */
7662
- async function fetchJson(url, init) {
7663
- const res = await fetch(url, init);
7664
- if (!res.ok) {
7665
- throw new Error('HTTP ' + String(res.status) + ': ' + (await res.text()));
7666
- }
7667
- return res.json();
7668
- }
7669
- /**
7670
- * POST JSON to a URL and return parsed response.
7671
- *
7672
- * @param url - URL to POST to.
7673
- * @param body - Request body (will be JSON-stringified).
7674
- * @returns Parsed JSON response body.
7675
- */
7676
- async function postJson(url, body) {
7677
- return fetchJson(url, {
7678
- method: 'POST',
7679
- headers: { 'Content-Type': 'application/json' },
7680
- body: JSON.stringify(body),
7681
- });
7682
- }
7683
7654
 
7684
7655
  /**
7685
7656
  * Platform-aware service state detection.
@@ -8055,6 +8026,35 @@ function createServiceManager(descriptor) {
8055
8026
  return createLinuxManager(descriptor);
8056
8027
  }
8057
8028
  }
8029
+ /**
8030
+ * Fetch JSON from a URL, throwing on non-OK responses.
8031
+ *
8032
+ * @param url - URL to fetch.
8033
+ * @param init - Optional `fetch` init options.
8034
+ * @returns Parsed JSON response body.
8035
+ * @throws Error with `HTTP {status}: {body}` message on non-OK responses.
8036
+ */
8037
+ async function fetchJson(url, init) {
8038
+ const res = await fetch(url, init);
8039
+ if (!res.ok) {
8040
+ throw new Error('HTTP ' + String(res.status) + ': ' + (await res.text()));
8041
+ }
8042
+ return res.json();
8043
+ }
8044
+ /**
8045
+ * POST JSON to a URL and return parsed response.
8046
+ *
8047
+ * @param url - URL to POST to.
8048
+ * @param body - Request body (will be JSON-stringified).
8049
+ * @returns Parsed JSON response body.
8050
+ */
8051
+ async function postJson(url, body) {
8052
+ return fetchJson(url, {
8053
+ method: 'POST',
8054
+ headers: { 'Content-Type': 'application/json' },
8055
+ body: JSON.stringify(body),
8056
+ });
8057
+ }
8058
8058
 
8059
8059
  /**
8060
8060
  * Factory for the standard Jeeves service CLI.
@@ -9590,7 +9590,10 @@ function createLogger(config) {
9590
9590
  *
9591
9591
  * @module prompts
9592
9592
  */
9593
- const promptDir = dirname(fileURLToPath(import.meta.url));
9593
+ const packageRoot = packageDirectorySync({
9594
+ cwd: fileURLToPath(import.meta.url),
9595
+ });
9596
+ const promptDir = join(packageRoot, 'dist', 'prompts');
9594
9597
  /** Built-in default architect prompt. */
9595
9598
  const DEFAULT_ARCHITECT_PROMPT = readFileSync(join(promptDir, 'architect.md'), 'utf8');
9596
9599
  /** Built-in default critic prompt. */
package/dist/index.js CHANGED
@@ -14,8 +14,8 @@ import require$$2 from 'events';
14
14
  import vm from 'vm';
15
15
  import { z } from 'zod';
16
16
  import * as commander from 'commander';
17
- import { tmpdir } from 'node:os';
18
17
  import 'node:child_process';
18
+ import { tmpdir } from 'node:os';
19
19
  import pino from 'pino';
20
20
  import Handlebars from 'handlebars';
21
21
  import { Cron } from 'croner';
@@ -9309,7 +9309,10 @@ function createLogger(config) {
9309
9309
  *
9310
9310
  * @module prompts
9311
9311
  */
9312
- const promptDir = dirname(fileURLToPath(import.meta.url));
9312
+ const packageRoot = packageDirectorySync({
9313
+ cwd: fileURLToPath(import.meta.url),
9314
+ });
9315
+ const promptDir = join(packageRoot, 'dist', 'prompts');
9313
9316
  /** Built-in default architect prompt. */
9314
9317
  const DEFAULT_ARCHITECT_PROMPT = readFileSync(join(promptDir, 'architect.md'), 'utf8');
9315
9318
  /** Built-in default critic prompt. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@karmaniverous/jeeves-meta",
3
- "version": "0.13.1",
3
+ "version": "0.13.3",
4
4
  "author": "Jason Williscroft",
5
5
  "description": "Fastify HTTP service for the Jeeves Meta synthesis engine",
6
6
  "license": "BSD-3-Clause",
@@ -41,7 +41,7 @@
41
41
  "node": ">=22"
42
42
  },
43
43
  "dependencies": {
44
- "@karmaniverous/jeeves": "^0.5.3",
44
+ "@karmaniverous/jeeves": "^0.5.4",
45
45
  "commander": "^14",
46
46
  "croner": "^10",
47
47
  "fastify": "^5.8",