@keystrokehq/cli 0.1.106 → 0.1.108
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/{dist-BvmFovtv.mjs → dist-BFOvwXwm.mjs} +3 -3
- package/dist/{dist-BvmFovtv.mjs.map → dist-BFOvwXwm.mjs.map} +1 -1
- package/dist/{dist-ZZlE2vk6.mjs → dist-BoZPZ9Sz.mjs} +12 -4
- package/dist/dist-BoZPZ9Sz.mjs.map +1 -0
- package/dist/{dist-DKVmrzVc.mjs → dist-D9y3OVoD.mjs} +1 -1
- package/dist/{dist-odLBD6p1.mjs → dist-De18Uq1U.mjs} +103 -3
- package/dist/dist-De18Uq1U.mjs.map +1 -0
- package/dist/{dist-C8eO3iET.mjs → dist-yDNd8kGO.mjs} +3 -3
- package/dist/{dist-C8eO3iET.mjs.map → dist-yDNd8kGO.mjs.map} +1 -1
- package/dist/index.mjs +108 -109
- package/dist/index.mjs.map +1 -1
- package/dist/{maybe-auto-update-DflBoY7a.mjs → maybe-auto-update-C-HUlgKp.mjs} +2 -2
- package/dist/{maybe-auto-update-DflBoY7a.mjs.map → maybe-auto-update-C-HUlgKp.mjs.map} +1 -1
- package/dist/{run-package-manager-update-BVuBh1a2.mjs → run-package-manager-update-D_jU5wZe.mjs} +2 -2
- package/dist/{run-package-manager-update-BVuBh1a2.mjs.map → run-package-manager-update-D_jU5wZe.mjs.map} +1 -1
- package/package.json +3 -3
- package/dist/dist-ZZlE2vk6.mjs.map +0 -1
- package/dist/dist-odLBD6p1.mjs.map +0 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { r as __toESM, t as __commonJSMin } from "./chunk-DiodbrVj.mjs";
|
|
3
|
-
import { $r as
|
|
3
|
+
import { $r as url, Br as discriminatedUnion, Fr as _null, Gr as number, Ir as any, Jr as preprocess, Kr as object, Lr as array, Nr as _enum, Qr as unknown, Rr as boolean, Tr as parseStoredRouteManifest, Ur as literal, Vr as intersection, Wr as looseObject, Xr as string, Yr as record, Zr as union, ei as datetime, jr as number$1, mn as ROUTE_MANIFEST_REL_PATH, ni as safeParse$1, qr as optional, ri as NEVER, zr as custom } from "./dist-BoZPZ9Sz.mjs";
|
|
4
4
|
import { tmpdir } from "node:os";
|
|
5
5
|
import { dirname, join, relative } from "node:path";
|
|
6
6
|
import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
7
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
7
8
|
import { spawnSync } from "node:child_process";
|
|
8
9
|
import "@aws-sdk/client-s3";
|
|
9
10
|
import "@aws-sdk/s3-request-presigner";
|
|
@@ -27,6 +28,105 @@ const ZodIssueCode = {
|
|
|
27
28
|
var ZodFirstPartyTypeKind;
|
|
28
29
|
(function(ZodFirstPartyTypeKind) {})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
|
29
30
|
//#endregion
|
|
31
|
+
//#region ../../packages/telemetry/dist/index.mjs
|
|
32
|
+
const storage = new AsyncLocalStorage();
|
|
33
|
+
function getTelemetryContext() {
|
|
34
|
+
return storage.getStore();
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Returns true when an error is an expected client/control-flow failure that
|
|
38
|
+
* should not become an Error Tracking issue.
|
|
39
|
+
*/
|
|
40
|
+
function isExpectedError(error) {
|
|
41
|
+
if (!error || typeof error !== "object") return false;
|
|
42
|
+
const status = readStatus(error);
|
|
43
|
+
if (status !== void 0 && (status === 0 || status >= 400 && status < 500)) return true;
|
|
44
|
+
if ("name" in error && typeof error.name === "string") {
|
|
45
|
+
if (error.name === "AbortError" || error.name === "CanceledError" || error.name === "CancelledError" || error.name === "RunTimeoutError") return true;
|
|
46
|
+
}
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
function readStatus(error) {
|
|
50
|
+
if ("status" in error && typeof error.status === "number") return error.status;
|
|
51
|
+
if ("statusCode" in error && typeof error.statusCode === "number") return error.statusCode;
|
|
52
|
+
}
|
|
53
|
+
const EVENT_NAME_PATTERN = /^[a-z][a-z0-9_]*(:[a-z][a-z0-9_]*)?$/;
|
|
54
|
+
let sink;
|
|
55
|
+
function configureTelemetry(options) {
|
|
56
|
+
sink = options.sink;
|
|
57
|
+
}
|
|
58
|
+
async function flushTelemetry() {
|
|
59
|
+
await sink?.flush?.();
|
|
60
|
+
}
|
|
61
|
+
async function shutdownTelemetry() {
|
|
62
|
+
const current = sink;
|
|
63
|
+
sink = void 0;
|
|
64
|
+
await current?.shutdown?.();
|
|
65
|
+
}
|
|
66
|
+
async function captureException(input) {
|
|
67
|
+
if (isExpectedError(input.error) || !sink?.captureException) return;
|
|
68
|
+
const context = getTelemetryContext();
|
|
69
|
+
const actorId = input.actorId ?? context?.actorId;
|
|
70
|
+
const analyticsId = input.analyticsId ?? context?.analyticsId;
|
|
71
|
+
const organizationId = input.organizationId ?? context?.organizationId;
|
|
72
|
+
const projectId = input.projectId ?? context?.projectId;
|
|
73
|
+
const sessionId = input.sessionId ?? context?.sessionId;
|
|
74
|
+
const enriched = {
|
|
75
|
+
error: input.error,
|
|
76
|
+
...actorId ? { actorId } : {},
|
|
77
|
+
...analyticsId ? { analyticsId } : {},
|
|
78
|
+
...organizationId ? { organizationId } : {},
|
|
79
|
+
...projectId ? { projectId } : {},
|
|
80
|
+
...sessionId ? { sessionId } : {},
|
|
81
|
+
...input.operation ? { operation: input.operation } : {},
|
|
82
|
+
...input.properties ? { properties: input.properties } : {}
|
|
83
|
+
};
|
|
84
|
+
try {
|
|
85
|
+
await sink.captureException(enriched);
|
|
86
|
+
} catch (error) {
|
|
87
|
+
console.error("[telemetry] captureException sink failed", error);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
async function event(input) {
|
|
91
|
+
if (!EVENT_NAME_PATTERN.test(input.name)) {
|
|
92
|
+
console.error(`[telemetry] rejected invalid event name: ${input.name}`);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const actorId = input.actorId.trim();
|
|
96
|
+
if (!actorId) {
|
|
97
|
+
console.error("[telemetry] rejected event without actorId");
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (!sink?.event) return;
|
|
101
|
+
try {
|
|
102
|
+
await sink.event({
|
|
103
|
+
...input,
|
|
104
|
+
actorId,
|
|
105
|
+
timestamp: input.timestamp ?? /* @__PURE__ */ new Date(),
|
|
106
|
+
uuid: input.uuid ?? globalThis.crypto.randomUUID()
|
|
107
|
+
});
|
|
108
|
+
} catch (error) {
|
|
109
|
+
console.error("[telemetry] event sink failed", error);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
async function alias(input) {
|
|
113
|
+
const distinctId = input.distinctId.trim();
|
|
114
|
+
const aliasId = input.alias.trim();
|
|
115
|
+
if (!distinctId || !aliasId) {
|
|
116
|
+
console.error("[telemetry] rejected alias without distinctId/alias");
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
if (!sink?.alias) return;
|
|
120
|
+
try {
|
|
121
|
+
await sink.alias({
|
|
122
|
+
distinctId,
|
|
123
|
+
alias: aliasId
|
|
124
|
+
});
|
|
125
|
+
} catch (error) {
|
|
126
|
+
console.error("[telemetry] alias sink failed", error);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
//#endregion
|
|
30
130
|
//#region ../../packages/storage/dist/pack-artifact-DYN-lXBn.mjs
|
|
31
131
|
let forceLocalSupported;
|
|
32
132
|
/**
|
|
@@ -11575,6 +11675,6 @@ async function mapInParallelBatches(items, batchSize, fn) {
|
|
|
11575
11675
|
return results;
|
|
11576
11676
|
}
|
|
11577
11677
|
//#endregion
|
|
11578
|
-
export { packProjectArtifact as i, withMcpReadClient as n, mergeFilteredArtifact as r, mapInParallelBatches as t };
|
|
11678
|
+
export { alias as a, event as c, packProjectArtifact as i, flushTelemetry as l, withMcpReadClient as n, captureException as o, mergeFilteredArtifact as r, configureTelemetry as s, mapInParallelBatches as t, shutdownTelemetry as u };
|
|
11579
11679
|
|
|
11580
|
-
//# sourceMappingURL=dist-
|
|
11680
|
+
//# sourceMappingURL=dist-De18Uq1U.mjs.map
|