sim 2.1.17-preview.126.1 → 2.1.17
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/index.js +19 -25
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8053,31 +8053,32 @@ function formatClientInfo(info) {
|
|
|
8053
8053
|
tokens.push(product(AGENT_KEY, info.agent));
|
|
8054
8054
|
return tokens.join("; ");
|
|
8055
8055
|
}
|
|
8056
|
+
var INTERNAL_AUTH_KINDS = new Set([
|
|
8057
|
+
"internal_jwt",
|
|
8058
|
+
"delegated",
|
|
8059
|
+
"organization_delegated",
|
|
8060
|
+
"system"
|
|
8061
|
+
]);
|
|
8056
8062
|
|
|
8057
8063
|
// src/telemetry/coding-agent.ts
|
|
8058
8064
|
var AGENT_NAME_PATTERN = /^[a-z0-9_-]+$/i;
|
|
8059
8065
|
var MAX_AGENT_NAME_LENGTH = 64;
|
|
8060
8066
|
var anyOf = (...variables) => (env) => variables.some((variable) => Boolean(env[variable]));
|
|
8061
8067
|
var AGENT_MARKERS = [
|
|
8062
|
-
{ name: "amp", matches: (env) => env.AGENT === "amp"
|
|
8063
|
-
{
|
|
8064
|
-
name: "codex",
|
|
8065
|
-
matches: anyOf("CODEX_THREAD_ID", "CODEX_SANDBOX", "CODEX_CI", "CODEX_SANDBOX_NETWORK_DISABLED")
|
|
8066
|
-
},
|
|
8068
|
+
{ name: "amp", matches: (env) => env.AGENT === "amp" },
|
|
8069
|
+
{ name: "codex", matches: anyOf("CODEX_SANDBOX", "CODEX_CI", "CODEX_THREAD_ID") },
|
|
8067
8070
|
{ name: "gemini-cli", matches: anyOf("GEMINI_CLI") },
|
|
8071
|
+
{ name: "copilot-cli", matches: anyOf("COPILOT_CLI") },
|
|
8068
8072
|
{ name: "opencode", matches: anyOf("OPENCODE") },
|
|
8069
8073
|
{ name: "antigravity", matches: anyOf("ANTIGRAVITY_AGENT") },
|
|
8070
|
-
{ name: "augment", matches: anyOf("AUGMENT_AGENT") },
|
|
8071
|
-
{ name: "cline", matches: anyOf("CLINE_ACTIVE") },
|
|
8074
|
+
{ name: "augment-cli", matches: anyOf("AUGMENT_AGENT") },
|
|
8072
8075
|
{ name: "cowork", matches: anyOf("CLAUDE_CODE_IS_COWORK") },
|
|
8073
8076
|
{ name: "claude-code", matches: anyOf("CLAUDECODE", "CLAUDE_CODE") },
|
|
8077
|
+
{ name: "cursor", matches: anyOf("CURSOR_TRACE_ID") },
|
|
8074
8078
|
{
|
|
8075
|
-
name: "cursor",
|
|
8076
|
-
matches: (env) =>
|
|
8077
|
-
}
|
|
8078
|
-
{ name: "warp", matches: anyOf("OZ_RUN_ID") },
|
|
8079
|
-
{ name: "pi", matches: anyOf("PI_CODING_AGENT") },
|
|
8080
|
-
{ name: "crush", matches: anyOf("CRUSH") }
|
|
8079
|
+
name: "cursor-cli",
|
|
8080
|
+
matches: (env) => Boolean(env.CURSOR_AGENT) || env.CURSOR_EXTENSION_HOST_ROLE === "agent-exec"
|
|
8081
|
+
}
|
|
8081
8082
|
];
|
|
8082
8083
|
var VERSIONED_DECLARATION = /^(.+?)_\d+(?:-\d+)*(?:_[a-z0-9-]+)?$/;
|
|
8083
8084
|
function declaredAgentName(value) {
|
|
@@ -8088,14 +8089,9 @@ function declaredAgentName(value) {
|
|
|
8088
8089
|
return;
|
|
8089
8090
|
return VERSIONED_DECLARATION.exec(trimmed)?.[1] ?? trimmed;
|
|
8090
8091
|
}
|
|
8092
|
+
var NO_CODING_AGENT = "none";
|
|
8091
8093
|
function detectCodingAgent(env = process.env) {
|
|
8092
|
-
|
|
8093
|
-
if (declared)
|
|
8094
|
-
return declared;
|
|
8095
|
-
const generic = declaredAgentName(env.AGENT);
|
|
8096
|
-
if (generic && generic !== "1")
|
|
8097
|
-
return generic;
|
|
8098
|
-
return AGENT_MARKERS.find((marker) => marker.matches(env))?.name;
|
|
8094
|
+
return declaredAgentName(env.AI_AGENT) ?? AGENT_MARKERS.find((marker) => marker.matches(env))?.name;
|
|
8099
8095
|
}
|
|
8100
8096
|
|
|
8101
8097
|
// src/telemetry/policy.ts
|
|
@@ -8205,7 +8201,7 @@ function buildClientInfoHeader(env) {
|
|
|
8205
8201
|
runtime: { name: "node", version: process.versions.node },
|
|
8206
8202
|
os: process.platform,
|
|
8207
8203
|
arch: process.arch,
|
|
8208
|
-
...reportingAllowed(env) ? { agent: detectCodingAgent(env) } : {}
|
|
8204
|
+
...reportingAllowed(env) ? { agent: detectCodingAgent(env) ?? NO_CODING_AGENT } : {}
|
|
8209
8205
|
});
|
|
8210
8206
|
}
|
|
8211
8207
|
function reportingAllowed(env) {
|
|
@@ -20988,14 +20984,12 @@ function createCommandTelemetry(options = {}) {
|
|
|
20988
20984
|
os: process.platform,
|
|
20989
20985
|
arch: process.arch,
|
|
20990
20986
|
is_tty: stdoutIsTty,
|
|
20991
|
-
is_ci: isCi(env)
|
|
20987
|
+
is_ci: isCi(env),
|
|
20988
|
+
coding_agent: detectCodingAgent(env) ?? NO_CODING_AGENT
|
|
20992
20989
|
};
|
|
20993
20990
|
const kind = endpointKind(invocation.action);
|
|
20994
20991
|
if (kind)
|
|
20995
20992
|
properties.endpoint_kind = kind;
|
|
20996
|
-
const agent = detectCodingAgent(env);
|
|
20997
|
-
if (agent)
|
|
20998
|
-
properties.coding_agent = agent;
|
|
20999
20993
|
send(target, {
|
|
21000
20994
|
api_key: target.key,
|
|
21001
20995
|
event: COMMAND_EVENT,
|