@codeam/shared 2.61.17 → 2.61.19
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.d.mts +26 -2
- package/dist/index.d.ts +26 -2
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -130,6 +130,15 @@ declare const UNKNOWN_MODEL_PRICING: ModelPricing;
|
|
|
130
130
|
*/
|
|
131
131
|
declare function getPricing(model: string): ModelPricing;
|
|
132
132
|
declare function getContextWindow(model: string | null): number;
|
|
133
|
+
/**
|
|
134
|
+
* Context window ONLY when it's a confident match — `undefined` otherwise (no
|
|
135
|
+
* default). Use where a wrong value is worse than none: the runtime model
|
|
136
|
+
* selector maps native ACP model ids, many of which are opaque aliases
|
|
137
|
+
* ("default", "opus") or proxied ids (a MiniMax-backed house agent) that aren't
|
|
138
|
+
* in the catalog. Falling back to 200K for those printed a fake "200K context"
|
|
139
|
+
* on every row; returning undefined lets the UI omit the sub-label instead.
|
|
140
|
+
*/
|
|
141
|
+
declare function tryGetContextWindow(model: string | null): number | undefined;
|
|
133
142
|
|
|
134
143
|
type AgentId = 'claude' | 'codex' | 'copilot' | 'coderabbit' | 'cursor' | 'aider' | 'gemini' | 'kimi';
|
|
135
144
|
type AgentAuthKind = 'oauth_token' | 'api_key' | 'setup_token';
|
|
@@ -149,7 +158,10 @@ interface AgentAuth {
|
|
|
149
158
|
interface AgentModel {
|
|
150
159
|
id: string;
|
|
151
160
|
label: string;
|
|
152
|
-
|
|
161
|
+
/** Optional — omitted when the model id isn't in the context-window catalog
|
|
162
|
+
* (opaque native aliases / proxied ids). The UI hides the sub-label rather
|
|
163
|
+
* than printing a misleading default. */
|
|
164
|
+
contextWindow?: number;
|
|
153
165
|
pricing?: {
|
|
154
166
|
inputPerM: number;
|
|
155
167
|
outputPerM: number;
|
|
@@ -157,6 +169,18 @@ interface AgentModel {
|
|
|
157
169
|
cacheCreationPerM?: number;
|
|
158
170
|
};
|
|
159
171
|
}
|
|
172
|
+
/**
|
|
173
|
+
* An agent operating/permission MODE — a DIFFERENT ACP axis than {@link AgentModel}.
|
|
174
|
+
* Sourced from the native ACP `SessionModeState` on `newSession`/`loadSession`
|
|
175
|
+
* (the standard `session/set_mode` write targets it), e.g. Claude's
|
|
176
|
+
* default/plan/acceptEdits/bypass. Modes have neither pricing nor a context
|
|
177
|
+
* window — just an id, a human label, and an optional description.
|
|
178
|
+
*/
|
|
179
|
+
interface AgentMode {
|
|
180
|
+
id: string;
|
|
181
|
+
label: string;
|
|
182
|
+
description?: string;
|
|
183
|
+
}
|
|
160
184
|
interface NormalizedMessage {
|
|
161
185
|
id: string;
|
|
162
186
|
role: 'user' | 'agent' | 'system';
|
|
@@ -1290,4 +1314,4 @@ type UserEventName = (typeof USER_EVENTS)[keyof typeof USER_EVENTS];
|
|
|
1290
1314
|
*/
|
|
1291
1315
|
declare const PREVIEW_DETECT_PROMPT: string;
|
|
1292
1316
|
|
|
1293
|
-
export { AGENT_REGISTRY, type AgentAuth, type AgentAuthKind, type AgentId, type AgentMetadata, type AgentModel, type AnswerResolvedEvent, type AwaitingAnswerEvent, type BeadsActionCommand, type BeadsActionKind, type BeadsActionPayload, type BeadsActionRequest, type BeadsActionType, type BeadsConfigureAction, type BeadsDependencyDto, type BeadsDependencyKind, type BeadsIngestPayload, type BeadsIssueDto, type BeadsIssueStatus, type BeadsMemoryDto, type BeadsProjectDto, type BeadsProvisioningPayload, type BeadsProvisioningStatus, type BeadsSnapshotDto, type BeadsStatus, type BeadsStatusState, type BeadsStatusSummary, type BlameLineWire, type BrokeredIntegrationToken, type ChromeStep, type ChromeToolType, type CommitEntryWire, DEFAULT_API_BASE_URL, DEV_API_BASE_URL, type EnvVar, type FileBlameEvent, type FileChangeStatus, type FileChangedEvent, type FileHistoryEvent, type FileReviewStatus, HEADROOM_BACKEND_ENV, HEADROOM_EXTRAS_BY_SURFACE, HEADROOM_MODELS, HEADROOM_PIP_COMPANIONS, HEADROOM_PROXY_PORT, HEARTBEAT_INTERVAL_MS_DEFAULT, HOUSE_AGENT_ID, HOUSE_AGENT_NAME, HOUSE_AGENT_PROVIDER, HOUSE_AGENT_SUBTITLE, HOUSE_AGENT_VENDOR, type HeadroomBudgetCommand, type HeadroomBudgetPeriod, type HeadroomBudgetUsage, type HeadroomKind, type HeadroomModelSpec, type HeadroomPythonRenderOpts, type HeadroomStatus, type HeadroomStep, type HeadroomSurface, type HunkLineType, INTEGRATION_BRANDING, INTEGRATION_REGISTRY, INTERNAL_TO_PUBLIC, type InputSuggestionChunk, type IntegrationApiKeyField, type IntegrationAuthKind, type IntegrationBranding, type IntegrationCategory, type IntegrationDefinition, type IntegrationDelivery, type IntegrationHealth, type IntegrationId, type IntegrationMcpDelivery, type IntegrationStatus, type IntegrationsManifest, type IntegrationsManifestEntry, LINKED_AGENT_IDS, type LinkedAgentId, MODEL_CONTEXT_WINDOW, MODEL_PRICING, type ModelPricing, type NormalizedMessage, OBSERVER_BRIDGE_PORT, PREVIEW_DETECT_PROMPT, PROTOCOL_VERSION, PUBLIC_TO_INTERNAL, type PendingReviewHunkEvent, type PendingReviewHunkLine, type PreviewDetection, type PreviewErrorStage, type PreviewState, type PreviewStatus, type RemoteCommand, SSE_SOCKET_TIMEOUT_MS, type SelectPrompt, type StreamingChunkEvent, type StreamingChunkKind, TERMINAL_AGENT_PREFIX, UNKNOWN_MODEL_PRICING, UPCOMING_INTEGRATION_IDS, USER_EVENTS, type UserEventName, getAgent, getContextWindow, getEnabledAgents, getEnabledIntegrations, getIntegration, getIntegrationBranding, getIntegrationsByCategory, getPricing, headroomKindFor, headroomModelPredownloadScript, headroomPipPackage, headroomSnapshotDownloadLine, internalToPublic, isHeadroomWrappable, isKnownAgentId, isKnownIntegrationId, isKnownModel, isLinkedAgentId, normalizeAgentId, publicToInternal, renderToLines, resolveApiBaseUrl, toRemoteCommand };
|
|
1317
|
+
export { AGENT_REGISTRY, type AgentAuth, type AgentAuthKind, type AgentId, type AgentMetadata, type AgentMode, type AgentModel, type AnswerResolvedEvent, type AwaitingAnswerEvent, type BeadsActionCommand, type BeadsActionKind, type BeadsActionPayload, type BeadsActionRequest, type BeadsActionType, type BeadsConfigureAction, type BeadsDependencyDto, type BeadsDependencyKind, type BeadsIngestPayload, type BeadsIssueDto, type BeadsIssueStatus, type BeadsMemoryDto, type BeadsProjectDto, type BeadsProvisioningPayload, type BeadsProvisioningStatus, type BeadsSnapshotDto, type BeadsStatus, type BeadsStatusState, type BeadsStatusSummary, type BlameLineWire, type BrokeredIntegrationToken, type ChromeStep, type ChromeToolType, type CommitEntryWire, DEFAULT_API_BASE_URL, DEV_API_BASE_URL, type EnvVar, type FileBlameEvent, type FileChangeStatus, type FileChangedEvent, type FileHistoryEvent, type FileReviewStatus, HEADROOM_BACKEND_ENV, HEADROOM_EXTRAS_BY_SURFACE, HEADROOM_MODELS, HEADROOM_PIP_COMPANIONS, HEADROOM_PROXY_PORT, HEARTBEAT_INTERVAL_MS_DEFAULT, HOUSE_AGENT_ID, HOUSE_AGENT_NAME, HOUSE_AGENT_PROVIDER, HOUSE_AGENT_SUBTITLE, HOUSE_AGENT_VENDOR, type HeadroomBudgetCommand, type HeadroomBudgetPeriod, type HeadroomBudgetUsage, type HeadroomKind, type HeadroomModelSpec, type HeadroomPythonRenderOpts, type HeadroomStatus, type HeadroomStep, type HeadroomSurface, type HunkLineType, INTEGRATION_BRANDING, INTEGRATION_REGISTRY, INTERNAL_TO_PUBLIC, type InputSuggestionChunk, type IntegrationApiKeyField, type IntegrationAuthKind, type IntegrationBranding, type IntegrationCategory, type IntegrationDefinition, type IntegrationDelivery, type IntegrationHealth, type IntegrationId, type IntegrationMcpDelivery, type IntegrationStatus, type IntegrationsManifest, type IntegrationsManifestEntry, LINKED_AGENT_IDS, type LinkedAgentId, MODEL_CONTEXT_WINDOW, MODEL_PRICING, type ModelPricing, type NormalizedMessage, OBSERVER_BRIDGE_PORT, PREVIEW_DETECT_PROMPT, PROTOCOL_VERSION, PUBLIC_TO_INTERNAL, type PendingReviewHunkEvent, type PendingReviewHunkLine, type PreviewDetection, type PreviewErrorStage, type PreviewState, type PreviewStatus, type RemoteCommand, SSE_SOCKET_TIMEOUT_MS, type SelectPrompt, type StreamingChunkEvent, type StreamingChunkKind, TERMINAL_AGENT_PREFIX, UNKNOWN_MODEL_PRICING, UPCOMING_INTEGRATION_IDS, USER_EVENTS, type UserEventName, getAgent, getContextWindow, getEnabledAgents, getEnabledIntegrations, getIntegration, getIntegrationBranding, getIntegrationsByCategory, getPricing, headroomKindFor, headroomModelPredownloadScript, headroomPipPackage, headroomSnapshotDownloadLine, internalToPublic, isHeadroomWrappable, isKnownAgentId, isKnownIntegrationId, isKnownModel, isLinkedAgentId, normalizeAgentId, publicToInternal, renderToLines, resolveApiBaseUrl, toRemoteCommand, tryGetContextWindow };
|
package/dist/index.d.ts
CHANGED
|
@@ -130,6 +130,15 @@ declare const UNKNOWN_MODEL_PRICING: ModelPricing;
|
|
|
130
130
|
*/
|
|
131
131
|
declare function getPricing(model: string): ModelPricing;
|
|
132
132
|
declare function getContextWindow(model: string | null): number;
|
|
133
|
+
/**
|
|
134
|
+
* Context window ONLY when it's a confident match — `undefined` otherwise (no
|
|
135
|
+
* default). Use where a wrong value is worse than none: the runtime model
|
|
136
|
+
* selector maps native ACP model ids, many of which are opaque aliases
|
|
137
|
+
* ("default", "opus") or proxied ids (a MiniMax-backed house agent) that aren't
|
|
138
|
+
* in the catalog. Falling back to 200K for those printed a fake "200K context"
|
|
139
|
+
* on every row; returning undefined lets the UI omit the sub-label instead.
|
|
140
|
+
*/
|
|
141
|
+
declare function tryGetContextWindow(model: string | null): number | undefined;
|
|
133
142
|
|
|
134
143
|
type AgentId = 'claude' | 'codex' | 'copilot' | 'coderabbit' | 'cursor' | 'aider' | 'gemini' | 'kimi';
|
|
135
144
|
type AgentAuthKind = 'oauth_token' | 'api_key' | 'setup_token';
|
|
@@ -149,7 +158,10 @@ interface AgentAuth {
|
|
|
149
158
|
interface AgentModel {
|
|
150
159
|
id: string;
|
|
151
160
|
label: string;
|
|
152
|
-
|
|
161
|
+
/** Optional — omitted when the model id isn't in the context-window catalog
|
|
162
|
+
* (opaque native aliases / proxied ids). The UI hides the sub-label rather
|
|
163
|
+
* than printing a misleading default. */
|
|
164
|
+
contextWindow?: number;
|
|
153
165
|
pricing?: {
|
|
154
166
|
inputPerM: number;
|
|
155
167
|
outputPerM: number;
|
|
@@ -157,6 +169,18 @@ interface AgentModel {
|
|
|
157
169
|
cacheCreationPerM?: number;
|
|
158
170
|
};
|
|
159
171
|
}
|
|
172
|
+
/**
|
|
173
|
+
* An agent operating/permission MODE — a DIFFERENT ACP axis than {@link AgentModel}.
|
|
174
|
+
* Sourced from the native ACP `SessionModeState` on `newSession`/`loadSession`
|
|
175
|
+
* (the standard `session/set_mode` write targets it), e.g. Claude's
|
|
176
|
+
* default/plan/acceptEdits/bypass. Modes have neither pricing nor a context
|
|
177
|
+
* window — just an id, a human label, and an optional description.
|
|
178
|
+
*/
|
|
179
|
+
interface AgentMode {
|
|
180
|
+
id: string;
|
|
181
|
+
label: string;
|
|
182
|
+
description?: string;
|
|
183
|
+
}
|
|
160
184
|
interface NormalizedMessage {
|
|
161
185
|
id: string;
|
|
162
186
|
role: 'user' | 'agent' | 'system';
|
|
@@ -1290,4 +1314,4 @@ type UserEventName = (typeof USER_EVENTS)[keyof typeof USER_EVENTS];
|
|
|
1290
1314
|
*/
|
|
1291
1315
|
declare const PREVIEW_DETECT_PROMPT: string;
|
|
1292
1316
|
|
|
1293
|
-
export { AGENT_REGISTRY, type AgentAuth, type AgentAuthKind, type AgentId, type AgentMetadata, type AgentModel, type AnswerResolvedEvent, type AwaitingAnswerEvent, type BeadsActionCommand, type BeadsActionKind, type BeadsActionPayload, type BeadsActionRequest, type BeadsActionType, type BeadsConfigureAction, type BeadsDependencyDto, type BeadsDependencyKind, type BeadsIngestPayload, type BeadsIssueDto, type BeadsIssueStatus, type BeadsMemoryDto, type BeadsProjectDto, type BeadsProvisioningPayload, type BeadsProvisioningStatus, type BeadsSnapshotDto, type BeadsStatus, type BeadsStatusState, type BeadsStatusSummary, type BlameLineWire, type BrokeredIntegrationToken, type ChromeStep, type ChromeToolType, type CommitEntryWire, DEFAULT_API_BASE_URL, DEV_API_BASE_URL, type EnvVar, type FileBlameEvent, type FileChangeStatus, type FileChangedEvent, type FileHistoryEvent, type FileReviewStatus, HEADROOM_BACKEND_ENV, HEADROOM_EXTRAS_BY_SURFACE, HEADROOM_MODELS, HEADROOM_PIP_COMPANIONS, HEADROOM_PROXY_PORT, HEARTBEAT_INTERVAL_MS_DEFAULT, HOUSE_AGENT_ID, HOUSE_AGENT_NAME, HOUSE_AGENT_PROVIDER, HOUSE_AGENT_SUBTITLE, HOUSE_AGENT_VENDOR, type HeadroomBudgetCommand, type HeadroomBudgetPeriod, type HeadroomBudgetUsage, type HeadroomKind, type HeadroomModelSpec, type HeadroomPythonRenderOpts, type HeadroomStatus, type HeadroomStep, type HeadroomSurface, type HunkLineType, INTEGRATION_BRANDING, INTEGRATION_REGISTRY, INTERNAL_TO_PUBLIC, type InputSuggestionChunk, type IntegrationApiKeyField, type IntegrationAuthKind, type IntegrationBranding, type IntegrationCategory, type IntegrationDefinition, type IntegrationDelivery, type IntegrationHealth, type IntegrationId, type IntegrationMcpDelivery, type IntegrationStatus, type IntegrationsManifest, type IntegrationsManifestEntry, LINKED_AGENT_IDS, type LinkedAgentId, MODEL_CONTEXT_WINDOW, MODEL_PRICING, type ModelPricing, type NormalizedMessage, OBSERVER_BRIDGE_PORT, PREVIEW_DETECT_PROMPT, PROTOCOL_VERSION, PUBLIC_TO_INTERNAL, type PendingReviewHunkEvent, type PendingReviewHunkLine, type PreviewDetection, type PreviewErrorStage, type PreviewState, type PreviewStatus, type RemoteCommand, SSE_SOCKET_TIMEOUT_MS, type SelectPrompt, type StreamingChunkEvent, type StreamingChunkKind, TERMINAL_AGENT_PREFIX, UNKNOWN_MODEL_PRICING, UPCOMING_INTEGRATION_IDS, USER_EVENTS, type UserEventName, getAgent, getContextWindow, getEnabledAgents, getEnabledIntegrations, getIntegration, getIntegrationBranding, getIntegrationsByCategory, getPricing, headroomKindFor, headroomModelPredownloadScript, headroomPipPackage, headroomSnapshotDownloadLine, internalToPublic, isHeadroomWrappable, isKnownAgentId, isKnownIntegrationId, isKnownModel, isLinkedAgentId, normalizeAgentId, publicToInternal, renderToLines, resolveApiBaseUrl, toRemoteCommand };
|
|
1317
|
+
export { AGENT_REGISTRY, type AgentAuth, type AgentAuthKind, type AgentId, type AgentMetadata, type AgentMode, type AgentModel, type AnswerResolvedEvent, type AwaitingAnswerEvent, type BeadsActionCommand, type BeadsActionKind, type BeadsActionPayload, type BeadsActionRequest, type BeadsActionType, type BeadsConfigureAction, type BeadsDependencyDto, type BeadsDependencyKind, type BeadsIngestPayload, type BeadsIssueDto, type BeadsIssueStatus, type BeadsMemoryDto, type BeadsProjectDto, type BeadsProvisioningPayload, type BeadsProvisioningStatus, type BeadsSnapshotDto, type BeadsStatus, type BeadsStatusState, type BeadsStatusSummary, type BlameLineWire, type BrokeredIntegrationToken, type ChromeStep, type ChromeToolType, type CommitEntryWire, DEFAULT_API_BASE_URL, DEV_API_BASE_URL, type EnvVar, type FileBlameEvent, type FileChangeStatus, type FileChangedEvent, type FileHistoryEvent, type FileReviewStatus, HEADROOM_BACKEND_ENV, HEADROOM_EXTRAS_BY_SURFACE, HEADROOM_MODELS, HEADROOM_PIP_COMPANIONS, HEADROOM_PROXY_PORT, HEARTBEAT_INTERVAL_MS_DEFAULT, HOUSE_AGENT_ID, HOUSE_AGENT_NAME, HOUSE_AGENT_PROVIDER, HOUSE_AGENT_SUBTITLE, HOUSE_AGENT_VENDOR, type HeadroomBudgetCommand, type HeadroomBudgetPeriod, type HeadroomBudgetUsage, type HeadroomKind, type HeadroomModelSpec, type HeadroomPythonRenderOpts, type HeadroomStatus, type HeadroomStep, type HeadroomSurface, type HunkLineType, INTEGRATION_BRANDING, INTEGRATION_REGISTRY, INTERNAL_TO_PUBLIC, type InputSuggestionChunk, type IntegrationApiKeyField, type IntegrationAuthKind, type IntegrationBranding, type IntegrationCategory, type IntegrationDefinition, type IntegrationDelivery, type IntegrationHealth, type IntegrationId, type IntegrationMcpDelivery, type IntegrationStatus, type IntegrationsManifest, type IntegrationsManifestEntry, LINKED_AGENT_IDS, type LinkedAgentId, MODEL_CONTEXT_WINDOW, MODEL_PRICING, type ModelPricing, type NormalizedMessage, OBSERVER_BRIDGE_PORT, PREVIEW_DETECT_PROMPT, PROTOCOL_VERSION, PUBLIC_TO_INTERNAL, type PendingReviewHunkEvent, type PendingReviewHunkLine, type PreviewDetection, type PreviewErrorStage, type PreviewState, type PreviewStatus, type RemoteCommand, SSE_SOCKET_TIMEOUT_MS, type SelectPrompt, type StreamingChunkEvent, type StreamingChunkKind, TERMINAL_AGENT_PREFIX, UNKNOWN_MODEL_PRICING, UPCOMING_INTEGRATION_IDS, USER_EVENTS, type UserEventName, getAgent, getContextWindow, getEnabledAgents, getEnabledIntegrations, getIntegration, getIntegrationBranding, getIntegrationsByCategory, getPricing, headroomKindFor, headroomModelPredownloadScript, headroomPipPackage, headroomSnapshotDownloadLine, internalToPublic, isHeadroomWrappable, isKnownAgentId, isKnownIntegrationId, isKnownModel, isLinkedAgentId, normalizeAgentId, publicToInternal, renderToLines, resolveApiBaseUrl, toRemoteCommand, tryGetContextWindow };
|
package/dist/index.js
CHANGED
|
@@ -71,7 +71,8 @@ __export(index_exports, {
|
|
|
71
71
|
publicToInternal: () => publicToInternal,
|
|
72
72
|
renderToLines: () => renderToLines,
|
|
73
73
|
resolveApiBaseUrl: () => resolveApiBaseUrl,
|
|
74
|
-
toRemoteCommand: () => toRemoteCommand
|
|
74
|
+
toRemoteCommand: () => toRemoteCommand,
|
|
75
|
+
tryGetContextWindow: () => tryGetContextWindow
|
|
75
76
|
});
|
|
76
77
|
module.exports = __toCommonJS(index_exports);
|
|
77
78
|
|
|
@@ -289,6 +290,10 @@ function getContextWindow(model) {
|
|
|
289
290
|
if (!model) return DEFAULT_CONTEXT_WINDOW;
|
|
290
291
|
return longestPrefixMatch(MODEL_CONTEXT_WINDOW, model) ?? DEFAULT_CONTEXT_WINDOW;
|
|
291
292
|
}
|
|
293
|
+
function tryGetContextWindow(model) {
|
|
294
|
+
if (!model) return void 0;
|
|
295
|
+
return longestPrefixMatch(MODEL_CONTEXT_WINDOW, model);
|
|
296
|
+
}
|
|
292
297
|
|
|
293
298
|
// src/agents/registry.ts
|
|
294
299
|
var AGENT_REGISTRY = {
|
|
@@ -1307,6 +1312,7 @@ OUTPUT JSON ONLY. NO MARKDOWN. NO COMMENTARY.
|
|
|
1307
1312
|
publicToInternal,
|
|
1308
1313
|
renderToLines,
|
|
1309
1314
|
resolveApiBaseUrl,
|
|
1310
|
-
toRemoteCommand
|
|
1315
|
+
toRemoteCommand,
|
|
1316
|
+
tryGetContextWindow
|
|
1311
1317
|
});
|
|
1312
1318
|
//# sourceMappingURL=index.js.map
|