oh-my-knowledge 0.48.0 → 0.49.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 +50 -18
- package/README.zh.md +55 -23
- package/dist/analysis/coverage-analyzer.d.ts +1 -0
- package/dist/analysis/coverage-analyzer.js +125 -62
- package/dist/analysis/failure-clusterer.js +2 -1
- package/dist/analysis/gap-analyzer.d.ts +2 -2
- package/dist/analysis/gap-analyzer.js +13 -3
- package/dist/analysis/hedging-classifier.d.ts +2 -2
- package/dist/analysis/hedging-classifier.js +3 -4
- package/dist/analysis/report-diagnostics.js +9 -7
- package/dist/analysis/sample-diagnostics.js +6 -6
- package/dist/artifact-graph/doctor.js +15 -7
- package/dist/assets/agent-skills/omk/SKILL.md +27 -7
- package/dist/assets/agent-skills/omk/references/commands.md +18 -17
- package/dist/authoring/evolver.d.ts +10 -6
- package/dist/authoring/evolver.js +496 -83
- package/dist/authoring/generator.d.ts +3 -3
- package/dist/authoring/generator.js +5 -10
- package/dist/authoring/sample-fixer.d.ts +8 -6
- package/dist/authoring/sample-fixer.js +76 -5
- package/dist/cli/commands/doctor.js +31 -14
- package/dist/cli/commands/eval/index.d.ts +3 -0
- package/dist/cli/commands/eval/index.js +163 -17
- package/dist/cli/commands/evolve.d.ts +4 -4
- package/dist/cli/commands/evolve.js +27 -13
- package/dist/cli/commands/init.js +16 -3
- package/dist/cli/commands/observe/inbox.js +28 -21
- package/dist/cli/commands/observe/index.js +20 -11
- package/dist/cli/commands/observe/ingest.d.ts +3 -0
- package/dist/cli/commands/observe/ingest.js +30 -2
- package/dist/cli/commands/sample.d.ts +6 -3
- package/dist/cli/commands/sample.js +72 -68
- package/dist/cli/lib/codex-model-hint.d.ts +9 -0
- package/dist/cli/lib/codex-model-hint.js +45 -0
- package/dist/cli/lib/generation-failure-hint.d.ts +2 -0
- package/dist/cli/lib/generation-failure-hint.js +61 -0
- package/dist/cli/lib/i18n-dict/common.d.ts +1 -1
- package/dist/cli/lib/i18n-dict/common.js +4 -0
- package/dist/cli/lib/i18n-dict/gen.d.ts +1 -1
- package/dist/cli/lib/i18n-dict/gen.js +38 -6
- package/dist/cli/lib/i18n-dict/help.js +6 -6
- package/dist/cli/lib/i18n-dict/init.d.ts +1 -1
- package/dist/cli/lib/i18n-dict/init.js +13 -9
- package/dist/cli/lib/i18n-dict/run.d.ts +1 -1
- package/dist/cli/lib/i18n-dict/run.js +34 -2
- package/dist/cli/lib/llm-failure-classifier.d.ts +2 -0
- package/dist/cli/lib/llm-failure-classifier.js +8 -0
- package/dist/cli/lib/parse-run-config.d.ts +6 -5
- package/dist/cli/lib/parse-run-config.js +16 -9
- package/dist/cli/lib/runtime-defaults.d.ts +21 -0
- package/dist/cli/lib/runtime-defaults.js +79 -0
- package/dist/diagnosis/observe-mapper.js +14 -15
- package/dist/diagnosis/observe-producer.js +3 -1
- package/dist/diagnosis/studio-projection.js +14 -7
- package/dist/diagnosis/types.d.ts +2 -0
- package/dist/diagnosis/types.js +12 -0
- package/dist/doctor/endpoint-rule.js +2 -1
- package/dist/eval-core/artifact-file-names.js +18 -1
- package/dist/eval-core/artifact-index.d.ts +7 -11
- package/dist/eval-core/artifact-index.js +139 -80
- package/dist/eval-core/cache.d.ts +12 -3
- package/dist/eval-core/cache.js +89 -29
- package/dist/eval-core/comparability.js +10 -6
- package/dist/eval-core/evaluation-execution.d.ts +2 -1
- package/dist/eval-core/evaluation-execution.js +122 -37
- package/dist/eval-core/evaluation-job.d.ts +4 -1
- package/dist/eval-core/evaluation-job.js +4 -1
- package/dist/eval-core/evaluation-reporting.d.ts +15 -13
- package/dist/eval-core/evaluation-reporting.js +54 -52
- package/dist/eval-core/execution-strategy.d.ts +2 -0
- package/dist/eval-core/execution-strategy.js +11 -9
- package/dist/eval-core/fact-checker.js +15 -7
- package/dist/eval-core/holdout.js +3 -2
- package/dist/eval-core/judge-independence.d.ts +2 -2
- package/dist/eval-core/mock-hook.cjs +23 -6
- package/dist/eval-core/mocks-runtime.js +30 -8
- package/dist/eval-core/report-document.d.ts +12 -0
- package/dist/eval-core/report-document.js +1151 -0
- package/dist/eval-core/report-extensions.d.ts +4 -0
- package/dist/eval-core/report-extensions.js +500 -0
- package/dist/eval-core/report-file-migration.js +7 -2
- package/dist/eval-core/resume-compatibility.d.ts +31 -0
- package/dist/eval-core/resume-compatibility.js +141 -0
- package/dist/eval-core/sample-fingerprint.d.ts +12 -0
- package/dist/eval-core/sample-fingerprint.js +193 -0
- package/dist/eval-core/schema.js +86 -31
- package/dist/eval-core/verdict.d.ts +8 -4
- package/dist/eval-core/verdict.js +24 -10
- package/dist/eval-workflows/batch-evaluation-workflow.d.ts +2 -1
- package/dist/eval-workflows/batch-evaluation-workflow.js +25 -12
- package/dist/eval-workflows/evaluation-pipeline/preflight-warnings.d.ts +10 -5
- package/dist/eval-workflows/evaluation-pipeline/preflight-warnings.js +58 -21
- package/dist/eval-workflows/evaluation-pipeline/report-finalize.js +3 -1
- package/dist/eval-workflows/evaluation-pipeline/run-state.d.ts +4 -1
- package/dist/eval-workflows/evaluation-pipeline/run-state.js +4 -1
- package/dist/eval-workflows/evaluation-pipeline/test-set-hash.d.ts +6 -5
- package/dist/eval-workflows/evaluation-pipeline/test-set-hash.js +17 -10
- package/dist/eval-workflows/evaluation-pipeline.js +12 -7
- package/dist/eval-workflows/run-evaluation.d.ts +9 -7
- package/dist/eval-workflows/run-evaluation.js +79 -51
- package/dist/executors/anthropic-api.js +65 -9
- package/dist/executors/claude-cli.js +16 -79
- package/dist/executors/claude-protocol.d.ts +28 -0
- package/dist/executors/claude-protocol.js +180 -0
- package/dist/executors/claude-sdk-trace.js +56 -28
- package/dist/executors/claude-sdk.d.ts +1 -0
- package/dist/executors/claude-sdk.js +39 -93
- package/dist/executors/codex-cli-trace.js +166 -31
- package/dist/executors/codex-cli.d.ts +6 -8
- package/dist/executors/codex-cli.js +49 -151
- package/dist/executors/codex-protocol.d.ts +24 -0
- package/dist/executors/codex-protocol.js +234 -0
- package/dist/executors/codex-sdk.js +68 -120
- package/dist/executors/gemini.js +88 -13
- package/dist/executors/index.d.ts +2 -3
- package/dist/executors/index.js +5 -3
- package/dist/executors/openai-api.js +70 -9
- package/dist/executors/runtime-fingerprint.js +88 -11
- package/dist/executors/script-command.d.ts +8 -0
- package/dist/executors/script-command.js +87 -0
- package/dist/executors/script.js +202 -29
- package/dist/executors/shared.d.ts +35 -3
- package/dist/executors/shared.js +113 -15
- package/dist/grading/assertions.d.ts +1 -1
- package/dist/grading/assertions.js +19 -9
- package/dist/grading/diagnostic.d.ts +9 -2
- package/dist/grading/diagnostic.js +25 -2
- package/dist/grading/index.js +10 -4
- package/dist/grading/judge.js +19 -6
- package/dist/grading/layered-scores.d.ts +2 -3
- package/dist/grading/layered-scores.js +2 -3
- package/dist/inputs/load-samples.d.ts +1 -2
- package/dist/inputs/load-samples.js +23 -1
- package/dist/inputs/mcp-resolver.js +6 -3
- package/dist/inputs/sample-document.d.ts +11 -0
- package/dist/inputs/sample-document.js +96 -0
- package/dist/managed/evidence.d.ts +1 -0
- package/dist/managed/evidence.js +1 -1
- package/dist/managed/store.js +200 -91
- package/dist/observability/codex-trace-adapter.d.ts +5 -0
- package/dist/observability/codex-trace-adapter.js +850 -0
- package/dist/observability/experience.d.ts +32 -6
- package/dist/observability/experience.js +2695 -459
- package/dist/observability/feedback-matchers.js +16 -1
- package/dist/observability/inbox-view-model.d.ts +1 -1
- package/dist/observability/inbox-view-model.js +19 -14
- package/dist/observability/inbox.d.ts +7 -1
- package/dist/observability/inbox.js +632 -124
- package/dist/observability/problem-patterns.js +2 -0
- package/dist/observability/review-state.d.ts +6 -0
- package/dist/observability/review-state.js +235 -63
- package/dist/observability/skill-chain-advisories.js +1 -1
- package/dist/observability/skill-chain.js +17 -4
- package/dist/observability/skill-health-analyzer.d.ts +32 -7
- package/dist/observability/skill-health-analyzer.js +194 -121
- package/dist/observability/skill-health-report.d.ts +10 -0
- package/dist/observability/skill-health-report.js +620 -0
- package/dist/observability/soft-standards/constants.d.ts +0 -1
- package/dist/observability/soft-standards/constants.js +0 -1
- package/dist/observability/soft-standards/index.d.ts +1 -1
- package/dist/observability/soft-standards/index.js +1 -1
- package/dist/observability/soft-standards/llm-extractor.js +8 -10
- package/dist/observability/soft-standards/skill-standards-store.d.ts +2 -1
- package/dist/observability/soft-standards/skill-standards-store.js +59 -18
- package/dist/observability/soft-standards/types.d.ts +2 -2
- package/dist/observability/trace-adapter.d.ts +12 -7
- package/dist/observability/trace-adapter.js +11 -9
- package/dist/observability/trace-attribution.d.ts +13 -5
- package/dist/observability/trace-attribution.js +315 -21
- package/dist/observability/trace-ingestion.d.ts +9 -0
- package/dist/observability/trace-ingestion.js +80 -0
- package/dist/observability/trace-ir.d.ts +113 -0
- package/dist/observability/trace-ir.js +87 -0
- package/dist/observability/trace-segmenter.d.ts +19 -6
- package/dist/observability/trace-segmenter.js +377 -196
- package/dist/observability/trace-session-index.d.ts +19 -0
- package/dist/observability/trace-session-index.js +68 -0
- package/dist/observability/trace-source.d.ts +12 -4
- package/dist/observability/trace-source.js +939 -215
- package/dist/renderer/html-renderer.js +37 -6
- package/dist/renderer/icons.js +3 -0
- package/dist/renderer/observation-inbox-renderer.js +208 -90
- package/dist/renderer/skill-detail-renderer.js +452 -109
- package/dist/renderer/skill-health-renderer.js +69 -12
- package/dist/renderer/summary.js +28 -7
- package/dist/renderer/table.js +21 -4
- package/dist/renderer/test-view.d.ts +1 -0
- package/dist/renderer/test-view.js +44 -9
- package/dist/server/indexed-report-store.js +14 -18
- package/dist/server/job-store.js +64 -26
- package/dist/server/report-server.js +190 -78
- package/dist/server/report-store.js +57 -80
- package/dist/server/skill-index.js +143 -49
- package/dist/server/skill-insights.js +44 -5
- package/dist/shared/artifact-graph.d.ts +3 -0
- package/dist/shared/artifact-graph.js +224 -0
- package/dist/shared/assertion-types.d.ts +8 -0
- package/dist/shared/assertion-types.js +46 -0
- package/dist/shared/atomic-json.d.ts +8 -0
- package/dist/shared/atomic-json.js +33 -0
- package/dist/shared/diagnosis-schema.d.ts +9 -0
- package/dist/shared/diagnosis-schema.js +181 -0
- package/dist/shared/doctor-report.d.ts +3 -0
- package/dist/shared/doctor-report.js +103 -0
- package/dist/shared/evaluation-job.d.ts +6 -0
- package/dist/shared/evaluation-job.js +217 -0
- package/dist/shared/executor-result.d.ts +17 -0
- package/dist/shared/executor-result.js +221 -0
- package/dist/shared/file-lock.d.ts +12 -0
- package/dist/shared/file-lock.js +129 -0
- package/dist/shared/json-value.d.ts +5 -0
- package/dist/shared/json-value.js +36 -0
- package/dist/shared/keyed-mutex.d.ts +7 -0
- package/dist/shared/keyed-mutex.js +24 -0
- package/dist/shared/record-count.d.ts +8 -0
- package/dist/shared/record-count.js +43 -0
- package/dist/shared/sample-contract.d.ts +3 -0
- package/dist/shared/sample-contract.js +332 -0
- package/dist/shared/timestamp.d.ts +6 -0
- package/dist/shared/timestamp.js +64 -0
- package/dist/shared/token-usage.d.ts +19 -0
- package/dist/shared/token-usage.js +50 -0
- package/dist/shared/tool-call-status.d.ts +8 -0
- package/dist/shared/tool-call-status.js +28 -0
- package/dist/shared/tool-identity.d.ts +21 -0
- package/dist/shared/tool-identity.js +84 -0
- package/dist/shared/tool-search.js +73 -16
- package/dist/shared/trace-projection.d.ts +5 -0
- package/dist/shared/trace-projection.js +20 -0
- package/dist/shared/trace-source-kind.d.ts +3 -0
- package/dist/shared/trace-source-kind.js +12 -0
- package/dist/types/diagnosis.d.ts +2 -0
- package/dist/types/eval.d.ts +4 -0
- package/dist/types/executor.d.ts +32 -5
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/judge.d.ts +2 -0
- package/dist/types/observability.d.ts +116 -9
- package/dist/types/report.d.ts +58 -6
- package/dist/types/skill-index.d.ts +7 -0
- package/dist/types/trace.d.ts +2 -0
- package/dist/types/trace.js +1 -0
- package/package.json +9 -5
|
@@ -59,11 +59,13 @@ const USER_GOAL_SHIFT_TERMS = [
|
|
|
59
59
|
'新启动一个',
|
|
60
60
|
'另开一个',
|
|
61
61
|
'再开一个',
|
|
62
|
-
'参考apply-cc的能力新开',
|
|
63
62
|
'拉下最新',
|
|
64
63
|
'拉取最新',
|
|
65
64
|
'切到最新',
|
|
66
65
|
];
|
|
66
|
+
const USER_GOAL_SHIFT_PATTERNS = [
|
|
67
|
+
/参考.{0,40}(?:能力|skill).{0,20}(?:新开|另开|启动)/gi,
|
|
68
|
+
];
|
|
67
69
|
const NEGATIVE_FEEDBACK_TERMS = [
|
|
68
70
|
'没有用',
|
|
69
71
|
'没用',
|
|
@@ -168,6 +170,9 @@ export function findUserGoalShiftMatches(value) {
|
|
|
168
170
|
for (const term of USER_GOAL_SHIFT_TERMS) {
|
|
169
171
|
pushTermMatches(value, term, ranges, false);
|
|
170
172
|
}
|
|
173
|
+
for (const pattern of USER_GOAL_SHIFT_PATTERNS) {
|
|
174
|
+
pushPatternMatches(value, pattern, ranges);
|
|
175
|
+
}
|
|
171
176
|
return ranges.sort((a, b) => a.start - b.start);
|
|
172
177
|
}
|
|
173
178
|
export function hasUserGoalShiftSignal(value) {
|
|
@@ -224,6 +229,16 @@ function pushTermMatches(value, term, ranges, requireBoundary, caseInsensitive =
|
|
|
224
229
|
index = haystack.indexOf(needle, index + needle.length);
|
|
225
230
|
}
|
|
226
231
|
}
|
|
232
|
+
function pushPatternMatches(value, pattern, ranges) {
|
|
233
|
+
pattern.lastIndex = 0;
|
|
234
|
+
for (const match of value.matchAll(pattern)) {
|
|
235
|
+
const start = match.index;
|
|
236
|
+
const end = start + match[0].length;
|
|
237
|
+
if (!ranges.some((range) => start < range.end && end > range.start)) {
|
|
238
|
+
ranges.push({ start, end });
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
227
242
|
function isTextBoundary(value) {
|
|
228
243
|
if (value === undefined)
|
|
229
244
|
return true;
|
|
@@ -31,7 +31,7 @@ export interface ObservationInboxViewModelOptions {
|
|
|
31
31
|
}
|
|
32
32
|
export declare function buildObservationInboxViewModel(observationsDir: string, options?: ObservationInboxViewModelOptions): ObservationInboxViewModel;
|
|
33
33
|
export { severityReasonFor } from './inbox.js';
|
|
34
|
-
export { observationMetricAnnotationTargetId } from './review-state.js';
|
|
34
|
+
export { observationMetricAnnotationEntry, observationMetricAnnotationTargetId, } from './review-state.js';
|
|
35
35
|
export { resolveObservationReviewSession } from './resolved-review.js';
|
|
36
36
|
export { getSkillChainAdvisory, resolveAdvisoryCommand } from './skill-chain-advisories.js';
|
|
37
37
|
export { ASSISTANT_DELIVERABLE_ARTIFACT_RE, hasAssistantDeliverableArtifactText, hasAssistantDeliverySignalText, hasUserHardRuleText, HARD_RULE_TEXT_RE, isAssistantProgressUpdateText, isScheduledTaskPromptText, isSyntheticUserMessageText, isUserInteractionMetricText, } from './text-signals.js';
|
|
@@ -4,6 +4,7 @@ import { resolveObservationReviewSession, } from './resolved-review.js';
|
|
|
4
4
|
import { buildObservationSkillChains } from './skill-chain.js';
|
|
5
5
|
import { loadSkillDerivedStandards, resolveSkillStandards, } from './soft-standards/index.js';
|
|
6
6
|
import { durationMsBetween } from '../shared/time.js';
|
|
7
|
+
import { incrementRecordCount, ownRecordValue, setOwnRecordValue, } from '../shared/record-count.js';
|
|
7
8
|
export function buildObservationInboxViewModel(observationsDir, options = {}) {
|
|
8
9
|
const activeSkill = options.skill?.trim() || undefined;
|
|
9
10
|
const allItems = filterItemsBySkill(queryObservationInbox(observationsDir), activeSkill);
|
|
@@ -12,30 +13,31 @@ export function buildObservationInboxViewModel(observationsDir, options = {}) {
|
|
|
12
13
|
const experienceReports = reports.flatMap((report) => report.experience ? [report.experience] : []);
|
|
13
14
|
const skillInvocationCounts = reports.reduce((acc, report) => {
|
|
14
15
|
for (const [skill, count] of Object.entries(report.meta.skillInvocationCounts ?? {})) {
|
|
15
|
-
acc
|
|
16
|
+
incrementRecordCount(acc, skill, count);
|
|
16
17
|
}
|
|
17
18
|
return acc;
|
|
18
19
|
}, {});
|
|
19
20
|
const skillSessionCounts = reports.reduce((acc, report) => {
|
|
20
21
|
for (const [skill, count] of Object.entries(report.meta.skillSessionCounts ?? {})) {
|
|
21
|
-
acc
|
|
22
|
+
incrementRecordCount(acc, skill, count);
|
|
22
23
|
}
|
|
23
24
|
return acc;
|
|
24
25
|
}, {});
|
|
25
26
|
const skillInvocationLastSeen = reports.reduce((acc, report) => {
|
|
26
27
|
for (const [skill, timestamp] of Object.entries(report.meta.skillInvocationLastSeen ?? {})) {
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
const previous = ownRecordValue(acc, skill);
|
|
29
|
+
if (!previous || timestamp > previous)
|
|
30
|
+
setOwnRecordValue(acc, skill, timestamp);
|
|
29
31
|
}
|
|
30
32
|
return acc;
|
|
31
33
|
}, {});
|
|
32
34
|
const skillToolCallCounts = reports.reduce((acc, report) => {
|
|
33
35
|
for (const [skill, counts] of Object.entries(report.meta.skillToolCallCounts ?? {})) {
|
|
34
|
-
const target = acc
|
|
36
|
+
const target = ownRecordValue(acc, skill) ?? {};
|
|
35
37
|
for (const [tool, count] of Object.entries(counts)) {
|
|
36
|
-
target
|
|
38
|
+
incrementRecordCount(target, tool, count);
|
|
37
39
|
}
|
|
38
|
-
acc
|
|
40
|
+
setOwnRecordValue(acc, skill, target);
|
|
39
41
|
}
|
|
40
42
|
return acc;
|
|
41
43
|
}, {});
|
|
@@ -54,25 +56,28 @@ export function buildObservationInboxViewModel(observationsDir, options = {}) {
|
|
|
54
56
|
...experienceReports.flatMap((report) => report.skills.map((skill) => skill.skillName)),
|
|
55
57
|
]));
|
|
56
58
|
const skillChains = buildObservationSkillChains(skillNames, process.cwd(), experienceReports);
|
|
57
|
-
const
|
|
59
|
+
const reviewState = loadObservationReviewState(observationsDir);
|
|
60
|
+
const skillDerivedStandards = loadSkillDerivedStandards(observationsDir, reviewState);
|
|
58
61
|
const skillResolvedStandards = Object.fromEntries(skillNames.map((skillName) => [skillName, resolveSkillStandards(skillName, {
|
|
59
62
|
observationsDir,
|
|
60
63
|
skillChain: skillChains[skillName],
|
|
61
64
|
derivedStandards: skillDerivedStandards,
|
|
62
65
|
})]));
|
|
63
|
-
const latestSeen = allItems
|
|
66
|
+
const latestSeen = allItems
|
|
67
|
+
.filter((item) => (item.timestampedOccurrences
|
|
68
|
+
?? (item.firstSeen === '1970-01-01T00:00:00.000Z' ? 0 : item.occurrences)) > 0)
|
|
69
|
+
.reduce((latest, item) => item.lastSeen > latest ? item.lastSeen : latest, '');
|
|
64
70
|
const reportCount = reports.length;
|
|
65
71
|
const latestSeenLabel = latestSeen ? latestSeen.slice(0, 19).replace('T', ' ') : '—';
|
|
66
|
-
const reviewState = loadObservationReviewState(observationsDir);
|
|
67
72
|
const resolvedReviewSessions = {};
|
|
68
73
|
for (const experience of experienceReports) {
|
|
69
74
|
for (const session of experience.sessions) {
|
|
70
|
-
const enhancedReview = skillDerivedStandards
|
|
71
|
-
resolvedReviewSessions
|
|
75
|
+
const enhancedReview = ownRecordValue(skillDerivedStandards, session.skillName)?.enhancedReview;
|
|
76
|
+
setOwnRecordValue(resolvedReviewSessions, session.id, resolveObservationReviewSession({
|
|
72
77
|
session,
|
|
73
78
|
enhancedReview,
|
|
74
79
|
reviewState,
|
|
75
|
-
});
|
|
80
|
+
}));
|
|
76
81
|
}
|
|
77
82
|
}
|
|
78
83
|
return {
|
|
@@ -174,7 +179,7 @@ function buildReportSessionTimeRange(ranges = []) {
|
|
|
174
179
|
// 继续直接 import observability 内部 —— 它们不是「视图」,不在 facade 收敛范围。
|
|
175
180
|
// ============================================================================
|
|
176
181
|
export { severityReasonFor } from './inbox.js';
|
|
177
|
-
export { observationMetricAnnotationTargetId } from './review-state.js';
|
|
182
|
+
export { observationMetricAnnotationEntry, observationMetricAnnotationTargetId, } from './review-state.js';
|
|
178
183
|
export { resolveObservationReviewSession } from './resolved-review.js';
|
|
179
184
|
export { getSkillChainAdvisory, resolveAdvisoryCommand } from './skill-chain-advisories.js';
|
|
180
185
|
export { ASSISTANT_DELIVERABLE_ARTIFACT_RE, hasAssistantDeliverableArtifactText, hasAssistantDeliverySignalText, hasUserHardRuleText, HARD_RULE_TEXT_RE, isAssistantProgressUpdateText, isScheduledTaskPromptText, isSyntheticUserMessageText, isUserInteractionMetricText, } from './text-signals.js';
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import type { BuildObservationInboxReportOptions, ObservationEvidence, ObservationInboxItem, ObservationInboxReport, ObservationMessageRef, ObservationMessageWindow, ObservationSessionTimeRange, ObservationSeverityReasonCode, ObservationSignalSubtype, ObservationSignalType, ObservationSkillRollup, ObservationSourceKind } from '../types/index.js';
|
|
2
|
+
import { type PersistedObservationExperienceReport } from './experience.js';
|
|
2
3
|
export type { BuildObservationInboxReportOptions, ObservationEvidence, ObservationInboxItem, ObservationInboxReport, ObservationMessageRef, ObservationMessageWindow, ObservationSessionTimeRange, ObservationSeverityReasonCode, ObservationSignalSubtype, ObservationSignalType, ObservationSkillRollup, ObservationSourceKind, };
|
|
4
|
+
export type PersistedObservationInboxReport = Omit<ObservationInboxReport, 'experience'> & {
|
|
5
|
+
experience?: PersistedObservationExperienceReport;
|
|
6
|
+
};
|
|
3
7
|
export declare const DEFAULT_PROJECT_OBSERVATIONS_DIR: string;
|
|
4
8
|
export declare const DEFAULT_GLOBAL_OBSERVATIONS_DIR: string;
|
|
5
9
|
export declare const DEFAULT_OBSERVATIONS_DIR: string;
|
|
6
10
|
export declare function normalizeObservationKeyInput(value: unknown): string;
|
|
11
|
+
/** Legacy migration only. New reports take sourceKind from Trace IR. */
|
|
7
12
|
export declare function inferObservationSourceKind(sourceTrace: string): ObservationSourceKind;
|
|
8
13
|
export declare function severityReasonFor(item: Pick<ObservationInboxItem, 'signalType' | 'signalSubtype' | 'severity' | 'confidence' | 'evidence' | 'severityReasonCode'>, lang?: 'zh' | 'en'): string;
|
|
9
14
|
export declare function legacySeverityReasonFor(item: Pick<ObservationInboxItem, 'signalType' | 'signalSubtype' | 'severity' | 'confidence' | 'evidence'>): string;
|
|
@@ -16,12 +21,13 @@ export declare function severityReasonCodeFor(item: Pick<ObservationInboxItem, '
|
|
|
16
21
|
export declare function buildObservationInboxReport(tracePath: string, options?: BuildObservationInboxReportOptions): ObservationInboxReport;
|
|
17
22
|
export declare function aggregateInboxItems(items: ObservationInboxItem[]): ObservationInboxItem[];
|
|
18
23
|
export declare function saveObservationInboxReport(report: ObservationInboxReport, outDir?: string): string;
|
|
24
|
+
export declare function compactObservationInboxReport(report: ObservationInboxReport): PersistedObservationInboxReport;
|
|
19
25
|
export declare function loadObservationInboxReports(dir?: string): ObservationInboxReport[];
|
|
20
26
|
export declare function loadLatestObservationInboxReport(dir?: string): ObservationInboxReport | null;
|
|
21
27
|
export declare function loadLatestObservationInboxReports(dir?: string): ObservationInboxReport[];
|
|
22
28
|
export declare function queryObservationInbox(dir?: string): ObservationInboxItem[];
|
|
23
29
|
export declare function summarizeObservationInboxBySkill(items: ObservationInboxItem[], reports?: ObservationInboxReport[]): ObservationSkillRollup[];
|
|
24
30
|
export declare function findObservationInboxItem(id: string, dir?: string): ObservationInboxItem | null;
|
|
25
|
-
export declare function buildObservationMessageWindow(item: Pick<ObservationInboxItem, 'sourceTrace' | 'signalType' | 'evidence'>, radius?: number): ObservationMessageWindow | undefined;
|
|
31
|
+
export declare function buildObservationMessageWindow(item: Pick<ObservationInboxItem, 'sourceTrace' | 'signalType' | 'evidence'>, radius?: number, preloadedMessages?: ObservationMessageRef[]): ObservationMessageWindow | undefined;
|
|
26
32
|
export declare function formatObservationShow(item: ObservationInboxItem): string;
|
|
27
33
|
export declare function selectExploreInboxItems(items: ObservationInboxItem[], limit: number, includeNoise?: boolean, random?: () => number): ObservationInboxItem[];
|