Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions src/cli/aws/agentcore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
EvaluateCommand,
InvokeAgentRuntimeCommand,
InvokeAgentRuntimeCommandCommand,
StopRuntimeSessionCommand,
} from '@aws-sdk/client-bedrock-agentcore';
import type { HttpRequest } from '@smithy/protocol-http';
import type { DocumentType } from '@smithy/types';
Expand Down Expand Up @@ -96,17 +95,6 @@ export interface StreamingInvokeResult {
sessionId: string | undefined;
}

export interface StopRuntimeSessionOptions {
region: string;
runtimeArn: string;
sessionId: string;
}

export interface StopRuntimeSessionResult {
sessionId: string | undefined;
statusCode: number | undefined;
}

/**
* Parse a single SSE data line and extract the content.
* Returns null if the line is not a data line or contains an error.
Expand Down Expand Up @@ -1118,28 +1106,6 @@ export async function invokeAguiRuntime(
};
}

/**
* Stop a runtime session.
*/
export async function stopRuntimeSession(options: StopRuntimeSessionOptions): Promise<StopRuntimeSessionResult> {
const client = new BedrockAgentCoreClient({
region: options.region,
credentials: getCredentialProvider(),
});

const command = new StopRuntimeSessionCommand({
agentRuntimeArn: options.runtimeArn,
runtimeSessionId: options.sessionId,
});

const response = await client.send(command);

return {
sessionId: response.runtimeSessionId,
statusCode: response.statusCode,
};
}

