langwatch 1.12.1 → 1.13.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.
Files changed (41) hide show
  1. package/dist/agent/index.d.mts +5 -1
  2. package/dist/agent/index.d.ts +5 -1
  3. package/dist/agent/index.js +239 -14
  4. package/dist/agent/index.js.map +1 -1
  5. package/dist/agent/index.mjs +239 -14
  6. package/dist/agent/index.mjs.map +1 -1
  7. package/dist/{chunk-OSVJ65OO.js → chunk-7R54TMZZ.js} +2 -2
  8. package/dist/{chunk-OSVJ65OO.js.map → chunk-7R54TMZZ.js.map} +1 -1
  9. package/dist/{chunk-H2DJGGYQ.js → chunk-G64XZMIU.js} +12 -12
  10. package/dist/{chunk-H2DJGGYQ.js.map → chunk-G64XZMIU.js.map} +1 -1
  11. package/dist/{chunk-53NOLJEX.mjs → chunk-N3755EHD.mjs} +2 -2
  12. package/dist/{chunk-2HA4SJSD.mjs → chunk-NPEK4RSD.mjs} +5 -2
  13. package/dist/{chunk-2HA4SJSD.mjs.map → chunk-NPEK4RSD.mjs.map} +1 -1
  14. package/dist/{chunk-4ERRCKOH.js → chunk-O4J3ZPZY.js} +5 -2
  15. package/dist/chunk-O4J3ZPZY.js.map +1 -0
  16. package/dist/{chunk-IVRETMQH.mjs → chunk-UHRSTPZ5.mjs} +2 -2
  17. package/dist/{chunk-IVRETMQH.mjs.map → chunk-UHRSTPZ5.mjs.map} +1 -1
  18. package/dist/cli/bundle.js +362 -358
  19. package/dist/{implementation-BNaydX6f.d.ts → implementation-BDK4X-CS.d.ts} +1 -1
  20. package/dist/{implementation-DLMEZQgA.d.mts → implementation-BOP-3GoX.d.mts} +1 -1
  21. package/dist/index.d.mts +75 -5
  22. package/dist/index.d.ts +75 -5
  23. package/dist/index.js +324 -99
  24. package/dist/index.js.map +1 -1
  25. package/dist/index.mjs +242 -17
  26. package/dist/index.mjs.map +1 -1
  27. package/dist/observability-sdk/index.d.mts +3 -3
  28. package/dist/observability-sdk/index.d.ts +3 -3
  29. package/dist/observability-sdk/index.js +3 -3
  30. package/dist/observability-sdk/index.mjs +2 -2
  31. package/dist/observability-sdk/instrumentation/langchain/index.d.mts +1 -1
  32. package/dist/observability-sdk/instrumentation/langchain/index.d.ts +1 -1
  33. package/dist/observability-sdk/instrumentation/langchain/index.js +3 -3
  34. package/dist/observability-sdk/instrumentation/langchain/index.mjs +1 -1
  35. package/dist/observability-sdk/setup/node/index.js +3 -3
  36. package/dist/observability-sdk/setup/node/index.mjs +2 -2
  37. package/dist/{types-CLDQMYpV.d.ts → types-C3SDhizh.d.ts} +1138 -111
  38. package/dist/{types-DWNdXOWw.d.mts → types-C9abONOS.d.mts} +1138 -111
  39. package/package.json +1 -1
  40. package/dist/chunk-4ERRCKOH.js.map +0 -1
  41. /package/dist/{chunk-53NOLJEX.mjs.map → chunk-N3755EHD.mjs.map} +0 -0
@@ -4,7 +4,7 @@ import { ExportResult } from '@opentelemetry/core';
4
4
  import { Logger, LogRecord, LoggerProvider } from '@opentelemetry/api-logs';
5
5
  import { b as SemConvLogRecordAttributes, a as SemConvAttributes } from './types-VOZv9LYO.js';
6
6
  import { TracerProvider } from '@opentelemetry/api';
7
- import { j as LangWatchTracer } from './types-CLDQMYpV.js';
7
+ import { j as LangWatchTracer } from './types-C3SDhizh.js';
8
8
 
