qlogicagent 0.2.1 → 0.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/dist/agent.js +1 -0
- package/dist/cli.js +9 -0
- package/dist/contracts.js +1 -0
- package/dist/index.js +5 -15
- package/dist/orchestration.js +118 -0
- package/package.json +56 -42
- package/dist/agent/agent.js +0 -113
- package/dist/agent/tool-loop.js +0 -575
- package/dist/agent/types.js +0 -14
- package/dist/cli/main.js +0 -23
- package/dist/cli/stdio-server.js +0 -463
- package/dist/config/config.js +0 -21
- package/dist/contracts/hooks.js +0 -7
- package/dist/contracts/index.js +0 -10
- package/dist/contracts/planner.js +0 -2
- package/dist/contracts/skill-candidate.js +0 -195
- package/dist/contracts/todo.js +0 -9
- package/dist/llm/builtin-providers.js +0 -531
- package/dist/llm/index.js +0 -14
- package/dist/llm/llm-client.js +0 -67
- package/dist/llm/model-catalog.js +0 -191
- package/dist/llm/provider-def.js +0 -12
- package/dist/llm/provider-registry.js +0 -147
- package/dist/llm/transport.js +0 -27
- package/dist/llm/transports/anthropic-messages.js +0 -293
- package/dist/llm/transports/openai-chat.js +0 -165
- package/dist/orchestration/agent-registry.js +0 -116
- package/dist/orchestration/approval-aware-tool-plan.js +0 -87
- package/dist/orchestration/context-compression.js +0 -583
- package/dist/orchestration/conversation-repair.js +0 -429
- package/dist/orchestration/curator-scheduler.js +0 -135
- package/dist/orchestration/embedded-failover-policy.js +0 -168
- package/dist/orchestration/error-classification.js +0 -77
- package/dist/orchestration/failover-classification.js +0 -381
- package/dist/orchestration/failover-error.js +0 -198
- package/dist/orchestration/fork-subagent.js +0 -98
- package/dist/orchestration/index.js +0 -267
- package/dist/orchestration/memory-flush-policy.js +0 -85
- package/dist/orchestration/memory-provider.js +0 -2
- package/dist/orchestration/parallel-tool-calls.js +0 -59
- package/dist/orchestration/prompt-cache-strategy.js +0 -228
- package/dist/orchestration/reactive-compact.js +0 -78
- package/dist/orchestration/retry-loop.js +0 -24
- package/dist/orchestration/skill-candidate.js +0 -141
- package/dist/orchestration/skill-consolidation.js +0 -220
- package/dist/orchestration/skill-improvement.js +0 -66
- package/dist/orchestration/skill-similarity.js +0 -131
- package/dist/orchestration/streaming-tool-executor.js +0 -96
- package/dist/orchestration/team-orchestration.js +0 -369
- package/dist/orchestration/team-tool-loop-wiring.js +0 -147
- package/dist/orchestration/tool-choice-policy.js +0 -164
- package/dist/orchestration/tool-loop-state.js +0 -133
- package/dist/orchestration/tool-schema.js +0 -297
- package/dist/orchestration/transcript-repair.js +0 -426
- package/dist/orchestration/turn-loop-guard.js +0 -92
- package/dist/orchestration/web-browser-policy.js +0 -39
- package/dist/runtime/context-compression.js +0 -274
- package/dist/runtime/hook-registry.js +0 -53
- package/dist/runtime/memory-hooks.js +0 -65
- package/dist/runtime/tool-eligibility.js +0 -111
- package/dist/skills/index.js +0 -82
- package/dist/skills/memory-extractor.js +0 -173
- package/dist/skills/memory-query-tool.js +0 -127
- package/dist/skills/memory-store.js +0 -228
- package/dist/skills/memory-tool.js +0 -192
- package/dist/skills/portable-tool.js +0 -14
- package/dist/skills/qmemory-adapter.js +0 -165
- package/dist/skills/skill-frontmatter.js +0 -344
- package/dist/skills/skill-guard.js +0 -229
- package/dist/skills/skill-loader.js +0 -303
- package/dist/skills/skill-source.js +0 -126
- package/dist/skills/skill-types.js +0 -6
- package/dist/skills/think-tool.js +0 -59
- package/dist/skills/todo-tool.js +0 -114
- package/dist/skills/tools/agent-tool.js +0 -142
- package/dist/skills/tools/apply-patch-tool.js +0 -184
- package/dist/skills/tools/ask-user-tool.js +0 -121
- package/dist/skills/tools/brief-tool.js +0 -95
- package/dist/skills/tools/browser-tool.js +0 -155
- package/dist/skills/tools/checkpoint-tool.js +0 -102
- package/dist/skills/tools/config-tool.js +0 -143
- package/dist/skills/tools/cron-tool.js +0 -175
- package/dist/skills/tools/edit-tool.js +0 -70
- package/dist/skills/tools/exec-tool.js +0 -133
- package/dist/skills/tools/image-generate-tool.js +0 -67
- package/dist/skills/tools/instructions-tool.js +0 -187
- package/dist/skills/tools/lsp-tool.js +0 -227
- package/dist/skills/tools/mcp-client-types.js +0 -53
- package/dist/skills/tools/mcp-tool.js +0 -503
- package/dist/skills/tools/memory-tool.js +0 -88
- package/dist/skills/tools/monitor-tool.js +0 -131
- package/dist/skills/tools/music-generate-tool.js +0 -62
- package/dist/skills/tools/notify-tool.js +0 -62
- package/dist/skills/tools/patch-tool.js +0 -505
- package/dist/skills/tools/pdf-tool.js +0 -88
- package/dist/skills/tools/plan-mode-tool.js +0 -122
- package/dist/skills/tools/read-tool.js +0 -84
- package/dist/skills/tools/repl-tool.js +0 -69
- package/dist/skills/tools/search-tool.js +0 -225
- package/dist/skills/tools/send-message-tool.js +0 -76
- package/dist/skills/tools/skill-list-tool.js +0 -54
- package/dist/skills/tools/skill-manage-tool.js +0 -153
- package/dist/skills/tools/skill-view-tool.js +0 -72
- package/dist/skills/tools/sleep-tool.js +0 -81
- package/dist/skills/tools/structured-output-tool.js +0 -176
- package/dist/skills/tools/task-tool.js +0 -161
- package/dist/skills/tools/team-tool.js +0 -105
- package/dist/skills/tools/tool-search-tool.js +0 -110
- package/dist/skills/tools/tts-tool.js +0 -45
- package/dist/skills/tools/video-edit-tool.js +0 -74
- package/dist/skills/tools/video-generate-tool.js +0 -66
- package/dist/skills/tools/video-merge-tool.js +0 -92
- package/dist/skills/tools/video-upscale-tool.js +0 -52
- package/dist/skills/tools/web-fetch-tool.js +0 -92
- package/dist/skills/tools/web-search-tool.js +0 -86
- package/dist/skills/tools/worktree-tool.js +0 -147
- package/dist/skills/tools/write-tool.js +0 -81
- /package/dist/{agent → types/agent}/agent.d.ts +0 -0
- /package/dist/{agent → types/agent}/tool-loop.d.ts +0 -0
- /package/dist/{agent → types/agent}/types.d.ts +0 -0
- /package/dist/{cli → types/cli}/main.d.ts +0 -0
- /package/dist/{cli → types/cli}/stdio-server.d.ts +0 -0
- /package/dist/{config → types/config}/config.d.ts +0 -0
- /package/dist/{contracts → types/contracts}/hooks.d.ts +0 -0
- /package/dist/{contracts → types/contracts}/index.d.ts +0 -0
- /package/dist/{contracts → types/contracts}/planner.d.ts +0 -0
- /package/dist/{contracts → types/contracts}/skill-candidate.d.ts +0 -0
- /package/dist/{contracts → types/contracts}/todo.d.ts +0 -0
- /package/dist/{index.d.ts → types/index.d.ts} +0 -0
- /package/dist/{llm → types/llm}/builtin-providers.d.ts +0 -0
- /package/dist/{llm → types/llm}/index.d.ts +0 -0
- /package/dist/{llm → types/llm}/llm-client.d.ts +0 -0
- /package/dist/{llm → types/llm}/model-catalog.d.ts +0 -0
- /package/dist/{llm → types/llm}/provider-def.d.ts +0 -0
- /package/dist/{llm → types/llm}/provider-registry.d.ts +0 -0
- /package/dist/{llm → types/llm}/transport.d.ts +0 -0
- /package/dist/{llm → types/llm}/transports/anthropic-messages.d.ts +0 -0
- /package/dist/{llm → types/llm}/transports/openai-chat.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/agent-registry.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/approval-aware-tool-plan.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/context-compression.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/conversation-repair.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/curator-scheduler.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/embedded-failover-policy.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/error-classification.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/failover-classification.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/failover-error.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/fork-subagent.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/index.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/memory-flush-policy.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/memory-provider.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/parallel-tool-calls.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/prompt-cache-strategy.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/reactive-compact.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/retry-loop.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/skill-candidate.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/skill-consolidation.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/skill-improvement.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/skill-similarity.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/streaming-tool-executor.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/team-orchestration.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/team-tool-loop-wiring.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/tool-choice-policy.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/tool-loop-state.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/tool-schema.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/transcript-repair.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/turn-loop-guard.d.ts +0 -0
- /package/dist/{orchestration → types/orchestration}/web-browser-policy.d.ts +0 -0
- /package/dist/{runtime → types/runtime}/context-compression.d.ts +0 -0
- /package/dist/{runtime → types/runtime}/hook-registry.d.ts +0 -0
- /package/dist/{runtime → types/runtime}/memory-hooks.d.ts +0 -0
- /package/dist/{runtime → types/runtime}/tool-eligibility.d.ts +0 -0
- /package/dist/{skills → types/skills}/index.d.ts +0 -0
- /package/dist/{skills → types/skills}/memory-extractor.d.ts +0 -0
- /package/dist/{skills → types/skills}/memory-query-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/memory-store.d.ts +0 -0
- /package/dist/{skills → types/skills}/memory-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/portable-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/qmemory-adapter.d.ts +0 -0
- /package/dist/{skills → types/skills}/skill-frontmatter.d.ts +0 -0
- /package/dist/{skills → types/skills}/skill-guard.d.ts +0 -0
- /package/dist/{skills → types/skills}/skill-loader.d.ts +0 -0
- /package/dist/{skills → types/skills}/skill-source.d.ts +0 -0
- /package/dist/{skills → types/skills}/skill-types.d.ts +0 -0
- /package/dist/{skills → types/skills}/think-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/todo-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/agent-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/apply-patch-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/ask-user-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/brief-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/browser-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/checkpoint-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/config-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/cron-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/edit-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/exec-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/image-generate-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/instructions-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/lsp-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/mcp-client-types.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/mcp-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/memory-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/monitor-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/music-generate-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/notify-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/patch-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/pdf-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/plan-mode-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/read-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/repl-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/search-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/send-message-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/skill-list-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/skill-manage-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/skill-view-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/sleep-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/structured-output-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/task-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/team-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/tool-search-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/tts-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/video-edit-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/video-generate-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/video-merge-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/video-upscale-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/web-fetch-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/web-search-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/worktree-tool.d.ts +0 -0
- /package/dist/{skills → types/skills}/tools/write-tool.d.ts +0 -0
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
export const SKILL_CANDIDATE_STATUS_VALUES = [
|
|
2
|
-
"draft",
|
|
3
|
-
"in_review",
|
|
4
|
-
"approved",
|
|
5
|
-
"rejected",
|
|
6
|
-
"canary",
|
|
7
|
-
"published",
|
|
8
|
-
"stale",
|
|
9
|
-
"superseded",
|
|
10
|
-
"rolled_back",
|
|
11
|
-
];
|
|
12
|
-
export const SKILL_CANDIDATE_ACTION_VALUES = [
|
|
13
|
-
"submit-review",
|
|
14
|
-
"approve",
|
|
15
|
-
"reject",
|
|
16
|
-
"start-canary",
|
|
17
|
-
"record-effectiveness",
|
|
18
|
-
"promote",
|
|
19
|
-
"publish",
|
|
20
|
-
"mark-stale",
|
|
21
|
-
"mark-superseded",
|
|
22
|
-
"rollback",
|
|
23
|
-
];
|
|
24
|
-
export const SKILL_CANDIDATE_EFFECTIVENESS_PHASE_VALUES = ["canary", "published"];
|
|
25
|
-
function normalizeOptionalString(value) {
|
|
26
|
-
if (typeof value !== "string") {
|
|
27
|
-
return undefined;
|
|
28
|
-
}
|
|
29
|
-
const trimmed = value.trim();
|
|
30
|
-
return trimmed ? trimmed : undefined;
|
|
31
|
-
}
|
|
32
|
-
function normalizeOptionalFiniteNumber(value) {
|
|
33
|
-
if (typeof value === "number" && Number.isFinite(value)) {
|
|
34
|
-
return value;
|
|
35
|
-
}
|
|
36
|
-
if (typeof value !== "string") {
|
|
37
|
-
return undefined;
|
|
38
|
-
}
|
|
39
|
-
const trimmed = value.trim();
|
|
40
|
-
if (!trimmed) {
|
|
41
|
-
return undefined;
|
|
42
|
-
}
|
|
43
|
-
const parsed = Number(trimmed);
|
|
44
|
-
return Number.isFinite(parsed) ? parsed : undefined;
|
|
45
|
-
}
|
|
46
|
-
function normalizeCount(value, fallback = 0) {
|
|
47
|
-
const normalized = normalizeOptionalFiniteNumber(value);
|
|
48
|
-
if (normalized === undefined) {
|
|
49
|
-
return Math.max(0, Math.floor(fallback));
|
|
50
|
-
}
|
|
51
|
-
return Math.max(0, Math.floor(normalized));
|
|
52
|
-
}
|
|
53
|
-
export function coerceSkillCandidateJsonObject(value) {
|
|
54
|
-
return value && typeof value === "object" && !Array.isArray(value)
|
|
55
|
-
? { ...value }
|
|
56
|
-
: {};
|
|
57
|
-
}
|
|
58
|
-
export function isSkillCandidateStatus(value) {
|
|
59
|
-
return typeof value === "string"
|
|
60
|
-
&& SKILL_CANDIDATE_STATUS_VALUES.includes(value);
|
|
61
|
-
}
|
|
62
|
-
export function isSkillCandidateAction(value) {
|
|
63
|
-
return typeof value === "string"
|
|
64
|
-
&& SKILL_CANDIDATE_ACTION_VALUES.includes(value);
|
|
65
|
-
}
|
|
66
|
-
export function isSkillCandidateEffectivenessPhase(value) {
|
|
67
|
-
return typeof value === "string"
|
|
68
|
-
&& SKILL_CANDIDATE_EFFECTIVENESS_PHASE_VALUES.includes(value);
|
|
69
|
-
}
|
|
70
|
-
export function normalizeSkillCandidateStatus(value, fallback = "draft") {
|
|
71
|
-
const normalized = normalizeOptionalString(value);
|
|
72
|
-
return normalized && isSkillCandidateStatus(normalized) ? normalized : fallback;
|
|
73
|
-
}
|
|
74
|
-
export function normalizeSkillCandidateAction(value) {
|
|
75
|
-
const normalized = normalizeOptionalString(value);
|
|
76
|
-
return normalized && isSkillCandidateAction(normalized) ? normalized : null;
|
|
77
|
-
}
|
|
78
|
-
export function normalizeSkillCandidateEffectivenessPhase(value) {
|
|
79
|
-
const normalized = normalizeOptionalString(value);
|
|
80
|
-
return normalized && isSkillCandidateEffectivenessPhase(normalized) ? normalized : null;
|
|
81
|
-
}
|
|
82
|
-
export function normalizeSkillCandidateArtifact(value) {
|
|
83
|
-
const record = coerceSkillCandidateJsonObject(value);
|
|
84
|
-
const uri = normalizeOptionalString(record.uri);
|
|
85
|
-
if (!uri) {
|
|
86
|
-
return null;
|
|
87
|
-
}
|
|
88
|
-
const sha256 = normalizeOptionalString(record.sha256);
|
|
89
|
-
const workspaceDir = normalizeOptionalString(record.workspaceDir);
|
|
90
|
-
const relativePath = normalizeOptionalString(record.relativePath);
|
|
91
|
-
const sourceWorkspaceDir = normalizeOptionalString(record.sourceWorkspaceDir);
|
|
92
|
-
const stagedAt = normalizeOptionalString(record.stagedAt);
|
|
93
|
-
return {
|
|
94
|
-
uri,
|
|
95
|
-
...(sha256 ? { sha256 } : {}),
|
|
96
|
-
...(workspaceDir ? { workspaceDir } : {}),
|
|
97
|
-
...(relativePath ? { relativePath } : {}),
|
|
98
|
-
...(sourceWorkspaceDir ? { sourceWorkspaceDir } : {}),
|
|
99
|
-
...(stagedAt ? { stagedAt } : {}),
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
export function normalizeSkillCandidateSourceExecution(value) {
|
|
103
|
-
const record = coerceSkillCandidateJsonObject(value);
|
|
104
|
-
const executionId = normalizeOptionalString(record.executionId);
|
|
105
|
-
const rootExecutionId = normalizeOptionalString(record.rootExecutionId);
|
|
106
|
-
const parentExecutionId = normalizeOptionalString(record.parentExecutionId);
|
|
107
|
-
const sidechainId = normalizeOptionalString(record.sidechainId);
|
|
108
|
-
const attemptId = normalizeOptionalString(record.attemptId);
|
|
109
|
-
const outcomeId = normalizeOptionalString(record.outcomeId);
|
|
110
|
-
const sessionId = normalizeOptionalString(record.sessionId);
|
|
111
|
-
const turnId = normalizeOptionalString(record.turnId);
|
|
112
|
-
if (!executionId
|
|
113
|
-
&& !rootExecutionId
|
|
114
|
-
&& !parentExecutionId
|
|
115
|
-
&& !sidechainId
|
|
116
|
-
&& !attemptId
|
|
117
|
-
&& !outcomeId
|
|
118
|
-
&& !sessionId
|
|
119
|
-
&& !turnId) {
|
|
120
|
-
return null;
|
|
121
|
-
}
|
|
122
|
-
return {
|
|
123
|
-
...(executionId ? { executionId } : {}),
|
|
124
|
-
...(rootExecutionId ? { rootExecutionId } : {}),
|
|
125
|
-
...(parentExecutionId ? { parentExecutionId } : {}),
|
|
126
|
-
...(sidechainId ? { sidechainId } : {}),
|
|
127
|
-
...(attemptId ? { attemptId } : {}),
|
|
128
|
-
...(outcomeId ? { outcomeId } : {}),
|
|
129
|
-
...(sessionId ? { sessionId } : {}),
|
|
130
|
-
...(turnId ? { turnId } : {}),
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
export function normalizeSkillCandidateReview(value) {
|
|
134
|
-
const record = coerceSkillCandidateJsonObject(value);
|
|
135
|
-
const action = normalizeSkillCandidateAction(record.action);
|
|
136
|
-
if (!action) {
|
|
137
|
-
return null;
|
|
138
|
-
}
|
|
139
|
-
const actor = normalizeOptionalString(record.actor) ?? null;
|
|
140
|
-
const notes = normalizeOptionalString(record.notes) ?? null;
|
|
141
|
-
const payload = coerceSkillCandidateJsonObject(record.payload);
|
|
142
|
-
const createdAt = normalizeOptionalString(record.createdAt);
|
|
143
|
-
return {
|
|
144
|
-
action,
|
|
145
|
-
actor,
|
|
146
|
-
notes,
|
|
147
|
-
payload,
|
|
148
|
-
...(createdAt ? { createdAt } : {}),
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
export function normalizeSkillCandidateEffectiveness(value) {
|
|
152
|
-
const record = coerceSkillCandidateJsonObject(value);
|
|
153
|
-
const phase = normalizeSkillCandidateEffectivenessPhase(record.phase);
|
|
154
|
-
if (!phase) {
|
|
155
|
-
return null;
|
|
156
|
-
}
|
|
157
|
-
const successCount = normalizeCount(record.successCount);
|
|
158
|
-
const explicitFailureCount = normalizeOptionalFiniteNumber(record.failureCount);
|
|
159
|
-
const sampleCount = normalizeCount(record.sampleCount, explicitFailureCount !== undefined ? successCount + explicitFailureCount : successCount);
|
|
160
|
-
const failureCount = normalizeCount(record.failureCount, Math.max(sampleCount - successCount, 0));
|
|
161
|
-
const regressionCount = normalizeCount(record.regressionCount);
|
|
162
|
-
const successRate = normalizeOptionalFiniteNumber(record.successRate)
|
|
163
|
-
?? (sampleCount > 0 ? successCount / sampleCount : 0);
|
|
164
|
-
const regressionRate = normalizeOptionalFiniteNumber(record.regressionRate)
|
|
165
|
-
?? (sampleCount > 0 ? regressionCount / sampleCount : 0);
|
|
166
|
-
const avgLatencyMs = normalizeOptionalFiniteNumber(record.avgLatencyMs);
|
|
167
|
-
const avgCostUsd = normalizeOptionalFiniteNumber(record.avgCostUsd);
|
|
168
|
-
const score = normalizeOptionalFiniteNumber(record.score);
|
|
169
|
-
const staleReason = normalizeOptionalString(record.staleReason) ?? null;
|
|
170
|
-
const notes = normalizeOptionalString(record.notes) ?? null;
|
|
171
|
-
const summary = coerceSkillCandidateJsonObject(record.summary);
|
|
172
|
-
const lastObservedAt = normalizeOptionalString(record.lastObservedAt);
|
|
173
|
-
const updatedAt = normalizeOptionalString(record.updatedAt);
|
|
174
|
-
const lastActivityAt = normalizeOptionalString(record.lastActivityAt);
|
|
175
|
-
const activityCount = normalizeOptionalFiniteNumber(record.activityCount);
|
|
176
|
-
return {
|
|
177
|
-
phase,
|
|
178
|
-
sampleCount,
|
|
179
|
-
successCount,
|
|
180
|
-
failureCount,
|
|
181
|
-
regressionCount,
|
|
182
|
-
successRate,
|
|
183
|
-
regressionRate,
|
|
184
|
-
...(avgLatencyMs !== undefined ? { avgLatencyMs } : {}),
|
|
185
|
-
...(avgCostUsd !== undefined ? { avgCostUsd } : {}),
|
|
186
|
-
...(score !== undefined ? { score } : {}),
|
|
187
|
-
...(staleReason ? { staleReason } : {}),
|
|
188
|
-
...(notes ? { notes } : {}),
|
|
189
|
-
...(Object.keys(summary).length > 0 ? { summary } : {}),
|
|
190
|
-
...(lastObservedAt ? { lastObservedAt } : {}),
|
|
191
|
-
...(updatedAt ? { updatedAt } : {}),
|
|
192
|
-
...(lastActivityAt ? { lastActivityAt } : {}),
|
|
193
|
-
...(activityCount !== undefined ? { activityCount } : {}),
|
|
194
|
-
};
|
|
195
|
-
}
|
package/dist/contracts/todo.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export const TODO_ITEM_STATUS_VALUES = ["not-started", "in-progress", "completed"];
|
|
2
|
-
export function summarizeTodoList(items) {
|
|
3
|
-
return {
|
|
4
|
-
total: items.length,
|
|
5
|
-
completed: items.filter((item) => item.status === "completed").length,
|
|
6
|
-
inProgress: items.filter((item) => item.status === "in-progress").length,
|
|
7
|
-
notStarted: items.filter((item) => item.status === "not-started").length,
|
|
8
|
-
};
|
|
9
|
-
}
|