@builder.io/ai-utils 0.53.0 → 0.53.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/ai-utils",
3
- "version": "0.53.0",
3
+ "version": "0.53.1",
4
4
  "description": "Builder.io AI utils",
5
5
  "files": [
6
6
  "src"
package/src/codegen.d.ts CHANGED
@@ -946,10 +946,13 @@ export interface CodeGenInputOptions {
946
946
  * @internal - Set by middleware, not by clients
947
947
  */
948
948
  branchAgentTypeChecked?: boolean;
949
+ /** Immediate parent session id when this completion runs inside a sub-agent. */
950
+ parentSessionId?: string;
949
951
  /**
950
- * The parent session ID, used to roll up sub-agent costs into the parent session's extraCost.
952
+ * Root session of the agent tree. Sub-agents inherit this from their parent
953
+ * so cost rolls up to the root in one hop, regardless of nesting depth.
951
954
  */
952
- parentSessionId?: string;
955
+ mainSessionId?: string;
953
956
  /** @deprecated */
954
957
  prevId?: string;
955
958
  /** @deprecated */
@@ -2536,8 +2539,16 @@ export interface SessionData {
2536
2539
  cost: number;
2537
2540
  /** Cost from tools (e.g. WebSearch LLM calls) and sub-agent roll-ups. Total session cost = cost + extraCost. */
2538
2541
  extraCost?: number;
2539
- /** If set, this session is a sub-agent of the given parent session. Used to avoid double-counting in aggregations. */
2542
+ /** Immediate parent when this session is a sub-agent. */
2540
2543
  parentSessionId?: string;
2544
+ /**
2545
+ * Root of the agent tree this session belongs to. Sub-agents inherit
2546
+ * `mainSessionId` from their parent so cost can roll up directly to the
2547
+ * top in one hop, regardless of nesting depth.
2548
+ */
2549
+ mainSessionId?: string;
2550
+ /** Agent role (e.g. "code-review-orchestrator", "browser-testing"). */
2551
+ position?: string;
2541
2552
  /** Credits from tools (e.g. WebSearch LLM calls) and sub-agent roll-ups. Total session credits = per-completion tokenCreditsUsed + extraCreditsConsumed. */
2542
2553
  extraCreditsConsumed?: number;
2543
2554
  totalCompletions: number;
package/src/projects.d.ts CHANGED
@@ -367,6 +367,13 @@ export interface PartialBranchData {
367
367
  type?: BranchType | null;
368
368
  /** Auto-assigned category based on the user prompt (feature, fix, research, other) */
369
369
  category?: BranchCategory | null;
370
+ /**
371
+ * Optional short words derived from the user prompt, used opportunistically
372
+ * by `generateBranchName` to make the auto-generated branch name human-readable
373
+ * (e.g. ["add", "user", "settings"] → "add-user-settings-x1y2z3a4"). A random
374
+ * suffix is appended to prevent collisions. Ignored when `name` is provided.
375
+ */
376
+ nameWords?: string[];
370
377
  cloneFrom?: {
371
378
  projectId: string;
372
379
  branchName: string;