9
9
  /**
10
10
  * Filterable Batch Span Exporter for OpenTelemetry
@@ -4,7 +4,7 @@ import { ExportResult } from '@opentelemetry/core';
4
4
  import { Logger, LogRecord, LoggerProvider } from '@opentelemetry/api-logs';
5
5
  import { b as SemConvLogRecordAttributes, a as SemConvAttributes } from './types-VOZv9LYO.mjs';
6
6
  import { TracerProvider } from '@opentelemetry/api';
7
- import { j as LangWatchTracer } from './types-DWNdXOWw.mjs';
7
+ import { j as LangWatchTracer } from './types-C9abONOS.mjs';
8
8
 
9
9
  /**
10
10
  * Filterable Batch Span Exporter for OpenTelemetry
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { L as Logger, C as ConsoleLogger, N as NoOpLogger } from './index-D7rKIGrO.mjs';
2
- export { F as FilterableBatchSpanProcessor, L as LangWatchExporter, S as SpanProcessingExcludeRule, g as getLangWatchLogger, a as getLangWatchTracer } from './implementation-DLMEZQgA.mjs';
2
+ export { F as FilterableBatchSpanProcessor, L as LangWatchExporter, S as SpanProcessingExcludeRule, g as getLangWatchLogger, a as getLangWatchTracer } from './implementation-BOP-3GoX.mjs';
3
3
  import { z } from 'zod';
4
- import { p as paths, P as PromptResponse, C as CreatePromptBody, U as UpdatePromptBody, T as TagDefinition, a as CreatedTag, o as operations, b as PromptData, F as FetchPolicy, c as Prompt, L as LangWatchSpan, d as components } from './types-DWNdXOWw.mjs';
4
+ import { p as paths, P as PromptResponse, C as CreatePromptBody, U as UpdatePromptBody, T as TagDefinition, a as CreatedTag, o as operations, b as PromptData, F as FetchPolicy, c as Prompt, L as LangWatchSpan, d as components } from './types-C9abONOS.mjs';
5
5
  import openApiCreateClient from 'openapi-fetch';
6
6
  export { l as attributes } from './types-VOZv9LYO.mjs';
7
7
  import { CliHandledErrorReason, CliHandledError } from '@langwatch/langy/cards/handled-error';
@@ -2066,8 +2066,13 @@ type TestSuite = NonNullable<paths["/api/v1/test-suites"]["get"]["responses"]["2
2066
2066
  type TestSuiteDetail = paths["/api/v1/test-suites/{id}"]["get"]["responses"]["200"]["content"]["application/json"];
2067
2067
  /** The body `POST /api/v1/test-suites` takes. */
2068
2068
  type CreateTestSuiteBody = NonNullable<paths["/api/v1/test-suites"]["post"]["requestBody"]>["content"]["application/json"];
2069
- /** The body `PATCH /api/v1/test-suites/{id}` takes. */
2070
- type RenameTestSuiteBody = NonNullable<paths["/api/v1/test-suites/{id}"]["patch"]["requestBody"]>["content"]["application/json"];
2069
+ /**
2070
+ * The body `PATCH /api/v1/test-suites/{id}` takes: any of the name, the full
2071
+ * field list and the full evaluator list.
2072
+ */
2073
+ type UpdateTestSuiteBody = NonNullable<paths["/api/v1/test-suites/{id}"]["patch"]["requestBody"]>["content"]["application/json"];
2074
+ /** The body `rename` sends: the name alone. */
2075
+ type RenameTestSuiteBody = Pick<UpdateTestSuiteBody, "name"> & Required<Pick<UpdateTestSuiteBody, "name">>;
2071
2076
  /** The body `POST /api/v1/test-suites/{id}/run` takes. */
2072
2077
  type RunTestSuiteBody = NonNullable<paths["/api/v1/test-suites/{id}/run"]["post"]["requestBody"]>["content"]["application/json"];
2073
2078
  /** What a scheduled suite run answers with. It is a run plan run. */
@@ -2091,6 +2096,12 @@ declare class TestSuitesApiService {
2091
2096
  }): Promise<TestSuite[]>;
2092
2097
  create(params: CreateTestSuiteBody): Promise<TestSuite>;
2093
2098
  get(id: string): Promise<TestSuiteDetail>;
2099
+ /**
2100
+ * Edits a suite: any of its name, its fields and its evaluators. A field
2101
+ * list or an evaluator list replaces the one the suite holds; a key left
2102
+ * out keeps what the suite has.
2103
+ */
2104
+ update(id: string, params: UpdateTestSuiteBody): Promise<TestSuite>;
2094
2105
  /** Renames a suite. The slug is kept, so links and run history stay put. */
2095
2106
  rename(id: string, params: RenameTestSuiteBody): Promise<TestSuite>;
2096
2107
  /** Archives a suite. The scenarios filed in it are archived with it. */
@@ -2184,6 +2195,14 @@ interface AgentResponse {
2184
2195
  } | null;
2185
2196
  /** The machine a host-scoped development agent belongs to. */
2186
2197
  hostLabel?: string | null;
2198
+ /**
2199
+ * Whether this key can run the agent. A personal development agent of
2200
+ * another person is listed all the same, so two agents of one name can be
2201
+ * told apart, but it cannot be run with this key.
2202
+ */
2203
+ selectable?: boolean;
2204
+ /** Why the agent cannot be run with this key; null when it can. */
2205
+ notSelectableReason?: "owned_by_another_person" | null;
2187
2206
  parameters?: AgentParameterSpec[];
