kodingo-cli 1.0.33 → 1.0.35
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.js +2 -1
- package/dist/ports/cloud-event-port.js +26 -2
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -24,7 +24,8 @@ const session_brief_1 = require("./commands/session-brief");
|
|
|
24
24
|
const check_rules_1 = require("./commands/check-rules");
|
|
25
25
|
const aging_1 = require("./commands/aging");
|
|
26
26
|
const program = new commander_1.Command();
|
|
27
|
-
|
|
27
|
+
const { version } = require("../package.json");
|
|
28
|
+
program.name("kodingo").description("Kodingo CLI").version(version);
|
|
28
29
|
// ── init ──────────────────────────────────────────────────────────────────────
|
|
29
30
|
(0, init_1.registerInitCommand)(program);
|
|
30
31
|
// ── update ────────────────────────────────────────────────────────────────────
|
|
@@ -20,6 +20,30 @@ class CloudEventPort {
|
|
|
20
20
|
}
|
|
21
21
|
async pushDecision(decision, _context) {
|
|
22
22
|
await this.persistence.initDb();
|
|
23
|
+
// Build real priorMemory from existing records for this project
|
|
24
|
+
let context = _context;
|
|
25
|
+
try {
|
|
26
|
+
const existing = await this.persistence.queryMemoryBySymbol({
|
|
27
|
+
symbol: decision.id,
|
|
28
|
+
limit: 50,
|
|
29
|
+
includeDenied: false,
|
|
30
|
+
onlyCanonical: false,
|
|
31
|
+
});
|
|
32
|
+
const decisions = existing
|
|
33
|
+
.filter(r => r.externalId?.startsWith("git:"))
|
|
34
|
+
.map(r => r.externalId ?? r.id);
|
|
35
|
+
context = {
|
|
36
|
+
..._context,
|
|
37
|
+
priorMemory: {
|
|
38
|
+
projectId: decision.projectId,
|
|
39
|
+
decisions,
|
|
40
|
+
updatedAt: existing[0]?.updatedAt ?? new Date(0),
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
context = _context;
|
|
46
|
+
}
|
|
23
47
|
const { title, content, symbol, externalId } = await this.mapDecisionToMemory(decision);
|
|
24
48
|
// Confidence accumulation: if symbol is present, look for existing record
|
|
25
49
|
if (symbol) {
|
|
@@ -62,14 +86,14 @@ class CloudEventPort {
|
|
|
62
86
|
}
|
|
63
87
|
// No existing proposed/ignored record — validate invariants via core then insert
|
|
64
88
|
try {
|
|
65
|
-
(0, kodingo_core_1.enforceDecisionInvariants)(decision,
|
|
89
|
+
(0, kodingo_core_1.enforceDecisionInvariants)(decision, context);
|
|
66
90
|
}
|
|
67
91
|
catch (e) {
|
|
68
92
|
console.warn(`[core] Decision invariant failed: ${e.message} — skipping`);
|
|
69
93
|
return;
|
|
70
94
|
}
|
|
71
95
|
// Apply lifecycle — produces events and new memory state
|
|
72
|
-
const outcome = (0, kodingo_core_1.applyDecisionLifecycle)(decision,
|
|
96
|
+
const outcome = (0, kodingo_core_1.applyDecisionLifecycle)(decision, context);
|
|
73
97
|
const input = {
|
|
74
98
|
type: "decision",
|
|
75
99
|
content,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kodingo-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.35",
|
|
4
4
|
"description": "Kodingo CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@typescript-eslint/types": "^8.61.1",
|
|
26
26
|
"@typescript-eslint/typescript-estree": "^8.61.1",
|
|
27
27
|
"commander": "^12.1.0",
|
|
28
|
-
"kodingo-core": "^0.2.
|
|
28
|
+
"kodingo-core": "^0.2.1",
|
|
29
29
|
"open": "^11.0.0",
|
|
30
30
|
"simple-git": "^3.30.0",
|
|
31
31
|
"uuid": "^10.0.0"
|