@edihasaj/recall 0.9.4 → 0.9.5
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/{chunk-LXM75CET.js → chunk-BMZ2NRLH.js} +7 -7
- package/dist/{chunk-U77N3BFL.js → chunk-BZF6TLQ3.js} +2 -2
- package/dist/{chunk-ILPPEXXU.js → chunk-G2OSUUTC.js} +3 -3
- package/dist/{chunk-5GKJR75B.js → chunk-KDQYI5UT.js} +3 -3
- package/dist/{chunk-O2SK7DSZ.js → chunk-LLIYJ6CD.js} +89 -47
- package/dist/chunk-LLIYJ6CD.js.map +1 -0
- package/dist/{chunk-UZBJBVAW.js → chunk-LXJWMIBR.js} +2 -1
- package/dist/{chunk-ETQ4ZICM.js → chunk-NMFI3TIF.js} +6 -6
- package/dist/{chunk-AE646XCL.js → chunk-QEYL4ZNZ.js} +2 -2
- package/dist/{chunk-UJ3CEOAR.js → chunk-UDMQCRTL.js} +5 -5
- package/dist/{cleanup-AXEV7OYT.js → cleanup-QIYS3OCH.js} +4 -4
- package/dist/cli.js +18 -18
- package/dist/daemon.js +9 -9
- package/dist/{dispatcher-KJHTFHYA.js → dispatcher-VRR44JFE.js} +4 -4
- package/dist/{embeddings-ZFZRA46X.js → embeddings-FEYQRSRV.js} +2 -2
- package/dist/{ingest-HET7DF2P.js → ingest-N6XSNRQH.js} +3 -3
- package/dist/mcp.js +7 -7
- package/dist/{memory-value-TNQOOIVG.js → memory-value-X76RRECS.js} +4 -4
- package/dist/{quality-JMTT3OOA.js → quality-5TZ3B4LR.js} +5 -5
- package/dist/{retrieval-2STFA5XU.js → retrieval-IRYNANIM.js} +4 -4
- package/dist/{tasks-INHGPSBF.js → tasks-UEJORN2X.js} +6 -4
- package/package.json +1 -1
- package/dist/chunk-O2SK7DSZ.js.map +0 -1
- /package/dist/{chunk-LXM75CET.js.map → chunk-BMZ2NRLH.js.map} +0 -0
- /package/dist/{chunk-U77N3BFL.js.map → chunk-BZF6TLQ3.js.map} +0 -0
- /package/dist/{chunk-ILPPEXXU.js.map → chunk-G2OSUUTC.js.map} +0 -0
- /package/dist/{chunk-5GKJR75B.js.map → chunk-KDQYI5UT.js.map} +0 -0
- /package/dist/{chunk-UZBJBVAW.js.map → chunk-LXJWMIBR.js.map} +0 -0
- /package/dist/{chunk-ETQ4ZICM.js.map → chunk-NMFI3TIF.js.map} +0 -0
- /package/dist/{chunk-AE646XCL.js.map → chunk-QEYL4ZNZ.js.map} +0 -0
- /package/dist/{chunk-UJ3CEOAR.js.map → chunk-UDMQCRTL.js.map} +0 -0
- /package/dist/{cleanup-AXEV7OYT.js.map → cleanup-QIYS3OCH.js.map} +0 -0
- /package/dist/{dispatcher-KJHTFHYA.js.map → dispatcher-VRR44JFE.js.map} +0 -0
- /package/dist/{embeddings-ZFZRA46X.js.map → embeddings-FEYQRSRV.js.map} +0 -0
- /package/dist/{ingest-HET7DF2P.js.map → ingest-N6XSNRQH.js.map} +0 -0
- /package/dist/{memory-value-TNQOOIVG.js.map → memory-value-X76RRECS.js.map} +0 -0
- /package/dist/{quality-JMTT3OOA.js.map → quality-5TZ3B4LR.js.map} +0 -0
- /package/dist/{retrieval-2STFA5XU.js.map → retrieval-IRYNANIM.js.map} +0 -0
- /package/dist/{tasks-INHGPSBF.js.map → tasks-UEJORN2X.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
graphQuery
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-G2OSUUTC.js";
|
|
4
4
|
import {
|
|
5
5
|
captureCorrectionFallback,
|
|
6
6
|
compileContext,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
scanAndStore,
|
|
27
27
|
sessionEndFallback,
|
|
28
28
|
signalOutcomeFallback
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-UDMQCRTL.js";
|
|
30
30
|
import {
|
|
31
31
|
DEFAULT_LEASE_SECONDS,
|
|
32
32
|
TaskClaimConflictError,
|
|
@@ -47,21 +47,21 @@ import {
|
|
|
47
47
|
releaseTask,
|
|
48
48
|
rollbackMemory,
|
|
49
49
|
submitTask
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-LLIYJ6CD.js";
|
|
51
51
|
import {
|
|
52
52
|
recordCompletionUseValueEventsSemantic
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-KDQYI5UT.js";
|
|
54
54
|
import {
|
|
55
55
|
confirmMemory,
|
|
56
56
|
demoteGlobalMemory,
|
|
57
57
|
getMemory,
|
|
58
58
|
queryMemories,
|
|
59
59
|
rejectMemory
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-BZF6TLQ3.js";
|
|
61
61
|
import {
|
|
62
62
|
loadEmbeddingConfigFromEnv,
|
|
63
63
|
tagActivitySource
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-LXJWMIBR.js";
|
|
65
65
|
import {
|
|
66
66
|
getEntity,
|
|
67
67
|
listEntities,
|
|
@@ -1197,4 +1197,4 @@ function createRecallMcpServer(db = initDb()) {
|
|
|
1197
1197
|
export {
|
|
1198
1198
|
createRecallMcpServer
|
|
1199
1199
|
};
|
|
1200
|
-
//# sourceMappingURL=chunk-
|
|
1200
|
+
//# sourceMappingURL=chunk-BMZ2NRLH.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
CONFIDENCE,
|
|
3
3
|
PROMOTION,
|
|
4
4
|
queueMemoryEmbeddingSync
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-LXJWMIBR.js";
|
|
6
6
|
import {
|
|
7
7
|
isPlausibleEntityName,
|
|
8
8
|
linkMemoryToEntity,
|
|
@@ -810,4 +810,4 @@ export {
|
|
|
810
810
|
getMemoryFeedbackSummaries,
|
|
811
811
|
feedbackWeightedScore
|
|
812
812
|
};
|
|
813
|
-
//# sourceMappingURL=chunk-
|
|
813
|
+
//# sourceMappingURL=chunk-BZF6TLQ3.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getMemory
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BZF6TLQ3.js";
|
|
4
4
|
import {
|
|
5
5
|
hybridSearch,
|
|
6
6
|
searchMemoryFtsIndex
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-LXJWMIBR.js";
|
|
8
8
|
import {
|
|
9
9
|
listEntitiesForMemory,
|
|
10
10
|
listMemoryIdsForEntity,
|
|
@@ -120,4 +120,4 @@ async function graphQuery(db, query, embeddingConfig, options = {}) {
|
|
|
120
120
|
export {
|
|
121
121
|
graphQuery
|
|
122
122
|
};
|
|
123
|
-
//# sourceMappingURL=chunk-
|
|
123
|
+
//# sourceMappingURL=chunk-G2OSUUTC.js.map
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
getMemory,
|
|
10
10
|
promoteMemory,
|
|
11
11
|
queryMemories
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BZF6TLQ3.js";
|
|
13
13
|
import {
|
|
14
14
|
cosineSimilarity,
|
|
15
15
|
generateEmbedding,
|
|
16
16
|
loadEmbedding,
|
|
17
17
|
loadEmbeddingConfigFromEnv
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-LXJWMIBR.js";
|
|
19
19
|
import {
|
|
20
20
|
and,
|
|
21
21
|
eq,
|
|
@@ -612,4 +612,4 @@ export {
|
|
|
612
612
|
detectAndRecordRetrievalMissesSemantic,
|
|
613
613
|
computeMemoryValueReport
|
|
614
614
|
};
|
|
615
|
-
//# sourceMappingURL=chunk-
|
|
615
|
+
//# sourceMappingURL=chunk-KDQYI5UT.js.map
|
|
@@ -20,16 +20,17 @@ import {
|
|
|
20
20
|
promoteMemory,
|
|
21
21
|
queryMemories,
|
|
22
22
|
updateMemoryCaptureContext
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-BZF6TLQ3.js";
|
|
24
24
|
import {
|
|
25
25
|
CONFIDENCE,
|
|
26
26
|
LlmCredentialError,
|
|
27
|
+
LlmRequestError,
|
|
27
28
|
callLlm,
|
|
28
29
|
findSemanticDuplicates,
|
|
29
30
|
findSimilarRejectedExemplar,
|
|
30
31
|
loadEmbeddingConfigFromEnv,
|
|
31
32
|
queueMemoryEmbeddingSync
|
|
32
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-LXJWMIBR.js";
|
|
33
34
|
import {
|
|
34
35
|
hasProviderConfigured,
|
|
35
36
|
init_keychain
|
|
@@ -377,6 +378,7 @@ async function dispatchPendingTasks(db, options = {}) {
|
|
|
377
378
|
outcomes: []
|
|
378
379
|
};
|
|
379
380
|
if (!provider) return report;
|
|
381
|
+
abandonInvalidOpenTasks(db);
|
|
380
382
|
const pending = listTasks(db, {
|
|
381
383
|
status: "pending",
|
|
382
384
|
kinds: options.kinds,
|
|
@@ -449,12 +451,12 @@ async function runSingle(db, task, provider, model) {
|
|
|
449
451
|
});
|
|
450
452
|
const parsed = parseJson(llmResult.text);
|
|
451
453
|
if (!parsed) {
|
|
452
|
-
|
|
454
|
+
submitTask(db, claimed.id, DISPATCH_AGENT, {});
|
|
453
455
|
return {
|
|
454
456
|
task_id: claimed.id,
|
|
455
457
|
kind: claimed.kind,
|
|
456
458
|
repo: claimed.repo,
|
|
457
|
-
status: "
|
|
459
|
+
status: "rejected",
|
|
458
460
|
reason: "llm did not return valid JSON",
|
|
459
461
|
prompt_tokens: llmResult.usage.prompt_tokens,
|
|
460
462
|
completion_tokens: llmResult.usage.completion_tokens,
|
|
@@ -489,8 +491,23 @@ async function runSingle(db, task, provider, model) {
|
|
|
489
491
|
duration_ms: llmResult.duration_ms
|
|
490
492
|
};
|
|
491
493
|
} catch (err) {
|
|
492
|
-
releaseTask(db, claimed.id, DISPATCH_AGENT);
|
|
493
494
|
const reason = err instanceof LlmCredentialError ? err.message : err instanceof Error ? err.message : String(err);
|
|
495
|
+
if (err instanceof LlmRequestError && reason.includes("content_filter")) {
|
|
496
|
+
abandonClaimedTask(
|
|
497
|
+
db,
|
|
498
|
+
claimed.id,
|
|
499
|
+
DISPATCH_AGENT,
|
|
500
|
+
"provider_content_filter"
|
|
501
|
+
);
|
|
502
|
+
return {
|
|
503
|
+
task_id: claimed.id,
|
|
504
|
+
kind: claimed.kind,
|
|
505
|
+
repo: claimed.repo,
|
|
506
|
+
status: "rejected",
|
|
507
|
+
reason: "provider content filter"
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
releaseTask(db, claimed.id, DISPATCH_AGENT, reason);
|
|
494
511
|
return {
|
|
495
512
|
task_id: claimed.id,
|
|
496
513
|
kind: claimed.kind,
|
|
@@ -663,7 +680,7 @@ function buildMergeDuplicatesPrompt(task) {
|
|
|
663
680
|
const user = [
|
|
664
681
|
`Repo: ${JSON.stringify(payload.repo ?? null)}`,
|
|
665
682
|
`Cluster:`,
|
|
666
|
-
JSON.stringify(payload.
|
|
683
|
+
JSON.stringify(payload.candidates ?? [], null, 2),
|
|
667
684
|
"",
|
|
668
685
|
'Return JSON: {"winner_id": uuid, "winner_text"?: string, "winner_scope"?: "session"|"path"|"repo"|"team", "winner_path_scope"?: string|null, "rationale"?: string}'
|
|
669
686
|
].join("\n");
|
|
@@ -1195,6 +1212,43 @@ function wordOverlap(a, b) {
|
|
|
1195
1212
|
return intersection.length / union.size;
|
|
1196
1213
|
}
|
|
1197
1214
|
|
|
1215
|
+
// src/capture/context.ts
|
|
1216
|
+
var SYSTEM_SCAFFOLD_RE = /(?:^\s*[⏺⎿❯✻※]|<\/?task-notification>|task-notification|hook activity|\[correction_summary\]|correction_summary|session(?:start| start| end) hook|stop hook|<system-reminder>|<\/?command-(?:name|message)>|recent_tool_calls|probeport qa agent contract|you extract durable memory candidates for a personal agent runtime|required schema_version:\s*memory_extraction|##\s*(?:run context|scout assignment|lead verifier assignment|available tool commands|mapped local files|allowed secret environment names))/i;
|
|
1217
|
+
var NON_USER_CONTEXT_RE = /\b(?:sub-?agent (?:context|transcript|output|notification)|(?:during|after) compaction|compaction (?:context|summary|transcript)|compacting (?:the )?(?:context|conversation)|system repair (?:context|transcript)|self[- ]repair context|repair context|cron context)\b/i;
|
|
1218
|
+
var INJECTION_ARTIFACT_RE = new RegExp(
|
|
1219
|
+
[
|
|
1220
|
+
"ignore (?:all |any |the )?(?:previous|prior|above|earlier) (?:instructions|prompts?|messages?|rules?)",
|
|
1221
|
+
"disregard (?:all |any |the )?(?:previous|prior|above|earlier)\\b",
|
|
1222
|
+
"\\bexact reply\\b",
|
|
1223
|
+
"reply (?:with )?exactly\\b",
|
|
1224
|
+
"use (?:private|runtime|internal)(?:/[a-z]+)* state for this answer",
|
|
1225
|
+
"do not use tools\\b[^.]*\\b(?:answer|state|reply|instead)",
|
|
1226
|
+
"required generated files?\\b",
|
|
1227
|
+
"verify the generated (?:scorecard|artifact|output|file)",
|
|
1228
|
+
"must preserve the visible labels?\\b",
|
|
1229
|
+
"promised\\b[^.]*\\bactions\\b[^.]*\\bexecuted",
|
|
1230
|
+
"\\bACP actions\\b"
|
|
1231
|
+
].join("|"),
|
|
1232
|
+
"i"
|
|
1233
|
+
);
|
|
1234
|
+
var EPHEMERAL_TASK_CONTEXT_RE = /(?:^\s*\/goal\b|pause for (?:the )?user\b|this is task def(?:inition)?:|key details\s+description\s+(?:goal|background)\b|link to jira ticket|what(?:'|’)s changed\?|this article lists the tools we use for development|required software on node)/i;
|
|
1235
|
+
function looksLikeQuestionContext(text) {
|
|
1236
|
+
if (/\b(?:always|never|remember|memorize|save this|from now on|by default|make it a rule)\b/i.test(text)) {
|
|
1237
|
+
return false;
|
|
1238
|
+
}
|
|
1239
|
+
if (/^\s*(?:how|why|what|where|which|who)\b/i.test(text)) {
|
|
1240
|
+
return true;
|
|
1241
|
+
}
|
|
1242
|
+
if (/^\s*(?:can|could|should|would)\s+(?:i|we|you|they|it)\b/i.test(text)) {
|
|
1243
|
+
return true;
|
|
1244
|
+
}
|
|
1245
|
+
if (!text.includes("?")) return false;
|
|
1246
|
+
return /\?\s*$/.test(text.trim()) || /(?:^|[.!?]\s+)(?:how|why|what|where|which|who|can|could|should|would|do|does|did|is|are|was|were|have|has)\b/i.test(text);
|
|
1247
|
+
}
|
|
1248
|
+
function isNonUserCaptureContext(text) {
|
|
1249
|
+
return SYSTEM_SCAFFOLD_RE.test(text) || NON_USER_CONTEXT_RE.test(text) || INJECTION_ARTIFACT_RE.test(text) || EPHEMERAL_TASK_CONTEXT_RE.test(text) || looksLikeQuestionContext(text);
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1198
1252
|
// src/scanner/signal.ts
|
|
1199
1253
|
var ACTIVE_COMMAND_PATTERNS = [
|
|
1200
1254
|
/^use\b/i
|
|
@@ -2323,41 +2377,6 @@ function isTriggerTemplateRule(text) {
|
|
|
2323
2377
|
function isHighRiskRule(text) {
|
|
2324
2378
|
return isDestructiveRisky(text) || isTriggerTemplateRule(text);
|
|
2325
2379
|
}
|
|
2326
|
-
var SYSTEM_SCAFFOLD_RE = /(?:^\s*[⏺⎿❯✻※]|<\/?task-notification>|task-notification|hook activity|\[correction_summary\]|correction_summary|session(?:start| start| end) hook|stop hook|<system-reminder>|<\/?command-(?:name|message)>|recent_tool_calls|probeport qa agent contract|you extract durable memory candidates for a personal agent runtime|required schema_version:\s*memory_extraction|##\s*(?:run context|scout assignment|lead verifier assignment|available tool commands|mapped local files|allowed secret environment names))/i;
|
|
2327
|
-
var NON_USER_CONTEXT_RE = /\b(?:sub-?agent (?:context|transcript|output|notification)|(?:during|after) compaction|compaction (?:context|summary|transcript)|compacting (?:the )?(?:context|conversation)|system repair (?:context|transcript)|self[- ]repair context|repair context|cron context)\b/i;
|
|
2328
|
-
var INJECTION_ARTIFACT_RE = new RegExp(
|
|
2329
|
-
[
|
|
2330
|
-
"ignore (?:all |any |the )?(?:previous|prior|above|earlier) (?:instructions|prompts?|messages?|rules?)",
|
|
2331
|
-
"disregard (?:all |any |the )?(?:previous|prior|above|earlier)\\b",
|
|
2332
|
-
"\\bexact reply\\b",
|
|
2333
|
-
"reply (?:with )?exactly\\b",
|
|
2334
|
-
"use (?:private|runtime|internal)(?:/[a-z]+)* state for this answer",
|
|
2335
|
-
"do not use tools\\b[^.]*\\b(?:answer|state|reply|instead)",
|
|
2336
|
-
"required generated files?\\b",
|
|
2337
|
-
"verify the generated (?:scorecard|artifact|output|file)",
|
|
2338
|
-
"must preserve the visible labels?\\b",
|
|
2339
|
-
"promised\\b[^.]*\\bactions\\b[^.]*\\bexecuted",
|
|
2340
|
-
"\\bACP actions\\b"
|
|
2341
|
-
].join("|"),
|
|
2342
|
-
"i"
|
|
2343
|
-
);
|
|
2344
|
-
var EPHEMERAL_TASK_CONTEXT_RE = /(?:^\s*\/goal\b|pause for (?:the )?user\b|this is task def(?:inition)?:|key details\s+description\s+(?:goal|background)\b|link to jira ticket|what(?:'|’)s changed\?|this article lists the tools we use for development|required software on node)/i;
|
|
2345
|
-
function looksLikeQuestionContext(text) {
|
|
2346
|
-
if (/\b(?:always|never|remember|memorize|save this|from now on|by default|make it a rule)\b/i.test(text)) {
|
|
2347
|
-
return false;
|
|
2348
|
-
}
|
|
2349
|
-
if (/^\s*(?:how|why|what|where|which|who)\b/i.test(text)) {
|
|
2350
|
-
return true;
|
|
2351
|
-
}
|
|
2352
|
-
if (/^\s*(?:can|could|should|would)\s+(?:i|we|you|they|it)\b/i.test(text)) {
|
|
2353
|
-
return true;
|
|
2354
|
-
}
|
|
2355
|
-
if (!text.includes("?")) return false;
|
|
2356
|
-
return /\?\s*$/.test(text.trim()) || /(?:^|[.!?]\s+)(?:how|why|what|where|which|who|can|could|should|would|do|does|did|is|are|was|were|have|has)\b/i.test(text);
|
|
2357
|
-
}
|
|
2358
|
-
function isNonUserCaptureContext(text) {
|
|
2359
|
-
return SYSTEM_SCAFFOLD_RE.test(text) || NON_USER_CONTEXT_RE.test(text) || INJECTION_ARTIFACT_RE.test(text) || EPHEMERAL_TASK_CONTEXT_RE.test(text) || looksLikeQuestionContext(text);
|
|
2360
|
-
}
|
|
2361
2380
|
var NON_LETTER = "(?<![\\p{L}])(?:";
|
|
2362
2381
|
var NON_LETTER_END = ")(?![\\p{L}])";
|
|
2363
2382
|
var PROMPT_SCREEN_RE = new RegExp(
|
|
@@ -3361,6 +3380,12 @@ function taskTargetReasons(db, task) {
|
|
|
3361
3380
|
)).all();
|
|
3362
3381
|
if (live.length < 2) return ["merge_candidates_not_live"];
|
|
3363
3382
|
}
|
|
3383
|
+
if (task.kind === "extract_rules_from_prompt") {
|
|
3384
|
+
const rawPrompt = payloadString(payload, "raw_prompt");
|
|
3385
|
+
if (rawPrompt && isNonUserCaptureContext(rawPrompt)) {
|
|
3386
|
+
return ["non_user_capture_context"];
|
|
3387
|
+
}
|
|
3388
|
+
}
|
|
3364
3389
|
return [];
|
|
3365
3390
|
}
|
|
3366
3391
|
function abandonInvalidOpenTasks(db, now = /* @__PURE__ */ new Date()) {
|
|
@@ -3670,10 +3695,10 @@ var SummarizeHistoryResult = z.object({
|
|
|
3670
3695
|
});
|
|
3671
3696
|
var MergeDuplicatesResult = z.object({
|
|
3672
3697
|
winner_id: z.string().uuid(),
|
|
3673
|
-
winner_text: z.string().min(1).max(4e3).optional(),
|
|
3674
|
-
winner_scope: MemoryScope.optional(),
|
|
3698
|
+
winner_text: z.string().min(1).max(4e3).nullable().optional(),
|
|
3699
|
+
winner_scope: MemoryScope.nullable().optional(),
|
|
3675
3700
|
winner_path_scope: z.string().max(512).nullable().optional(),
|
|
3676
|
-
rationale: z.string().max(2e3).optional()
|
|
3701
|
+
rationale: z.string().max(2e3).nullable().optional()
|
|
3677
3702
|
});
|
|
3678
3703
|
var SummarizeSessionResult = z.object({
|
|
3679
3704
|
summary_text: z.string().min(1).max(4e3)
|
|
@@ -3688,11 +3713,11 @@ var ExtractedRule = z.object({
|
|
|
3688
3713
|
path_scope: z.string().max(512).nullable().optional(),
|
|
3689
3714
|
confidence: z.number().min(0).max(1),
|
|
3690
3715
|
is_destructive_risky: z.boolean().optional(),
|
|
3691
|
-
rationale: z.string().max(500).optional()
|
|
3716
|
+
rationale: z.string().max(500).nullable().optional()
|
|
3692
3717
|
});
|
|
3693
3718
|
var ExtractRulesFromPromptResult = z.object({
|
|
3694
3719
|
rules: z.array(ExtractedRule).max(10),
|
|
3695
|
-
dropped_reason: z.string().max(500).optional()
|
|
3720
|
+
dropped_reason: z.string().max(500).nullable().optional()
|
|
3696
3721
|
});
|
|
3697
3722
|
var RESULT_SCHEMAS = {
|
|
3698
3723
|
verify_capture: VerifyCaptureResult,
|
|
@@ -3837,6 +3862,22 @@ function submitTask(db, taskId, agent, result) {
|
|
|
3837
3862
|
audit_entry_id: applyOutcome.audit_entry_id
|
|
3838
3863
|
};
|
|
3839
3864
|
}
|
|
3865
|
+
function abandonClaimedTask(db, taskId, agent, reason) {
|
|
3866
|
+
const existing = getTask(db, taskId);
|
|
3867
|
+
if (!existing || existing.status !== "claimed" || existing.claimed_by !== agent) {
|
|
3868
|
+
return false;
|
|
3869
|
+
}
|
|
3870
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
3871
|
+
const result = db.update(memoryMaintenanceTasks).set({
|
|
3872
|
+
status: "abandoned",
|
|
3873
|
+
claimed_by: null,
|
|
3874
|
+
claimed_at: null,
|
|
3875
|
+
claim_expires_at: null,
|
|
3876
|
+
failure_reason: reason.slice(0, 500),
|
|
3877
|
+
completed_at: now
|
|
3878
|
+
}).where(eq(memoryMaintenanceTasks.id, taskId)).run();
|
|
3879
|
+
return result.changes > 0;
|
|
3880
|
+
}
|
|
3840
3881
|
function releaseTask(db, taskId, agent, reason) {
|
|
3841
3882
|
const existing = getTask(db, taskId);
|
|
3842
3883
|
if (!existing) return { status: "not-found" };
|
|
@@ -3893,6 +3934,7 @@ export {
|
|
|
3893
3934
|
TaskClaimConflictError,
|
|
3894
3935
|
claimTask,
|
|
3895
3936
|
submitTask,
|
|
3937
|
+
abandonClaimedTask,
|
|
3896
3938
|
releaseTask,
|
|
3897
3939
|
dispatchPendingTasks,
|
|
3898
3940
|
hasAnyLlmProvider,
|
|
@@ -3925,4 +3967,4 @@ export {
|
|
|
3925
3967
|
processCorrection,
|
|
3926
3968
|
processReviewFeedback
|
|
3927
3969
|
};
|
|
3928
|
-
//# sourceMappingURL=chunk-
|
|
3970
|
+
//# sourceMappingURL=chunk-LLIYJ6CD.js.map
|