2188
2207
  }
2189
2208
  interface AgentListResponse {
@@ -4135,9 +4154,60 @@ interface VerifyWebhookSignatureOptions {
4135
4154
  */
4136
4155
  declare function verifyWebhookSignature(options: VerifyWebhookSignatureOptions): void;
4137
4156
 
4157
+ /**
4158
+ * The one HTTP client every request to the LangWatch API goes through.
4159
+ *
4160
+ * A LangWatch endpoint configured as `http://app.langwatch.ai` answers with a
4161
+ * redirect to https. The global `fetch` follows it on its own and, for a 301
4162
+ * or 302, turns the POST into a GET and drops the body, so the event is lost
4163
+ * without an error. This client sends with `redirect: "manual"` and applies a
4164
+ * rule per method to the 3xx it gets back.
4165
+ *
4166
+ * GET and HEAD follow a 301, 302, 303, 307 or 308 with the same method, up to
4167
+ * five hops. A hop that keeps the origin, or only upgrades http to https on
4168
+ * the same host and port, keeps every header; any other hop drops the
4169
+ * credential headers first. A hop from https to http and a hop without a
4170
+ * Location are refused.
4171
+ *
4172
+ * Every other method follows exactly one redirect, and only when the target is
4173
+ * the same URL with the scheme changed from http to https (same host, port,
4174
+ * path and query). The replay uses the same method, headers and body bytes.
4175
+ *
4176
+ * Every refused redirect throws `LangWatchRedirectError`.
4177
+ *
4178
+ * This module depends on the SDK logger only, so the CLI boot graph and the
4179
+ * `agent` entry can import it without pulling anything else in.
4180
+ */
4181
+
4182
+ declare class LangWatchRedirectError extends Error {
4183
+ readonly url: string;
4184
+ readonly location: string | null;
4185
+ readonly status: number;
4186
+ constructor({ url, location, status, }: {
4187
+ url: string;
4188
+ location: string | null;
4189
+ status: number;
4190
+ });
4191
+ }
4192
+ type LangWatchFetch = typeof globalThis.fetch;
4193
+ interface CreateLangWatchFetchOptions {
4194
+ /** The transport to send with. Defaults to the global `fetch` at call time. */
4195
+ fetch?: LangWatchFetch;
4196
+ /** Receives the one warning per process about an http endpoint. */
4197
+ logger?: Logger;
4198
+ }
4199
+ /**
4200
+ * Builds a `fetch` that applies the redirect rule. Pass `fetch` to send through
4201
+ * another transport (a test double, a proxying client) and `logger` to route
4202
+ * the http endpoint warning.
4203
+ */
4204
+ declare const createLangWatchFetch: ({ fetch: fetchImpl, logger, }?: CreateLangWatchFetchOptions) => LangWatchFetch;
4205
+ /** The shared client, bound to the global `fetch` and the SDK console logger. */
4206
+ declare const langwatchFetch: LangWatchFetch;
4207
+
4138
4208
  declare const logger: {
4139
4209
  ConsoleLogger: typeof ConsoleLogger;
4140
4210
  NoOpLogger: typeof NoOpLogger;
4141
4211
  };
4142
4212
 
4143
- export { type ArchivedProject, type ArchivedTeam, type BatchCreateRecordsResponse, type BudgetOnBreach, type BudgetScopeKind, type BudgetWindow, ComparisonError, type ComparisonMetric, type ComparisonOptions, type ComparisonStatus, type ComparisonVerdict, type CreateDatasetOptions, type CreateEvaluatorBody, type CreateFromUploadResponse, type CreateGatewayBudgetInput, type CreateGatewayBudgetScope, type CreateProjectInput, type CreateVirtualKeyInput, type CreateWebhookEndpointInput, type Dataset, DatasetApiError, type DatasetColumnType, type DatasetEntry, DatasetError, type DatasetListItem, type DatasetMetadata, DatasetNotFoundError, DatasetPlanLimitError, type DatasetRecordResponse, DatasetValidationError, DatasetsFacade, type DeleteRecordsResponse, type EmittedEvent, type EmittedEventsPage, type EndUserCap, type EndUserSpend, type EvaluateOptions, type EvaluationCost, EvaluationError, type EvaluationResult, type EvaluationStatus, EvaluationsApiError, EvaluationsFacade, EvaluatorCallError, EvaluatorError, type EvaluatorField, EvaluatorNotFoundError, type EvaluatorResponse, EvaluatorsApiError, EvaluatorsApiService, Experiment, ExperimentApiError, ExperimentError, type EvaluateOptions$1 as ExperimentEvaluateOptions, type EvaluationResult$1 as ExperimentEvaluationResult, type EvaluationStatus$1 as ExperimentEvaluationStatus, ExperimentInitError, type ExperimentInitOptions, type ExperimentRowResult, type ExperimentRunWithResults, ExperimentsFacade, FetchPolicy, type GatewayBudget, type GatewayBudgetPage, GatewayBudgetsApiError, GatewayBudgetsApiService, type GetDatasetOptions, type GetPromptOptions, IDEMPOTENCY_KEY_HEADER, IDEMPOTENT_REPLAY_HEADER, type IdempotentCreateOptions, LangWatch, LangWatchApiError, LangWatchHandledError, type ListDatasetsApiResponse, type ListDatasetsOptions, type ListRecordsApiResponse, type ListRecordsOptions, type ListTeamsResponse, type LogOptions, type MutationOptions, type PaginatedProjects, type PaginatedResponse, type Pagination, type Project, type ProjectWithServiceKey, ProjectsApiError, ProjectsApiService, type RunCallback, type RunContext, type RunOptions, type RunWithResultsOptions, type SpendEvent, type SpendEventStatus, SpendEventsApiError, SpendEventsApiService, type SpendEventsPage, type SpendFilterOptions, type SpendGroupBy, type SpendReplayResult, type SpendSummariesOptions, type SpendSummariesPage, type SpendSummaryRow, type SpendSummaryStatus, type TargetInfo, type TargetMetadata, TargetMetadataConflictError, type TargetType, type Team, type TeamMember, type TeamPagination, TeamsApiError, TeamsApiService, type UpdateDatasetOptions, type UpdateGatewayBudgetInput, type UpdateProjectInput, type UpdateVirtualKeyInput, type UpdateWebhookEndpointInput, type UploadResponse, type VerifyWebhookSignatureOptions, type VirtualKey, type VirtualKeyBudgetInput, type VirtualKeyPage, type VirtualKeyRoutingMode, type VirtualKeyScope, type VirtualKeyScopeType, type VirtualKeySpendSummary, type VirtualKeyWithSecret, VirtualKeysApiError, VirtualKeysApiService, WEBHOOK_DELIVERY_ID_HEADER, WEBHOOK_EVENT_ID_HEADER, WEBHOOK_SIGNATURE_DEFAULT_TOLERANCE_SECONDS, WEBHOOK_SIGNATURE_HEADER, type WebhookDeliveryPage, type WebhookDeliveryRecord, type WebhookEndpointHealth, type WebhookEndpointSummary, type WebhookEndpointWithSecret, type WebhookEventType, type WebhookSignatureFailureCode, WebhookSignatureVerificationError, type WebhookTestResult, WebhooksApiError, WebhooksApiService, isLangWatchHandledError, logger, verifyWebhookSignature };
4213
+ export { type ArchivedProject, type ArchivedTeam, type BatchCreateRecordsResponse, type BudgetOnBreach, type BudgetScopeKind, type BudgetWindow, ComparisonError, type ComparisonMetric, type ComparisonOptions, type ComparisonStatus, type ComparisonVerdict, type CreateDatasetOptions, type CreateEvaluatorBody, type CreateFromUploadResponse, type CreateGatewayBudgetInput, type CreateGatewayBudgetScope, type CreateLangWatchFetchOptions, type CreateProjectInput, type CreateVirtualKeyInput, type CreateWebhookEndpointInput, type Dataset, DatasetApiError, type DatasetColumnType, type DatasetEntry, DatasetError, type DatasetListItem, type DatasetMetadata, DatasetNotFoundError, DatasetPlanLimitError, type DatasetRecordResponse, DatasetValidationError, DatasetsFacade, type DeleteRecordsResponse, type EmittedEvent, type EmittedEventsPage, type EndUserCap, type EndUserSpend, type EvaluateOptions, type EvaluationCost, EvaluationError, type EvaluationResult, type EvaluationStatus, EvaluationsApiError, EvaluationsFacade, EvaluatorCallError, EvaluatorError, type EvaluatorField, EvaluatorNotFoundError, type EvaluatorResponse, EvaluatorsApiError, EvaluatorsApiService, Experiment, ExperimentApiError, ExperimentError, type EvaluateOptions$1 as ExperimentEvaluateOptions, type EvaluationResult$1 as ExperimentEvaluationResult, type EvaluationStatus$1 as ExperimentEvaluationStatus, ExperimentInitError, type ExperimentInitOptions, type ExperimentRowResult, type ExperimentRunWithResults, ExperimentsFacade, FetchPolicy, type GatewayBudget, type GatewayBudgetPage, GatewayBudgetsApiError, GatewayBudgetsApiService, type GetDatasetOptions, type GetPromptOptions, IDEMPOTENCY_KEY_HEADER, IDEMPOTENT_REPLAY_HEADER, type IdempotentCreateOptions, LangWatch, LangWatchApiError, type LangWatchFetch, LangWatchHandledError, LangWatchRedirectError, type ListDatasetsApiResponse, type ListDatasetsOptions, type ListRecordsApiResponse, type ListRecordsOptions, type ListTeamsResponse, type LogOptions, type MutationOptions, type PaginatedProjects, type PaginatedResponse, type Pagination, type Project, type ProjectWithServiceKey, ProjectsApiError, ProjectsApiService, type RunCallback, type RunContext, type RunOptions, type RunWithResultsOptions, type SpendEvent, type SpendEventStatus, SpendEventsApiError, SpendEventsApiService, type SpendEventsPage, type SpendFilterOptions, type SpendGroupBy, type SpendReplayResult, type SpendSummariesOptions, type SpendSummariesPage, type SpendSummaryRow, type SpendSummaryStatus, type TargetInfo, type TargetMetadata, TargetMetadataConflictError, type TargetType, type Team, type TeamMember, type TeamPagination, TeamsApiError, TeamsApiService, type UpdateDatasetOptions, type UpdateGatewayBudgetInput, type UpdateProjectInput, type UpdateVirtualKeyInput, type UpdateWebhookEndpointInput, type UploadResponse, type VerifyWebhookSignatureOptions, type VirtualKey, type VirtualKeyBudgetInput, type VirtualKeyPage, type VirtualKeyRoutingMode, type VirtualKeyScope, type VirtualKeyScopeType, type VirtualKeySpendSummary, type VirtualKeyWithSecret, VirtualKeysApiError, VirtualKeysApiService, WEBHOOK_DELIVERY_ID_HEADER, WEBHOOK_EVENT_ID_HEADER, WEBHOOK_SIGNATURE_DEFAULT_TOLERANCE_SECONDS, WEBHOOK_SIGNATURE_HEADER, type WebhookDeliveryPage, type WebhookDeliveryRecord, type WebhookEndpointHealth, type WebhookEndpointSummary, type WebhookEndpointWithSecret, type WebhookEventType, type WebhookSignatureFailureCode, WebhookSignatureVerificationError, type WebhookTestResult, WebhooksApiError, WebhooksApiService, createLangWatchFetch, isLangWatchHandledError, langwatchFetch, logger, verifyWebhookSignature };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { L as Logger, C as ConsoleLogger, N as NoOpLogger } from './index-D7rKIGrO.js';
2
- export { F as FilterableBatchSpanProcessor, L as LangWatchExporter, S as SpanProcessingExcludeRule, g as getLangWatchLogger, a as getLangWatchTracer } from './implementation-BNaydX6f.js';
2
+ export { F as FilterableBatchSpanProcessor, L as LangWatchExporter, S as SpanProcessingExcludeRule, g as getLangWatchLogger, a as getLangWatchTracer } from './implementation-BDK4X-CS.js';
3
3
  import { z } from 'zod';
4
- import { p as paths, P as PromptResponse, C as CreatePromptBody, U as UpdatePromptBody, T as TagDefinition, a as CreatedTag, o as operations, b as PromptData, F as FetchPolicy, c as Prompt, L as LangWatchSpan, d as components } from './types-CLDQMYpV.js';
4
+ import { p as paths, P as PromptResponse, C as CreatePromptBody, U as UpdatePromptBody, T as TagDefinition, a as CreatedTag, o as operations, b as PromptData, F as FetchPolicy, c as Prompt, L as LangWatchSpan, d as components } from './types-C3SDhizh.js';
5
5
  import openApiCreateClient from 'openapi-fetch';
6
6
  export { l as attributes } from './types-VOZv9LYO.js';
7
7
  import { CliHandledErrorReason, CliHandledError } from '@langwatch/langy/cards/handled-error';
@@ -2066,8 +2066,13 @@ type TestSuite = NonNullable<paths["/api/v1/test-suites"]["get"]["responses"]["2
2066
2066
  type TestSuiteDetail = paths["/api/v1/test-suites/{id}"]["get"]["responses"]["200"]["content"]["application/json"];
2067
2067
  /** The body `POST /api/v1/test-suites` takes. */
2068
2068
  type CreateTestSuiteBody = NonNullable<paths["/api/v1/test-suites"]["post"]["requestBody"]>["content"]["application/json"];
2069
- /** The body `PATCH /api/v1/test-suites/{id}` takes. */
2070
- type RenameTestSuiteBody = NonNullable<paths["/api/v1/test-suites/{id}"]["patch"]["requestBody"]>["content"]["application/json"];
2069
+ /**
2070
+ * The body `PATCH /api/v1/test-suites/{id}` takes: any of the name, the full
2071
+ * field list and the full evaluator list.
2072
+ */
2073
+ type UpdateTestSuiteBody = NonNullable<paths["/api/v1/test-suites/{id}"]["patch"]["requestBody"]>["content"]["application/json"];
2074
+ /** The body `rename` sends: the name alone. */
2075
+ type RenameTestSuiteBody = Pick<UpdateTestSuiteBody, "name"> & Required<Pick<UpdateTestSuiteBody, "name">>;
2071
2076
  /** The body `POST /api/v1/test-suites/{id}/run` takes. */
2072
2077
  type RunTestSuiteBody = NonNullable<paths["/api/v1/test-suites/{id}/run"]["post"]["requestBody"]>["content"]["application/json"];
2073
2078
  /** What a scheduled suite run answers with. It is a run plan run. */
@@ -2091,6 +2096,12 @@ declare class TestSuitesApiService {
2091
2096
  }): Promise<TestSuite[]>;
2092
2097
  create(params: CreateTestSuiteBody): Promise<TestSuite>;
2093
2098
  get(id: string): Promise<TestSuiteDetail>;
2099
+ /**
2100
+ * Edits a suite: any of its name, its fields and its evaluators. A field
2101
+ * list or an evaluator list replaces the one the suite holds; a key left
2102
+ * out keeps what the suite has.
2103
+ */
2104
+ update(id: string, params: UpdateTestSuiteBody): Promise<TestSuite>;
2094
2105
  /** Renames a suite. The slug is kept, so links and run history stay put. */
2095
2106
  rename(id: string, params: RenameTestSuiteBody): Promise<TestSuite>;
2096
2107
  /** Archives a suite. The scenarios filed in it are archived with it. */
@@ -2184,6 +2195,14 @@ interface AgentResponse {
2184
2195
  } | null;
2185
2196
  /** The machine a host-scoped development agent belongs to. */
2186
2197
  hostLabel?: string | null;
2198
+ /**
2199
+ * Whether this key can run the agent. A personal development agent of
2200
+ * another person is listed all the same, so two agents of one name can be
2201
+ * told apart, but it cannot be run with this key.
2202
+ */
2203
+ selectable?: boolean;
2204
+ /** Why the agent cannot be run with this key; null when it can. */
2205
+ notSelectableReason?: "owned_by_another_person" | null;
2187
2206
  parameters?: AgentParameterSpec[];
2188
2207
  }
2189
2208
  interface AgentListResponse {
@@ -4135,9 +4154,60 @@ interface VerifyWebhookSignatureOptions {
4135
4154
  */
4136
4155
  declare function verifyWebhookSignature(options: VerifyWebhookSignatureOptions): void;
4137
4156
 
4157
+ /**
4158
+ * The one HTTP client every request to the LangWatch API goes through.
4159
+ *
4160
+ * A LangWatch endpoint configured as `http://app.langwatch.ai` answers with a
4161
+ * redirect to https. The global `fetch` follows it on its own and, for a 301
4162
+ * or 302, turns the POST into a GET and drops the body, so the event is lost
4163
+ * without an error. This client sends with `redirect: "manual"` and applies a
4164
+ * rule per method to the 3xx it gets back.
4165
+ *
4166
+ * GET and HEAD follow a 301, 302, 303, 307 or 308 with the same method, up to
4167
+ * five hops. A hop that keeps the origin, or only upgrades http to https on
4168
+ * the same host and port, keeps every header; any other hop drops the
4169
+ * credential headers first. A hop from https to http and a hop without a
4170
+ * Location are refused.
4171
+ *
4172
+ * Every other method follows exactly one redirect, and only when the target is
4173
+ * the same URL with the scheme changed from http to https (same host, port,
4174
+ * path and query). The replay uses the same method, headers and body bytes.
4175
+ *
4176
+ * Every refused redirect throws `LangWatchRedirectError`.
4177
+ *
4178
+ * This module depends on the SDK logger only, so the CLI boot graph and the
4179
+ * `agent` entry can import it without pulling anything else in.
4180
+ */
4181
+
4182
+ declare class LangWatchRedirectError extends Error {
4183
+ readonly url: string;
4184
+ readonly location: string | null;
4185
+ readonly status: number;
4186
+ constructor({ url, location, status, }: {
4187
+ url: string;
4188
+ location: string | null;
4189
+ status: number;
4190
+ });
4191
+ }
4192
+ type LangWatchFetch = typeof globalThis.fetch;
4193
+ interface CreateLangWatchFetchOptions {
4194
+ /** The transport to send with. Defaults to the global `fetch` at call time. */
4195
+ fetch?: LangWatchFetch;
4196
+ /** Receives the one warning per process about an http endpoint. */
4197
+ logger?: Logger;
4198
+ }
4199
+ /**
4200
+ * Builds a `fetch` that applies the redirect rule. Pass `fetch` to send through
4201
+ * another transport (a test double, a proxying client) and `logger` to route
4202
+ * the http endpoint warning.
4203
+ */
4204
+ declare const createLangWatchFetch: ({ fetch: fetchImpl, logger, }?: CreateLangWatchFetchOptions) => LangWatchFetch;
4205
+ /** The shared client, bound to the global `fetch` and the SDK console logger. */
4206
+ declare const langwatchFetch: LangWatchFetch;
4207
+
4138
4208
  declare const logger: {
4139
4209
  ConsoleLogger: typeof ConsoleLogger;
4140
4210
  NoOpLogger: typeof NoOpLogger;
4141
4211
  };
4142
4212
 
4143
- export { type ArchivedProject, type ArchivedTeam, type BatchCreateRecordsResponse, type BudgetOnBreach, type BudgetScopeKind, type BudgetWindow, ComparisonError, type ComparisonMetric, type ComparisonOptions, type ComparisonStatus, type ComparisonVerdict, type CreateDatasetOptions, type CreateEvaluatorBody, type CreateFromUploadResponse, type CreateGatewayBudgetInput, type CreateGatewayBudgetScope, type CreateProjectInput, type CreateVirtualKeyInput, type CreateWebhookEndpointInput, type Dataset, DatasetApiError, type DatasetColumnType, type DatasetEntry, DatasetError, type DatasetListItem, type DatasetMetadata, DatasetNotFoundError, DatasetPlanLimitError, type DatasetRecordResponse, DatasetValidationError, DatasetsFacade, type DeleteRecordsResponse, type EmittedEvent, type EmittedEventsPage, type EndUserCap, type EndUserSpend, type EvaluateOptions, type EvaluationCost, EvaluationError, type EvaluationResult, type EvaluationStatus, EvaluationsApiError, EvaluationsFacade, EvaluatorCallError, EvaluatorError, type EvaluatorField, EvaluatorNotFoundError, type EvaluatorResponse, EvaluatorsApiError, EvaluatorsApiService, Experiment, ExperimentApiError, ExperimentError, type EvaluateOptions$1 as ExperimentEvaluateOptions, type EvaluationResult$1 as ExperimentEvaluationResult, type EvaluationStatus$1 as ExperimentEvaluationStatus, ExperimentInitError, type ExperimentInitOptions, type ExperimentRowResult, type ExperimentRunWithResults, ExperimentsFacade, FetchPolicy, type GatewayBudget, type GatewayBudgetPage, GatewayBudgetsApiError, GatewayBudgetsApiService, type GetDatasetOptions, type GetPromptOptions, IDEMPOTENCY_KEY_HEADER, IDEMPOTENT_REPLAY_HEADER, type IdempotentCreateOptions, LangWatch, LangWatchApiError, LangWatchHandledError, type ListDatasetsApiResponse, type ListDatasetsOptions, type ListRecordsApiResponse, type ListRecordsOptions, type ListTeamsResponse, type LogOptions, type MutationOptions, type PaginatedProjects, type PaginatedResponse, type Pagination, type Project, type ProjectWithServiceKey, ProjectsApiError, ProjectsApiService, type RunCallback, type RunContext, type RunOptions, type RunWithResultsOptions, type SpendEvent, type SpendEventStatus, SpendEventsApiError, SpendEventsApiService, type SpendEventsPage, type SpendFilterOptions, type SpendGroupBy, type SpendReplayResult, type SpendSummariesOptions, type SpendSummariesPage, type SpendSummaryRow, type SpendSummaryStatus, type TargetInfo, type TargetMetadata, TargetMetadataConflictError, type TargetType, type Team, type TeamMember, type TeamPagination, TeamsApiError, TeamsApiService, type UpdateDatasetOptions, type UpdateGatewayBudgetInput, type UpdateProjectInput, type UpdateVirtualKeyInput, type UpdateWebhookEndpointInput, type UploadResponse, type VerifyWebhookSignatureOptions, type VirtualKey, type VirtualKeyBudgetInput, type VirtualKeyPage, type VirtualKeyRoutingMode, type VirtualKeyScope, type VirtualKeyScopeType, type VirtualKeySpendSummary, type VirtualKeyWithSecret, VirtualKeysApiError, VirtualKeysApiService, WEBHOOK_DELIVERY_ID_HEADER, WEBHOOK_EVENT_ID_HEADER, WEBHOOK_SIGNATURE_DEFAULT_TOLERANCE_SECONDS, WEBHOOK_SIGNATURE_HEADER, type WebhookDeliveryPage, type WebhookDeliveryRecord, type WebhookEndpointHealth, type WebhookEndpointSummary, type WebhookEndpointWithSecret, type WebhookEventType, type WebhookSignatureFailureCode, WebhookSignatureVerificationError, type WebhookTestResult, WebhooksApiError, WebhooksApiService, isLangWatchHandledError, logger, verifyWebhookSignature };
4213
+ export { type ArchivedProject, type ArchivedTeam, type BatchCreateRecordsResponse, type BudgetOnBreach, type BudgetScopeKind, type BudgetWindow, ComparisonError, type ComparisonMetric, type ComparisonOptions, type ComparisonStatus, type ComparisonVerdict, type CreateDatasetOptions, type CreateEvaluatorBody, type CreateFromUploadResponse, type CreateGatewayBudgetInput, type CreateGatewayBudgetScope, type CreateLangWatchFetchOptions, type CreateProjectInput, type CreateVirtualKeyInput, type CreateWebhookEndpointInput, type Dataset, DatasetApiError, type DatasetColumnType, type DatasetEntry, DatasetError, type DatasetListItem, type DatasetMetadata, DatasetNotFoundError, DatasetPlanLimitError, type DatasetRecordResponse, DatasetValidationError, DatasetsFacade, type DeleteRecordsResponse, type EmittedEvent, type EmittedEventsPage, type EndUserCap, type EndUserSpend, type EvaluateOptions, type EvaluationCost, EvaluationError, type EvaluationResult, type EvaluationStatus, EvaluationsApiError, EvaluationsFacade, EvaluatorCallError, EvaluatorError, type EvaluatorField, EvaluatorNotFoundError, type EvaluatorResponse, EvaluatorsApiError, EvaluatorsApiService, Experiment, ExperimentApiError, ExperimentError, type EvaluateOptions$1 as ExperimentEvaluateOptions, type EvaluationResult$1 as ExperimentEvaluationResult, type EvaluationStatus$1 as ExperimentEvaluationStatus, ExperimentInitError, type ExperimentInitOptions, type ExperimentRowResult, type ExperimentRunWithResults, ExperimentsFacade, FetchPolicy, type GatewayBudget, type GatewayBudgetPage, GatewayBudgetsApiError, GatewayBudgetsApiService, type GetDatasetOptions, type GetPromptOptions, IDEMPOTENCY_KEY_HEADER, IDEMPOTENT_REPLAY_HEADER, type IdempotentCreateOptions, LangWatch, LangWatchApiError, type LangWatchFetch, LangWatchHandledError, LangWatchRedirectError, type ListDatasetsApiResponse, type ListDatasetsOptions, type ListRecordsApiResponse, type ListRecordsOptions, type ListTeamsResponse, type LogOptions, type MutationOptions, type PaginatedProjects, type PaginatedResponse, type Pagination, type Project, type ProjectWithServiceKey, ProjectsApiError, ProjectsApiService, type RunCallback, type RunContext, type RunOptions, type RunWithResultsOptions, type SpendEvent, type SpendEventStatus, SpendEventsApiError, SpendEventsApiService, type SpendEventsPage, type SpendFilterOptions, type SpendGroupBy, type SpendReplayResult, type SpendSummariesOptions, type SpendSummariesPage, type SpendSummaryRow, type SpendSummaryStatus, type TargetInfo, type TargetMetadata, TargetMetadataConflictError, type TargetType, type Team, type TeamMember, type TeamPagination, TeamsApiError, TeamsApiService, type UpdateDatasetOptions, type UpdateGatewayBudgetInput, type UpdateProjectInput, type UpdateVirtualKeyInput, type UpdateWebhookEndpointInput, type UploadResponse, type VerifyWebhookSignatureOptions, type VirtualKey, type VirtualKeyBudgetInput, type VirtualKeyPage, type VirtualKeyRoutingMode, type VirtualKeyScope, type VirtualKeyScopeType, type VirtualKeySpendSummary, type VirtualKeyWithSecret, VirtualKeysApiError, VirtualKeysApiService, WEBHOOK_DELIVERY_ID_HEADER, WEBHOOK_EVENT_ID_HEADER, WEBHOOK_SIGNATURE_DEFAULT_TOLERANCE_SECONDS, WEBHOOK_SIGNATURE_HEADER, type WebhookDeliveryPage, type WebhookDeliveryRecord, type WebhookEndpointHealth, type WebhookEndpointSummary, type WebhookEndpointWithSecret, type WebhookEventType, type WebhookSignatureFailureCode, WebhookSignatureVerificationError, type WebhookTestResult, WebhooksApiError, WebhooksApiService, createLangWatchFetch, isLangWatchHandledError, langwatchFetch, logger, verifyWebhookSignature };