@open-tomato/rafa 0.34.1 → 0.35.0
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/README.md +18 -18
- package/dist/bundled/agents/doc-updater.md +1 -1
- package/dist/bundled/operators/.claude-plugin/plugin.json +5 -0
- package/dist/bundled/operators/agents/rafa-stretch-engineer.md +36 -15
- package/dist/bundled/operators/skills/rafa-stretch-pit-stop/SKILL.md +2 -2
- package/dist/cli.js +11408 -10529
- package/dist/describe-59899b0p.js +11 -0
- package/dist/effort/store/index.js +33 -36
- package/dist/index-21jcfatr.js +16 -0
- package/dist/{index-vp0xghk2.js → index-2tjmxwvp.js} +519 -114
- package/dist/{index-v8d7c6sw.js → index-41vzahew.js} +69 -33
- package/dist/{index-bebv92ha.js → index-ckqfhynj.js} +824 -547
- package/dist/{index-s8ff86xt.js → index-dvrq9nfb.js} +4646 -3954
- package/dist/{index-d6d0942q.js → index-hgcvjke7.js} +17 -17
- package/dist/{index-nr4hdb35.js → index-se13pvag.js} +2471 -2303
- package/dist/index.js +147 -154
- package/dist/learning/index.js +20 -20
- package/dist/plan/index.js +42 -45
- package/package.json +1 -1
- package/dist/describe-5hqfwbjc.js +0 -14
- package/dist/index-3mzw3kzh.js +0 -129
- package/dist/index-fzhd3d4y.js +0 -446
- package/dist/index-k6sd4ym5.js +0 -243
- package/dist/index-wp8c28fd.js +0 -18
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from "./index-
|
|
3
|
+
GAP2,
|
|
4
|
+
SOURCE_STEP2,
|
|
5
|
+
CONFIDENCE_MIN2,
|
|
6
|
+
CONFIDENCE_MAX2,
|
|
7
|
+
triggerKey2
|
|
8
|
+
} from "./index-21jcfatr.js";
|
|
9
9
|
|
|
10
10
|
// src/learning/bless.ts
|
|
11
11
|
import { createHash } from "crypto";
|
|
@@ -32,19 +32,19 @@ function blessedRecords(held, minConfidence) {
|
|
|
32
32
|
function versionOf(instincts) {
|
|
33
33
|
return createHash("sha256").update(JSON.stringify(instincts)).digest("hex");
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function bless2(held, options) {
|
|
36
36
|
const instincts = blessedRecords(held, options.minConfidence);
|
|
37
37
|
return { version: versionOf(instincts), instincts };
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function promotable2(held, options) {
|
|
40
40
|
return blessedRecords(held, options.minConfidence).filter((each) => each.usage_count >= options.after);
|
|
41
41
|
}
|
|
42
42
|
// src/learning/merge.ts
|
|
43
43
|
var HUNDREDTHS2 = 100;
|
|
44
|
-
var GAP_H = Math.round(
|
|
45
|
-
var STEP_H = Math.round(
|
|
46
|
-
var MIN_H = Math.round(
|
|
47
|
-
var MAX_H = Math.round(
|
|
44
|
+
var GAP_H = Math.round(GAP2 * HUNDREDTHS2);
|
|
45
|
+
var STEP_H = Math.round(SOURCE_STEP2 * HUNDREDTHS2);
|
|
46
|
+
var MIN_H = Math.round(CONFIDENCE_MIN2 * HUNDREDTHS2);
|
|
47
|
+
var MAX_H = Math.round(CONFIDENCE_MAX2 * HUNDREDTHS2);
|
|
48
48
|
function hundredths2(confidence) {
|
|
49
49
|
return Math.round(confidence * HUNDREDTHS2);
|
|
50
50
|
}
|
|
@@ -194,16 +194,16 @@ function settleTrigger(held, incoming, now) {
|
|
|
194
194
|
}
|
|
195
195
|
return settleMany(collapsed, held, now);
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function merge2(held, payload, now) {
|
|
198
198
|
const incoming = payload.instincts.map((record) => withSource(record, payload.source_id));
|
|
199
|
-
const keys = [...new Set(incoming.map((record) =>
|
|
199
|
+
const keys = [...new Set(incoming.map((record) => triggerKey2(record.trigger)))];
|
|
200
200
|
const outcomes = new Map;
|
|
201
201
|
for (const key of keys) {
|
|
202
|
-
const onKey = (record) =>
|
|
202
|
+
const onKey = (record) => triggerKey2(record.trigger) === key;
|
|
203
203
|
outcomes.set(key, settleTrigger(held.filter(onKey), incoming.filter(onKey), now));
|
|
204
204
|
}
|
|
205
205
|
const decisions = payload.instincts.map((record) => {
|
|
206
|
-
const outcome = outcomes.get(
|
|
206
|
+
const outcome = outcomes.get(triggerKey2(record.trigger));
|
|
207
207
|
return {
|
|
208
208
|
incoming: record,
|
|
209
209
|
rule: outcome.rules.get(record.action_hash),
|
|
@@ -215,4 +215,4 @@ function merge(held, payload, now) {
|
|
|
215
215
|
discarded: keys.flatMap((key) => outcomes.get(key).discarded)
|
|
216
216
|
};
|
|
217
217
|
}
|
|
218
|
-
export {
|
|
218
|
+
export { bless2, promotable2, merge2 };
|