@bunshin-cc/bunshin 0.4.1 → 0.4.2
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/bin.js +15 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -879,6 +879,8 @@ function firstHeading(text2) {
|
|
|
879
879
|
function applyTextOp(text2, op, legacyAnchor = "") {
|
|
880
880
|
const anchor = "anchor" in op && op.anchor || legacyAnchor;
|
|
881
881
|
switch (op.op) {
|
|
882
|
+
case "situation":
|
|
883
|
+
return { ok: true, text: text2 };
|
|
882
884
|
case "rewrite":
|
|
883
885
|
return { ok: true, text: op.text };
|
|
884
886
|
case "create":
|
|
@@ -1744,6 +1746,11 @@ ${robot ? `- Values that belong to THIS robot or cell (calibration, pixel column
|
|
|
1744
1746
|
- Code that should change (a hard-coded constant, a helper) \u2192 describe it as an append to the
|
|
1745
1747
|
skill's section, stating the change; reconciliation turns it into a harness patch.` : `- Machine specifics and personal preferences \u2192 your own user layer.`}
|
|
1746
1748
|
- Never include secrets, credentials or customer data.
|
|
1749
|
+
- A retrieval miss: if a document in the list above would have helped, but the agent did not use
|
|
1750
|
+
it (the user had to point at it, asked why it was not used, or the agent found it only late), add
|
|
1751
|
+
op "situation" to that document: the request as the user actually phrased it, made general (names
|
|
1752
|
+
and ticket ids replaced by what they stand for), e.g. "run me through an e2e test and what it
|
|
1753
|
+
does". Recall learns from it, so the next such request finds the document.
|
|
1747
1754
|
|
|
1748
1755
|
## Output
|
|
1749
1756
|
|
|
@@ -1755,7 +1762,8 @@ At most ${max} suggestions. Schema:
|
|
|
1755
1762
|
| {"op": "create", "section": {"kind": "skill"|"procedure"|"spec"|"verification"|"rule"|"guardrail"|"reference",
|
|
1756
1763
|
"title": string, "body": string, "when": string,
|
|
1757
1764
|
"paths"?: string[], "entities"?: string[], "skills"?: string[]}}
|
|
1758
|
-
| {"op": "param", "key": string, "value": string|number|boolean}
|
|
1765
|
+
| {"op": "param", "key": string, "value": string|number|boolean}
|
|
1766
|
+
| {"op": "situation", "text": string},
|
|
1759
1767
|
"rationale": string, "urgency": "normal"|"urgent"}]}`;
|
|
1760
1768
|
}
|
|
1761
1769
|
function extractJson(text2) {
|
|
@@ -1797,6 +1805,10 @@ function parseOp(raw) {
|
|
|
1797
1805
|
section: { kind, title, body, when: when || title, paths: strList(s.paths), entities: strList(s.entities).map((e) => e.toLowerCase()), skills: strList(s.skills) }
|
|
1798
1806
|
};
|
|
1799
1807
|
}
|
|
1808
|
+
case "situation": {
|
|
1809
|
+
const text2 = clean(o.text);
|
|
1810
|
+
return text2 ? { op: "situation", text: text2.slice(0, 500) } : null;
|
|
1811
|
+
}
|
|
1800
1812
|
case "param": {
|
|
1801
1813
|
const key = typeof o.key === "string" ? o.key.trim() : "";
|
|
1802
1814
|
const v = o.value;
|
|
@@ -3599,6 +3611,8 @@ function summarize(op) {
|
|
|
3599
3611
|
return clip(op.content === null ? `delete ${op.path}` : `file ${op.path}`);
|
|
3600
3612
|
case "retire":
|
|
3601
3613
|
return clip(`retire: ${op.reason}`);
|
|
3614
|
+
case "situation":
|
|
3615
|
+
return clip(`also applies to: ${op.text}`);
|
|
3602
3616
|
}
|
|
3603
3617
|
}
|
|
3604
3618
|
function describeTarget(s, view) {
|