@xn-intenton-z2a/agentic-lib 7.1.33 → 7.1.34
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/package.json
CHANGED
|
@@ -85,8 +85,10 @@ async function run() {
|
|
|
85
85
|
github: github.context,
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
-
// Run the task
|
|
88
|
+
// Run the task (measure wall-clock duration for cost tracking)
|
|
89
|
+
const startTime = Date.now();
|
|
89
90
|
const result = await handler(context);
|
|
91
|
+
const durationMs = Date.now() - startTime;
|
|
90
92
|
|
|
91
93
|
// Set outputs
|
|
92
94
|
core.setOutput("result", result.outcome || "completed");
|
|
@@ -108,6 +110,7 @@ async function run() {
|
|
|
108
110
|
inputTokens: result.inputTokens,
|
|
109
111
|
outputTokens: result.outputTokens,
|
|
110
112
|
cost: result.cost,
|
|
113
|
+
durationMs,
|
|
111
114
|
model: result.model || model,
|
|
112
115
|
details: result.details,
|
|
113
116
|
workflowUrl: `${process.env.GITHUB_SERVER_URL}/${github.context.repo.owner}/${github.context.repo.repo}/actions/runs/${github.context.runId}`,
|
|
@@ -22,7 +22,8 @@ import * as core from "@actions/core";
|
|
|
22
22
|
* @param {number} [options.tokensUsed] - Total tokens consumed (input + output)
|
|
23
23
|
* @param {number} [options.inputTokens] - Input tokens consumed
|
|
24
24
|
* @param {number} [options.outputTokens] - Output tokens consumed
|
|
25
|
-
* @param {number} [options.cost] -
|
|
25
|
+
* @param {number} [options.cost] - Model invocations (from Copilot SDK)
|
|
26
|
+
* @param {number} [options.durationMs] - Task wall-clock duration in milliseconds
|
|
26
27
|
* @param {string} [options.model] - Model used
|
|
27
28
|
* @param {string} [options.details] - Additional details
|
|
28
29
|
* @param {string} [options.workflowUrl] - URL to the workflow run
|
|
@@ -38,6 +39,7 @@ export function logActivity({
|
|
|
38
39
|
inputTokens,
|
|
39
40
|
outputTokens,
|
|
40
41
|
cost,
|
|
42
|
+
durationMs,
|
|
41
43
|
model,
|
|
42
44
|
details,
|
|
43
45
|
workflowUrl,
|
|
@@ -54,8 +56,13 @@ export function logActivity({
|
|
|
54
56
|
if (prNumber) parts.push(`**PR:** #${prNumber}`);
|
|
55
57
|
if (commitUrl) parts.push(`**Commit:** [${commitUrl}](${commitUrl})`);
|
|
56
58
|
if (model) parts.push(`**Model:** ${model}`);
|
|
57
|
-
if (tokensUsed) parts.push(`**
|
|
58
|
-
if (cost) parts.push(`**
|
|
59
|
+
if (tokensUsed) parts.push(`**Token Count:** ${tokensUsed} (in: ${inputTokens || 0}, out: ${outputTokens || 0})`);
|
|
60
|
+
if (cost) parts.push(`**Model Invocations:** ${cost}`);
|
|
61
|
+
if (durationMs) {
|
|
62
|
+
const secs = Math.round(durationMs / 1000);
|
|
63
|
+
const mins = (durationMs / 60000).toFixed(1);
|
|
64
|
+
parts.push(`**Duration:** ${secs}s (~${mins} GitHub Actions min)`);
|
|
65
|
+
}
|
|
59
66
|
if (workflowUrl) parts.push(`**Workflow:** [${workflowUrl}](${workflowUrl})`);
|
|
60
67
|
if (details) {
|
|
61
68
|
parts.push("");
|