@uipath/common 1.203.0-preview.205 → 1.204.0-preview.206
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/attachment-binding.d.ts +14 -0
- package/dist/error-graph.d.ts +37 -0
- package/dist/error-handler.d.ts +2 -8
- package/dist/error-handler.js +760 -0
- package/dist/formatter.d.ts +23 -0
- package/dist/index.browser.d.ts +2 -0
- package/dist/index.browser.js +353 -66
- package/dist/index.d.ts +3 -1
- package/dist/index.js +648 -111
- package/dist/local-permission-codes.d.ts +1 -0
- package/dist/mime-types.d.ts +8 -0
- package/dist/sdk-user-agent.js +130 -2
- package/dist/telemetry/command-attribution.d.ts +19 -3
- package/dist/telemetry/command-name.d.ts +77 -31
- package/dist/telemetry/command-terminal.d.ts +1 -1
- package/dist/telemetry/environment-info.d.ts +2 -2
- package/dist/telemetry/index.d.ts +1 -0
- package/dist/telemetry/index.js +227 -14
- package/dist/telemetry/session-id.d.ts +1 -1
- package/dist/telemetry/ship-succeeded.d.ts +13 -13
- package/dist/telemetry/telemetry-dimensions.d.ts +237 -0
- package/dist/telemetry/telemetry-events.d.ts +18 -6
- package/dist/trackedAction.d.ts +20 -7
- package/package.json +6 -2
package/dist/telemetry/index.js
CHANGED
|
@@ -18164,12 +18164,177 @@ class BrowserContextStorage {
|
|
|
18164
18164
|
return this.contextStack.length > 0 ? this.contextStack[this.contextStack.length - 1] : undefined;
|
|
18165
18165
|
}
|
|
18166
18166
|
}
|
|
18167
|
+
// src/telemetry/telemetry-dimensions.ts
|
|
18168
|
+
var CLI_APPLICATION_NAME = "UiPath.Cli";
|
|
18169
|
+
var BaseDimensions = {
|
|
18170
|
+
ApplicationName: "ApplicationName",
|
|
18171
|
+
ProductVersion: "ProductVersion",
|
|
18172
|
+
InstallationId: "InstallationId",
|
|
18173
|
+
CloudUserId: "CloudUserId",
|
|
18174
|
+
CloudTenantId: "CloudTenantId",
|
|
18175
|
+
CloudOrganizationId: "CloudOrganizationId",
|
|
18176
|
+
IsInternalUser: "IsInternalUser",
|
|
18177
|
+
Environment: "Environment",
|
|
18178
|
+
BaseUrl: "BaseUrl",
|
|
18179
|
+
Region: "Region",
|
|
18180
|
+
Agent: "Agent",
|
|
18181
|
+
AgentVersion: "AgentVersion",
|
|
18182
|
+
AgentModel: "AgentModel",
|
|
18183
|
+
ToolName: "ToolName",
|
|
18184
|
+
ToolVersion: "ToolVersion",
|
|
18185
|
+
ExecutionContext: "ExecutionContext",
|
|
18186
|
+
CiProvider: "CiProvider",
|
|
18187
|
+
SessionIdSource: "SessionIdSource",
|
|
18188
|
+
SessionId: "SessionId"
|
|
18189
|
+
};
|
|
18190
|
+
var CommandDimensions = {
|
|
18191
|
+
IsCommand: "IsCommand",
|
|
18192
|
+
IsReexec: "IsReexec",
|
|
18193
|
+
CommandName: "CommandName",
|
|
18194
|
+
ExitCode: "ExitCode",
|
|
18195
|
+
TerminalOutcome: "TerminalOutcome",
|
|
18196
|
+
ErrorClass: "ErrorClass",
|
|
18197
|
+
TerminalSignal: "TerminalSignal",
|
|
18198
|
+
ErrorMessage: "ErrorMessage",
|
|
18199
|
+
SkillName: "SkillName",
|
|
18200
|
+
ProductArea: "ProductArea",
|
|
18201
|
+
Mode: "Mode"
|
|
18202
|
+
};
|
|
18203
|
+
var ShipDimensions = {
|
|
18204
|
+
ShipKind: "ShipKind",
|
|
18205
|
+
Target: "Target",
|
|
18206
|
+
ProjectType: "ProjectType",
|
|
18207
|
+
ProjectTypes: "ProjectTypes",
|
|
18208
|
+
ArtifactCorrelationKey: "ArtifactCorrelationKey",
|
|
18209
|
+
PackageName: "PackageName",
|
|
18210
|
+
PackageVersion: "PackageVersion",
|
|
18211
|
+
PackageVersionKey: "PackageVersionKey",
|
|
18212
|
+
DeploymentKey: "DeploymentKey",
|
|
18213
|
+
SolutionId: "SolutionId",
|
|
18214
|
+
FolderKey: "FolderKey",
|
|
18215
|
+
FeedId: "FeedId"
|
|
18216
|
+
};
|
|
18217
|
+
var ErrorDimensions = {
|
|
18218
|
+
Result: "Result",
|
|
18219
|
+
ErrorCode: "ErrorCode",
|
|
18220
|
+
Retry: "Retry",
|
|
18221
|
+
ErrorMessage: "ErrorMessage"
|
|
18222
|
+
};
|
|
18223
|
+
var AuthDimensions = {
|
|
18224
|
+
AuthenticationMethod: "AuthenticationMethod",
|
|
18225
|
+
Success: "Success",
|
|
18226
|
+
Reason: "Reason"
|
|
18227
|
+
};
|
|
18228
|
+
var SkillsDimensions = {
|
|
18229
|
+
SchemaVersion: "SchemaVersion",
|
|
18230
|
+
AgentType: "AgentType",
|
|
18231
|
+
SkillsVersion: "SkillsVersion",
|
|
18232
|
+
UipSubcommand: "UipSubcommand",
|
|
18233
|
+
FileExtension: "FileExtension",
|
|
18234
|
+
SubagentModel: "SubagentModel",
|
|
18235
|
+
SubagentType: "SubagentType",
|
|
18236
|
+
PermissionMode: "PermissionMode",
|
|
18237
|
+
EffortLevel: "EffortLevel",
|
|
18238
|
+
SessionSource: "SessionSource",
|
|
18239
|
+
Outcome: "Outcome",
|
|
18240
|
+
DurationMs: "DurationMs",
|
|
18241
|
+
Source: "Source"
|
|
18242
|
+
};
|
|
18243
|
+
var PackagerDimensions = {
|
|
18244
|
+
ProjectId: "ProjectId",
|
|
18245
|
+
ProjectType: "ProjectType",
|
|
18246
|
+
SolutionId: "SolutionId"
|
|
18247
|
+
};
|
|
18248
|
+
var ScopeDimensions = {
|
|
18249
|
+
FolderId: "FolderId"
|
|
18250
|
+
};
|
|
18251
|
+
var ID_DIMENSIONS = new Set([
|
|
18252
|
+
BaseDimensions.CloudUserId,
|
|
18253
|
+
BaseDimensions.CloudTenantId,
|
|
18254
|
+
BaseDimensions.CloudOrganizationId,
|
|
18255
|
+
BaseDimensions.InstallationId,
|
|
18256
|
+
ShipDimensions.ArtifactCorrelationKey,
|
|
18257
|
+
ShipDimensions.PackageVersionKey,
|
|
18258
|
+
ShipDimensions.DeploymentKey,
|
|
18259
|
+
ShipDimensions.SolutionId,
|
|
18260
|
+
ShipDimensions.FolderKey,
|
|
18261
|
+
ShipDimensions.FeedId,
|
|
18262
|
+
PackagerDimensions.ProjectId
|
|
18263
|
+
]);
|
|
18264
|
+
var NON_IDENTIFIER_PLACEHOLDER_PATTERN = /^(?:\[[A-Z_]+\]|<[^>]+>)$/;
|
|
18265
|
+
var DIMENSION_NAME_EXEMPT_PREFIXES = [
|
|
18266
|
+
"uip.cmd.arg.",
|
|
18267
|
+
"server.",
|
|
18268
|
+
"http."
|
|
18269
|
+
];
|
|
18270
|
+
function isExemptDimensionName(name) {
|
|
18271
|
+
return DIMENSION_NAME_EXEMPT_PREFIXES.some((prefix) => name.startsWith(prefix));
|
|
18272
|
+
}
|
|
18273
|
+
var DIMENSION_NAME_PATTERN = /^[A-Z][A-Za-z0-9]*$/;
|
|
18274
|
+
var EVENT_NAME_PATTERN = /^[A-Z][A-Za-z0-9]*\.[A-Z][A-Za-z0-9]*$/;
|
|
18275
|
+
var RESERVED_DIMENSION_NAMES = new Set([
|
|
18276
|
+
...Object.values(BaseDimensions),
|
|
18277
|
+
...Object.values(CommandDimensions),
|
|
18278
|
+
...Object.values(ShipDimensions),
|
|
18279
|
+
...Object.values(ErrorDimensions),
|
|
18280
|
+
...Object.values(AuthDimensions),
|
|
18281
|
+
...Object.values(SkillsDimensions),
|
|
18282
|
+
...Object.values(PackagerDimensions),
|
|
18283
|
+
...Object.values(ScopeDimensions)
|
|
18284
|
+
]);
|
|
18285
|
+
var CURATED_DIMENSIONS = new Set([
|
|
18286
|
+
BaseDimensions.ApplicationName,
|
|
18287
|
+
BaseDimensions.ProductVersion,
|
|
18288
|
+
BaseDimensions.InstallationId,
|
|
18289
|
+
BaseDimensions.CloudUserId,
|
|
18290
|
+
BaseDimensions.CloudTenantId,
|
|
18291
|
+
BaseDimensions.CloudOrganizationId,
|
|
18292
|
+
BaseDimensions.IsInternalUser,
|
|
18293
|
+
BaseDimensions.Environment,
|
|
18294
|
+
BaseDimensions.BaseUrl,
|
|
18295
|
+
BaseDimensions.Region,
|
|
18296
|
+
BaseDimensions.Agent,
|
|
18297
|
+
BaseDimensions.AgentVersion,
|
|
18298
|
+
BaseDimensions.ToolVersion,
|
|
18299
|
+
BaseDimensions.ExecutionContext,
|
|
18300
|
+
BaseDimensions.CiProvider,
|
|
18301
|
+
BaseDimensions.SessionIdSource,
|
|
18302
|
+
BaseDimensions.SessionId,
|
|
18303
|
+
...Object.values(CommandDimensions),
|
|
18304
|
+
...Object.values(ShipDimensions)
|
|
18305
|
+
]);
|
|
18306
|
+
function assertNoCuratedDimensionTargets(map, mapName) {
|
|
18307
|
+
for (const [inputKey, dimension] of Object.entries(map)) {
|
|
18308
|
+
if (CURATED_DIMENSIONS.has(dimension)) {
|
|
18309
|
+
throw new Error(`${mapName}: input field "${inputKey}" maps to curated dimension "${dimension}"`);
|
|
18310
|
+
}
|
|
18311
|
+
}
|
|
18312
|
+
}
|
|
18313
|
+
function lowercaseIdDimensionValues(properties) {
|
|
18314
|
+
let changed = false;
|
|
18315
|
+
const result = {
|
|
18316
|
+
...properties
|
|
18317
|
+
};
|
|
18318
|
+
for (const key of Object.keys(result)) {
|
|
18319
|
+
const value = result[key];
|
|
18320
|
+
if (!ID_DIMENSIONS.has(key) || typeof value !== "string" || NON_IDENTIFIER_PLACEHOLDER_PATTERN.test(value)) {
|
|
18321
|
+
continue;
|
|
18322
|
+
}
|
|
18323
|
+
const lowered = value.toLowerCase();
|
|
18324
|
+
if (lowered !== value) {
|
|
18325
|
+
result[key] = lowered;
|
|
18326
|
+
changed = true;
|
|
18327
|
+
}
|
|
18328
|
+
}
|
|
18329
|
+
return changed ? result : properties;
|
|
18330
|
+
}
|
|
18331
|
+
|
|
18167
18332
|
// src/telemetry/command-attribution.ts
|
|
18168
18333
|
var LEGACY_SKILL_NAMESPACE = "uipath:";
|
|
18169
18334
|
var MAX_SKILL_NAME_LENGTH = 80;
|
|
18170
18335
|
var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
|
|
18171
18336
|
function productMode(productArea, mode) {
|
|
18172
|
-
return {
|
|
18337
|
+
return { ProductArea: productArea, Mode: mode };
|
|
18173
18338
|
}
|
|
18174
18339
|
function attributionRecord(groups) {
|
|
18175
18340
|
const record = {};
|
|
@@ -18227,6 +18392,7 @@ var COMMAND_ATTRIBUTION = commandAttribution([
|
|
|
18227
18392
|
["rpa", "build", ["uip.rpa-legacy"]],
|
|
18228
18393
|
["conversational", "operate", ["uip.conversational"]],
|
|
18229
18394
|
["agents", "build", ["uip.codedagent", "uip.agent"]],
|
|
18395
|
+
["coding-agents", "build", ["uip.coder"]],
|
|
18230
18396
|
["agenthub", "build", ["uip.agenthub"]],
|
|
18231
18397
|
["coded-apps", "build", ["uip.codedapp"]],
|
|
18232
18398
|
["functions", "build", ["uip.function", "uip.functions"]],
|
|
@@ -18317,7 +18483,7 @@ function normalizeLegacySkillName(value) {
|
|
|
18317
18483
|
function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
18318
18484
|
const skillName = normalizeSkillName(skillSource);
|
|
18319
18485
|
return {
|
|
18320
|
-
...skillName ? {
|
|
18486
|
+
...skillName ? { SkillName: skillName } : {},
|
|
18321
18487
|
...getCommandProductModeAttribution(commandPath)
|
|
18322
18488
|
};
|
|
18323
18489
|
}
|
|
@@ -18328,9 +18494,29 @@ function buildSkillEventTelemetryAttribution(skillSource, uipSubcommand) {
|
|
|
18328
18494
|
return {
|
|
18329
18495
|
...skillAttribution,
|
|
18330
18496
|
...commandAttribution2,
|
|
18331
|
-
...skillName ? {
|
|
18497
|
+
...skillName ? { SkillName: skillName } : {}
|
|
18332
18498
|
};
|
|
18333
18499
|
}
|
|
18500
|
+
var AGENT_SESSION_ENV = {
|
|
18501
|
+
[BaseDimensions.AgentModel]: "UIPATH_AGENT_MODEL",
|
|
18502
|
+
[SkillsDimensions.PermissionMode]: "UIPATH_PERMISSION_MODE",
|
|
18503
|
+
[SkillsDimensions.EffortLevel]: "UIPATH_EFFORT_LEVEL",
|
|
18504
|
+
[SkillsDimensions.SkillsVersion]: "UIPATH_SKILLS_VERSION"
|
|
18505
|
+
};
|
|
18506
|
+
var MAX_TELEMETRY_TOKEN_LENGTH = 120;
|
|
18507
|
+
function sanitizeTelemetryToken(value) {
|
|
18508
|
+
return value.replace(/[^A-Za-z0-9:._/ -]/g, "_").slice(0, MAX_TELEMETRY_TOKEN_LENGTH);
|
|
18509
|
+
}
|
|
18510
|
+
function buildAgentSessionTelemetry(env) {
|
|
18511
|
+
const dimensions = {};
|
|
18512
|
+
for (const [key, variable] of Object.entries(AGENT_SESSION_ENV)) {
|
|
18513
|
+
const value = env[variable]?.trim();
|
|
18514
|
+
if (value) {
|
|
18515
|
+
dimensions[key] = sanitizeTelemetryToken(value);
|
|
18516
|
+
}
|
|
18517
|
+
}
|
|
18518
|
+
return dimensions;
|
|
18519
|
+
}
|
|
18334
18520
|
// src/telemetry/console-telemetry-provider.ts
|
|
18335
18521
|
class ConsoleTelemetryProvider {
|
|
18336
18522
|
async trackEvent({ name }) {
|
|
@@ -18398,14 +18584,14 @@ function deriveRegion(baseUrl) {
|
|
|
18398
18584
|
}
|
|
18399
18585
|
function buildEnvironmentProperties(baseUrl) {
|
|
18400
18586
|
const props = {
|
|
18401
|
-
|
|
18587
|
+
[BaseDimensions.Environment]: normalizeEnvironment(baseUrl)
|
|
18402
18588
|
};
|
|
18403
18589
|
const normalized = normalizeBaseUrl(baseUrl);
|
|
18404
18590
|
if (normalized)
|
|
18405
|
-
props.
|
|
18591
|
+
props[BaseDimensions.BaseUrl] = normalized;
|
|
18406
18592
|
const region = deriveRegion(baseUrl);
|
|
18407
18593
|
if (region)
|
|
18408
|
-
props.
|
|
18594
|
+
props[BaseDimensions.Region] = region;
|
|
18409
18595
|
return props;
|
|
18410
18596
|
}
|
|
18411
18597
|
// src/singleton.ts
|
|
@@ -18578,8 +18764,8 @@ function detectExecutionContext(options = {}) {
|
|
|
18578
18764
|
function getExecutionContextTelemetryProperties() {
|
|
18579
18765
|
const detected = detectExecutionContext();
|
|
18580
18766
|
return {
|
|
18581
|
-
|
|
18582
|
-
...detected.ciProvider ? {
|
|
18767
|
+
[BaseDimensions.ExecutionContext]: detected.executionContext,
|
|
18768
|
+
...detected.ciProvider ? { [BaseDimensions.CiProvider]: detected.ciProvider } : {}
|
|
18583
18769
|
};
|
|
18584
18770
|
}
|
|
18585
18771
|
// src/telemetry/pseudonymize.ts
|
|
@@ -19039,7 +19225,7 @@ function getInboundTraceContext() {
|
|
|
19039
19225
|
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
19040
19226
|
var SESSION_ID_MAX_LENGTH = 64;
|
|
19041
19227
|
var RANDOM_SESSION_ID_LENGTH = 32;
|
|
19042
|
-
var TELEMETRY_SESSION_SOURCE_PROPERTY = "
|
|
19228
|
+
var TELEMETRY_SESSION_SOURCE_PROPERTY = "SessionIdSource";
|
|
19043
19229
|
var CONTROL_CHARACTERS = /\p{Cc}/gu;
|
|
19044
19230
|
var INHERITED_SESSION_SOURCES = [
|
|
19045
19231
|
{ envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
|
|
@@ -19174,7 +19360,10 @@ class TelemetryService {
|
|
|
19174
19360
|
} catch (error) {
|
|
19175
19361
|
const durationMs = clock.elapsedMs();
|
|
19176
19362
|
const err = error instanceof Error ? error : new Error(String(error));
|
|
19177
|
-
await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, {
|
|
19363
|
+
await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, {
|
|
19364
|
+
...properties,
|
|
19365
|
+
[CommandDimensions.ErrorMessage]: err.message
|
|
19366
|
+
}, context));
|
|
19178
19367
|
throw error;
|
|
19179
19368
|
}
|
|
19180
19369
|
}
|
|
@@ -19245,7 +19434,10 @@ class TelemetryService {
|
|
|
19245
19434
|
const durationMs = clock.elapsedMs();
|
|
19246
19435
|
const err = error instanceof Error ? error : new Error(String(error));
|
|
19247
19436
|
await this.telemetryProvider.trackDependency({
|
|
19248
|
-
...this.spanFor(name, durationMs, false, {
|
|
19437
|
+
...this.spanFor(name, durationMs, false, {
|
|
19438
|
+
...properties,
|
|
19439
|
+
[CommandDimensions.ErrorMessage]: err.message
|
|
19440
|
+
}, childContext),
|
|
19249
19441
|
type
|
|
19250
19442
|
});
|
|
19251
19443
|
throw error;
|
|
@@ -19280,9 +19472,10 @@ class TelemetryService {
|
|
|
19280
19472
|
...globalProperties,
|
|
19281
19473
|
...this.defaultProperties,
|
|
19282
19474
|
...redactProperties(properties ?? {}),
|
|
19283
|
-
[TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource()
|
|
19475
|
+
[TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource(),
|
|
19476
|
+
[BaseDimensions.SessionId]: this.telemetryProvider.getSessionId?.() ?? getTelemetrySessionId()
|
|
19284
19477
|
};
|
|
19285
|
-
return enriched;
|
|
19478
|
+
return lowercaseIdDimensionValues(enriched);
|
|
19286
19479
|
}
|
|
19287
19480
|
generateId() {
|
|
19288
19481
|
const bytes = new Uint8Array(8);
|
|
@@ -19298,12 +19491,29 @@ class TelemetryService {
|
|
|
19298
19491
|
}
|
|
19299
19492
|
}
|
|
19300
19493
|
export {
|
|
19494
|
+
AuthDimensions,
|
|
19495
|
+
BaseDimensions,
|
|
19301
19496
|
BrowserContextStorage,
|
|
19497
|
+
CLI_APPLICATION_NAME,
|
|
19498
|
+
CURATED_DIMENSIONS,
|
|
19499
|
+
CommandDimensions,
|
|
19302
19500
|
ConsoleTelemetryProvider,
|
|
19501
|
+
DIMENSION_NAME_EXEMPT_PREFIXES,
|
|
19502
|
+
DIMENSION_NAME_PATTERN,
|
|
19503
|
+
EVENT_NAME_PATTERN,
|
|
19303
19504
|
EXECUTION_CONTEXT_VALUES,
|
|
19505
|
+
ErrorDimensions,
|
|
19506
|
+
ID_DIMENSIONS,
|
|
19507
|
+
PackagerDimensions,
|
|
19508
|
+
RESERVED_DIMENSION_NAMES,
|
|
19509
|
+
ScopeDimensions,
|
|
19510
|
+
ShipDimensions,
|
|
19511
|
+
SkillsDimensions,
|
|
19304
19512
|
TELEMETRY_SESSION_ID_ENV,
|
|
19305
19513
|
TELEMETRY_SESSION_SOURCE_PROPERTY,
|
|
19306
19514
|
TelemetryService,
|
|
19515
|
+
assertNoCuratedDimensionTargets,
|
|
19516
|
+
buildAgentSessionTelemetry,
|
|
19307
19517
|
buildCommandTelemetryAttribution,
|
|
19308
19518
|
buildEnvironmentProperties,
|
|
19309
19519
|
buildSkillEventTelemetryAttribution,
|
|
@@ -19312,13 +19522,16 @@ export {
|
|
|
19312
19522
|
getExecutionContextTelemetryProperties,
|
|
19313
19523
|
getTelemetrySessionId,
|
|
19314
19524
|
getTelemetrySessionSource,
|
|
19525
|
+
isExemptDimensionName,
|
|
19526
|
+
lowercaseIdDimensionValues,
|
|
19315
19527
|
normalizeBaseUrl,
|
|
19316
19528
|
normalizeEnvironment,
|
|
19317
19529
|
normalizeSkillName,
|
|
19318
19530
|
redactError,
|
|
19319
19531
|
redactProperties,
|
|
19320
19532
|
redactProperty,
|
|
19533
|
+
sanitizeTelemetryToken,
|
|
19321
19534
|
setExecutionContextAuthSignal
|
|
19322
19535
|
};
|
|
19323
19536
|
|
|
19324
|
-
//# debugId=
|
|
19537
|
+
//# debugId=185B0F4985CF941364756E2164756E21
|
|
@@ -20,7 +20,7 @@ export declare const RANDOM_SESSION_ID_LENGTH = 32;
|
|
|
20
20
|
* handles pass through as the host exported them, with no source marker. Low
|
|
21
21
|
* cardinality by construction: one of {@link TelemetrySessionSource}.
|
|
22
22
|
*/
|
|
23
|
-
export declare const TELEMETRY_SESSION_SOURCE_PROPERTY = "
|
|
23
|
+
export declare const TELEMETRY_SESSION_SOURCE_PROPERTY = "SessionIdSource";
|
|
24
24
|
/**
|
|
25
25
|
* Where a session id came from — the value of the
|
|
26
26
|
* {@link TELEMETRY_SESSION_SOURCE_PROPERTY} dimension.
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export interface ShipSucceededTelemetryPayload {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
ShipKind: string;
|
|
3
|
+
Target: string;
|
|
4
|
+
ProjectType: string;
|
|
5
|
+
CommandName: string;
|
|
6
|
+
ArtifactCorrelationKey?: string;
|
|
7
|
+
PackageVersionKey?: string;
|
|
8
|
+
PackageName?: string;
|
|
9
|
+
PackageVersion?: string;
|
|
10
|
+
DeploymentKey?: string;
|
|
11
|
+
SolutionId?: string;
|
|
12
|
+
FolderKey?: string;
|
|
13
|
+
FeedId?: string;
|
|
14
|
+
ProjectTypes?: string;
|
|
15
15
|
}
|
|
16
16
|
export declare function trackShipSucceeded(payload: ShipSucceededTelemetryPayload): boolean;
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The canonical names of every custom dimension the CLI emits.
|
|
3
|
+
*
|
|
4
|
+
* UiPath's business-telemetry convention (PRENG-7421) asks for PascalCase
|
|
5
|
+
* "without word separation of any kind", first-level under `customDimensions`.
|
|
6
|
+
* Before this existed the repo carried four casings at once — snake_case
|
|
7
|
+
* (`skill_name`), camelCase (`toolName`), PascalCase (`CloudUserId`) and dotted
|
|
8
|
+
* namespaces — because nothing named the dimensions in one place and no test
|
|
9
|
+
* could see the set.
|
|
10
|
+
*
|
|
11
|
+
* Producers import a constant from here rather than writing a string literal.
|
|
12
|
+
* That is deliberate and it is the whole point: a rename map applied at the
|
|
13
|
+
* emit choke point would have left both spellings alive in the source forever,
|
|
14
|
+
* and the next person would not know which one was real.
|
|
15
|
+
*
|
|
16
|
+
* `telemetry-dimensions.spec.ts` asserts the shape of every value below, and
|
|
17
|
+
* `telemetry-service.spec.ts` asserts that nothing outside this registry (bar
|
|
18
|
+
* the exempt prefixes) reaches a provider.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* The value of {@link BaseDimensions.ApplicationName} for this product.
|
|
22
|
+
*
|
|
23
|
+
* `UiPath.[ProductName]` is the convention's shape, and this string is the
|
|
24
|
+
* join key the analytics estate identifies the CLI by — it is not a label to
|
|
25
|
+
* reword. Lowercasing it would break that join, which is why
|
|
26
|
+
* {@link ID_DIMENSIONS} deliberately does not list `ApplicationName`.
|
|
27
|
+
*/
|
|
28
|
+
export declare const CLI_APPLICATION_NAME = "UiPath.Cli";
|
|
29
|
+
/**
|
|
30
|
+
* Stamped on every item, from the CLI host's startup and auth context.
|
|
31
|
+
*
|
|
32
|
+
* `ApplicationName` and `SessionId` are the two the convention requires that
|
|
33
|
+
* the CLI did not have: the first identifies the product across the shared
|
|
34
|
+
* analytics estate (and replaces the old `name startswith "uip."` filter), the
|
|
35
|
+
* second mirrors the native `ai.session.id` tag into a queryable dimension.
|
|
36
|
+
*/
|
|
37
|
+
export declare const BaseDimensions: {
|
|
38
|
+
/** `UiPath.[ProductName]` — the convention's product identifier. */
|
|
39
|
+
readonly ApplicationName: "ApplicationName";
|
|
40
|
+
/** The CLI's own version. Also on the native `ai.application.ver` tag. */
|
|
41
|
+
readonly ProductVersion: "ProductVersion";
|
|
42
|
+
/** Random UUID from `~/.uipath/cli-device-id`. Never a machine identifier. */
|
|
43
|
+
readonly InstallationId: "InstallationId";
|
|
44
|
+
readonly CloudUserId: "CloudUserId";
|
|
45
|
+
readonly CloudTenantId: "CloudTenantId";
|
|
46
|
+
readonly CloudOrganizationId: "CloudOrganizationId";
|
|
47
|
+
/** Derived from the auth email domain. Only the boolean is emitted. */
|
|
48
|
+
readonly IsInternalUser: "IsInternalUser";
|
|
49
|
+
/** `prod` | `staging` | `alpha` | `local` | `unknown`. */
|
|
50
|
+
readonly Environment: "Environment";
|
|
51
|
+
/** The auth base URL reduced to its origin. */
|
|
52
|
+
readonly BaseUrl: "BaseUrl";
|
|
53
|
+
/** The cloud deployment ring where the host reveals one, e.g. `gov`. */
|
|
54
|
+
readonly Region: "Region";
|
|
55
|
+
/** The invoking coding agent, when one was detected. */
|
|
56
|
+
readonly Agent: "Agent";
|
|
57
|
+
readonly AgentVersion: "AgentVersion";
|
|
58
|
+
/** The agent session's main model, as a sanitized slug. */
|
|
59
|
+
readonly AgentModel: "AgentModel";
|
|
60
|
+
/** The tool bundle that owns the running command, e.g. `or`. */
|
|
61
|
+
readonly ToolName: "ToolName";
|
|
62
|
+
readonly ToolVersion: "ToolVersion";
|
|
63
|
+
/** `manual` | `agent` | `ci` | `scheduler` | `service_account` | `unknown`. */
|
|
64
|
+
readonly ExecutionContext: "ExecutionContext";
|
|
65
|
+
readonly CiProvider: "CiProvider";
|
|
66
|
+
/** Which host handle produced the session id. CLI-owned, unshadowable. */
|
|
67
|
+
readonly SessionIdSource: "SessionIdSource";
|
|
68
|
+
/** The session handle itself, mirroring the native `ai.session.id` tag. */
|
|
69
|
+
readonly SessionId: "SessionId";
|
|
70
|
+
};
|
|
71
|
+
/** Dimensions a command invocation's request row carries. */
|
|
72
|
+
export declare const CommandDimensions: {
|
|
73
|
+
/** Marks the row as a command invocation. Unoverridable by a caller. */
|
|
74
|
+
readonly IsCommand: "IsCommand";
|
|
75
|
+
/** Marks the delegated half of the version-sync re-exec. */
|
|
76
|
+
readonly IsReexec: "IsReexec";
|
|
77
|
+
/** The command path, space-separated — the breakdown the flat name drops. */
|
|
78
|
+
readonly CommandName: "CommandName";
|
|
79
|
+
readonly ExitCode: "ExitCode";
|
|
80
|
+
/** `success` | `no_op` | `failure` | `cancelled`. */
|
|
81
|
+
readonly TerminalOutcome: "TerminalOutcome";
|
|
82
|
+
readonly ErrorClass: "ErrorClass";
|
|
83
|
+
readonly TerminalSignal: "TerminalSignal";
|
|
84
|
+
readonly ErrorMessage: "ErrorMessage";
|
|
85
|
+
/** Canonical skill name from `UIPATH_SKILL`. */
|
|
86
|
+
readonly SkillName: "SkillName";
|
|
87
|
+
readonly ProductArea: "ProductArea";
|
|
88
|
+
/** `build` | `operate` | `troubleshoot`. */
|
|
89
|
+
readonly Mode: "Mode";
|
|
90
|
+
};
|
|
91
|
+
/** Dimensions on `Cli.ShipSucceeded`. */
|
|
92
|
+
export declare const ShipDimensions: {
|
|
93
|
+
readonly ShipKind: "ShipKind";
|
|
94
|
+
readonly Target: "Target";
|
|
95
|
+
readonly ProjectType: "ProjectType";
|
|
96
|
+
readonly ProjectTypes: "ProjectTypes";
|
|
97
|
+
readonly ArtifactCorrelationKey: "ArtifactCorrelationKey";
|
|
98
|
+
readonly PackageName: "PackageName";
|
|
99
|
+
readonly PackageVersion: "PackageVersion";
|
|
100
|
+
readonly PackageVersionKey: "PackageVersionKey";
|
|
101
|
+
readonly DeploymentKey: "DeploymentKey";
|
|
102
|
+
readonly SolutionId: "SolutionId";
|
|
103
|
+
readonly FolderKey: "FolderKey";
|
|
104
|
+
readonly FeedId: "FeedId";
|
|
105
|
+
};
|
|
106
|
+
/** Dimensions on `Application.Error`, from the failure envelope. */
|
|
107
|
+
export declare const ErrorDimensions: {
|
|
108
|
+
readonly Result: "Result";
|
|
109
|
+
readonly ErrorCode: "ErrorCode";
|
|
110
|
+
readonly Retry: "Retry";
|
|
111
|
+
/** The envelope's `Message`, under the name the convention prescribes. */
|
|
112
|
+
readonly ErrorMessage: "ErrorMessage";
|
|
113
|
+
};
|
|
114
|
+
/** Dimensions on the `Authenticate.*` events. */
|
|
115
|
+
export declare const AuthDimensions: {
|
|
116
|
+
/** The login flow. The convention's well-known name for exactly this. */
|
|
117
|
+
readonly AuthenticationMethod: "AuthenticationMethod";
|
|
118
|
+
readonly Success: "Success";
|
|
119
|
+
readonly Reason: "Reason";
|
|
120
|
+
};
|
|
121
|
+
/** Dimensions on the `Cli.Skills*` events, forwarded from the hook payload. */
|
|
122
|
+
export declare const SkillsDimensions: {
|
|
123
|
+
readonly SchemaVersion: "SchemaVersion";
|
|
124
|
+
readonly AgentType: "AgentType";
|
|
125
|
+
readonly SkillsVersion: "SkillsVersion";
|
|
126
|
+
readonly UipSubcommand: "UipSubcommand";
|
|
127
|
+
readonly FileExtension: "FileExtension";
|
|
128
|
+
readonly SubagentModel: "SubagentModel";
|
|
129
|
+
readonly SubagentType: "SubagentType";
|
|
130
|
+
readonly PermissionMode: "PermissionMode";
|
|
131
|
+
readonly EffortLevel: "EffortLevel";
|
|
132
|
+
/** `startup` | `resume` | `clear` | `compact`. */
|
|
133
|
+
readonly SessionSource: "SessionSource";
|
|
134
|
+
readonly Outcome: "Outcome";
|
|
135
|
+
readonly DurationMs: "DurationMs";
|
|
136
|
+
/** Forced to `skills-plugin` by the CLI; a payload cannot set it. */
|
|
137
|
+
readonly Source: "Source";
|
|
138
|
+
};
|
|
139
|
+
/** Dimensions a packager dependency span carries. */
|
|
140
|
+
export declare const PackagerDimensions: {
|
|
141
|
+
readonly ProjectId: "ProjectId";
|
|
142
|
+
readonly ProjectType: "ProjectType";
|
|
143
|
+
readonly SolutionId: "SolutionId";
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* The platform scope a session is pointed at, stamped as defaults rather than
|
|
147
|
+
* per call. `CloudOrganizationId` / `CloudTenantId` carry the rest of it.
|
|
148
|
+
*/
|
|
149
|
+
export declare const ScopeDimensions: {
|
|
150
|
+
/**
|
|
151
|
+
* The selected Orchestrator folder's numeric id. Not in
|
|
152
|
+
* {@link ID_DIMENSIONS}: digits have no case, so the lowercase pass would
|
|
153
|
+
* be a no-op on it — unlike `FolderKey`, which is a GUID an API can return
|
|
154
|
+
* in either case.
|
|
155
|
+
*/
|
|
156
|
+
readonly FolderId: "FolderId";
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* Every dimension whose value is an id, and therefore has to ship lowercase.
|
|
160
|
+
*
|
|
161
|
+
* The convention says "Lower Case for all ids" — ids only, not every value.
|
|
162
|
+
* Lowercasing indiscriminately would turn `UiPath.Cli` into `uipath.cli`,
|
|
163
|
+
* flatten model slugs, and rewrite the redactor's `[REDACTED]` sentinel into
|
|
164
|
+
* something a downstream reader would not recognise as redacted.
|
|
165
|
+
*
|
|
166
|
+
* `SessionId` is deliberately NOT here. It is the host's handle, shipped
|
|
167
|
+
* verbatim so a host that exports `UIPATH_SESSION_ID=AbC` can find its own
|
|
168
|
+
* sessions by that literal string — and it has to keep agreeing with the
|
|
169
|
+
* native `ai.session.id` tag, which nothing lowercases.
|
|
170
|
+
*/
|
|
171
|
+
export declare const ID_DIMENSIONS: ReadonlySet<string>;
|
|
172
|
+
/**
|
|
173
|
+
* Key prefixes the PascalCase rule does not apply to.
|
|
174
|
+
*
|
|
175
|
+
* - `uip.cmd.arg.` namespaces a command's own option names. The prefix is the
|
|
176
|
+
* guarantee that user-supplied keys can never collide with a system dimension
|
|
177
|
+
* at the root (see `TELEMETRY_COMMAND_ARG_PREFIX`), and option names are
|
|
178
|
+
* kebab-case anyway. PascalCasing them would trade a real safety property for
|
|
179
|
+
* a cosmetic one.
|
|
180
|
+
* - `server.` / `http.` are OpenTelemetry stable semantic conventions, emitted
|
|
181
|
+
* only on HTTP dependency spans. Those spans are operational telemetry, which
|
|
182
|
+
* the same convention page says does not belong in Snowflake at all; renaming
|
|
183
|
+
* them would break OTel and APM tooling for no analytics gain.
|
|
184
|
+
*/
|
|
185
|
+
export declare const DIMENSION_NAME_EXEMPT_PREFIXES: readonly string[];
|
|
186
|
+
/** Whether a dimension key is exempt from the PascalCase rule. */
|
|
187
|
+
export declare function isExemptDimensionName(name: string): boolean;
|
|
188
|
+
/** PascalCase, no separators — the convention's rule for a dimension key. */
|
|
189
|
+
export declare const DIMENSION_NAME_PATTERN: RegExp;
|
|
190
|
+
/**
|
|
191
|
+
* `[FeatureName].[PerformedAction]` — two PascalCase segments, no more.
|
|
192
|
+
*
|
|
193
|
+
* The "no more" is the part worth testing: `Cli.Pull.Failed` satisfies every
|
|
194
|
+
* casing rule and still fails the convention.
|
|
195
|
+
*/
|
|
196
|
+
export declare const EVENT_NAME_PATTERN: RegExp;
|
|
197
|
+
/** Every dimension name the CLI knows about. */
|
|
198
|
+
export declare const RESERVED_DIMENSION_NAMES: ReadonlySet<string>;
|
|
199
|
+
/**
|
|
200
|
+
* Dimensions the CLI computes for itself, which no external payload may set.
|
|
201
|
+
*
|
|
202
|
+
* `uip track` checks its payload-to-dimension map against this at module load.
|
|
203
|
+
* The point is identity: a hook that could land a value on `CloudUserId` could
|
|
204
|
+
* attribute its own events to any user it liked, and the allowlist is the only
|
|
205
|
+
* path from a payload to a dimension. Failing at startup beats shipping a
|
|
206
|
+
* spoofed id quietly.
|
|
207
|
+
*
|
|
208
|
+
* Two dimensions a hook legitimately fills are deliberately NOT here:
|
|
209
|
+
*
|
|
210
|
+
* - `AgentModel` — only the agent knows its own model; the CLI cannot derive it
|
|
211
|
+
* from the environment.
|
|
212
|
+
* - `ToolName` — on a skills event this is the AGENT's tool (`Bash`, `Edit`),
|
|
213
|
+
* not the CLI tool bundle the base dimension carries. The two have shared a
|
|
214
|
+
* name since before the rename and do not collide in practice, because a
|
|
215
|
+
* `uip track` run registers no tool bundle. It is still one name for two
|
|
216
|
+
* concepts and is worth splitting; doing it here would have changed a
|
|
217
|
+
* dashboard-facing dimension under cover of a casing change, so it is called
|
|
218
|
+
* out in `docs/reference/skills-telemetry-events.md` instead.
|
|
219
|
+
*/
|
|
220
|
+
export declare const CURATED_DIMENSIONS: ReadonlySet<string>;
|
|
221
|
+
/**
|
|
222
|
+
* Fail loudly if an ingestion map would let external input write a dimension
|
|
223
|
+
* the CLI computes for itself.
|
|
224
|
+
*
|
|
225
|
+
* Called at module load by `uip track`, so a map that could attribute a hook's
|
|
226
|
+
* events to an arbitrary `CloudUserId` breaks the CLI at startup instead of
|
|
227
|
+
* shipping a spoofed identity quietly. `inputKey` is named in the message
|
|
228
|
+
* because the map is the only place the mistake can be made.
|
|
229
|
+
*/
|
|
230
|
+
export declare function assertNoCuratedDimensionTargets(map: Readonly<Record<string, string>>, mapName: string): void;
|
|
231
|
+
/**
|
|
232
|
+
* Lowercase the values of the id dimensions, leaving every other value alone.
|
|
233
|
+
*
|
|
234
|
+
* Runs at the emit choke point after the whole bag is assembled, so it applies
|
|
235
|
+
* to an id whichever layer contributed it.
|
|
236
|
+
*/
|
|
237
|
+
export declare function lowercaseIdDimensionValues<T extends Record<string, string | number | boolean | undefined>>(properties: T): T;
|
|
@@ -1,14 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Canonical CLI event names.
|
|
3
3
|
*
|
|
4
|
-
* Every name
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Every name is `[FeatureName].[PerformedAction]` — two PascalCase segments —
|
|
5
|
+
* per UiPath's business-telemetry convention (PRENG-7421). `Cli` is the feature
|
|
6
|
+
* slot for the CLI's own actions. The convention's minimum events keep their
|
|
7
|
+
* prescribed names (`Application.Start`, `Application.Error`,
|
|
8
|
+
* `Authenticate.LogIn`), so a cross-product query finds the CLI's rows; filter
|
|
9
|
+
* on `ApplicationName == "UiPath.Cli"` to pick the CLI out, not on the name.
|
|
10
|
+
*
|
|
11
|
+
* A third segment is not a smaller violation than a lowercase name: it fails
|
|
12
|
+
* the convention just as squarely, so `Cli.ShipSucceeded`, not
|
|
13
|
+
* `Cli.Ship.Succeeded`.
|
|
7
14
|
*/
|
|
8
15
|
export declare const CommonTelemetryEvents: {
|
|
9
|
-
|
|
16
|
+
/** One per run the CLI records: the minimum event for "the app started".
|
|
17
|
+
* The run's request row carries the command itself. */
|
|
18
|
+
readonly Start: "Application.Start";
|
|
19
|
+
/** A command failed. The convention's minimum event for an error, with
|
|
20
|
+
* `ErrorCode` and `ErrorMessage`. */
|
|
21
|
+
readonly Error: "Application.Error";
|
|
10
22
|
/** A ship (publish/deploy/upload) completed. The command that shipped is
|
|
11
|
-
* carried by the `
|
|
23
|
+
* carried by the `CommandName` dimension; `ShipKind`/`Target` describe
|
|
12
24
|
* what was shipped where. */
|
|
13
|
-
readonly ShipSucceeded: "
|
|
25
|
+
readonly ShipSucceeded: "Cli.ShipSucceeded";
|
|
14
26
|
};
|