@a5c-ai/babysitter-sdk 0.0.186 → 0.0.187-staging.02a0ee21
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/commands/costStats.d.ts +13 -0
- package/dist/cli/commands/costStats.d.ts.map +1 -0
- package/dist/cli/commands/costStats.js +319 -0
- package/dist/cli/commands/harnessPhase2.js +10 -10
- package/dist/cli/commands/instructions.d.ts.map +1 -1
- package/dist/cli/commands/instructions.js +5 -3
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +16 -1
- package/dist/config/defaults.d.ts +10 -0
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +19 -0
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +2 -1
- package/dist/cost/claudeCodeParser.d.ts +81 -0
- package/dist/cost/claudeCodeParser.d.ts.map +1 -0
- package/dist/cost/claudeCodeParser.js +232 -0
- package/dist/cost/collector.d.ts +42 -0
- package/dist/cost/collector.d.ts.map +1 -0
- package/dist/cost/collector.js +105 -0
- package/dist/cost/index.d.ts +18 -0
- package/dist/cost/index.d.ts.map +1 -0
- package/dist/cost/index.js +37 -0
- package/dist/cost/journal.d.ts +40 -0
- package/dist/cost/journal.d.ts.map +1 -0
- package/dist/cost/journal.js +137 -0
- package/dist/cost/types.d.ts +164 -0
- package/dist/cost/types.d.ts.map +1 -0
- package/dist/cost/types.js +231 -0
- package/dist/harness/claudeCode.js +1 -1
- package/dist/harness/cursor.js +1 -1
- package/dist/harness/discovery.d.ts.map +1 -1
- package/dist/harness/discovery.js +8 -1
- package/dist/harness/geminiCli.js +1 -1
- package/dist/harness/githubCopilot.js +1 -1
- package/dist/harness/index.d.ts +1 -0
- package/dist/harness/index.d.ts.map +1 -1
- package/dist/harness/index.js +3 -1
- package/dist/harness/invoker.d.ts.map +1 -1
- package/dist/harness/invoker.js +1 -0
- package/dist/harness/openclaw.d.ts +20 -0
- package/dist/harness/openclaw.d.ts.map +1 -0
- package/dist/harness/openclaw.js +338 -0
- package/dist/harness/opencode.d.ts.map +1 -1
- package/dist/harness/opencode.js +75 -5
- package/dist/harness/registry.d.ts.map +1 -1
- package/dist/harness/registry.js +2 -0
- package/dist/hooks/dispatcher.d.ts +9 -0
- package/dist/hooks/dispatcher.d.ts.map +1 -1
- package/dist/hooks/dispatcher.js +94 -0
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/logging/runLogger.js +2 -2
- package/dist/prompts/babysitterMdDiscovery.d.ts +38 -0
- package/dist/prompts/babysitterMdDiscovery.d.ts.map +1 -0
- package/dist/prompts/babysitterMdDiscovery.js +150 -0
- package/dist/prompts/compose.d.ts.map +1 -1
- package/dist/prompts/compose.js +5 -0
- package/dist/prompts/context.d.ts +4 -0
- package/dist/prompts/context.d.ts.map +1 -1
- package/dist/prompts/context.js +37 -0
- package/dist/prompts/index.d.ts +1 -1
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +2 -1
- package/dist/prompts/parts/index.d.ts +3 -0
- package/dist/prompts/parts/index.d.ts.map +1 -1
- package/dist/prompts/parts/index.js +7 -1
- package/dist/prompts/parts/parallelPhaseDetection.d.ts +6 -0
- package/dist/prompts/parts/parallelPhaseDetection.d.ts.map +1 -0
- package/dist/prompts/parts/parallelPhaseDetection.js +10 -0
- package/dist/prompts/parts/projectInstructions.d.ts +8 -0
- package/dist/prompts/parts/projectInstructions.d.ts.map +1 -0
- package/dist/prompts/parts/projectInstructions.js +28 -0
- package/dist/prompts/parts/runOverlapDetection.d.ts +6 -0
- package/dist/prompts/parts/runOverlapDetection.d.ts.map +1 -0
- package/dist/prompts/parts/runOverlapDetection.js +10 -0
- package/dist/prompts/templates/commands/doctor.md +9 -9
- package/dist/prompts/templates/intent-fidelity-checks.md +3 -1
- package/dist/prompts/templates/parallel-phase-detection.md +59 -0
- package/dist/prompts/templates/process-creation.md +9 -2
- package/dist/prompts/templates/process-guidelines.md +5 -2
- package/dist/prompts/templates/run-overlap-detection.md +63 -0
- package/dist/prompts/templates/task-examples.md +47 -0
- package/dist/prompts/templates/task-kinds.md +44 -2
- package/dist/runtime/intrinsics/breakpoint.d.ts.map +1 -1
- package/dist/runtime/intrinsics/breakpoint.js +20 -1
- package/dist/runtime/orchestrateIteration.d.ts.map +1 -1
- package/dist/runtime/orchestrateIteration.js +14 -0
- package/dist/session/types.d.ts +2 -0
- package/dist/session/types.d.ts.map +1 -1
- package/dist/storage/createRunDir.d.ts.map +1 -1
- package/dist/storage/createRunDir.js +2 -0
- package/dist/storage/icloudWarning.d.ts +6 -0
- package/dist/storage/icloudWarning.d.ts.map +1 -0
- package/dist/storage/icloudWarning.js +84 -0
- package/dist/storage/journal.d.ts.map +1 -1
- package/dist/storage/journal.js +2 -0
- package/package.json +1 -1
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -52,4 +52,5 @@ __exportStar(require("./plugins"), exports);
|
|
|
52
52
|
__exportStar(require("./interaction"), exports);
|
|
53
53
|
__exportStar(require("./prompts"), exports);
|
|
54
54
|
__exportStar(require("./logging"), exports);
|
|
55
|
+
__exportStar(require("./cost/index"), exports);
|
|
55
56
|
exports.anycli = __importStar(require("./anycli/index"));
|
|
@@ -57,13 +57,13 @@ exports.appendRunLog = appendRunLog;
|
|
|
57
57
|
exports.createRunLogger = createRunLogger;
|
|
58
58
|
const node_fs_1 = require("node:fs");
|
|
59
59
|
const path = __importStar(require("node:path"));
|
|
60
|
-
const
|
|
60
|
+
const config_1 = require("../config");
|
|
61
61
|
// ---------------------------------------------------------------------------
|
|
62
62
|
// Paths
|
|
63
63
|
// ---------------------------------------------------------------------------
|
|
64
64
|
const LOG_DIR_ENV = "BABYSITTER_LOG_DIR";
|
|
65
65
|
function getDefaultLogDir() {
|
|
66
|
-
return process.env[LOG_DIR_ENV] ||
|
|
66
|
+
return process.env[LOG_DIR_ENV] || (0, config_1.getGlobalLogDir)();
|
|
67
67
|
}
|
|
68
68
|
/** Log file names by type. */
|
|
69
69
|
const LOG_FILE_NAMES = {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Discovery of BABYSITTER.md files from a starting directory up to the git repo root.
|
|
3
|
+
*
|
|
4
|
+
* Walks the directory hierarchy upward, collecting BABYSITTER.md files (case-insensitive)
|
|
5
|
+
* at each level, and returns them sorted from repo root to leaf.
|
|
6
|
+
*
|
|
7
|
+
* @module prompts/babysitterMdDiscovery
|
|
8
|
+
*/
|
|
9
|
+
/** A discovered BABYSITTER.md file with its content and location metadata. */
|
|
10
|
+
export interface BabysitterMdFile {
|
|
11
|
+
/** Absolute file path */
|
|
12
|
+
filePath: string;
|
|
13
|
+
/** Content of the file */
|
|
14
|
+
content: string;
|
|
15
|
+
/** Path relative to the repo root (forward-slash separated) */
|
|
16
|
+
relativePath: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Finds the git repository root by walking upward from `startDir` looking for
|
|
20
|
+
* a `.git` directory or file.
|
|
21
|
+
*
|
|
22
|
+
* @param startDir - The directory to start searching from.
|
|
23
|
+
* @returns The absolute path to the repo root, or `undefined` if not inside a git repo.
|
|
24
|
+
*/
|
|
25
|
+
export declare function findGitRoot(startDir: string): string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Discovers BABYSITTER.md files from `startDir` upward to the git repo root.
|
|
28
|
+
*
|
|
29
|
+
* At each directory level the function reads directory entries and performs a
|
|
30
|
+
* case-insensitive match against "babysitter.md". Results are returned sorted
|
|
31
|
+
* from repo root to leaf (outermost first).
|
|
32
|
+
*
|
|
33
|
+
* @param startDir - The directory to start searching from. Defaults to `process.cwd()`.
|
|
34
|
+
* @returns An array of discovered files sorted root-to-leaf, or an empty array
|
|
35
|
+
* if not inside a git repo or no files are found.
|
|
36
|
+
*/
|
|
37
|
+
export declare function discoverBabysitterMdFiles(startDir?: string): BabysitterMdFile[];
|
|
38
|
+
//# sourceMappingURL=babysitterMdDiscovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"babysitterMdDiscovery.d.ts","sourceRoot":"","sources":["../../src/prompts/babysitterMdDiscovery.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,8EAA8E;AAC9E,MAAM,WAAW,gBAAgB;IAC/B,yBAAyB;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,0BAA0B;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,+DAA+D;IAC/D,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAsBhE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,gBAAgB,EAAE,CA2C/E"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Discovery of BABYSITTER.md files from a starting directory up to the git repo root.
|
|
4
|
+
*
|
|
5
|
+
* Walks the directory hierarchy upward, collecting BABYSITTER.md files (case-insensitive)
|
|
6
|
+
* at each level, and returns them sorted from repo root to leaf.
|
|
7
|
+
*
|
|
8
|
+
* @module prompts/babysitterMdDiscovery
|
|
9
|
+
*/
|
|
10
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
13
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc);
|
|
17
|
+
}) : (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
o[k2] = m[k];
|
|
20
|
+
}));
|
|
21
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
22
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
23
|
+
}) : function(o, v) {
|
|
24
|
+
o["default"] = v;
|
|
25
|
+
});
|
|
26
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
27
|
+
var ownKeys = function(o) {
|
|
28
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
29
|
+
var ar = [];
|
|
30
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
31
|
+
return ar;
|
|
32
|
+
};
|
|
33
|
+
return ownKeys(o);
|
|
34
|
+
};
|
|
35
|
+
return function (mod) {
|
|
36
|
+
if (mod && mod.__esModule) return mod;
|
|
37
|
+
var result = {};
|
|
38
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
39
|
+
__setModuleDefault(result, mod);
|
|
40
|
+
return result;
|
|
41
|
+
};
|
|
42
|
+
})();
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
exports.findGitRoot = findGitRoot;
|
|
45
|
+
exports.discoverBabysitterMdFiles = discoverBabysitterMdFiles;
|
|
46
|
+
const fs = __importStar(require("fs"));
|
|
47
|
+
const path = __importStar(require("path"));
|
|
48
|
+
/**
|
|
49
|
+
* Finds the git repository root by walking upward from `startDir` looking for
|
|
50
|
+
* a `.git` directory or file.
|
|
51
|
+
*
|
|
52
|
+
* @param startDir - The directory to start searching from.
|
|
53
|
+
* @returns The absolute path to the repo root, or `undefined` if not inside a git repo.
|
|
54
|
+
*/
|
|
55
|
+
function findGitRoot(startDir) {
|
|
56
|
+
let current = path.resolve(startDir);
|
|
57
|
+
// eslint-disable-next-line no-constant-condition
|
|
58
|
+
while (true) {
|
|
59
|
+
try {
|
|
60
|
+
const gitPath = path.join(current, ".git");
|
|
61
|
+
const stat = fs.statSync(gitPath);
|
|
62
|
+
// .git can be a directory (normal repo) or a file (worktree/submodule)
|
|
63
|
+
if (stat.isDirectory() || stat.isFile()) {
|
|
64
|
+
return current;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
// .git not found at this level — keep walking up
|
|
69
|
+
}
|
|
70
|
+
const parent = path.dirname(current);
|
|
71
|
+
if (parent === current) {
|
|
72
|
+
// Reached filesystem root without finding .git
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
current = parent;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Discovers BABYSITTER.md files from `startDir` upward to the git repo root.
|
|
80
|
+
*
|
|
81
|
+
* At each directory level the function reads directory entries and performs a
|
|
82
|
+
* case-insensitive match against "babysitter.md". Results are returned sorted
|
|
83
|
+
* from repo root to leaf (outermost first).
|
|
84
|
+
*
|
|
85
|
+
* @param startDir - The directory to start searching from. Defaults to `process.cwd()`.
|
|
86
|
+
* @returns An array of discovered files sorted root-to-leaf, or an empty array
|
|
87
|
+
* if not inside a git repo or no files are found.
|
|
88
|
+
*/
|
|
89
|
+
function discoverBabysitterMdFiles(startDir) {
|
|
90
|
+
const resolvedStart = path.resolve(startDir ?? process.cwd());
|
|
91
|
+
const repoRoot = findGitRoot(resolvedStart);
|
|
92
|
+
if (repoRoot === undefined) {
|
|
93
|
+
return [];
|
|
94
|
+
}
|
|
95
|
+
const found = [];
|
|
96
|
+
let current = path.resolve(resolvedStart);
|
|
97
|
+
// eslint-disable-next-line no-constant-condition
|
|
98
|
+
while (true) {
|
|
99
|
+
const match = findBabysitterMdInDir(current);
|
|
100
|
+
if (match !== undefined) {
|
|
101
|
+
const rel = path.relative(repoRoot, match);
|
|
102
|
+
// Normalize to forward slashes for cross-platform consistency
|
|
103
|
+
const relativePath = rel.split(path.sep).join("/");
|
|
104
|
+
try {
|
|
105
|
+
const content = fs.readFileSync(match, "utf-8");
|
|
106
|
+
found.push({ filePath: match, content, relativePath });
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
// File couldn't be read — skip it
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// Stop after processing the repo root
|
|
113
|
+
if (normalizePath(current) === normalizePath(repoRoot)) {
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
const parent = path.dirname(current);
|
|
117
|
+
if (parent === current) {
|
|
118
|
+
// Reached filesystem root without hitting repo root (shouldn't happen
|
|
119
|
+
// since we verified repoRoot is an ancestor, but guard anyway)
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
current = parent;
|
|
123
|
+
}
|
|
124
|
+
// Reverse so repo root comes first (we collected leaf-to-root)
|
|
125
|
+
found.reverse();
|
|
126
|
+
return found;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Looks for a BABYSITTER.md file (case-insensitive) in the given directory.
|
|
130
|
+
*
|
|
131
|
+
* @returns The absolute path to the matched file, or `undefined` if not found.
|
|
132
|
+
*/
|
|
133
|
+
function findBabysitterMdInDir(dir) {
|
|
134
|
+
try {
|
|
135
|
+
const entries = fs.readdirSync(dir);
|
|
136
|
+
for (const entry of entries) {
|
|
137
|
+
if (entry.toLowerCase() === "babysitter.md") {
|
|
138
|
+
return path.join(dir, entry);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
// Directory unreadable — skip
|
|
144
|
+
}
|
|
145
|
+
return undefined;
|
|
146
|
+
}
|
|
147
|
+
/** Normalizes a path for reliable comparison (resolves case, trailing separators). */
|
|
148
|
+
function normalizePath(p) {
|
|
149
|
+
return path.resolve(p).toLowerCase();
|
|
150
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../src/prompts/compose.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGxC;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../src/prompts/compose.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGxC;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CA4EpE;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAYrE;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAcrE;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAKlE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAEvD"}
|
package/dist/prompts/compose.js
CHANGED
|
@@ -101,6 +101,7 @@ function composeBabysitSkillPrompt(ctx) {
|
|
|
101
101
|
parts.renderUserProfile(ctx),
|
|
102
102
|
parts.renderProcessCreation(ctx),
|
|
103
103
|
parts.renderIntentFidelityChecks(ctx),
|
|
104
|
+
parts.renderRunOverlapDetection(ctx),
|
|
104
105
|
parts.renderRunCreation(ctx),
|
|
105
106
|
parts.renderIteration(ctx),
|
|
106
107
|
parts.renderEffects(ctx),
|
|
@@ -115,6 +116,7 @@ function composeBabysitSkillPrompt(ctx) {
|
|
|
115
116
|
parts.renderProcessGuidelines(ctx),
|
|
116
117
|
parts.renderCriticalRules(ctx),
|
|
117
118
|
parts.renderSeeAlso(ctx),
|
|
119
|
+
parts.renderProjectInstructions(ctx),
|
|
118
120
|
]);
|
|
119
121
|
}
|
|
120
122
|
/**
|
|
@@ -127,8 +129,10 @@ function composeProcessCreatePrompt(ctx) {
|
|
|
127
129
|
parts.renderProcessCreation(ctx),
|
|
128
130
|
parts.renderIntentFidelityChecks(ctx),
|
|
129
131
|
parts.renderProcessGuidelines(ctx),
|
|
132
|
+
parts.renderParallelPhaseDetection(ctx),
|
|
130
133
|
parts.renderTaskKinds(ctx),
|
|
131
134
|
parts.renderTaskExamples(ctx),
|
|
135
|
+
parts.renderProjectInstructions(ctx),
|
|
132
136
|
]);
|
|
133
137
|
}
|
|
134
138
|
/**
|
|
@@ -136,6 +140,7 @@ function composeProcessCreatePrompt(ctx) {
|
|
|
136
140
|
*/
|
|
137
141
|
function composeOrchestrationPrompt(ctx) {
|
|
138
142
|
return joinNonEmpty([
|
|
143
|
+
parts.renderRunOverlapDetection(ctx),
|
|
139
144
|
parts.renderRunCreation(ctx),
|
|
140
145
|
parts.renderIteration(ctx),
|
|
141
146
|
parts.renderEffects(ctx),
|
|
@@ -32,5 +32,9 @@ export declare function createOpenCodeContext(overrides?: Partial<PromptContext>
|
|
|
32
32
|
* Create a PromptContext pre-configured for PI.
|
|
33
33
|
*/
|
|
34
34
|
export declare function createPiContext(overrides?: Partial<PromptContext>): PromptContext;
|
|
35
|
+
/**
|
|
36
|
+
* Create a PromptContext pre-configured for OpenClaw.
|
|
37
|
+
*/
|
|
38
|
+
export declare function createOpenClawContext(overrides?: Partial<PromptContext>): PromptContext;
|
|
35
39
|
export declare function createOhMyPiContext(overrides?: Partial<PromptContext>): PromptContext;
|
|
36
40
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/prompts/context.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAUxC;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GACjC,aAAa,CA+Bf;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GACjC,aAAa,CAgCf;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GACjC,aAAa,CAiCf;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GACjC,aAAa,CAiCf;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GACjC,aAAa,CA+Bf;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GACjC,aAAa,CAkCf;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,SAAS,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GACjC,aAAa,CA+Bf;AAED,wBAAgB,mBAAmB,CACjC,SAAS,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GACjC,aAAa,CA+Bf"}
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/prompts/context.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAUxC;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GACjC,aAAa,CA+Bf;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GACjC,aAAa,CAgCf;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GACjC,aAAa,CAiCf;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GACjC,aAAa,CAiCf;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GACjC,aAAa,CA+Bf;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GACjC,aAAa,CAkCf;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,SAAS,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GACjC,aAAa,CA+Bf;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GACjC,aAAa,CAgCf;AAED,wBAAgB,mBAAmB,CACjC,SAAS,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GACjC,aAAa,CA+Bf"}
|
package/dist/prompts/context.js
CHANGED
|
@@ -12,6 +12,7 @@ exports.createCursorContext = createCursorContext;
|
|
|
12
12
|
exports.createGeminiCliContext = createGeminiCliContext;
|
|
13
13
|
exports.createOpenCodeContext = createOpenCodeContext;
|
|
14
14
|
exports.createPiContext = createPiContext;
|
|
15
|
+
exports.createOpenClawContext = createOpenClawContext;
|
|
15
16
|
exports.createOhMyPiContext = createOhMyPiContext;
|
|
16
17
|
const COMMON_DEFAULTS = {
|
|
17
18
|
interactive: true,
|
|
@@ -272,6 +273,42 @@ function createPiContext(overrides) {
|
|
|
272
273
|
...overrides,
|
|
273
274
|
};
|
|
274
275
|
}
|
|
276
|
+
/**
|
|
277
|
+
* Create a PromptContext pre-configured for OpenClaw.
|
|
278
|
+
*/
|
|
279
|
+
function createOpenClawContext(overrides) {
|
|
280
|
+
return {
|
|
281
|
+
...COMMON_DEFAULTS,
|
|
282
|
+
harness: 'openclaw',
|
|
283
|
+
harnessLabel: 'OpenClaw',
|
|
284
|
+
capabilities: ['session-binding', 'mcp', 'headless-prompt', 'task-tool', 'breakpoint-routing'],
|
|
285
|
+
pluginRootVar: '',
|
|
286
|
+
// Daemon model: no stop-hook. Agent lifecycle managed by agent_end signal.
|
|
287
|
+
loopControlTerm: 'agent_end',
|
|
288
|
+
sessionBindingFlags: '',
|
|
289
|
+
hookDriven: false,
|
|
290
|
+
interactiveToolName: 'AskUserQuestion tool',
|
|
291
|
+
sessionEnvVars: 'BABYSITTER_SESSION_ID, OPENCLAW_SHELL (auto-injected by gateway)',
|
|
292
|
+
resumeFlags: '',
|
|
293
|
+
cliSetupSnippet: [
|
|
294
|
+
'Use the installed CLI alias:',
|
|
295
|
+
'',
|
|
296
|
+
'```bash',
|
|
297
|
+
'CLI="babysitter"',
|
|
298
|
+
'```',
|
|
299
|
+
'',
|
|
300
|
+
'If it is not available on the path, use:',
|
|
301
|
+
'',
|
|
302
|
+
'```bash',
|
|
303
|
+
'CLI="npx -y @a5c-ai/babysitter-sdk"',
|
|
304
|
+
'```',
|
|
305
|
+
].join('\n'),
|
|
306
|
+
iterateFlags: '',
|
|
307
|
+
hasIntentFidelityChecks: false,
|
|
308
|
+
hasNonNegotiables: false,
|
|
309
|
+
...overrides,
|
|
310
|
+
};
|
|
311
|
+
}
|
|
275
312
|
function createOhMyPiContext(overrides) {
|
|
276
313
|
return {
|
|
277
314
|
...COMMON_DEFAULTS,
|
package/dist/prompts/index.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ export { createClaudeCodeContext, createCodexContext, createGeminiCliContext, cr
|
|
|
8
8
|
export { renderTemplate, renderTemplateString, resolveTemplatePath, } from './templateRenderer';
|
|
9
9
|
export { renderCommandTemplate, resolveCommandTemplatePath, } from './commandTemplates';
|
|
10
10
|
export { composeBabysitSkillPrompt, composeProcessCreatePrompt, composeOrchestrationPrompt, composeBreakpointPrompt, joinNonEmpty, } from './compose';
|
|
11
|
-
export { renderDependencies, renderInterview, renderUserProfile, renderProcessCreation, renderIntentFidelityChecks, renderRunCreation, renderIteration, renderEffects, renderBreakpointHandling, renderResultsPosting, renderLoopControl, renderCompletionProof, renderTaskKinds, renderTaskExamples, renderQuickReference, renderRecovery, renderProcessGuidelines, renderCriticalRules, renderSeeAlso, renderNonNegotiables, } from './parts';
|
|
11
|
+
export { renderDependencies, renderInterview, renderUserProfile, renderProcessCreation, renderIntentFidelityChecks, renderRunCreation, renderIteration, renderEffects, renderBreakpointHandling, renderResultsPosting, renderLoopControl, renderCompletionProof, renderTaskKinds, renderTaskExamples, renderQuickReference, renderRecovery, renderProcessGuidelines, renderCriticalRules, renderSeeAlso, renderNonNegotiables, renderProjectInstructions, } from './parts';
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGzD,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,GAChB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACvB,YAAY,GACb,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAC1B,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,wBAAwB,EACxB,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,uBAAuB,EACvB,mBAAmB,EACnB,aAAa,EACb,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGzD,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,GAChB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACvB,YAAY,GACb,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAC1B,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,wBAAwB,EACxB,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,uBAAuB,EACvB,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,SAAS,CAAC"}
|
package/dist/prompts/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @module prompts
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.renderNonNegotiables = exports.renderSeeAlso = exports.renderCriticalRules = exports.renderProcessGuidelines = exports.renderRecovery = exports.renderQuickReference = exports.renderTaskExamples = exports.renderTaskKinds = exports.renderCompletionProof = exports.renderLoopControl = exports.renderResultsPosting = exports.renderBreakpointHandling = exports.renderEffects = exports.renderIteration = exports.renderRunCreation = exports.renderIntentFidelityChecks = exports.renderProcessCreation = exports.renderUserProfile = exports.renderInterview = exports.renderDependencies = exports.joinNonEmpty = exports.composeBreakpointPrompt = exports.composeOrchestrationPrompt = exports.composeProcessCreatePrompt = exports.composeBabysitSkillPrompt = exports.resolveCommandTemplatePath = exports.renderCommandTemplate = exports.resolveTemplatePath = exports.renderTemplateString = exports.renderTemplate = exports.createPiContext = exports.createGeminiCliContext = exports.createCodexContext = exports.createClaudeCodeContext = void 0;
|
|
8
|
+
exports.renderProjectInstructions = exports.renderNonNegotiables = exports.renderSeeAlso = exports.renderCriticalRules = exports.renderProcessGuidelines = exports.renderRecovery = exports.renderQuickReference = exports.renderTaskExamples = exports.renderTaskKinds = exports.renderCompletionProof = exports.renderLoopControl = exports.renderResultsPosting = exports.renderBreakpointHandling = exports.renderEffects = exports.renderIteration = exports.renderRunCreation = exports.renderIntentFidelityChecks = exports.renderProcessCreation = exports.renderUserProfile = exports.renderInterview = exports.renderDependencies = exports.joinNonEmpty = exports.composeBreakpointPrompt = exports.composeOrchestrationPrompt = exports.composeProcessCreatePrompt = exports.composeBabysitSkillPrompt = exports.resolveCommandTemplatePath = exports.renderCommandTemplate = exports.resolveTemplatePath = exports.renderTemplateString = exports.renderTemplate = exports.createPiContext = exports.createGeminiCliContext = exports.createCodexContext = exports.createClaudeCodeContext = void 0;
|
|
9
9
|
// Context factories
|
|
10
10
|
var context_1 = require("./context");
|
|
11
11
|
Object.defineProperty(exports, "createClaudeCodeContext", { enumerable: true, get: function () { return context_1.createClaudeCodeContext; } });
|
|
@@ -49,3 +49,4 @@ Object.defineProperty(exports, "renderProcessGuidelines", { enumerable: true, ge
|
|
|
49
49
|
Object.defineProperty(exports, "renderCriticalRules", { enumerable: true, get: function () { return parts_1.renderCriticalRules; } });
|
|
50
50
|
Object.defineProperty(exports, "renderSeeAlso", { enumerable: true, get: function () { return parts_1.renderSeeAlso; } });
|
|
51
51
|
Object.defineProperty(exports, "renderNonNegotiables", { enumerable: true, get: function () { return parts_1.renderNonNegotiables; } });
|
|
52
|
+
Object.defineProperty(exports, "renderProjectInstructions", { enumerable: true, get: function () { return parts_1.renderProjectInstructions; } });
|
|
@@ -9,8 +9,10 @@ export { renderUserProfile } from './userProfile';
|
|
|
9
9
|
export { renderProcessCreation } from './processCreation';
|
|
10
10
|
export { renderIntentFidelityChecks } from './intentFidelityChecks';
|
|
11
11
|
export { renderRunCreation } from './runCreation';
|
|
12
|
+
export { renderRunOverlapDetection } from './runOverlapDetection';
|
|
12
13
|
export { renderIteration } from './iteration';
|
|
13
14
|
export { renderEffects } from './effects';
|
|
15
|
+
export { renderParallelPhaseDetection } from './parallelPhaseDetection';
|
|
14
16
|
export { renderBreakpointHandling } from './breakpointHandling';
|
|
15
17
|
export { renderResultsPosting } from './resultsPosting';
|
|
16
18
|
export { renderLoopControl } from './loopControl';
|
|
@@ -23,4 +25,5 @@ export { renderProcessGuidelines } from './processGuidelines';
|
|
|
23
25
|
export { renderCriticalRules } from './criticalRules';
|
|
24
26
|
export { renderSeeAlso } from './seeAlso';
|
|
25
27
|
export { renderNonNegotiables } from './nonNegotiables';
|
|
28
|
+
export { renderProjectInstructions } from './projectInstructions';
|
|
26
29
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/prompts/parts/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/prompts/parts/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @module prompts/parts
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.renderNonNegotiables = exports.renderSeeAlso = exports.renderCriticalRules = exports.renderProcessGuidelines = exports.renderRecovery = exports.renderQuickReference = exports.renderTaskExamples = exports.renderTaskKinds = exports.renderCompletionProof = exports.renderLoopControl = exports.renderResultsPosting = exports.renderBreakpointHandling = exports.renderEffects = exports.renderIteration = exports.renderRunCreation = exports.renderIntentFidelityChecks = exports.renderProcessCreation = exports.renderUserProfile = exports.renderInterview = exports.renderDependencies = void 0;
|
|
8
|
+
exports.renderProjectInstructions = exports.renderNonNegotiables = exports.renderSeeAlso = exports.renderCriticalRules = exports.renderProcessGuidelines = exports.renderRecovery = exports.renderQuickReference = exports.renderTaskExamples = exports.renderTaskKinds = exports.renderCompletionProof = exports.renderLoopControl = exports.renderResultsPosting = exports.renderBreakpointHandling = exports.renderParallelPhaseDetection = exports.renderEffects = exports.renderIteration = exports.renderRunOverlapDetection = exports.renderRunCreation = exports.renderIntentFidelityChecks = exports.renderProcessCreation = exports.renderUserProfile = exports.renderInterview = exports.renderDependencies = void 0;
|
|
9
9
|
var dependencies_1 = require("./dependencies");
|
|
10
10
|
Object.defineProperty(exports, "renderDependencies", { enumerable: true, get: function () { return dependencies_1.renderDependencies; } });
|
|
11
11
|
var interview_1 = require("./interview");
|
|
@@ -18,10 +18,14 @@ var intentFidelityChecks_1 = require("./intentFidelityChecks");
|
|
|
18
18
|
Object.defineProperty(exports, "renderIntentFidelityChecks", { enumerable: true, get: function () { return intentFidelityChecks_1.renderIntentFidelityChecks; } });
|
|
19
19
|
var runCreation_1 = require("./runCreation");
|
|
20
20
|
Object.defineProperty(exports, "renderRunCreation", { enumerable: true, get: function () { return runCreation_1.renderRunCreation; } });
|
|
21
|
+
var runOverlapDetection_1 = require("./runOverlapDetection");
|
|
22
|
+
Object.defineProperty(exports, "renderRunOverlapDetection", { enumerable: true, get: function () { return runOverlapDetection_1.renderRunOverlapDetection; } });
|
|
21
23
|
var iteration_1 = require("./iteration");
|
|
22
24
|
Object.defineProperty(exports, "renderIteration", { enumerable: true, get: function () { return iteration_1.renderIteration; } });
|
|
23
25
|
var effects_1 = require("./effects");
|
|
24
26
|
Object.defineProperty(exports, "renderEffects", { enumerable: true, get: function () { return effects_1.renderEffects; } });
|
|
27
|
+
var parallelPhaseDetection_1 = require("./parallelPhaseDetection");
|
|
28
|
+
Object.defineProperty(exports, "renderParallelPhaseDetection", { enumerable: true, get: function () { return parallelPhaseDetection_1.renderParallelPhaseDetection; } });
|
|
25
29
|
var breakpointHandling_1 = require("./breakpointHandling");
|
|
26
30
|
Object.defineProperty(exports, "renderBreakpointHandling", { enumerable: true, get: function () { return breakpointHandling_1.renderBreakpointHandling; } });
|
|
27
31
|
var resultsPosting_1 = require("./resultsPosting");
|
|
@@ -46,3 +50,5 @@ var seeAlso_1 = require("./seeAlso");
|
|
|
46
50
|
Object.defineProperty(exports, "renderSeeAlso", { enumerable: true, get: function () { return seeAlso_1.renderSeeAlso; } });
|
|
47
51
|
var nonNegotiables_1 = require("./nonNegotiables");
|
|
48
52
|
Object.defineProperty(exports, "renderNonNegotiables", { enumerable: true, get: function () { return nonNegotiables_1.renderNonNegotiables; } });
|
|
53
|
+
var projectInstructions_1 = require("./projectInstructions");
|
|
54
|
+
Object.defineProperty(exports, "renderProjectInstructions", { enumerable: true, get: function () { return projectInstructions_1.renderProjectInstructions; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallelPhaseDetection.d.ts","sourceRoot":"","sources":["../../../src/prompts/parts/parallelPhaseDetection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAEvE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderParallelPhaseDetection = renderParallelPhaseDetection;
|
|
4
|
+
const templateRenderer_1 = require("../templateRenderer");
|
|
5
|
+
/**
|
|
6
|
+
* Renders the Parallel Phase Detection section.
|
|
7
|
+
*/
|
|
8
|
+
function renderParallelPhaseDetection(ctx) {
|
|
9
|
+
return (0, templateRenderer_1.renderTemplate)((0, templateRenderer_1.resolveTemplatePath)('parallel-phase-detection.md'), ctx);
|
|
10
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PromptContext } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Renders a "Project Instructions" section from BABYSITTER.md files
|
|
4
|
+
* found between the current directory and the git repo root.
|
|
5
|
+
* Returns empty string if no files are found.
|
|
6
|
+
*/
|
|
7
|
+
export declare function renderProjectInstructions(_ctx: PromptContext): string;
|
|
8
|
+
//# sourceMappingURL=projectInstructions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projectInstructions.d.ts","sourceRoot":"","sources":["../../../src/prompts/parts/projectInstructions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAmBrE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderProjectInstructions = renderProjectInstructions;
|
|
4
|
+
const babysitterMdDiscovery_1 = require("../babysitterMdDiscovery");
|
|
5
|
+
/**
|
|
6
|
+
* Renders a "Project Instructions" section from BABYSITTER.md files
|
|
7
|
+
* found between the current directory and the git repo root.
|
|
8
|
+
* Returns empty string if no files are found.
|
|
9
|
+
*/
|
|
10
|
+
function renderProjectInstructions(_ctx) {
|
|
11
|
+
const files = (0, babysitterMdDiscovery_1.discoverBabysitterMdFiles)();
|
|
12
|
+
if (files.length === 0)
|
|
13
|
+
return '';
|
|
14
|
+
const sections = files.map(f => {
|
|
15
|
+
const header = files.length > 1
|
|
16
|
+
? `### ${f.relativePath}\n\n`
|
|
17
|
+
: '';
|
|
18
|
+
return header + f.content.trim();
|
|
19
|
+
});
|
|
20
|
+
return [
|
|
21
|
+
'## Project Instructions (BABYSITTER.md)',
|
|
22
|
+
'',
|
|
23
|
+
...(files.length > 1
|
|
24
|
+
? ['*Merged from ' + files.length + ' BABYSITTER.md files (repo root to current directory):*', '']
|
|
25
|
+
: []),
|
|
26
|
+
sections.join('\n\n'),
|
|
27
|
+
].join('\n');
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runOverlapDetection.d.ts","sourceRoot":"","sources":["../../../src/prompts/parts/runOverlapDetection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAEpE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderRunOverlapDetection = renderRunOverlapDetection;
|
|
4
|
+
const templateRenderer_1 = require("../templateRenderer");
|
|
5
|
+
/**
|
|
6
|
+
* Renders the Run Overlap Detection section.
|
|
7
|
+
*/
|
|
8
|
+
function renderRunOverlapDetection(ctx) {
|
|
9
|
+
return (0, templateRenderer_1.renderTemplate)((0, templateRenderer_1.resolveTemplatePath)('run-overlap-detection.md'), ctx);
|
|
10
|
+
}
|
|
@@ -177,13 +177,13 @@ Mark as PASS if no issues. Mark as WARN if runaway loops or stale sessions detec
|
|
|
177
177
|
**Goal:** Analyze babysitter log files for errors, warnings, and stop hook decisions.
|
|
178
178
|
|
|
179
179
|
Read the last 50 lines of each of these log files (if they exist):
|
|
180
|
-
- `$
|
|
181
|
-
- `$
|
|
182
|
-
- `$
|
|
183
|
-
- `$
|
|
184
|
-
- `$
|
|
185
|
-
- `$
|
|
186
|
-
- `$HOME/.a5c/logs/` and relevant
|
|
180
|
+
- `${BABYSITTER_LOG_DIR:-$HOME/.a5c/logs}/hooks.log`
|
|
181
|
+
- `${BABYSITTER_LOG_DIR:-$HOME/.a5c/logs}/babysitter-stop-hook.log`
|
|
182
|
+
- `${BABYSITTER_LOG_DIR:-$HOME/.a5c/logs}/babysitter-stop-hook-stderr.log`
|
|
183
|
+
- `${BABYSITTER_LOG_DIR:-$HOME/.a5c/logs}/babysitter-session-start-hook.log`
|
|
184
|
+
- `${BABYSITTER_LOG_DIR:-$HOME/.a5c/logs}/babysitter-session-start-hook-stderr.log`
|
|
185
|
+
- `${BABYSITTER_LOG_DIR:-$HOME/.a5c/logs}/babysitter.log`
|
|
186
|
+
- `${BABYSITTER_LOG_DIR:-$HOME/.a5c/logs}/` and relevant run/session specific logs there
|
|
187
187
|
|
|
188
188
|
|
|
189
189
|
For each log file:
|
|
@@ -285,7 +285,7 @@ The hooks delegate to the `babysitter` CLI. Check if it is available:
|
|
|
285
285
|
Check whether the stop hook has actually been invoked during this run's lifetime:
|
|
286
286
|
|
|
287
287
|
**From log files:**
|
|
288
|
-
- Read `$
|
|
288
|
+
- Read `${BABYSITTER_LOG_DIR:-$HOME/.a5c/logs}/babysitter-stop-hook.log` (if it exists).
|
|
289
289
|
- Count the number of "Hook script invoked" lines. This is the total invocation count.
|
|
290
290
|
- Count the number of "CLI exit code=" lines and extract exit codes.
|
|
291
291
|
- If the log file does not exist or has zero invocations, the stop hook has NOT been running.
|
|
@@ -297,7 +297,7 @@ Check whether the stop hook has actually been invoked during this run's lifetime
|
|
|
297
297
|
- If no STOP_HOOK_INVOKED events exist in the journal, note that the stop hook has not recorded any decisions for this run.
|
|
298
298
|
|
|
299
299
|
**From stderr:**
|
|
300
|
-
- Read `$
|
|
300
|
+
- Read `${BABYSITTER_LOG_DIR:-$HOME/.a5c/logs}/babysitter-stop-hook-stderr.log`.
|
|
301
301
|
- If it contains error output, display it and diagnose:
|
|
302
302
|
- "command not found" or exit code 127 → CLI not installed (see 10c)
|
|
303
303
|
- "MODULE_NOT_FOUND" or "Cannot find module" → SDK package corrupted or not built
|
|
@@ -6,7 +6,9 @@ Before calling `run:create`, verify and document in your working notes:
|
|
|
6
6
|
2. The process structure follows library style/composition patterns rather than
|
|
7
7
|
a one-off minimal flow.
|
|
8
8
|
3. Quality gates exist (verification/refinement loops, integration checks,
|
|
9
|
-
and/or breakpoints appropriate for the task).
|
|
9
|
+
and/or breakpoints appropriate for the task). Objectively verifiable checks
|
|
10
|
+
(compilation, linting, tests, grep, dependencies) use `kind: 'shell'` with
|
|
11
|
+
`expectedExitCode`, not `kind: 'agent'`.
|
|
10
12
|
4. Any scope reduction, simplification, or recovery tradeoff is explicitly
|
|
11
13
|
approved by the user before execution.
|
|
12
14
|
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
### Parallel Phase Design
|
|
2
|
+
|
|
3
|
+
When authoring a process definition, identify phases that have no mutual
|
|
4
|
+
dependencies and express them as parallel groups. This reduces total run time
|
|
5
|
+
without compromising correctness.
|
|
6
|
+
|
|
7
|
+
**Identifying independent phases:**
|
|
8
|
+
|
|
9
|
+
Two phases are independent — and safe to parallelize — when **all** of the
|
|
10
|
+
following hold:
|
|
11
|
+
|
|
12
|
+
1. They do not write to any resource that the other reads (no write-to-read
|
|
13
|
+
dependency).
|
|
14
|
+
2. They do not both write to the same resource (no write-to-write conflict).
|
|
15
|
+
3. Each phase depends only on already-completed phases, not on each other.
|
|
16
|
+
|
|
17
|
+
**Example:** If phases 4, 5, and 6 all depend on the outputs of phases 1 and 2
|
|
18
|
+
but share no inputs or outputs with each other, they are candidates for
|
|
19
|
+
parallel execution.
|
|
20
|
+
|
|
21
|
+
**Expressing parallelism in the process definition:**
|
|
22
|
+
|
|
23
|
+
Use `ctx.parallel.all()` for a fixed set of independent tasks:
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
const [featureTagging, hookImpl, retrospectIntegration] = await ctx.parallel.all([
|
|
27
|
+
ctx.task(featureTaggingTask, { architecture, coreImpl }),
|
|
28
|
+
ctx.task(hookImplementationTask, { architecture, coreImpl }),
|
|
29
|
+
ctx.task(retrospectIntegrationTask, { architecture, coreImpl }),
|
|
30
|
+
]);
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Use `ctx.parallel.map()` when applying the same task across multiple
|
|
34
|
+
independent items:
|
|
35
|
+
|
|
36
|
+
```js
|
|
37
|
+
const results = await ctx.parallel.map(modules, (mod) =>
|
|
38
|
+
ctx.task(moduleImplementationTask, { module: mod, architecture }),
|
|
39
|
+
);
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**When to use parallelism:**
|
|
43
|
+
|
|
44
|
+
- Multiple implementation phases that depend on the same planning/architecture
|
|
45
|
+
output but not on each other.
|
|
46
|
+
- Per-module or per-component work where each unit is self-contained.
|
|
47
|
+
- Independent verification steps (e.g., linting, type-checking, and unit tests
|
|
48
|
+
can often run in parallel).
|
|
49
|
+
|
|
50
|
+
**Safety constraints:**
|
|
51
|
+
|
|
52
|
+
- **Max 3 concurrent phases** by default. Keep parallel groups small to avoid
|
|
53
|
+
overwhelming the execution environment.
|
|
54
|
+
- **Correctness over speed.** When dependency analysis is ambiguous or the
|
|
55
|
+
phases might interact through shared files, fall back to sequential execution.
|
|
56
|
+
- **Merge before dependents.** Always `await` the full parallel group before
|
|
57
|
+
dispatching any phase that consumes their outputs.
|
|
58
|
+
- **When in doubt, run sequentially.** A correct slow run is always preferable
|
|
59
|
+
to a fast broken one.
|