@kernel.chat/kbot 2.8.0 → 2.9.1

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.
Files changed (48) hide show
  1. package/dist/agent-protocol.d.ts +97 -0
  2. package/dist/agent-protocol.d.ts.map +1 -0
  3. package/dist/agent-protocol.js +618 -0
  4. package/dist/agent-protocol.js.map +1 -0
  5. package/dist/agent.d.ts +2 -0
  6. package/dist/agent.d.ts.map +1 -1
  7. package/dist/agent.js +1 -1
  8. package/dist/agent.js.map +1 -1
  9. package/dist/auth.d.ts.map +1 -1
  10. package/dist/auth.js +17 -12
  11. package/dist/auth.js.map +1 -1
  12. package/dist/cli.js +166 -2
  13. package/dist/cli.js.map +1 -1
  14. package/dist/cloud-sync.d.ts.map +1 -1
  15. package/dist/cloud-sync.js +15 -4
  16. package/dist/cloud-sync.js.map +1 -1
  17. package/dist/confidence.d.ts +102 -0
  18. package/dist/confidence.d.ts.map +1 -0
  19. package/dist/confidence.js +696 -0
  20. package/dist/confidence.js.map +1 -0
  21. package/dist/ide/acp-server.js +5 -4
  22. package/dist/ide/acp-server.js.map +1 -1
  23. package/dist/ide/lsp-bridge.d.ts.map +1 -1
  24. package/dist/ide/lsp-bridge.js +11 -5
  25. package/dist/ide/lsp-bridge.js.map +1 -1
  26. package/dist/intentionality.d.ts +139 -0
  27. package/dist/intentionality.d.ts.map +1 -0
  28. package/dist/intentionality.js +1092 -0
  29. package/dist/intentionality.js.map +1 -0
  30. package/dist/planner.d.ts.map +1 -1
  31. package/dist/planner.js +3 -2
  32. package/dist/planner.js.map +1 -1
  33. package/dist/reasoning.d.ts +100 -0
  34. package/dist/reasoning.d.ts.map +1 -0
  35. package/dist/reasoning.js +1292 -0
  36. package/dist/reasoning.js.map +1 -0
  37. package/dist/streaming.d.ts.map +1 -1
  38. package/dist/streaming.js +18 -2
  39. package/dist/streaming.js.map +1 -1
  40. package/dist/temporal.d.ts +133 -0
  41. package/dist/temporal.d.ts.map +1 -0
  42. package/dist/temporal.js +778 -0
  43. package/dist/temporal.js.map +1 -0
  44. package/dist/tools/index.d.ts.map +1 -1
  45. package/dist/tools/index.js +30 -10
  46. package/dist/tools/index.js.map +1 -1
  47. package/dist/ui.js +1 -1
  48. package/package.json +2 -2
@@ -0,0 +1,102 @@
1
+ export interface ConfidenceScore {
2
+ /** 0-1: overall confidence in the action/response */
3
+ overall: number;
4
+ /** 0-1: how sure about factual accuracy */
5
+ factual: number;
6
+ /** 0-1: how sure the chosen approach is correct */
7
+ approach: number;
8
+ /** 0-1: how sure all aspects were covered */
9
+ completeness: number;
10
+ /** One-line explanation of the confidence level */
11
+ reasoning: string;
12
+ }
13
+ /**
14
+ * Estimate confidence for a task before execution.
15
+ *
16
+ * Considers task complexity, past success with similar tasks,
17
+ * provider capability, and available context.
18
+ */
19
+ export declare function estimateConfidence(task: string, context: string): ConfidenceScore;
20
+ /**
21
+ * Format a confidence score as a human-readable string.
22
+ */
23
+ export declare function reportConfidence(score: ConfidenceScore): string;
24
+ /**
25
+ * Record a calibration entry — predicted vs actual (from self-eval or user feedback).
26
+ * Called after a task completes to improve future predictions.
27
+ */
28
+ export declare function recordCalibration(task: string, predicted: number, actual: number): void;
29
+ export interface SkillEntry {
30
+ /** Domain or skill area, e.g. 'typescript', 'python', 'devops' */
31
+ domain: string;
32
+ /** 0-1 success rate from historical data */
33
+ successRate: number;
34
+ /** 0-1 average confidence when working in this domain */
35
+ avgConfidence: number;
36
+ /** Number of task attempts */
37
+ sampleSize: number;
38
+ /** ISO date of last attempt */
39
+ lastAttempt: string;
40
+ }
41
+ export interface SkillProfile {
42
+ /** Domains the agent excels at (successRate >= 0.7, sampleSize >= 3) */
43
+ strengths: SkillEntry[];
44
+ /** Domains the agent struggles with (successRate < 0.5, sampleSize >= 3) */
45
+ weaknesses: SkillEntry[];
46
+ /** Domains the agent hasn't tried enough to assess (<3 samples) */
47
+ unknown: string[];
48
+ }
49
+ /**
50
+ * Build a skill profile from stored skill data and calibration history.
51
+ */
52
+ export declare function getSkillProfile(): SkillProfile;
53
+ /**
54
+ * Assess whether the agent is suitable for a given task.
55
+ */
56
+ export declare function assessSkillForTask(task: string): {
57
+ canDo: boolean;
58
+ confidence: number;
59
+ suggestion?: string;
60
+ };
61
+ /**
62
+ * Update the skill profile after completing a task.
63
+ *
64
+ * @param domain - The task domain (auto-detected or overridden)
65
+ * @param success - Whether the task completed successfully
66
+ * @param confidence - The confidence score used for this task
67
+ */
68
+ export declare function updateSkillProfile(domain: string, success: boolean, confidence: number): void;
69
+ export interface EffortEstimate {
70
+ /** Tool call count estimate: min, expected, max */
71
+ toolCalls: {
72
+ min: number;
73
+ expected: number;
74
+ max: number;
75
+ };
76
+ /** Estimated cost in USD: min, expected, max */
77
+ estimatedCostUsd: {
78
+ min: number;
79
+ expected: number;
80
+ max: number;
81
+ };
82
+ /** Complexity classification */
83
+ complexity: 'trivial' | 'simple' | 'moderate' | 'complex' | 'ambitious';
84
+ /** Human-readable breakdown of expected operations */
85
+ breakdown: string;
86
+ }
87
+ /**
88
+ * Estimate the effort required for a task — tool calls, cost, and complexity.
89
+ *
90
+ * @param task - The task description
91
+ * @param context - Optional context (repo state, file list, etc.)
92
+ */
93
+ export declare function estimateEffort(task: string, context?: string): EffortEstimate;
94
+ /**
95
+ * Record actual effort after a task completes, for future calibration.
96
+ */
97
+ export declare function recordActualEffort(task: string, actualToolCalls: number, actualCostUsd: number): void;
98
+ /**
99
+ * Register confidence engine tools with the K:BOT tool registry.
100
+ */
101
+ export declare function registerConfidenceTools(): void;
102
+ //# sourceMappingURL=confidence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confidence.d.ts","sourceRoot":"","sources":["../src/confidence.ts"],"names":[],"mappings":"AAiDA,MAAM,WAAW,eAAe;IAC9B,qDAAqD;IACrD,OAAO,EAAE,MAAM,CAAA;IACf,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAA;IACf,mDAAmD;IACnD,QAAQ,EAAE,MAAM,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