agenr 3.2.0 → 3.3.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/CHANGELOG.md +25 -0
- package/README.md +7 -5
- package/dist/adapters/skeln/index.d.ts +1 -2
- package/dist/adapters/skeln/index.js +2629 -85
- package/dist/{chunk-UEGURBBW.js → chunk-KH52KJSJ.js} +1 -1
- package/dist/{chunk-TMDNFBBC.js → chunk-M5M65AYP.js} +1 -2
- package/dist/{chunk-6HY5F5FE.js → chunk-RYMSM3OS.js} +10 -8
- package/dist/{chunk-FMQTRTWE.js → chunk-Z5X7T4QZ.js} +4 -68
- package/dist/{ports-CpzWESmZ.d.ts → claim-slot-policy-CQ-h0GaV.d.ts} +10 -55
- package/dist/cli.js +1333 -136
- package/dist/core/recall/index.d.ts +2 -3
- package/dist/internal-eval-server.js +3 -4
- package/dist/internal-recall-eval-server.js +3 -4
- package/package.json +4 -4
- package/dist/adapters/openclaw/index.d.ts +0 -32
- package/dist/adapters/openclaw/index.js +0 -3112
- package/dist/chunk-GELCEVFA.js +0 -14
- package/dist/chunk-KL6X2E3I.js +0 -2660
- package/dist/chunk-ZAX3YSTU.js +0 -1207
- package/dist/claim-slot-policy-CdrW_1l4.d.ts +0 -13
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
readRequiredString,
|
|
24
24
|
truncate,
|
|
25
25
|
validateTemporalValidityRange
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-Z5X7T4QZ.js";
|
|
27
27
|
import {
|
|
28
28
|
compactClaimKey,
|
|
29
29
|
describeClaimKeyNormalizationFailure,
|
|
@@ -4055,7 +4055,6 @@ export {
|
|
|
4055
4055
|
formatErrorMessage,
|
|
4056
4056
|
buildEntryMemoryResolverPorts,
|
|
4057
4057
|
resolveTargetEntry,
|
|
4058
|
-
readBooleanParam,
|
|
4059
4058
|
ENTRY_TYPE_DESCRIPTION,
|
|
4060
4059
|
EXPIRY_DESCRIPTION,
|
|
4061
4060
|
UPDATE_EXPIRY_DESCRIPTION,
|
|
@@ -3,16 +3,10 @@ import {
|
|
|
3
3
|
computeProcedureRevisionHash,
|
|
4
4
|
computeProcedureSourceHash
|
|
5
5
|
} from "./chunk-ZYADFKX3.js";
|
|
6
|
-
import {
|
|
7
|
-
BEFORE_TURN_DEBUG_ARTIFACT_DEFAULT_TOP_K,
|
|
8
|
-
BEFORE_TURN_DEBUG_ARTIFACT_MAX_TOP_K,
|
|
9
|
-
RECALL_DEBUG_ARTIFACT_DEFAULT_TOP_K,
|
|
10
|
-
RECALL_DEBUG_ARTIFACT_MAX_TOP_K
|
|
11
|
-
} from "./chunk-GELCEVFA.js";
|
|
12
6
|
import {
|
|
13
7
|
formatAgenrBeforeTurnRecall,
|
|
14
8
|
runBeforeTurn
|
|
15
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KH52KJSJ.js";
|
|
16
10
|
import {
|
|
17
11
|
CLAIM_KEY_SOURCES,
|
|
18
12
|
CLAIM_KEY_STATUSES,
|
|
@@ -41,7 +35,7 @@ import {
|
|
|
41
35
|
resolveEmbeddingModel,
|
|
42
36
|
resolveModel,
|
|
43
37
|
runUnifiedRecall
|
|
44
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-Z5X7T4QZ.js";
|
|
45
39
|
import {
|
|
46
40
|
recall
|
|
47
41
|
} from "./chunk-5LADPJ4C.js";
|
|
@@ -444,6 +438,14 @@ function applyTelemetryWriteGate(ports, sandbox) {
|
|
|
444
438
|
};
|
|
445
439
|
}
|
|
446
440
|
|
|
441
|
+
// src/app/debug-artifacts/before-turn.ts
|
|
442
|
+
var BEFORE_TURN_DEBUG_ARTIFACT_DEFAULT_TOP_K = 10;
|
|
443
|
+
var BEFORE_TURN_DEBUG_ARTIFACT_MAX_TOP_K = 25;
|
|
444
|
+
|
|
445
|
+
// src/app/debug-artifacts/recall.ts
|
|
446
|
+
var RECALL_DEBUG_ARTIFACT_DEFAULT_TOP_K = 10;
|
|
447
|
+
var RECALL_DEBUG_ARTIFACT_MAX_TOP_K = 25;
|
|
448
|
+
|
|
447
449
|
// src/app/evals/before-turn/build-debug-artifact.ts
|
|
448
450
|
function buildBeforeTurnDebugArtifact(params) {
|
|
449
451
|
const { request, patch, sandbox } = params;
|
|
@@ -152,6 +152,9 @@ var DEFAULT_AGENR_FEATURE_FLAGS = {
|
|
|
152
152
|
sessionTreeCompaction: false,
|
|
153
153
|
goalContinuation: false
|
|
154
154
|
};
|
|
155
|
+
function createAllEnabledFeatureFlagConfig() {
|
|
156
|
+
return Object.fromEntries(AGENR_FEATURE_FLAG_KEYS.map((key) => [key, true]));
|
|
157
|
+
}
|
|
155
158
|
|
|
156
159
|
// src/adapters/config/parse-feature-flags.ts
|
|
157
160
|
function parseFeatureFlags(value, path5, issues) {
|
|
@@ -5436,8 +5439,6 @@ async function rollbackTransaction(transaction) {
|
|
|
5436
5439
|
}
|
|
5437
5440
|
|
|
5438
5441
|
// src/adapters/shared/memory-tool-format.ts
|
|
5439
|
-
var DEFAULT_RECALL_LIMIT = 10;
|
|
5440
|
-
var RESULT_SUBJECT_LOG_LIMIT = 5;
|
|
5441
5442
|
var ENTRY_PREVIEW_MAX_CHARS = 220;
|
|
5442
5443
|
var ENTRY_FETCH_MAX_CONTENT_CHARS = 32768;
|
|
5443
5444
|
function buildEntryRecallPreview(content) {
|
|
@@ -5469,68 +5470,6 @@ function truncate(value, maxChars) {
|
|
|
5469
5470
|
}
|
|
5470
5471
|
return `${value.slice(0, maxChars - 3).trimEnd()}...`;
|
|
5471
5472
|
}
|
|
5472
|
-
function sanitizeStoreToolParams(params) {
|
|
5473
|
-
return {
|
|
5474
|
-
type: params.type,
|
|
5475
|
-
subject: params.subject,
|
|
5476
|
-
...params.importance !== void 0 ? { importance: params.importance } : {},
|
|
5477
|
-
...params.expiry !== void 0 ? { expiry: params.expiry } : {},
|
|
5478
|
-
...params.tags.length > 0 ? { tags: params.tags } : {},
|
|
5479
|
-
contentLength: params.content.length,
|
|
5480
|
-
...params.sourceContext !== void 0 ? { sourceContextLength: params.sourceContext.length } : {},
|
|
5481
|
-
...params.supersedes !== void 0 ? { hasSupersedes: true } : {},
|
|
5482
|
-
...params.claimKey !== void 0 ? { hasClaimKey: true } : {},
|
|
5483
|
-
...params.validFrom !== void 0 ? { hasValidFrom: true } : {},
|
|
5484
|
-
...params.validTo !== void 0 ? { hasValidTo: true } : {}
|
|
5485
|
-
};
|
|
5486
|
-
}
|
|
5487
|
-
function formatRecallToolSummary(params) {
|
|
5488
|
-
const parts = [`query=${JSON.stringify(truncate(params.query, 80))}`];
|
|
5489
|
-
if (params.mode) {
|
|
5490
|
-
parts.push(`mode=${params.mode}`);
|
|
5491
|
-
}
|
|
5492
|
-
if (params.limit !== void 0 && params.limit !== DEFAULT_RECALL_LIMIT) {
|
|
5493
|
-
parts.push(`limit=${params.limit}`);
|
|
5494
|
-
}
|
|
5495
|
-
if (params.types.length > 0) {
|
|
5496
|
-
parts.push(`types=${JSON.stringify(params.types)}`);
|
|
5497
|
-
}
|
|
5498
|
-
if (params.tags.length > 0) {
|
|
5499
|
-
parts.push(`tags=${JSON.stringify(params.tags)}`);
|
|
5500
|
-
}
|
|
5501
|
-
if (params.asOf) {
|
|
5502
|
-
parts.push(`as_of=${JSON.stringify(params.asOf)}`);
|
|
5503
|
-
}
|
|
5504
|
-
if (params.budget !== void 0) {
|
|
5505
|
-
parts.push(`budget=${params.budget}`);
|
|
5506
|
-
}
|
|
5507
|
-
return parts.join(" ");
|
|
5508
|
-
}
|
|
5509
|
-
function sanitizeRecallToolParams(params) {
|
|
5510
|
-
return {
|
|
5511
|
-
query: params.query,
|
|
5512
|
-
...params.mode ? { mode: params.mode } : {},
|
|
5513
|
-
...params.limit !== void 0 ? { limit: params.limit } : {},
|
|
5514
|
-
...params.threshold !== void 0 ? { threshold: params.threshold } : {},
|
|
5515
|
-
...params.types.length > 0 ? { types: params.types } : {},
|
|
5516
|
-
...params.tags.length > 0 ? { tags: params.tags } : {},
|
|
5517
|
-
...params.asOf ? { asOf: params.asOf } : {},
|
|
5518
|
-
...params.budget !== void 0 ? { budget: params.budget } : {}
|
|
5519
|
-
};
|
|
5520
|
-
}
|
|
5521
|
-
function formatUnifiedRecallLogSummary(result) {
|
|
5522
|
-
const procedureCount = result.procedureCandidates.length;
|
|
5523
|
-
const procedureSummary = result.procedure ? ` [procedure: ${JSON.stringify(truncate(result.procedure.title, 80))}]` : "";
|
|
5524
|
-
const entrySubjects = result.entries.map((entry) => entry.entry.subject.trim()).filter((subject) => subject.length > 0);
|
|
5525
|
-
const displayed = entrySubjects.slice(0, RESULT_SUBJECT_LOG_LIMIT).map((subject) => JSON.stringify(truncate(subject, 80)));
|
|
5526
|
-
const remaining = entrySubjects.length - RESULT_SUBJECT_LOG_LIMIT;
|
|
5527
|
-
const suffix = displayed.length === 0 ? "" : ` [entry subjects: ${displayed.join(", ")}${remaining > 0 ? `, ... and ${remaining} more` : ""}]`;
|
|
5528
|
-
const entryEpisodeSummary = `${result.episodes.length} episode${result.episodes.length === 1 ? "" : "s"}, ${result.entries.length} entr${result.entries.length === 1 ? "y" : "ies"}`;
|
|
5529
|
-
if (procedureCount === 0 && !result.procedure) {
|
|
5530
|
-
return `${entryEpisodeSummary}${suffix}`;
|
|
5531
|
-
}
|
|
5532
|
-
return `${procedureCount} procedure candidate${procedureCount === 1 ? "" : "s"}, ${entryEpisodeSummary}${procedureSummary}${suffix}`;
|
|
5533
|
-
}
|
|
5534
5473
|
function buildRecallToolDetails(result, extraDetails = {}) {
|
|
5535
5474
|
return {
|
|
5536
5475
|
status: "ok",
|
|
@@ -8005,6 +7944,7 @@ export {
|
|
|
8005
7944
|
parseOptionalTimestampString,
|
|
8006
7945
|
AGENR_FEATURE_FLAG_KEYS,
|
|
8007
7946
|
DEFAULT_AGENR_FEATURE_FLAGS,
|
|
7947
|
+
createAllEnabledFeatureFlagConfig,
|
|
8008
7948
|
DEFAULT_SURGEON_COST_CAP,
|
|
8009
7949
|
DEFAULT_SURGEON_DAILY_COST_CAP,
|
|
8010
7950
|
DEFAULT_SURGEON_CONTEXT_LIMIT,
|
|
@@ -8037,10 +7977,6 @@ export {
|
|
|
8037
7977
|
recallResultHasTruncatedEntryPreviews,
|
|
8038
7978
|
assertEntryFetchableContentLength,
|
|
8039
7979
|
truncate,
|
|
8040
|
-
sanitizeStoreToolParams,
|
|
8041
|
-
formatRecallToolSummary,
|
|
8042
|
-
sanitizeRecallToolParams,
|
|
8043
|
-
formatUnifiedRecallLogSummary,
|
|
8044
7980
|
buildRecallToolDetails,
|
|
8045
7981
|
formatFetchedEntryText,
|
|
8046
7982
|
buildFetchToolDetails,
|
|
@@ -334,54 +334,6 @@ interface Procedure extends ProcedureDefinition, ProcedureLifecycleMetadata {
|
|
|
334
334
|
source_file?: string;
|
|
335
335
|
embedding?: number[];
|
|
336
336
|
}
|
|
337
|
-
/**
|
|
338
|
-
* Normalized transcript message emitted by transcript adapters.
|
|
339
|
-
*/
|
|
340
|
-
interface TranscriptMessage {
|
|
341
|
-
index: number;
|
|
342
|
-
role: "user" | "assistant";
|
|
343
|
-
text: string;
|
|
344
|
-
timestamp?: string;
|
|
345
|
-
}
|
|
346
|
-
/**
|
|
347
|
-
* Session-level metadata derived while parsing a transcript file.
|
|
348
|
-
*/
|
|
349
|
-
interface SessionTranscriptMetadata {
|
|
350
|
-
sessionId?: string;
|
|
351
|
-
startedAt?: string;
|
|
352
|
-
endedAt?: string;
|
|
353
|
-
messageCount: number;
|
|
354
|
-
transcriptHash: string;
|
|
355
|
-
}
|
|
356
|
-
/**
|
|
357
|
-
* Parsed transcript metadata exposed to transcript consumers.
|
|
358
|
-
*/
|
|
359
|
-
interface ParsedTranscriptMetadata extends SessionTranscriptMetadata {
|
|
360
|
-
sessionLabel?: string;
|
|
361
|
-
modelsUsed?: string[];
|
|
362
|
-
/** Best-effort surface reconstructed from transcript content. */
|
|
363
|
-
reconstructedSurface?: string | null;
|
|
364
|
-
/** Provenance for the reconstructed surface value. */
|
|
365
|
-
surfaceReconstructionSource?: "reconstructed" | "none";
|
|
366
|
-
/** Stable source identity derived by the transcript adapter when available. */
|
|
367
|
-
sourceIdentity?: string;
|
|
368
|
-
/** Adapter-specific kind describing the stable source identity. */
|
|
369
|
-
sourceIdentityKind?: string;
|
|
370
|
-
/** Best-effort working-directory or workspace path for the session. */
|
|
371
|
-
workingDirectory?: string;
|
|
372
|
-
/** Explicit user identifier carried by the transcript source when available. */
|
|
373
|
-
userId?: string;
|
|
374
|
-
/** Explicit project identifier carried by the transcript source when available. */
|
|
375
|
-
project?: string;
|
|
376
|
-
}
|
|
377
|
-
/**
|
|
378
|
-
* Parsed transcript with normalized messages and source metadata.
|
|
379
|
-
*/
|
|
380
|
-
interface ParsedTranscript {
|
|
381
|
-
messages: TranscriptMessage[];
|
|
382
|
-
metadata: ParsedTranscriptMetadata;
|
|
383
|
-
warnings: string[];
|
|
384
|
-
}
|
|
385
337
|
|
|
386
338
|
/**
|
|
387
339
|
* Aggregate active corpus counts for one entity prefix.
|
|
@@ -912,14 +864,17 @@ interface CrossEncoderPort {
|
|
|
912
864
|
*/
|
|
913
865
|
rank(query: string, passages: readonly CrossEncoderPassage[]): Promise<CrossEncoderScore[]>;
|
|
914
866
|
}
|
|
867
|
+
|
|
868
|
+
/**
|
|
869
|
+
* Runtime slot-policy classes used by claim-centric read surfaces.
|
|
870
|
+
*/
|
|
871
|
+
type ClaimSlotPolicy = "exclusive" | "multivalued";
|
|
915
872
|
/**
|
|
916
|
-
*
|
|
873
|
+
* Data-driven slot-policy overrides keyed by canonical claim-key attribute head.
|
|
917
874
|
*/
|
|
918
|
-
interface
|
|
919
|
-
/**
|
|
920
|
-
|
|
921
|
-
verbose?: boolean;
|
|
922
|
-
}): Promise<ParsedTranscript>;
|
|
875
|
+
interface ClaimSlotPolicyConfig {
|
|
876
|
+
/** Optional attribute-head policy overrides such as `integration -> exclusive`. */
|
|
877
|
+
attributeHeads?: Readonly<Record<string, ClaimSlotPolicy>>;
|
|
923
878
|
}
|
|
924
879
|
|
|
925
|
-
export { type
|
|
880
|
+
export { type ClaimSlotPolicyConfig as C, DEFAULT_NEIGHBORHOOD_BUDGET as D, type EntryType as E, type FtsCandidate as F, type LlmPort as L, type NeighborhoodFamily as N, type ProcedureDatabasePort as P, type RecallInput as R, type SeededRerankCandidate as S, type VectorCandidate as V, type CrossEncoderPort as a, type Expiry as b, type RecallPorts as c, type RecallOutput as d, DEFAULT_SEEDED_RERANK_WEIGHT as e, DEFAULT_STRONG_SEED_SCORE_GAP as f, DEFAULT_STRONG_SEED_TOP_N as g, type EntityAttributeKind as h, type EntityAttributeQueryShape as i, type EntryFilters as j, type EntryNeighborhoodRequest as k, type RecallCandidateEntry as l, type RecallRankingProfile as m, type SeededRerankOptions as n, selectStrongSeeds as o, sharesEntryLineage as p, sharesEpisodeLineage as q, sharesProcedureLineage as r, seededRerank as s, type Entry as t, type ClaimSlotPolicy as u, type DatabasePort as v, type EpisodeDatabasePort as w, type EmbeddingPort as x };
|