// ---------------------------------------------------------------------------
// Execute Bash: Run shell commands in runtime containers
// ---------------------------------------------------------------------------
Expand Down
3 changes: 0 additions & 3 deletions src/cli/aws/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export {
mcpCallTool,
parseSSE,
extractResult,
stopRuntimeSession,
type ExecuteBashOptions,
type ExecuteBashResult,
type ExecuteBashStreamEvent,
Expand All @@ -72,8 +71,6 @@ export {
type McpToolDef,
type McpListToolsResult,
type StreamingInvokeResult,
type StopRuntimeSessionOptions,
type StopRuntimeSessionResult,
} from './agentcore';
export {
startRecommendation,
Expand Down
7 changes: 0 additions & 7 deletions src/cli/cdk/toolkit-lib/wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,6 @@ export class CdkToolkitWrapper {
this.options = options;
}

/**
* Get the path to the CDK project directory.
*/
getProjectDir(): string {
return this.projectDir;
}

/**
* Get the CDK app command for this project.
* Points to the compiled JS file in dist/ (requires tsc build first).
Expand Down
1 change: 0 additions & 1 deletion src/cli/cloudformation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ export * from './bootstrap';
export * from './outputs';
export * from './stack-discovery';
export * from './stack-status';
export * from './types';
30 changes: 0 additions & 30 deletions src/cli/cloudformation/types.ts

This file was deleted.

8 changes: 0 additions & 8 deletions src/cli/commands/add/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,6 @@ export interface AddDatasetOptions {
json?: boolean;
}

export interface AddDatasetResult {
success: boolean;
datasetName?: string;
error?: string;
}
// Credential types (v2: credential, no owner/user concept)
export interface AddCredentialOptions {
name?: string;
Expand All @@ -211,6 +206,3 @@ export interface AddCredentialOptions {
scopes?: string;
json?: boolean;
}

/** @deprecated Use AddCredentialOptions */
export type AddIdentityOptions = AddCredentialOptions;
13 changes: 0 additions & 13 deletions src/cli/commands/import/constants.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
/** Name validation regex used by all import handlers. */
export const NAME_REGEX = /^[a-zA-Z][a-zA-Z0-9_]{0,47}$/;

/**
* CloudFormation resource type to identifier key mapping for IMPORT.
*/
export const CFN_RESOURCE_IDENTIFIERS: Record<string, string[]> = {
'AWS::BedrockAgentCore::Runtime': ['AgentRuntimeId'],
'AWS::BedrockAgentCore::Memory': ['MemoryId'],
'AWS::BedrockAgentCore::Gateway': ['GatewayIdentifier'],
'AWS::BedrockAgentCore::GatewayTarget': ['GatewayIdentifier', 'TargetId'],
'AWS::BedrockAgentCore::Evaluator': ['EvaluatorId'],
'AWS::BedrockAgentCore::OnlineEvaluationConfig': ['OnlineEvaluationConfigId'],
'AWS::BedrockAgentCore::Harness': ['HarnessId'],
};

/**
* CloudFormation resource types that are primary (importable) resources.
* Everything else is a companion resource.
Expand Down
19 changes: 0 additions & 19 deletions src/cli/commands/index.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/cli/external-requirements/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,9 @@ export {
export {
checkNodeVersion,
checkUvVersion,
checkAwsCliVersion,
checkNpmCacheOwnership,
getAwsLoginGuidance,
formatVersionError,
formatNpmCacheError,
requiresUv,
requiresContainerRuntime,
checkDependencyVersions,
checkCreateDependencies,
type VersionCheckResult,
Expand Down
5 changes: 1 addition & 4 deletions src/cli/operations/dataset/push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import stableStringify from 'fast-json-stable-stringify';
import { randomUUID } from 'node:crypto';
import { readFile, writeFile } from 'node:fs/promises';
import { resolve } from 'node:path';
import { setTimeout as sleep } from 'node:timers/promises';

/** Maximum examples per API call (service limit). */
const API_BATCH_LIMIT = 1000;
Expand Down Expand Up @@ -179,10 +180,6 @@ async function batchOperation<T, R>(options: {
return results;
}

function sleep(ms: number): Promise<void> {
return new Promise(resolve => setTimeout(resolve, ms));
}

/**
* Write exampleIds back into the local JSONL file after push.
* In force mode (no addedExamples), all examples get new IDs.
Expand Down
10 changes: 5 additions & 5 deletions src/cli/operations/dev/otel/transforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { OtlpAttribute, OtlpAttributeValue, OtlpResource, OtlpResourceLog,
// Trace metadata extraction (from raw OTLP data)
// ---------------------------------------------------------------------------

export interface TraceMeta {
interface TraceMeta {
traceId?: string;
firstSeen: number;
lastSeen: number;
Expand Down Expand Up @@ -197,7 +197,7 @@ function normalizeSpanKind(kind: number | string | undefined): number {
// ---------------------------------------------------------------------------

/** Convert nanosecond timestamp (string) to milliseconds. */
export function nanoToMs(nano: string | undefined): number {
function nanoToMs(nano: string | undefined): number {
if (!nano) return 0;
return Math.floor(Number(nano) / 1_000_000);
}
Expand All @@ -206,7 +206,7 @@ export function nanoToMs(nano: string | undefined): number {
* Convert a value that may be base64 (from protobuf JSON roundtrip) or
* already a hex string into a hex string.
*/
export function hexFromB64OrString(val: string | undefined): string {
function hexFromB64OrString(val: string | undefined): string {
if (!val) return '';
// Already hex (32 chars for traceId, 16 for spanId)
if (/^[0-9a-f]+$/i.test(val) && (val.length === 32 || val.length === 16)) return val.toLowerCase();
Expand Down Expand Up @@ -239,7 +239,7 @@ function getAttrValue(attrs: OtlpAttribute[] | Record<string, unknown> | undefin
* Flatten OTLP attributes to a plain Record<string, unknown>.
* Handles both OTLP key/value array format and already-flat records.
*/
export function flattenAttributes(
function flattenAttributes(
attrs: OtlpAttribute[] | Record<string, unknown> | undefined
): Record<string, unknown> | undefined {
if (!attrs) return undefined;
Expand All @@ -263,7 +263,7 @@ export function flattenAttributes(
}

/** Extract a usable value from an OTLP AnyValue. */
export function extractAnyValue(val: unknown): unknown {
function extractAnyValue(val: unknown): unknown {
if (!val || typeof val !== 'object') return val;
const v = val as Record<string, unknown>;
if (v.stringValue !== undefined) return v.stringValue;
Expand Down
2 changes: 1 addition & 1 deletion src/cli/operations/eval/shared/span-collector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export async function executeQueryGraceful(
/**
* Execute a CloudWatch Logs Insights query and wait for results.
*/
export async function executeQuery(
async function executeQuery(
client: CloudWatchLogsClient,
logGroupName: string,
queryString: string,
Expand Down
4 changes: 2 additions & 2 deletions src/cli/operations/feedback/build-payload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ interface BuildPayloadInput {
osDescriptor?: string;
}

export function buildOsDescriptor(): string {
function buildOsDescriptor(): string {
return `${process.platform} ${os.release()}`;
}

export function buildLocationDescriptor(cliVersion: string, mode: FeedbackMode): string {
function buildLocationDescriptor(cliVersion: string, mode: FeedbackMode): string {
return `agentcore-cli@${cliVersion} (${process.platform}; node ${process.version}; ${mode})`;
}

Expand Down
5 changes: 1 addition & 4 deletions src/cli/operations/insights/run-insights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { getRegion } from '../../commands/shared/region-utils';
import { ExecLogger } from '../../logging/exec-logger';
import { saveInsightsRun, updateInsightsRun } from './insights-storage';
import type { InsightsRunRecord, RunInsightsOptions, RunInsightsResult } from './types';
import { setTimeout as sleep } from 'node:timers/promises';

// ============================================================================
// Constants
Expand Down Expand Up @@ -225,7 +226,3 @@ function buildFilterConfig(options: RunInsightsOptions): CloudWatchFilterConfig
const startTime = options.startTime ?? new Date(Date.now() - lookbackDays * 24 * 60 * 60 * 1000).toISOString();
return { timeRange: { startTime, endTime } };
}

function sleep(ms: number): Promise<void> {
return new Promise(resolve => setTimeout(resolve, ms));
}
4 changes: 2 additions & 2 deletions src/cli/operations/jobs/ab-test/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ export const IAM_PROPAGATION_DELAY_MS = 15_000;
// ============================================================================

/** Generate a project-scoped role name: AgentCore-{ProjectName}-ABTest{TestName}-{Hash} (max 64 chars). */
export function generateRoleName(projectName: string, testName: string): string {
function generateRoleName(projectName: string, testName: string): string {
// Deterministic hash so retries produce the same role name (avoids orphaned roles).
const hash = createHash('sha256').update(`${projectName}:${testName}`).digest('hex').slice(0, 8);
const base = `AgentCore-${projectName}-ABTest${testName}`;
return `${base.slice(0, 55)}-${hash}`;
}

/** Extract role name from ARN: arn:aws:iam::123456789012:role/RoleName → RoleName. */
export function roleNameFromArn(roleArn: string): string {
function roleNameFromArn(roleArn: string): string {
const parts = roleArn.split('/');
return parts[parts.length - 1] ?? roleArn;
}
Expand Down
Loading
Loading