@builder.io/ai-utils 0.14.4 → 0.15.0
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 +1 -1
- package/src/codegen.d.ts +35 -1
- package/src/projects.d.ts +25 -2
package/package.json
CHANGED
package/src/codegen.d.ts
CHANGED
|
@@ -467,12 +467,46 @@ export interface GenerateCompletionStepText {
|
|
|
467
467
|
type: "text";
|
|
468
468
|
content: string;
|
|
469
469
|
}
|
|
470
|
+
/**
|
|
471
|
+
* Represents the current state and composition of the AI model's context window.
|
|
472
|
+
* Used to track token usage and provide a breakdown of what content is consuming the context.
|
|
473
|
+
*/
|
|
470
474
|
export interface ContextWindow {
|
|
475
|
+
/** Percentage of context window currently in use (0-1 range) */
|
|
471
476
|
usage: number;
|
|
477
|
+
/** Total number of tokens currently used in the context */
|
|
472
478
|
usedTokens: number;
|
|
479
|
+
/** Number of tokens that are cached (reduces cost on subsequent requests) */
|
|
473
480
|
cachedTokens: number;
|
|
481
|
+
/** Maximum tokens available in the model's context window */
|
|
474
482
|
totalTokens: number;
|
|
475
|
-
|
|
483
|
+
/** Reserved token buffer to allow for compaction before hitting the limit */
|
|
484
|
+
compactBufferTokens: number;
|
|
485
|
+
/**
|
|
486
|
+
* Breakdown of context window usage by category, with each value representing
|
|
487
|
+
* the proportion (0-1) of total tokens used by that category.
|
|
488
|
+
*
|
|
489
|
+
* Common keys include:
|
|
490
|
+
* - `tool:<name>` - Tokens from tool calls and results (e.g., `tool:read_file`, `tool:bash`)
|
|
491
|
+
* - `tools:builtin` - Tokens from built-in tool definitions/schemas
|
|
492
|
+
* - `tools:mcp:<server>` - Tokens from MCP server tool definitions (e.g., `tools:mcp:browser`)
|
|
493
|
+
* - `images` - Tokens from image content (estimated at ~1200 tokens per image)
|
|
494
|
+
* - `system` - Tokens from system prompt content
|
|
495
|
+
* - `rules` - Tokens from custom instructions/rules
|
|
496
|
+
* - `memory` - Tokens from memory/context persistence
|
|
497
|
+
* - `reminder` - Tokens from generic system reminders
|
|
498
|
+
* - `reminder:plan` - Tokens from plan mode prompts
|
|
499
|
+
* - `reminder:framework` - Tokens from framework-specific prompts
|
|
500
|
+
* - `reminder:design-system` - Tokens from design system context
|
|
501
|
+
* - `reminder:ui-context` - Tokens from UI context information
|
|
502
|
+
* - `reminder:health` - Tokens from dev server health status
|
|
503
|
+
* - `reminder:url` - Tokens from dev server URL information
|
|
504
|
+
* - `reminder:environment-variables` - Tokens from environment variable context
|
|
505
|
+
* - `reminder:git-status` - Tokens from git status information
|
|
506
|
+
* - `reminder:modified-files-context` - Tokens from modified files diff context
|
|
507
|
+
* - `rest` - Tokens from other text content without a specific tag
|
|
508
|
+
*/
|
|
509
|
+
details: Record<string, number>;
|
|
476
510
|
}
|
|
477
511
|
export interface GenerateCompletionStepDone {
|
|
478
512
|
type: "done";
|
package/src/projects.d.ts
CHANGED
|
@@ -265,7 +265,7 @@ export interface PartialBranchData {
|
|
|
265
265
|
isDefault: boolean;
|
|
266
266
|
isPublic: boolean;
|
|
267
267
|
lockedFusionEnvironment?: FusionExecutionEnvironment;
|
|
268
|
-
metadata?:
|
|
268
|
+
metadata?: BranchMetadata;
|
|
269
269
|
backup?: BranchBackup;
|
|
270
270
|
gitAiBranch?: string | null;
|
|
271
271
|
lastCommitHash?: string | null;
|
|
@@ -279,6 +279,29 @@ export interface PartialBranchData {
|
|
|
279
279
|
};
|
|
280
280
|
}
|
|
281
281
|
export type EntityState = "active" | "deleted";
|
|
282
|
+
/**
|
|
283
|
+
* Metadata stored in branches for integration tracking and PR description generation.
|
|
284
|
+
* This type documents the integration context that can be attached to a branch.
|
|
285
|
+
*/
|
|
286
|
+
export interface BranchMetadata {
|
|
287
|
+
/** How the branch was created (e.g., "slack", "jira", "api", "cli") */
|
|
288
|
+
createdVia?: string;
|
|
289
|
+
/** JIRA issue key (e.g., "PROJ-123") - used to link back to the JIRA ticket in PR descriptions */
|
|
290
|
+
jiraIssueKey?: string;
|
|
291
|
+
/** JIRA cloud ID - UUID identifier for the Atlassian cloud instance */
|
|
292
|
+
jiraCloudId?: string;
|
|
293
|
+
/** JIRA site name - the subdomain used in the JIRA URL (e.g., "mycompany" for mycompany.atlassian.net) */
|
|
294
|
+
jiraSiteName?: string;
|
|
295
|
+
/** JIRA issue ID - internal JIRA identifier */
|
|
296
|
+
jiraIssueId?: string;
|
|
297
|
+
/** Slack team/workspace ID - used to ensure deep links open in the correct workspace for multi-workspace users */
|
|
298
|
+
slackTeamId?: string;
|
|
299
|
+
/** Slack channel ID - used to link back to the Slack thread in PR descriptions */
|
|
300
|
+
slackChannelId?: string;
|
|
301
|
+
/** Slack thread timestamp - used to construct the Slack thread URL */
|
|
302
|
+
slackThreadTs?: string;
|
|
303
|
+
[key: string]: unknown;
|
|
304
|
+
}
|
|
282
305
|
interface BranchSharedData {
|
|
283
306
|
appName?: string | null;
|
|
284
307
|
prNumber?: number | null;
|
|
@@ -310,7 +333,7 @@ interface BranchSharedData {
|
|
|
310
333
|
allocated: boolean | null;
|
|
311
334
|
} | null;
|
|
312
335
|
backup?: BranchBackup;
|
|
313
|
-
metadata?:
|
|
336
|
+
metadata?: BranchMetadata;
|
|
314
337
|
needsCleanup?: boolean;
|
|
315
338
|
/** @deprecated Use `state` field instead. Kept for backwards compatibility. */
|
|
316
339
|
deleted?: boolean;
|