@atolis-hq/wake 0.2.2 → 0.2.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.
@@ -4,7 +4,10 @@ import { createDefaultWakeConfig } from '../config/defaults.js';
4
4
  import { splitWakeConfig } from '../config/split-config.js';
5
5
  import { writeYamlFile } from '../lib/yaml-file.js';
6
6
  import { createWakePaths } from '../lib/paths.js';
7
- const promptFileNames = ['refine.md', 'implement.md'];
7
+ async function listPromptFileNames(repoRoot) {
8
+ const entries = await readdir(join(repoRoot, 'prompts'));
9
+ return entries.filter((name) => name.endsWith('.md')).sort();
10
+ }
8
11
  function sanitizeContainerName(name) {
9
12
  const sanitized = name
10
13
  .toLowerCase()
@@ -87,6 +90,7 @@ export async function scaffoldWakeHome(input) {
87
90
  ];
88
91
  await Promise.all(runtimeDirectories.map((directoryPath) => mkdir(directoryPath, { recursive: true })));
89
92
  const { infra, workflow } = splitWakeConfig(config);
93
+ const promptFileNames = await listPromptFileNames(repoRoot);
90
94
  await Promise.all([
91
95
  copyAssets(repoRoot, 'prompts', join(wakeRoot, 'prompts'), promptFileNames),
92
96
  writeYamlFile(join(wakeRoot, 'config.yaml'), infra),
@@ -5,7 +5,6 @@ export function createDefaultWakeConfig(wakeRoot = resolve(process.cwd(), '.wake
5
5
  return parseWakeConfig({
6
6
  paths: {
7
7
  wakeRoot,
8
- promptsRoot: resolve(wakeRoot, 'prompts'),
9
8
  },
10
9
  });
11
10
  }
@@ -1,5 +1,6 @@
1
1
  import { resolve, join } from 'node:path';
2
2
  import { access } from 'node:fs/promises';
3
+ import { existsSync } from 'node:fs';
3
4
  import { readJsonFile } from '../lib/json-file.js';
4
5
  import { readYamlFile } from '../lib/yaml-file.js';
5
6
  import { deepMergeRaw } from '../lib/deep-merge.js';
@@ -44,13 +45,24 @@ export async function loadWakeConfig(options) {
44
45
  }
45
46
  // wakeRoot is always the live invocation's --wake-root/cwd, never a value
46
47
  // to accept from a (possibly stale, possibly container-context) config
47
- // file — spread rawPaths first so wakeRoot always wins. promptsRoot and
48
- // any other paths key stay file-overridable.
48
+ // file — spread rawPaths first so wakeRoot always wins. promptsRoot stays
49
+ // file-overridable for a genuine custom location, but when the file is
50
+ // silent on it we default to the live wakeRoot's own prompts/ dir (the
51
+ // usual colocated layout `wake init` scaffolds) rather than leaving it to
52
+ // fall back to bundled prompts — this keeps a scaffolded home's prompt
53
+ // customizations in effect across host/container re-reads of the same
54
+ // config file, where an absolute promptsRoot baked in at init time would
55
+ // not resolve the same way.
49
56
  const rawPaths = raw.paths ?? {};
57
+ const wakeRootPromptsDir = join(wakeRoot, 'prompts');
58
+ const promptsRootDefault = rawPaths.promptsRoot === undefined && existsSync(wakeRootPromptsDir)
59
+ ? { promptsRoot: wakeRootPromptsDir }
60
+ : {};
50
61
  return parseWakeConfig({
51
62
  ...raw,
52
63
  paths: {
53
64
  ...rawPaths,
65
+ ...promptsRootDefault,
54
66
  wakeRoot,
55
67
  },
56
68
  });
@@ -1 +1 @@
1
- export const wakeVersion = "0.2.2+g83e9f9a";
1
+ export const wakeVersion = "0.2.3+gfb2197d";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atolis-hq/wake",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Local autonomous agent control plane for software development",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {