@temet/cli 0.3.1 → 0.3.2
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/assets/macos/README.md +8 -0
- package/assets/macos/Temet.app.zip +0 -0
- package/dist/audit.js +147 -30
- package/dist/index.js +56 -0
- package/dist/lib/audit-tracking.js +13 -2
- package/dist/lib/cli-args.js +6 -1
- package/dist/lib/diagnostic-runner.d.ts +13 -0
- package/dist/lib/diagnostic-runner.js +95 -0
- package/dist/lib/menubar-installer.d.ts +19 -0
- package/dist/lib/menubar-installer.js +99 -0
- package/dist/lib/menubar-state.d.ts +78 -0
- package/dist/lib/menubar-state.js +275 -0
- package/dist/lib/notifier.d.ts +2 -0
- package/dist/lib/notifier.js +11 -0
- package/dist/lib/report-writer.d.ts +2 -0
- package/dist/lib/report-writer.js +19 -1
- package/dist/plan.d.ts +33 -0
- package/dist/plan.js +90 -0
- package/dist/traces.d.ts +41 -0
- package/dist/traces.js +119 -0
- package/package.json +3 -2
package/dist/traces.js
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { defaultProjectLabel, resolveDiagnostics, } from "./lib/diagnostic-runner.js";
|
|
2
|
+
function evidenceCount(entry) {
|
|
3
|
+
return (entry.evidence.examples.length +
|
|
4
|
+
entry.evidence.decisionCriteria.length +
|
|
5
|
+
entry.evidence.antiPatterns.length +
|
|
6
|
+
entry.evidence.mentorAdvice.length);
|
|
7
|
+
}
|
|
8
|
+
function proficiencyScore(level) {
|
|
9
|
+
switch (level) {
|
|
10
|
+
case "expert":
|
|
11
|
+
return 5;
|
|
12
|
+
case "proficient":
|
|
13
|
+
return 4;
|
|
14
|
+
case "competent":
|
|
15
|
+
return 3;
|
|
16
|
+
case "advanced_beginner":
|
|
17
|
+
return 2;
|
|
18
|
+
default:
|
|
19
|
+
return 1;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function topCompetencies(competencies, limit = 6) {
|
|
23
|
+
return [...competencies]
|
|
24
|
+
.sort((a, b) => {
|
|
25
|
+
const scoreDiff = proficiencyScore(b.proficiencyLevel) -
|
|
26
|
+
proficiencyScore(a.proficiencyLevel);
|
|
27
|
+
if (scoreDiff !== 0)
|
|
28
|
+
return scoreDiff;
|
|
29
|
+
return evidenceCount(b) - evidenceCount(a);
|
|
30
|
+
})
|
|
31
|
+
.slice(0, limit);
|
|
32
|
+
}
|
|
33
|
+
function flattenEvidence(entry) {
|
|
34
|
+
return [
|
|
35
|
+
...entry.evidence.examples.map((text) => ({
|
|
36
|
+
kind: "example",
|
|
37
|
+
text,
|
|
38
|
+
})),
|
|
39
|
+
...entry.evidence.decisionCriteria.map((text) => ({
|
|
40
|
+
kind: "decision",
|
|
41
|
+
text,
|
|
42
|
+
})),
|
|
43
|
+
...entry.evidence.antiPatterns.map((text) => ({
|
|
44
|
+
kind: "anti_pattern",
|
|
45
|
+
text,
|
|
46
|
+
})),
|
|
47
|
+
...entry.evidence.mentorAdvice.map((text) => ({
|
|
48
|
+
kind: "mentor",
|
|
49
|
+
text,
|
|
50
|
+
})),
|
|
51
|
+
].slice(0, 6);
|
|
52
|
+
}
|
|
53
|
+
function kindLabel(kind) {
|
|
54
|
+
switch (kind) {
|
|
55
|
+
case "example":
|
|
56
|
+
return "example";
|
|
57
|
+
case "decision":
|
|
58
|
+
return "decision";
|
|
59
|
+
case "anti_pattern":
|
|
60
|
+
return "anti-pattern";
|
|
61
|
+
case "mentor":
|
|
62
|
+
return "signal";
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export function buildTracesJsonOutput(input) {
|
|
66
|
+
return {
|
|
67
|
+
project: input.projectLabel,
|
|
68
|
+
sessions: input.sessions,
|
|
69
|
+
prompts: input.prompts,
|
|
70
|
+
toolCalls: input.toolCalls,
|
|
71
|
+
competencies: topCompetencies(input.competencies).map((entry) => ({
|
|
72
|
+
name: entry.name,
|
|
73
|
+
category: entry.category,
|
|
74
|
+
proficiencyLevel: entry.proficiencyLevel,
|
|
75
|
+
description: entry.description,
|
|
76
|
+
evidence: flattenEvidence(entry),
|
|
77
|
+
})),
|
|
78
|
+
workflows: input.workflows.slice(0, 5),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function printTraces(input) {
|
|
82
|
+
console.log("TRACES");
|
|
83
|
+
console.log("");
|
|
84
|
+
console.log(`${input.project} · ${input.sessions} sessions · ${input.prompts} prompts · ${input.toolCalls} tool calls`);
|
|
85
|
+
console.log("");
|
|
86
|
+
for (const entry of input.competencies) {
|
|
87
|
+
console.log(`${entry.name} · ${entry.proficiencyLevel}`);
|
|
88
|
+
console.log(` ${entry.description}`);
|
|
89
|
+
for (const item of entry.evidence) {
|
|
90
|
+
console.log(` - ${kindLabel(item.kind)}: ${item.text}`);
|
|
91
|
+
}
|
|
92
|
+
console.log("");
|
|
93
|
+
}
|
|
94
|
+
if (input.workflows.length > 0) {
|
|
95
|
+
console.log("Repeated patterns");
|
|
96
|
+
for (const workflow of input.workflows) {
|
|
97
|
+
console.log(` - ${workflow.description} · ${workflow.occurrences} occurrences across ${workflow.sessions} sessions`);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
export async function runTracesCommand(opts) {
|
|
102
|
+
const diagnostics = await resolveDiagnostics(opts);
|
|
103
|
+
if (opts.quiet)
|
|
104
|
+
return;
|
|
105
|
+
const output = buildTracesJsonOutput({
|
|
106
|
+
projectLabel: diagnostics.tracking?.current.projectLabel ??
|
|
107
|
+
defaultProjectLabel(diagnostics.resolvedPath),
|
|
108
|
+
sessions: diagnostics.result.sessionCount,
|
|
109
|
+
prompts: diagnostics.result.promptCount,
|
|
110
|
+
toolCalls: diagnostics.result.toolCallCount,
|
|
111
|
+
competencies: diagnostics.competencies,
|
|
112
|
+
workflows: diagnostics.result.workflows,
|
|
113
|
+
});
|
|
114
|
+
if (opts.json) {
|
|
115
|
+
console.log(JSON.stringify(output, null, 2));
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
printTraces(output);
|
|
119
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@temet/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Temet CLI — discover the skills you already demonstrate in AI work",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"temet",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"temet": "dist/index.js"
|
|
25
25
|
},
|
|
26
26
|
"files": [
|
|
27
|
-
"dist"
|
|
27
|
+
"dist",
|
|
28
|
+
"assets"
|
|
28
29
|
],
|
|
29
30
|
"scripts": {
|
|
30
31
|
"build": "tsc -p tsconfig.json",
|