sim 2.1.14 → 2.1.15-preview.119.1
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 +4 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8079,11 +8079,14 @@ var AGENT_MARKERS = [
|
|
|
8079
8079
|
{ name: "pi", matches: anyOf("PI_CODING_AGENT") },
|
|
8080
8080
|
{ name: "crush", matches: anyOf("CRUSH") }
|
|
8081
8081
|
];
|
|
8082
|
+
var VERSIONED_DECLARATION = /^(.+?)_\d+(?:-\d+)*(?:_[a-z0-9-]+)?$/;
|
|
8082
8083
|
function declaredAgentName(value) {
|
|
8083
8084
|
const trimmed = value?.trim().toLowerCase();
|
|
8084
8085
|
if (!trimmed || trimmed.length > MAX_AGENT_NAME_LENGTH)
|
|
8085
8086
|
return;
|
|
8086
|
-
|
|
8087
|
+
if (!AGENT_NAME_PATTERN.test(trimmed))
|
|
8088
|
+
return;
|
|
8089
|
+
return VERSIONED_DECLARATION.exec(trimmed)?.[1] ?? trimmed;
|
|
8087
8090
|
}
|
|
8088
8091
|
function detectCodingAgent(env = process.env) {
|
|
8089
8092
|
const declared = declaredAgentName(env.AI_AGENT);
|