deepline 0.2.28 → 0.2.30

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.
@@ -160,7 +160,7 @@ export const SDK_RELEASE = {
160
160
  // 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
161
161
  // exposed storage-dependent synchronous access. This deliberate minor
162
162
  // release keeps lazy paging semantics independent of row residency.
163
- version: '0.2.28',
163
+ version: '0.2.30',
164
164
  contracts: {
165
165
  api: {
166
166
  name: 'sdk-http-api',
@@ -467,6 +467,12 @@ export interface ToolSearchResult {
467
467
  export interface ToolMetadata extends ToolDefinition {
468
468
  /** Related async polling action, if this tool supports async execution. */
469
469
  asyncGetAction?: string | null;
470
+ /** Async job lifecycle: this tool starts it, then polling may lead to final rows. */
471
+ asyncFlow?: {
472
+ startAction: string;
473
+ pollActions: string[];
474
+ finishAction?: string | null;
475
+ } | null;
470
476
  /** Known failure scenarios and their expected handling. */
471
477
  failureMode?: Record<string, unknown> | null;
472
478
  /** Sanitized pricing model for describe metadata. Provider internal prices are intentionally omitted. */
@@ -61,7 +61,7 @@ export type TelemetryMetricEvent = TelemetryEventBase & {
61
61
 
62
62
  export type TelemetrySpanEvent = TelemetryEventBase & {
63
63
  telemetryKind: 'span';
64
- telemetryLevel: 'info' | 'error';
64
+ telemetryLevel: 'info' | 'warn' | 'error';
65
65
  spanDurationMs: number;
66
66
  spanOutcome: TelemetrySpanOutcome;
67
67
  errorType?: string;
@@ -69,9 +69,7 @@ export type TelemetrySpanEvent = TelemetryEventBase & {
69
69
  };
70
70
 
71
71
  export type TelemetryEvent =
72
- | TelemetryLogEvent
73
- | TelemetryMetricEvent
74
- | TelemetrySpanEvent;
72
+ TelemetryLogEvent | TelemetryMetricEvent | TelemetrySpanEvent;
75
73
 
76
74
  export type TelemetryAdapter = {
77
75
  emit(event: TelemetryEvent): void | Promise<void>;
@@ -79,6 +77,11 @@ export type TelemetryAdapter = {
79
77
 
80
78
  export type TelemetryEventOptions = { tag?: string };
81
79
 
80
+ export type TelemetryTimeErrorOptions = {
81
+ telemetryLevel: 'warn' | 'error';
82
+ fields?: TelemetryFields;
83
+ };
84
+
82
85
  export type Telemetry = {
83
86
  child(input: { component?: string; context?: TelemetryContext }): Telemetry;
84
87
  debug(
@@ -117,6 +120,7 @@ export type Telemetry = {
117
120
  span: string,
118
121
  fields: TelemetryFields | undefined,
119
122
  fn: () => Promise<T> | T,
123
+ options?: { onError?: (error: unknown) => TelemetryTimeErrorOptions },
120
124
  ): Promise<T>;
121
125
  };
122
126
 
@@ -269,9 +273,8 @@ export function createConsoleTelemetryAdapter(input?: {
269
273
  return {
270
274
  emit(event) {
271
275
  const line = JSON.stringify(event);
272
- if (event.telemetryKind === 'log') target[event.telemetryLevel](line);
273
- else if (event.telemetryKind === 'span' && event.spanOutcome === 'error')
274
- target.error(line);
276
+ if (event.telemetryKind === 'log' || event.telemetryKind === 'span')
277
+ target[event.telemetryLevel](line);
275
278
  else target.info(line);
276
279
  },
277
280
  };
@@ -384,7 +387,7 @@ export function createTelemetry(input: CreateTelemetryInput): Telemetry {
384
387
  metric('gauge', name, value, undefined, fields),
385
388
  distribution: (name, value, options) =>
386
389
  metric('distribution', name, value, options?.unit, options?.fields),
387
- async time(span, fields, fn) {
390
+ async time(span, fields, fn, options) {
388
391
  const startedAt = performance.now();
389
392
  try {
390
393
  const result = await fn();
@@ -398,11 +401,13 @@ export function createTelemetry(input: CreateTelemetryInput): Telemetry {
398
401
  });
399
402
  return result;
400
403
  } catch (error) {
404
+ const errorOptions = options?.onError?.(error);
401
405
  await publish({
402
406
  ...base(span),
403
407
  ...normalizeFields(fields),
408
+ ...normalizeFields(errorOptions?.fields),
404
409
  telemetryKind: 'span',
405
- telemetryLevel: 'error',
410
+ telemetryLevel: errorOptions?.telemetryLevel ?? 'error',
406
411
  spanDurationMs: performance.now() - startedAt,
407
412
  spanOutcome: 'error',
408
413
  ...errorFields(error),
package/dist/cli/index.js CHANGED
@@ -1044,7 +1044,7 @@ var SDK_RELEASE = {
1044
1044
  // 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
1045
1045
  // exposed storage-dependent synchronous access. This deliberate minor
1046
1046
  // release keeps lazy paging semantics independent of row residency.
1047
- version: "0.2.28",
1047
+ version: "0.2.30",
1048
1048
  contracts: {
1049
1049
  api: {
1050
1050
  name: "sdk-http-api",
@@ -1030,7 +1030,7 @@ var SDK_RELEASE = {
1030
1030
  // 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
1031
1031
  // exposed storage-dependent synchronous access. This deliberate minor
1032
1032
  // release keeps lazy paging semantics independent of row residency.
1033
- version: "0.2.28",
1033
+ version: "0.2.30",
1034
1034
  contracts: {
1035
1035
  api: {
1036
1036
  name: "sdk-http-api",
package/dist/index.d.mts CHANGED
@@ -535,6 +535,12 @@ interface ToolSearchResult {
535
535
  interface ToolMetadata extends ToolDefinition {
536
536
  /** Related async polling action, if this tool supports async execution. */
537
537
  asyncGetAction?: string | null;
538
+ /** Async job lifecycle: this tool starts it, then polling may lead to final rows. */
539
+ asyncFlow?: {
540
+ startAction: string;
541
+ pollActions: string[];
542
+ finishAction?: string | null;
543
+ } | null;
538
544
  /** Known failure scenarios and their expected handling. */
539
545
  failureMode?: Record<string, unknown> | null;
540
546
  /** Sanitized pricing model for describe metadata. Provider internal prices are intentionally omitted. */
package/dist/index.d.ts CHANGED
@@ -535,6 +535,12 @@ interface ToolSearchResult {
535
535
  interface ToolMetadata extends ToolDefinition {
536
536
  /** Related async polling action, if this tool supports async execution. */
537
537
  asyncGetAction?: string | null;
538
+ /** Async job lifecycle: this tool starts it, then polling may lead to final rows. */
539
+ asyncFlow?: {
540
+ startAction: string;
541
+ pollActions: string[];
542
+ finishAction?: string | null;
543
+ } | null;
538
544
  /** Known failure scenarios and their expected handling. */
539
545
  failureMode?: Record<string, unknown> | null;
540
546
  /** Sanitized pricing model for describe metadata. Provider internal prices are intentionally omitted. */
package/dist/index.js CHANGED
@@ -763,7 +763,7 @@ var SDK_RELEASE = {
763
763
  // 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
764
764
  // exposed storage-dependent synchronous access. This deliberate minor
765
765
  // release keeps lazy paging semantics independent of row residency.
766
- version: "0.2.28",
766
+ version: "0.2.30",
767
767
  contracts: {
768
768
  api: {
769
769
  name: "sdk-http-api",
package/dist/index.mjs CHANGED
@@ -689,7 +689,7 @@ var SDK_RELEASE = {
689
689
  // 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
690
690
  // exposed storage-dependent synchronous access. This deliberate minor
691
691
  // release keeps lazy paging semantics independent of row residency.
692
- version: "0.2.28",
692
+ version: "0.2.30",
693
693
  contracts: {
694
694
  api: {
695
695
  name: "sdk-http-api",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.2.28",
3
+ "version": "0.2.30",
4
4
  "description": "Deepline SDK + CLI — B2B data enrichment powered by durable cloud execution",
5
5
  "license": "MIT",
6
6
  "repository": {