deepline 0.1.63 → 0.1.64

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.
@@ -132,7 +132,9 @@ export function compileRequestsWithStrategy<TRequest>(input: {
132
132
  export async function executeWaterfallProviders<TRequest, TResult>(input: {
133
133
  providers: string[];
134
134
  getPendingRequests: () => TRequest[];
135
- getCachedResults: (provider: string) => Array<ChunkExecutionResult<TRequest, TResult>> | null;
135
+ getCachedResults: (
136
+ provider: string,
137
+ ) => Array<ChunkExecutionResult<TRequest, TResult>> | null;
136
138
  storeCachedResults: (
137
139
  provider: string,
138
140
  results: Array<ChunkExecutionResult<TRequest, TResult>>,
@@ -177,6 +179,11 @@ export async function executeWaterfallProviders<TRequest, TResult>(input: {
177
179
  }
178
180
  }
179
181
 
180
- export function resolveWaterfallToolId(provider: string, toolName: string): string {
181
- return toolName.startsWith(`${provider}_`) ? toolName : `${provider}_${toolName}`;
182
+ export function resolveWaterfallToolId(
183
+ provider: string,
184
+ toolName: string,
185
+ ): string {
186
+ return toolName.startsWith(`${provider}_`)
187
+ ? toolName
188
+ : `${provider}_${toolName}`;
182
189
  }
@@ -10,7 +10,10 @@ export type BatchCompileItem<TSingle extends object> = {
10
10
  payload: TSingle;
11
11
  };
12
12
 
13
- export type BatchCompileResult<TBatch extends object, TSingle extends object> = {
13
+ export type BatchCompileResult<
14
+ TBatch extends object,
15
+ TSingle extends object,
16
+ > = {
14
17
  batchOperation: string;
15
18
  batchPayload: TBatch;
16
19
  items: Array<BatchCompileItem<TSingle>>;
@@ -58,7 +61,10 @@ export type AnyBatchOperationStrategy = {
58
61
  batchOperation: string;
59
62
  kind: BatchStrategyKind;
60
63
  maxBatchSize: number;
61
- canBatchWith(left: Record<string, unknown>, right: Record<string, unknown>): boolean;
64
+ canBatchWith(
65
+ left: Record<string, unknown>,
66
+ right: Record<string, unknown>,
67
+ ): boolean;
62
68
  toBucketKey(payload: Record<string, unknown>): string;
63
69
  toItemKey(payload: Record<string, unknown>): string;
64
70
  compile(payloads: Record<string, unknown>[]): {
@@ -81,8 +87,13 @@ export type AnyBatchOperationStrategy = {
81
87
 
82
88
  export type BatchStrategyMap = Record<string, AnyBatchOperationStrategy>;
83
89
 
84
- type StrictBatchOperationStrategy =
85
- BatchOperationStrategy<Record<string, unknown>, Record<string, unknown>, object, unknown, unknown>;
90
+ type StrictBatchOperationStrategy = BatchOperationStrategy<
91
+ Record<string, unknown>,
92
+ Record<string, unknown>,
93
+ object,
94
+ unknown,
95
+ unknown
96
+ >;
86
97
 
87
98
  export function defineBatchStrategyMap<
88
99
  TStrategies extends Record<string, StrictBatchOperationStrategy>,
@@ -31,7 +31,8 @@ function resolveInternalCoordinatorToken(): string | null {
31
31
  // Read lazily so the helper is safe to import in environments without
32
32
  // env access (e.g. workerd build-time bundling).
33
33
  const fromEnv =
34
- (typeof process !== 'undefined' && process?.env?.DEEPLINE_INTERNAL_TOKEN?.trim()) ||
34
+ (typeof process !== 'undefined' &&
35
+ process?.env?.DEEPLINE_INTERNAL_TOKEN?.trim()) ||
35
36
  null;
36
37
  if (fromEnv) return fromEnv;
37
38
  if (!warnedAboutMissingInternalToken) {
@@ -109,10 +109,9 @@ const testRateLimitBatchStrategy: BatchOperationStrategy<
109
109
  },
110
110
  };
111
111
 
112
- export const DEFAULT_PLAY_RUNTIME_BATCH_STRATEGIES =
113
- defineBatchStrategyMap({
114
- test_rate_limit: testRateLimitBatchStrategy,
115
- });
112
+ export const DEFAULT_PLAY_RUNTIME_BATCH_STRATEGIES = defineBatchStrategyMap({
113
+ test_rate_limit: testRateLimitBatchStrategy,
114
+ });
116
115
 
117
116
  export function getDefaultPlayRuntimeBatchStrategy(
118
117
  operation: string | null | undefined,
@@ -27,9 +27,7 @@ export function isCloudflareDurableObjectCodeUpdatedError(
27
27
  );
28
28
  }
29
29
 
30
- export function normalizePlayRunFailure(
31
- error: unknown,
32
- ): PlayRunFailureDetails {
30
+ export function normalizePlayRunFailure(error: unknown): PlayRunFailureDetails {
33
31
  const cause = toErrorText(error);
34
32
  if (isCloudflareDurableObjectCodeUpdatedError(cause)) {
35
33
  return {
@@ -24,7 +24,10 @@ export class PlayStepLifecycleTracker {
24
24
 
25
25
  constructor(
26
26
  private readonly nodes: readonly PlayStepLifecycleNode[],
27
- private readonly getProgress: () => Record<string, PlayStepLifecycleProgress>,
27
+ private readonly getProgress: () => Record<
28
+ string,
29
+ PlayStepLifecycleProgress
30
+ >,
28
31
  private readonly emit: (event: PlayStepLifecycleEvent) => void,
29
32
  private readonly now: () => number = Date.now,
30
33
  ) {}
@@ -55,7 +55,10 @@ export function createToolBatchExecutor(
55
55
  ): ToolBatchExecutor {
56
56
  return {
57
57
  async executeToolBatch(request) {
58
- const providerBatchSize = Math.max(1, Math.floor(request.providerBatchSize));
58
+ const providerBatchSize = Math.max(
59
+ 1,
60
+ Math.floor(request.providerBatchSize),
61
+ );
59
62
  const batches = chunkToolBatchItems(request.items, providerBatchSize);
60
63
  const results: ToolBatchItemResult[] = [];
61
64
  for (let batchIndex = 0; batchIndex < batches.length; batchIndex += 1) {
@@ -172,8 +172,8 @@ function inferPreviewColumns<T>(rows: readonly T[]): string[] | undefined {
172
172
  export function isPlayDataset<T>(value: unknown): value is PlayDataset<T> {
173
173
  return Boolean(
174
174
  value &&
175
- typeof value === 'object' &&
176
- (value as Record<PropertyKey, unknown>)[PLAY_DATASET_BRAND] === true,
175
+ typeof value === 'object' &&
176
+ (value as Record<PropertyKey, unknown>)[PLAY_DATASET_BRAND] === true,
177
177
  );
178
178
  }
179
179
 
@@ -182,13 +182,13 @@ export function isSerializedPlayDataset<T>(
182
182
  ): value is SerializedPlayDataset<T> {
183
183
  return Boolean(
184
184
  value &&
185
- typeof value === 'object' &&
186
- !Array.isArray(value) &&
187
- (value as Record<string, unknown>).kind === 'dataset' &&
188
- typeof (value as Record<string, unknown>).datasetKind === 'string' &&
189
- typeof (value as Record<string, unknown>).datasetId === 'string' &&
190
- typeof (value as Record<string, unknown>).count === 'number' &&
191
- Array.isArray((value as Record<string, unknown>).preview),
185
+ typeof value === 'object' &&
186
+ !Array.isArray(value) &&
187
+ (value as Record<string, unknown>).kind === 'dataset' &&
188
+ typeof (value as Record<string, unknown>).datasetKind === 'string' &&
189
+ typeof (value as Record<string, unknown>).datasetId === 'string' &&
190
+ typeof (value as Record<string, unknown>).count === 'number' &&
191
+ Array.isArray((value as Record<string, unknown>).preview),
192
192
  );
193
193
  }
194
194
 
@@ -506,8 +506,7 @@ export function createPlayDataset<T>(
506
506
  tableNamespace: metadata?.tableNamespace ?? null,
507
507
  resolvers: {
508
508
  count: async () => materializedRows.length,
509
- peek: async (limit) =>
510
- materializedRows.slice(0, Math.max(0, limit)),
509
+ peek: async (limit) => materializedRows.slice(0, Math.max(0, limit)),
511
510
  materialize: async (limit) =>
512
511
  limit === undefined
513
512
  ? [...materializedRows]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.1.63",
3
+ "version": "0.1.64",
4
4
  "description": "Deepline SDK + CLI — B2B data enrichment powered by durable cloud execution",
5
5
  "license": "MIT",
6
6
  "repository": {