@a5c-ai/babysitter-sdk 0.0.186 → 0.0.187-staging.1ec5e9f0
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/instructions.js +2 -2
- package/dist/prompts/compose.d.ts.map +1 -1
- package/dist/prompts/compose.js +2 -0
- package/dist/prompts/parts/index.d.ts +1 -0
- package/dist/prompts/parts/index.d.ts.map +1 -1
- package/dist/prompts/parts/index.js +3 -1
- 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/run-overlap-detection.md +63 -0
- package/package.json +1 -1
|
@@ -30,7 +30,7 @@ const COMPOSERS = {
|
|
|
30
30
|
promptType: "babysit-skill",
|
|
31
31
|
partsIncluded: [
|
|
32
32
|
"non-negotiables", "dependencies", "interview", "user-profile",
|
|
33
|
-
"process-creation", "intent-fidelity-checks", "run-creation",
|
|
33
|
+
"process-creation", "intent-fidelity-checks", "run-overlap-detection", "run-creation",
|
|
34
34
|
"iteration", "effects", "breakpoint-handling", "results-posting",
|
|
35
35
|
"loop-control", "completion-proof", "task-kinds", "task-examples",
|
|
36
36
|
"quick-reference", "recovery", "process-guidelines", "critical-rules",
|
|
@@ -50,7 +50,7 @@ const COMPOSERS = {
|
|
|
50
50
|
fn: prompts_1.composeOrchestrationPrompt,
|
|
51
51
|
promptType: "orchestrate",
|
|
52
52
|
partsIncluded: [
|
|
53
|
-
"run-creation", "iteration", "effects", "breakpoint-handling",
|
|
53
|
+
"run-overlap-detection", "run-creation", "iteration", "effects", "breakpoint-handling",
|
|
54
54
|
"results-posting", "loop-control", "completion-proof",
|
|
55
55
|
"quick-reference", "recovery", "critical-rules",
|
|
56
56
|
],
|
|
@@ -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,CA2EpE;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAUrE;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),
|
|
@@ -136,6 +137,7 @@ function composeProcessCreatePrompt(ctx) {
|
|
|
136
137
|
*/
|
|
137
138
|
function composeOrchestrationPrompt(ctx) {
|
|
138
139
|
return joinNonEmpty([
|
|
140
|
+
parts.renderRunOverlapDetection(ctx),
|
|
139
141
|
parts.renderRunCreation(ctx),
|
|
140
142
|
parts.renderIteration(ctx),
|
|
141
143
|
parts.renderEffects(ctx),
|
|
@@ -9,6 +9,7 @@ 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';
|
|
14
15
|
export { renderBreakpointHandling } from './breakpointHandling';
|
|
@@ -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,EAA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,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"}
|
|
@@ -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.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.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,6 +18,8 @@ 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");
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
### 2.0 Run Overlap Detection
|
|
2
|
+
|
|
3
|
+
Before calling `$CLI run:create`, scan for recent runs that may already cover
|
|
4
|
+
the same work. This avoids creating duplicate runs that waste tokens and
|
|
5
|
+
complicate the run history.
|
|
6
|
+
|
|
7
|
+
**Scan procedure:**
|
|
8
|
+
|
|
9
|
+
1. List recent run directories:
|
|
10
|
+
```bash
|
|
11
|
+
ls -lt .a5c/runs/ | head -20
|
|
12
|
+
```
|
|
13
|
+
2. For each run created within the last 30 minutes, read its metadata:
|
|
14
|
+
```bash
|
|
15
|
+
cat .a5c/runs/<runId>/run.json
|
|
16
|
+
```
|
|
17
|
+
3. Compare the candidate run's `prompt` and `processId` against the new
|
|
18
|
+
request:
|
|
19
|
+
- **Keyword overlap**: does the existing prompt share 3 or more significant
|
|
20
|
+
keywords with the new prompt?
|
|
21
|
+
- **Process match**: does `processId` match the process you intend to use?
|
|
22
|
+
4. If overlap is detected, check its current status:
|
|
23
|
+
```bash
|
|
24
|
+
$CLI run:status .a5c/runs/<runId>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**If an overlapping run is found:**
|
|
28
|
+
|
|
29
|
+
{{#interactive}}
|
|
30
|
+
Surface a clear warning to the user with the similar run's details:
|
|
31
|
+
|
|
32
|
+
- Run ID: `<runId>`
|
|
33
|
+
- Process: `<processId>`
|
|
34
|
+
- Created: `<createdAt>`
|
|
35
|
+
- Status: `<status>`
|
|
36
|
+
- Prompt excerpt: `<first 120 chars of prompt>`
|
|
37
|
+
|
|
38
|
+
Ask the user to choose one of:
|
|
39
|
+
1. **Proceed** — create a new run anyway (e.g., intentional retry or variant)
|
|
40
|
+
2. **Skip** — abort run creation; the existing run already covers the request
|
|
41
|
+
3. **Resume** — resume the existing run via `$CLI run:iterate .a5c/runs/<runId>`
|
|
42
|
+
|
|
43
|
+
Do not proceed with `run:create` until the user has responded.
|
|
44
|
+
{{/interactive}}
|
|
45
|
+
{{^interactive}}
|
|
46
|
+
Log a warning with the overlapping run's details (runId, processId, createdAt,
|
|
47
|
+
status) and continue creating the new run. Non-interactive mode does not block
|
|
48
|
+
on overlap — the caller is responsible for deduplication.
|
|
49
|
+
{{/interactive}}
|
|
50
|
+
|
|
51
|
+
**No overlap found:** proceed directly to `$CLI run:create` as normal.
|
|
52
|
+
|
|
53
|
+
**Tracking run chains:**
|
|
54
|
+
|
|
55
|
+
When creating a run that intentionally follows or retries a previous run,
|
|
56
|
+
include the related run ID in the inputs so the process can reference it:
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"relatedRunId": "<previousRunId>",
|
|
61
|
+
"relatedRunReason": "retry|variant|follow-up"
|
|
62
|
+
}
|
|
63
|
+
```
|
package/package.json
CHANGED