@agentuity/core 0.0.109 → 0.0.110

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/AGENTS.md CHANGED
@@ -47,6 +47,7 @@ src/
47
47
 
48
48
  - No test framework configured yet
49
49
  - When adding tests, use Bun's built-in test runner: `bun test`
50
+ - When running tests, prefer using a subagent (Task tool) to avoid context bloat from test output
50
51
 
51
52
  ## Publishing Checklist
52
53
 
package/dist/string.d.ts CHANGED
@@ -4,12 +4,14 @@
4
4
  /**
5
5
  * Convert a string to camelCase
6
6
  * @param str - The string to convert (can contain dashes, underscores, or spaces)
7
- * @returns The camelCase version of the string
7
+ * @returns The camelCase version of the string (always a valid JS/TS identifier)
8
8
  * @example
9
9
  * toCamelCase('my-agent') // 'myAgent'
10
10
  * toCamelCase('my_agent') // 'myAgent'
11
11
  * toCamelCase('my agent') // 'myAgent'
12
12
  * toCamelCase('my--multiple--dashes') // 'myMultipleDashes'
13
+ * toCamelCase('123-agent') // '_123Agent' (prefixed to make valid identifier)
14
+ * toCamelCase('123') // '_123' (prefixed to make valid identifier)
13
15
  */
14
16
  export declare function toCamelCase(str: string): string;
15
17
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../src/string.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAI/C;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGhD"}
1
+ {"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../src/string.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAO/C;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGhD"}
package/dist/string.js CHANGED
@@ -4,17 +4,21 @@
4
4
  /**
5
5
  * Convert a string to camelCase
6
6
  * @param str - The string to convert (can contain dashes, underscores, or spaces)
7
- * @returns The camelCase version of the string
7
+ * @returns The camelCase version of the string (always a valid JS/TS identifier)
8
8
  * @example
9
9
  * toCamelCase('my-agent') // 'myAgent'
10
10
  * toCamelCase('my_agent') // 'myAgent'
11
11
  * toCamelCase('my agent') // 'myAgent'
12
12
  * toCamelCase('my--multiple--dashes') // 'myMultipleDashes'
13
+ * toCamelCase('123-agent') // '_123Agent' (prefixed to make valid identifier)
14
+ * toCamelCase('123') // '_123' (prefixed to make valid identifier)
13
15
  */
14
16
  export function toCamelCase(str) {
15
- return str
17
+ const result = str
16
18
  .replace(/[-_\s]+(.)?/g, (_, char) => (char ? char.toUpperCase() : ''))
17
19
  .replace(/^(.)/, (char) => char.toLowerCase());
20
+ // Prefix with underscore if result starts with a digit (invalid JS/TS identifier)
21
+ return /^\d/.test(result) ? `_${result}` : result;
18
22
  }
19
23
  /**
20
24
  * Convert a string to PascalCase
@@ -1 +1 @@
1
- {"version":3,"file":"string.js","sourceRoot":"","sources":["../src/string.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAC,GAAW;IACtC,OAAO,GAAG;SACR,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SACtE,OAAO,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;AACjD,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW;IACvC,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAC/B,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACvD,CAAC"}
1
+ {"version":3,"file":"string.js","sourceRoot":"","sources":["../src/string.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,WAAW,CAAC,GAAW;IACtC,MAAM,MAAM,GAAG,GAAG;SAChB,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SACtE,OAAO,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IAEhD,kFAAkF;IAClF,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;AACnD,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW;IACvC,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAC/B,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACvD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentuity/core",
3
- "version": "0.0.109",
3
+ "version": "0.0.110",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Agentuity employees and contributors",
6
6
  "type": "module",
@@ -32,7 +32,7 @@
32
32
  "zod": "^4.1.12"
33
33
  },
34
34
  "devDependencies": {
35
- "@agentuity/test-utils": "0.0.109",
35
+ "@agentuity/test-utils": "0.0.110",
36
36
  "@types/bun": "latest",
37
37
  "bun-types": "latest",
38
38
  "typescript": "^5.9.0"
package/src/string.ts CHANGED
@@ -5,17 +5,22 @@
5
5
  /**
6
6
  * Convert a string to camelCase
7
7
  * @param str - The string to convert (can contain dashes, underscores, or spaces)
8
- * @returns The camelCase version of the string
8
+ * @returns The camelCase version of the string (always a valid JS/TS identifier)
9
9
  * @example
10
10
  * toCamelCase('my-agent') // 'myAgent'
11
11
  * toCamelCase('my_agent') // 'myAgent'
12
12
  * toCamelCase('my agent') // 'myAgent'
13
13
  * toCamelCase('my--multiple--dashes') // 'myMultipleDashes'
14
+ * toCamelCase('123-agent') // '_123Agent' (prefixed to make valid identifier)
15
+ * toCamelCase('123') // '_123' (prefixed to make valid identifier)
14
16
  */
15
17
  export function toCamelCase(str: string): string {
16
- return str
18
+ const result = str
17
19
  .replace(/[-_\s]+(.)?/g, (_, char) => (char ? char.toUpperCase() : ''))
18
20
  .replace(/^(.)/, (char) => char.toLowerCase());
21
+
22
+ // Prefix with underscore if result starts with a digit (invalid JS/TS identifier)
23
+ return /^\d/.test(result) ? `_${result}` : result;
19
24
  }
20
25
 
21
26
  /**