deepline 0.3.36 → 0.3.37
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/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/observability/scheduled-work.ts +165 -0
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.mjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/install-integrity.json +1 -0
- package/package.json +1 -1
|
@@ -199,7 +199,7 @@ export const SDK_RELEASE = {
|
|
|
199
199
|
// available at toolResponse.rawV2 while toolResponse.raw and all declared
|
|
200
200
|
// getters keep their established compatibility behavior.
|
|
201
201
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
202
|
-
version: '0.3.
|
|
202
|
+
version: '0.3.37',
|
|
203
203
|
updateSummary:
|
|
204
204
|
'Automatic CLI updates are now enabled by default. To opt out, run `deepline settings autoupdate off`; use `deepline settings autoupdate on` to re-enable updates or `deepline settings autoupdate pin <version>` to hold an exact release. This release also adds raw-v2 tool responses at toolResponse.rawV2 while preserving existing toolResponse.raw and declared getters.',
|
|
205
205
|
packageCapabilities: {
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
export const SCHEDULED_WORK_OBSERVABILITY_VERSION = 1 as const;
|
|
2
|
+
|
|
3
|
+
export type ScheduledWorkScheduler =
|
|
4
|
+
| 'convex_cron'
|
|
5
|
+
| 'convex_scheduled_action'
|
|
6
|
+
| 'github_actions'
|
|
7
|
+
| 'inngest'
|
|
8
|
+
| 'scheduled_play'
|
|
9
|
+
| 'vercel_cron';
|
|
10
|
+
|
|
11
|
+
export type ScheduledWorkOutcome = 'running' | 'succeeded' | 'failed';
|
|
12
|
+
|
|
13
|
+
export type ScheduledWorkVolume = {
|
|
14
|
+
unit: string;
|
|
15
|
+
attempted?: number;
|
|
16
|
+
completed?: number;
|
|
17
|
+
failed?: number;
|
|
18
|
+
skipped?: number;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The portable envelope emitted by every scheduler. Keep this deliberately
|
|
23
|
+
* small: it is both the durable health record and the Axiom graph contract.
|
|
24
|
+
*/
|
|
25
|
+
export type ScheduledWorkObservation = {
|
|
26
|
+
jobId: string;
|
|
27
|
+
jobName: string;
|
|
28
|
+
scheduler: ScheduledWorkScheduler;
|
|
29
|
+
owner: string;
|
|
30
|
+
criticality: string;
|
|
31
|
+
environment: string;
|
|
32
|
+
invocationId: string;
|
|
33
|
+
occurredAt: number;
|
|
34
|
+
outcome: ScheduledWorkOutcome;
|
|
35
|
+
expectedWithinMs: number;
|
|
36
|
+
durationMs?: number;
|
|
37
|
+
errorSummary?: string;
|
|
38
|
+
runUrl?: string;
|
|
39
|
+
volume?: ScheduledWorkVolume;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export function scheduledWorkTelemetryFields(
|
|
43
|
+
observation: ScheduledWorkObservation,
|
|
44
|
+
): Record<string, string | number> {
|
|
45
|
+
return {
|
|
46
|
+
scheduledWorkSchemaVersion: SCHEDULED_WORK_OBSERVABILITY_VERSION,
|
|
47
|
+
scheduledWorkJobId: observation.jobId,
|
|
48
|
+
scheduledWorkJobName: observation.jobName,
|
|
49
|
+
scheduledWorkScheduler: observation.scheduler,
|
|
50
|
+
scheduledWorkOwner: observation.owner,
|
|
51
|
+
scheduledWorkCriticality: observation.criticality,
|
|
52
|
+
scheduledWorkOutcome: observation.outcome,
|
|
53
|
+
scheduledWorkInvocationId: observation.invocationId,
|
|
54
|
+
scheduledWorkExpectedWithinMs: observation.expectedWithinMs,
|
|
55
|
+
...(observation.durationMs === undefined
|
|
56
|
+
? {}
|
|
57
|
+
: { scheduledWorkDurationMs: observation.durationMs }),
|
|
58
|
+
...(observation.errorSummary === undefined
|
|
59
|
+
? {}
|
|
60
|
+
: { scheduledWorkErrorSummary: observation.errorSummary }),
|
|
61
|
+
...(observation.runUrl === undefined
|
|
62
|
+
? {}
|
|
63
|
+
: { scheduledWorkRunUrl: observation.runUrl }),
|
|
64
|
+
...(observation.volume === undefined
|
|
65
|
+
? {}
|
|
66
|
+
: scheduledWorkVolumeTelemetryFields(observation.volume)),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function scheduledWorkVolumeTelemetryFields(
|
|
71
|
+
volume: ScheduledWorkVolume,
|
|
72
|
+
): Record<string, string | number> {
|
|
73
|
+
const attempted = finiteNonNegative(volume.attempted);
|
|
74
|
+
const completed = finiteNonNegative(volume.completed);
|
|
75
|
+
const failed = finiteNonNegative(volume.failed);
|
|
76
|
+
const skipped = finiteNonNegative(volume.skipped);
|
|
77
|
+
const scale =
|
|
78
|
+
attempted ??
|
|
79
|
+
(completed === undefined && failed === undefined && skipped === undefined
|
|
80
|
+
? 0
|
|
81
|
+
: (completed ?? 0) + (failed ?? 0) + (skipped ?? 0));
|
|
82
|
+
return {
|
|
83
|
+
scheduledWorkUnit: volume.unit,
|
|
84
|
+
...(attempted === undefined ? {} : { scheduledWorkAttempted: attempted }),
|
|
85
|
+
...(completed === undefined ? {} : { scheduledWorkCompleted: completed }),
|
|
86
|
+
...(failed === undefined ? {} : { scheduledWorkFailed: failed }),
|
|
87
|
+
...(skipped === undefined ? {} : { scheduledWorkSkipped: skipped }),
|
|
88
|
+
...(scale > 0 && failed !== undefined
|
|
89
|
+
? { scheduledWorkFailureRate: failed / scale }
|
|
90
|
+
: {}),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Safe default for existing roots. New roots should pass a domain-specific
|
|
96
|
+
* volume extractor, but familiar result shapes become useful immediately.
|
|
97
|
+
*/
|
|
98
|
+
export function inferScheduledWorkVolume(result: unknown): ScheduledWorkVolume {
|
|
99
|
+
if (!result || typeof result !== 'object' || Array.isArray(result)) {
|
|
100
|
+
return { unit: 'runs', attempted: 1, completed: 1 };
|
|
101
|
+
}
|
|
102
|
+
const record = result as Record<string, unknown>;
|
|
103
|
+
const attempted = firstFinite(record, [
|
|
104
|
+
'processed',
|
|
105
|
+
'scanned',
|
|
106
|
+
'orgsScanned',
|
|
107
|
+
'dueSubscriptions',
|
|
108
|
+
'queuedJobsFound',
|
|
109
|
+
'total',
|
|
110
|
+
]);
|
|
111
|
+
const completed = firstFinite(record, [
|
|
112
|
+
'completed',
|
|
113
|
+
'processed',
|
|
114
|
+
'launched',
|
|
115
|
+
'started',
|
|
116
|
+
'queued',
|
|
117
|
+
'cleaned',
|
|
118
|
+
'deleted',
|
|
119
|
+
]);
|
|
120
|
+
const failed = firstFinite(record, [
|
|
121
|
+
'failed',
|
|
122
|
+
'errorCount',
|
|
123
|
+
'error_count',
|
|
124
|
+
'scan_errors',
|
|
125
|
+
'notification_error_count',
|
|
126
|
+
]);
|
|
127
|
+
const skipped = firstFinite(record, [
|
|
128
|
+
'skipped',
|
|
129
|
+
'deduped',
|
|
130
|
+
'skippedNotDue',
|
|
131
|
+
'skippedNoActiveSubscriptions',
|
|
132
|
+
]);
|
|
133
|
+
if (
|
|
134
|
+
attempted === undefined &&
|
|
135
|
+
completed === undefined &&
|
|
136
|
+
failed === undefined &&
|
|
137
|
+
skipped === undefined
|
|
138
|
+
) {
|
|
139
|
+
return { unit: 'runs', attempted: 1, completed: 1 };
|
|
140
|
+
}
|
|
141
|
+
return {
|
|
142
|
+
unit: 'items',
|
|
143
|
+
...(attempted === undefined ? {} : { attempted }),
|
|
144
|
+
...(completed === undefined ? {} : { completed }),
|
|
145
|
+
...(failed === undefined ? {} : { failed }),
|
|
146
|
+
...(skipped === undefined ? {} : { skipped }),
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function firstFinite(
|
|
151
|
+
record: Record<string, unknown>,
|
|
152
|
+
keys: readonly string[],
|
|
153
|
+
): number | undefined {
|
|
154
|
+
for (const key of keys) {
|
|
155
|
+
const value = finiteNonNegative(record[key]);
|
|
156
|
+
if (value !== undefined) return value;
|
|
157
|
+
}
|
|
158
|
+
return undefined;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function finiteNonNegative(value: unknown): number | undefined {
|
|
162
|
+
return typeof value === 'number' && Number.isFinite(value) && value >= 0
|
|
163
|
+
? value
|
|
164
|
+
: undefined;
|
|
165
|
+
}
|
package/dist/cli/index.js
CHANGED
|
@@ -1043,7 +1043,7 @@ var SDK_RELEASE = {
|
|
|
1043
1043
|
// available at toolResponse.rawV2 while toolResponse.raw and all declared
|
|
1044
1044
|
// getters keep their established compatibility behavior.
|
|
1045
1045
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
1046
|
-
version: "0.3.
|
|
1046
|
+
version: "0.3.37",
|
|
1047
1047
|
updateSummary: "Automatic CLI updates are now enabled by default. To opt out, run `deepline settings autoupdate off`; use `deepline settings autoupdate on` to re-enable updates or `deepline settings autoupdate pin <version>` to hold an exact release. This release also adds raw-v2 tool responses at toolResponse.rawV2 while preserving existing toolResponse.raw and declared getters.",
|
|
1048
1048
|
packageCapabilities: {
|
|
1049
1049
|
updatePreferences: 1
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1029,7 +1029,7 @@ var SDK_RELEASE = {
|
|
|
1029
1029
|
// available at toolResponse.rawV2 while toolResponse.raw and all declared
|
|
1030
1030
|
// getters keep their established compatibility behavior.
|
|
1031
1031
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
1032
|
-
version: "0.3.
|
|
1032
|
+
version: "0.3.37",
|
|
1033
1033
|
updateSummary: "Automatic CLI updates are now enabled by default. To opt out, run `deepline settings autoupdate off`; use `deepline settings autoupdate on` to re-enable updates or `deepline settings autoupdate pin <version>` to hold an exact release. This release also adds raw-v2 tool responses at toolResponse.rawV2 while preserving existing toolResponse.raw and declared getters.",
|
|
1034
1034
|
packageCapabilities: {
|
|
1035
1035
|
updatePreferences: 1
|
package/dist/index.js
CHANGED
|
@@ -779,7 +779,7 @@ var SDK_RELEASE = {
|
|
|
779
779
|
// available at toolResponse.rawV2 while toolResponse.raw and all declared
|
|
780
780
|
// getters keep their established compatibility behavior.
|
|
781
781
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
782
|
-
version: "0.3.
|
|
782
|
+
version: "0.3.37",
|
|
783
783
|
updateSummary: "Automatic CLI updates are now enabled by default. To opt out, run `deepline settings autoupdate off`; use `deepline settings autoupdate on` to re-enable updates or `deepline settings autoupdate pin <version>` to hold an exact release. This release also adds raw-v2 tool responses at toolResponse.rawV2 while preserving existing toolResponse.raw and declared getters.",
|
|
784
784
|
packageCapabilities: {
|
|
785
785
|
updatePreferences: 1
|
package/dist/index.mjs
CHANGED
|
@@ -702,7 +702,7 @@ var SDK_RELEASE = {
|
|
|
702
702
|
// available at toolResponse.rawV2 while toolResponse.raw and all declared
|
|
703
703
|
// getters keep their established compatibility behavior.
|
|
704
704
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
705
|
-
version: "0.3.
|
|
705
|
+
version: "0.3.37",
|
|
706
706
|
updateSummary: "Automatic CLI updates are now enabled by default. To opt out, run `deepline settings autoupdate off`; use `deepline settings autoupdate on` to re-enable updates or `deepline settings autoupdate pin <version>` to hold an exact release. This release also adds raw-v2 tool responses at toolResponse.rawV2 while preserving existing toolResponse.raw and declared getters.",
|
|
707
707
|
packageCapabilities: {
|
|
708
708
|
updatePreferences: 1
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"dist/bundling-sources/shared_libs/observability/node-tracing.ts",
|
|
27
27
|
"dist/bundling-sources/shared_libs/observability/redaction.ts",
|
|
28
28
|
"dist/bundling-sources/shared_libs/observability/scheduled-job-errors.ts",
|
|
29
|
+
"dist/bundling-sources/shared_libs/observability/scheduled-work.ts",
|
|
29
30
|
"dist/bundling-sources/shared_libs/observability/telemetry.ts",
|
|
30
31
|
"dist/bundling-sources/shared_libs/observability/tracing.ts",
|
|
31
32
|
"dist/bundling-sources/shared_libs/observability/worker-telemetry.ts",
|