deepline 0.1.57 → 0.1.58

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.
@@ -0,0 +1,30 @@
1
+ /**
2
+ * GTM normalization primitives used by generated plays and user-authored
3
+ * prospecting notebooks.
4
+ *
5
+ * Keep these helpers small, deterministic, and schema-shaped. They are not an
6
+ * agent or a provider policy layer; they are the shared vocabulary for turning
7
+ * messy GTM rows into contact/account fields that Deepline plays understand.
8
+ * As provider enums and row conventions get sharper, improve them here so
9
+ * bootstrapped plays get better without carrying more generated glue.
10
+ *
11
+ * Do not add helpers that extract values from tool/play results. Result values
12
+ * should come from declared getters (`extractedValues.email.get()`) or declared
13
+ * play output fields (`result.email`). Helpers in this file normalize input
14
+ * rows and candidate entities, not opaque execution envelopes.
15
+ */
16
+ type GtmRow = Record<string, unknown>;
17
+ type GtmContact = GtmRow & {
18
+ first_name: string;
19
+ last_name: string;
20
+ domain: string;
21
+ company_name: string;
22
+ linkedin_url: string;
23
+ title: string;
24
+ email: string;
25
+ phone: string;
26
+ };
27
+ declare function normalizeGtmRows(value: unknown): GtmRow[];
28
+ declare function normalizeGtmContact(row: GtmRow): GtmContact;
29
+
30
+ export { type GtmContact, type GtmRow, normalizeGtmContact, normalizeGtmRows };
@@ -0,0 +1,30 @@
1
+ /**
2
+ * GTM normalization primitives used by generated plays and user-authored
3
+ * prospecting notebooks.
4
+ *
5
+ * Keep these helpers small, deterministic, and schema-shaped. They are not an
6
+ * agent or a provider policy layer; they are the shared vocabulary for turning
7
+ * messy GTM rows into contact/account fields that Deepline plays understand.
8
+ * As provider enums and row conventions get sharper, improve them here so
9
+ * bootstrapped plays get better without carrying more generated glue.
10
+ *
11
+ * Do not add helpers that extract values from tool/play results. Result values
12
+ * should come from declared getters (`extractedValues.email.get()`) or declared
13
+ * play output fields (`result.email`). Helpers in this file normalize input
14
+ * rows and candidate entities, not opaque execution envelopes.
15
+ */
16
+ type GtmRow = Record<string, unknown>;
17
+ type GtmContact = GtmRow & {
18
+ first_name: string;
19
+ last_name: string;
20
+ domain: string;
21
+ company_name: string;
22
+ linkedin_url: string;
23
+ title: string;
24
+ email: string;
25
+ phone: string;
26
+ };
27
+ declare function normalizeGtmRows(value: unknown): GtmRow[];
28
+ declare function normalizeGtmContact(row: GtmRow): GtmContact;
29
+
30
+ export { type GtmContact, type GtmRow, normalizeGtmContact, normalizeGtmRows };
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/helpers.ts
21
+ var helpers_exports = {};
22
+ __export(helpers_exports, {
23
+ normalizeGtmContact: () => normalizeGtmContact,
24
+ normalizeGtmRows: () => normalizeGtmRows
25
+ });
26
+ module.exports = __toCommonJS(helpers_exports);
27
+
28
+ // src/gtm.ts
29
+ function normalizeGtmRows(value) {
30
+ if (!value) return [];
31
+ if (Array.isArray(value)) return value.filter(isRecord);
32
+ if (isRecord(value)) {
33
+ for (const key of ["rows", "people", "contacts", "companies", "data"]) {
34
+ const nested = value[key];
35
+ if (Array.isArray(nested)) return nested.filter(isRecord);
36
+ }
37
+ }
38
+ return [];
39
+ }
40
+ function normalizeGtmContact(row) {
41
+ const first = pickString(row, [
42
+ "first_name",
43
+ "FIRST_NAME",
44
+ "firstName",
45
+ "first",
46
+ "firstname",
47
+ "First Name",
48
+ "given_name",
49
+ "givenName"
50
+ ]);
51
+ const last = pickString(row, [
52
+ "last_name",
53
+ "LAST_NAME",
54
+ "lastName",
55
+ "last",
56
+ "lastname",
57
+ "Last Name",
58
+ "family_name",
59
+ "familyName"
60
+ ]);
61
+ const full = pickString(row, [
62
+ "full_name",
63
+ "FULL_NAME",
64
+ "name",
65
+ "person_name"
66
+ ]);
67
+ const split = splitName(full);
68
+ return {
69
+ ...row,
70
+ first_name: first || split.first,
71
+ last_name: last || split.last,
72
+ domain: pickString(row, [
73
+ "domain",
74
+ "DOMAIN",
75
+ "company_domain",
76
+ "COMPANY_DOMAIN",
77
+ "companyDomain",
78
+ "website_domain",
79
+ "company website",
80
+ "Company Domain",
81
+ "Website",
82
+ "website"
83
+ ]),
84
+ company_name: pickString(row, [
85
+ "company_name",
86
+ "COMPANY_NAME",
87
+ "company",
88
+ "organization_name",
89
+ "account_name",
90
+ "Company",
91
+ "Account"
92
+ ]),
93
+ linkedin_url: pickString(row, [
94
+ "linkedin_url",
95
+ "LINKEDIN_URL",
96
+ "linkedin",
97
+ "person_linkedin_url",
98
+ "linkedin_profile",
99
+ "LinkedIn"
100
+ ]),
101
+ title: pickString(row, [
102
+ "title",
103
+ "TITLE",
104
+ "job_title",
105
+ "headline",
106
+ "Job Title"
107
+ ]),
108
+ email: pickString(row, [
109
+ "email",
110
+ "EMAIL",
111
+ "work_email",
112
+ "workEmail",
113
+ "Work Email"
114
+ ]),
115
+ phone: pickString(row, [
116
+ "phone",
117
+ "PHONE",
118
+ "phone_number",
119
+ "phoneNumber",
120
+ "mobile",
121
+ "Mobile Phone"
122
+ ])
123
+ };
124
+ }
125
+ function isRecord(value) {
126
+ return Boolean(value && typeof value === "object" && !Array.isArray(value));
127
+ }
128
+ function pickString(row, names) {
129
+ for (const name of names) {
130
+ const value = row[name];
131
+ if (typeof value === "string" && value.trim()) return value.trim();
132
+ }
133
+ return "";
134
+ }
135
+ function splitName(value) {
136
+ const parts = String(value || "").trim().split(/\s+/).filter(Boolean);
137
+ return { first: parts[0] ?? "", last: parts.slice(1).join(" ") };
138
+ }
139
+ // Annotate the CommonJS export names for ESM import in node:
140
+ 0 && (module.exports = {
141
+ normalizeGtmContact,
142
+ normalizeGtmRows
143
+ });
@@ -0,0 +1,115 @@
1
+ // src/gtm.ts
2
+ function normalizeGtmRows(value) {
3
+ if (!value) return [];
4
+ if (Array.isArray(value)) return value.filter(isRecord);
5
+ if (isRecord(value)) {
6
+ for (const key of ["rows", "people", "contacts", "companies", "data"]) {
7
+ const nested = value[key];
8
+ if (Array.isArray(nested)) return nested.filter(isRecord);
9
+ }
10
+ }
11
+ return [];
12
+ }
13
+ function normalizeGtmContact(row) {
14
+ const first = pickString(row, [
15
+ "first_name",
16
+ "FIRST_NAME",
17
+ "firstName",
18
+ "first",
19
+ "firstname",
20
+ "First Name",
21
+ "given_name",
22
+ "givenName"
23
+ ]);
24
+ const last = pickString(row, [
25
+ "last_name",
26
+ "LAST_NAME",
27
+ "lastName",
28
+ "last",
29
+ "lastname",
30
+ "Last Name",
31
+ "family_name",
32
+ "familyName"
33
+ ]);
34
+ const full = pickString(row, [
35
+ "full_name",
36
+ "FULL_NAME",
37
+ "name",
38
+ "person_name"
39
+ ]);
40
+ const split = splitName(full);
41
+ return {
42
+ ...row,
43
+ first_name: first || split.first,
44
+ last_name: last || split.last,
45
+ domain: pickString(row, [
46
+ "domain",
47
+ "DOMAIN",
48
+ "company_domain",
49
+ "COMPANY_DOMAIN",
50
+ "companyDomain",
51
+ "website_domain",
52
+ "company website",
53
+ "Company Domain",
54
+ "Website",
55
+ "website"
56
+ ]),
57
+ company_name: pickString(row, [
58
+ "company_name",
59
+ "COMPANY_NAME",
60
+ "company",
61
+ "organization_name",
62
+ "account_name",
63
+ "Company",
64
+ "Account"
65
+ ]),
66
+ linkedin_url: pickString(row, [
67
+ "linkedin_url",
68
+ "LINKEDIN_URL",
69
+ "linkedin",
70
+ "person_linkedin_url",
71
+ "linkedin_profile",
72
+ "LinkedIn"
73
+ ]),
74
+ title: pickString(row, [
75
+ "title",
76
+ "TITLE",
77
+ "job_title",
78
+ "headline",
79
+ "Job Title"
80
+ ]),
81
+ email: pickString(row, [
82
+ "email",
83
+ "EMAIL",
84
+ "work_email",
85
+ "workEmail",
86
+ "Work Email"
87
+ ]),
88
+ phone: pickString(row, [
89
+ "phone",
90
+ "PHONE",
91
+ "phone_number",
92
+ "phoneNumber",
93
+ "mobile",
94
+ "Mobile Phone"
95
+ ])
96
+ };
97
+ }
98
+ function isRecord(value) {
99
+ return Boolean(value && typeof value === "object" && !Array.isArray(value));
100
+ }
101
+ function pickString(row, names) {
102
+ for (const name of names) {
103
+ const value = row[name];
104
+ if (typeof value === "string" && value.trim()) return value.trim();
105
+ }
106
+ return "";
107
+ }
108
+ function splitName(value) {
109
+ const parts = String(value || "").trim().split(/\s+/).filter(Boolean);
110
+ return { first: parts[0] ?? "", last: parts.slice(1).join(" ") };
111
+ }
112
+ export {
113
+ normalizeGtmContact,
114
+ normalizeGtmRows
115
+ };
package/dist/index.d.mts CHANGED
@@ -160,6 +160,33 @@ type PlayCompilerManifest = {
160
160
  importedPlayDependencies: PlayCompilerDependencyManifest[];
161
161
  };
162
162
 
163
+ declare const DEEPLINE_TOOL_CATEGORIES: readonly ["company_search", "people_search", "people_enrich", "email_finder", "email_verify", "phone_finder", "phone_verify", "identity_resolution", "reverse_lookup", "enrichment", "batch", "premium", "free"];
164
+ type DeeplineToolCategory = (typeof DEEPLINE_TOOL_CATEGORIES)[number] | (string & {});
165
+ declare const PLAY_BOOTSTRAP_TEMPLATES: readonly ["people-list", "company-list", "people-email", "people-phone", "company-people", "company-people-email", "company-people-phone"];
166
+ type PlayBootstrapTemplate = (typeof PLAY_BOOTSTRAP_TEMPLATES)[number];
167
+ declare const PLAY_BOOTSTRAP_SOURCE_KINDS: readonly ["csv", "play", "provider", "providers"];
168
+ declare const PLAY_BOOTSTRAP_STAGE_KINDS: readonly ["play", "provider", "providers"];
169
+ declare const PLAY_BOOTSTRAP_FINDER_KINDS: readonly ["email_finder", "phone_finder"];
170
+ type PlayBootstrapFinderKind = (typeof PLAY_BOOTSTRAP_FINDER_KINDS)[number];
171
+ type PlayBootstrapEntityKind = 'company' | 'contact' | 'email' | 'phone' | 'unknown';
172
+ declare const PLAY_BOOTSTRAP_COMPANY_PROVIDER_CATEGORY: "company_search";
173
+ declare const PLAY_BOOTSTRAP_PEOPLE_PROVIDER_CATEGORY: "people_search";
174
+ declare const PLAY_BOOTSTRAP_PROVIDER_CATEGORY_BY_FINDER: {
175
+ readonly email_finder: "email_finder";
176
+ readonly phone_finder: "phone_finder";
177
+ };
178
+ declare const PLAY_BOOTSTRAP_OUTPUT_FIELD_BY_FINDER: {
179
+ readonly email_finder: "email";
180
+ readonly phone_finder: "phone";
181
+ };
182
+ declare const PLAY_BOOTSTRAP_CONTACT_FIELDS: readonly ["first_name", "last_name", "domain", "company_name", "linkedin_url", "title", "email", "phone"];
183
+ declare const PLAY_BOOTSTRAP_COMPANY_FIELDS: readonly ["domain", "company_domain", "company_name", "linkedin_url", "website"];
184
+ declare function isPlayBootstrapFinderKind(value: string): value is PlayBootstrapFinderKind;
185
+ declare function isPlayBootstrapTemplate(value: string): value is PlayBootstrapTemplate;
186
+ declare function formatPlayBootstrapFinderKinds(): string;
187
+ declare function formatPlayBootstrapTemplates(): string;
188
+ declare function formatPlayBootstrapFinderKindsForSentence(): string;
189
+
163
190
  /**
164
191
  * Options for constructing a {@link DeeplineClient} or connecting via {@link Deepline.connect}.
165
192
  *
@@ -237,19 +264,7 @@ interface ToolPricingSummary {
237
264
  /** Additional user-facing pricing notes. */
238
265
  details: string[];
239
266
  }
240
- /**
241
- * Summary definition of a tool, returned by {@link DeeplineClient.listTools}.
242
- *
243
- * Contains everything needed to discover, describe, and call a tool.
244
- *
245
- * @example
246
- * ```typescript
247
- * const tools = await client.listTools();
248
- * for (const tool of tools) {
249
- * console.log(`${tool.toolId} (${tool.provider}): ${tool.description}`);
250
- * }
251
- * ```
252
- */
267
+
253
268
  interface ToolDefinition {
254
269
  /** Unique tool identifier used in API calls (e.g. `"apollo_people_search"`). */
255
270
  toolId: string;
@@ -260,7 +275,7 @@ interface ToolDefinition {
260
275
  /** What this tool does — suitable for LLM tool descriptions. */
261
276
  description: string;
262
277
  /** Categorization tags (e.g. `["people", "enrichment"]`). */
263
- categories: string[];
278
+ categories: DeeplineToolCategory[];
264
279
  /** Operation slug within the provider. */
265
280
  operation?: string;
266
281
  /** Normalized operation identifier. */
@@ -1859,7 +1874,8 @@ type ToolResultExtractorDescriptor = {
1859
1874
  type ToolResultTargetAccessor<T = unknown> = ToolResultTargetMetadata & {
1860
1875
  get(): T | null;
1861
1876
  };
1862
- type ToolResultListAccessor<T = Record<string, unknown>> = ToolResultListMetadata & {
1877
+ type ToolResultListAccessor<T = Record<string, unknown>, TKey extends string = string> = Omit<ToolResultListMetadata, 'keys'> & {
1878
+ keys: Partial<Record<TKey, string>> & Record<string, string>;
1863
1879
  get(): T[];
1864
1880
  };
1865
1881
  type ToolResponseEnvelope<TData = unknown, TMeta = Record<string, unknown>> = {
@@ -2277,26 +2293,10 @@ interface DeeplinePlayRuntimeContext {
2277
2293
  bodyText: string;
2278
2294
  json: unknown | null;
2279
2295
  }>;
2280
- /**
2281
- * Invoke another registered or file-backed play as a child workflow.
2282
- *
2283
- * Use this for real composition boundaries, especially when a fitting
2284
- * scalar prebuilt play already encodes provider order, fallbacks,
2285
- * normalization, and no-result behavior. Do not invoke plays through
2286
- * `ctx.tools.execute`; tools and plays are separate namespaces.
2287
- *
2288
- * `key` is the stable child-call identity for idempotency and traceability.
2289
- *
2290
- * @param key - Child call id.
2291
- * @param playRef - Play name or handle.
2292
- * @param input - Child input.
2293
- * @param options - Run options.
2294
- * @returns Child play output.
2295
- */
2296
- runPlay(key: string, playRef: string | PlayReferenceLike, input: Record<string, unknown>, options: {
2296
+ runPlay<TOutput = unknown>(key: string, playRef: string | PlayReferenceLike, input: Record<string, unknown>, options: {
2297
2297
  description?: string;
2298
2298
  staleAfterSeconds?: number;
2299
- }): Promise<Record<string, unknown>>;
2299
+ }): Promise<TOutput>;
2300
2300
  /**
2301
2301
  * Emit a log line visible in `play tail` and the play's progress logs.
2302
2302
  *
@@ -2910,4 +2910,4 @@ declare function writeCsvOutputFile(rows: Array<Record<string, unknown>>, stem:
2910
2910
  */
2911
2911
  declare function extractSummaryFields(payload: unknown): Record<string, Scalar>;
2912
2912
 
2913
- export { AuthError, type ClearPlayHistoryRequest, type ClearPlayHistoryResult, type ColumnMap, type ConditionalStepResolver, ConfigError, type CsvInput, Deepline, DeeplineClient, type DeeplineClientOptions, DeeplineContext, DeeplineError, type DeeplineNamedPlay, type DeeplinePlayRuntimeContext, type DefinePlayConfig, type DefinedPlay, type FileInput, type LiveEventEnvelope, type MapStepBuilder, type MapStepResolver, PROD_URL, type PlayBindings, type PlayDataset, type PlayDatasetInput, type PlayInputContract, type PlayJob, type PlayListItem, type PlayLiveEvent, type PlayRevisionSummary, type PlayRunResult, type PlayRunStart, type PlayStatus, type PlayStepProgramStep, type PrebuiltPlayRef, type PublishPlayVersionRequest, type PublishPlayVersionResult, RateLimitError, type ResolvedConfig, SDK_API_CONTRACT, SDK_VERSION, type StartPlayRunRequest, type StepProgram, type StepProgramResolver, type StepResolver, type ToolDefinition, type ToolExecuteResult, type ToolExecution, type ToolMetadata, defineInput, definePlay, defineWorkflow, extractSummaryFields, getDefinedPlayMetadata, resolveConfig, steps, tryConvertToList, when, writeCsvOutputFile, writeJsonOutputFile };
2913
+ export { AuthError, type ClearPlayHistoryRequest, type ClearPlayHistoryResult, type ColumnMap, type ConditionalStepResolver, ConfigError, type CsvInput, DEEPLINE_TOOL_CATEGORIES, Deepline, DeeplineClient, type DeeplineClientOptions, DeeplineContext, DeeplineError, type DeeplineNamedPlay, type DeeplinePlayRuntimeContext, type DeeplineToolCategory, type DefinePlayConfig, type DefinedPlay, type FileInput, type LiveEventEnvelope, type MapStepBuilder, type MapStepResolver, PLAY_BOOTSTRAP_COMPANY_FIELDS, PLAY_BOOTSTRAP_COMPANY_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_CONTACT_FIELDS, PLAY_BOOTSTRAP_FINDER_KINDS, PLAY_BOOTSTRAP_OUTPUT_FIELD_BY_FINDER, PLAY_BOOTSTRAP_PEOPLE_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_PROVIDER_CATEGORY_BY_FINDER, PLAY_BOOTSTRAP_SOURCE_KINDS, PLAY_BOOTSTRAP_STAGE_KINDS, PLAY_BOOTSTRAP_TEMPLATES, PROD_URL, type PlayBindings, type PlayBootstrapEntityKind, type PlayBootstrapFinderKind, type PlayDataset, type PlayDatasetInput, type PlayInputContract, type PlayJob, type PlayListItem, type PlayLiveEvent, type PlayRevisionSummary, type PlayRunResult, type PlayRunStart, type PlayStatus, type PlayStepProgramStep, type PrebuiltPlayRef, type PublishPlayVersionRequest, type PublishPlayVersionResult, RateLimitError, type ResolvedConfig, SDK_API_CONTRACT, SDK_VERSION, type StartPlayRunRequest, type StepProgram, type StepProgramResolver, type StepResolver, type ToolDefinition, type ToolExecuteResult, type ToolExecution, type ToolMetadata, defineInput, definePlay, defineWorkflow, extractSummaryFields, formatPlayBootstrapFinderKinds, formatPlayBootstrapFinderKindsForSentence, formatPlayBootstrapTemplates, getDefinedPlayMetadata, isPlayBootstrapFinderKind, isPlayBootstrapTemplate, resolveConfig, steps, tryConvertToList, when, writeCsvOutputFile, writeJsonOutputFile };
package/dist/index.d.ts CHANGED
@@ -160,6 +160,33 @@ type PlayCompilerManifest = {
160
160
  importedPlayDependencies: PlayCompilerDependencyManifest[];
161
161
  };
162
162
 
163
+ declare const DEEPLINE_TOOL_CATEGORIES: readonly ["company_search", "people_search", "people_enrich", "email_finder", "email_verify", "phone_finder", "phone_verify", "identity_resolution", "reverse_lookup", "enrichment", "batch", "premium", "free"];
164
+ type DeeplineToolCategory = (typeof DEEPLINE_TOOL_CATEGORIES)[number] | (string & {});
165
+ declare const PLAY_BOOTSTRAP_TEMPLATES: readonly ["people-list", "company-list", "people-email", "people-phone", "company-people", "company-people-email", "company-people-phone"];
166
+ type PlayBootstrapTemplate = (typeof PLAY_BOOTSTRAP_TEMPLATES)[number];
167
+ declare const PLAY_BOOTSTRAP_SOURCE_KINDS: readonly ["csv", "play", "provider", "providers"];
168
+ declare const PLAY_BOOTSTRAP_STAGE_KINDS: readonly ["play", "provider", "providers"];
169
+ declare const PLAY_BOOTSTRAP_FINDER_KINDS: readonly ["email_finder", "phone_finder"];
170
+ type PlayBootstrapFinderKind = (typeof PLAY_BOOTSTRAP_FINDER_KINDS)[number];
171
+ type PlayBootstrapEntityKind = 'company' | 'contact' | 'email' | 'phone' | 'unknown';
172
+ declare const PLAY_BOOTSTRAP_COMPANY_PROVIDER_CATEGORY: "company_search";
173
+ declare const PLAY_BOOTSTRAP_PEOPLE_PROVIDER_CATEGORY: "people_search";
174
+ declare const PLAY_BOOTSTRAP_PROVIDER_CATEGORY_BY_FINDER: {
175
+ readonly email_finder: "email_finder";
176
+ readonly phone_finder: "phone_finder";
177
+ };
178
+ declare const PLAY_BOOTSTRAP_OUTPUT_FIELD_BY_FINDER: {
179
+ readonly email_finder: "email";
180
+ readonly phone_finder: "phone";
181
+ };
182
+ declare const PLAY_BOOTSTRAP_CONTACT_FIELDS: readonly ["first_name", "last_name", "domain", "company_name", "linkedin_url", "title", "email", "phone"];
183
+ declare const PLAY_BOOTSTRAP_COMPANY_FIELDS: readonly ["domain", "company_domain", "company_name", "linkedin_url", "website"];
184
+ declare function isPlayBootstrapFinderKind(value: string): value is PlayBootstrapFinderKind;
185
+ declare function isPlayBootstrapTemplate(value: string): value is PlayBootstrapTemplate;
186
+ declare function formatPlayBootstrapFinderKinds(): string;
187
+ declare function formatPlayBootstrapTemplates(): string;
188
+ declare function formatPlayBootstrapFinderKindsForSentence(): string;
189
+
163
190
  /**
164
191
  * Options for constructing a {@link DeeplineClient} or connecting via {@link Deepline.connect}.
165
192
  *
@@ -237,19 +264,7 @@ interface ToolPricingSummary {
237
264
  /** Additional user-facing pricing notes. */
238
265
  details: string[];
239
266
  }
240
- /**
241
- * Summary definition of a tool, returned by {@link DeeplineClient.listTools}.
242
- *
243
- * Contains everything needed to discover, describe, and call a tool.
244
- *
245
- * @example
246
- * ```typescript
247
- * const tools = await client.listTools();
248
- * for (const tool of tools) {
249
- * console.log(`${tool.toolId} (${tool.provider}): ${tool.description}`);
250
- * }
251
- * ```
252
- */
267
+
253
268
  interface ToolDefinition {
254
269
  /** Unique tool identifier used in API calls (e.g. `"apollo_people_search"`). */
255
270
  toolId: string;
@@ -260,7 +275,7 @@ interface ToolDefinition {
260
275
  /** What this tool does — suitable for LLM tool descriptions. */
261
276
  description: string;
262
277
  /** Categorization tags (e.g. `["people", "enrichment"]`). */
263
- categories: string[];
278
+ categories: DeeplineToolCategory[];
264
279
  /** Operation slug within the provider. */
265
280
  operation?: string;
266
281
  /** Normalized operation identifier. */
@@ -1859,7 +1874,8 @@ type ToolResultExtractorDescriptor = {
1859
1874
  type ToolResultTargetAccessor<T = unknown> = ToolResultTargetMetadata & {
1860
1875
  get(): T | null;
1861
1876
  };
1862
- type ToolResultListAccessor<T = Record<string, unknown>> = ToolResultListMetadata & {
1877
+ type ToolResultListAccessor<T = Record<string, unknown>, TKey extends string = string> = Omit<ToolResultListMetadata, 'keys'> & {
1878
+ keys: Partial<Record<TKey, string>> & Record<string, string>;
1863
1879
  get(): T[];
1864
1880
  };
1865
1881
  type ToolResponseEnvelope<TData = unknown, TMeta = Record<string, unknown>> = {
@@ -2277,26 +2293,10 @@ interface DeeplinePlayRuntimeContext {
2277
2293
  bodyText: string;
2278
2294
  json: unknown | null;
2279
2295
  }>;
2280
- /**
2281
- * Invoke another registered or file-backed play as a child workflow.
2282
- *
2283
- * Use this for real composition boundaries, especially when a fitting
2284
- * scalar prebuilt play already encodes provider order, fallbacks,
2285
- * normalization, and no-result behavior. Do not invoke plays through
2286
- * `ctx.tools.execute`; tools and plays are separate namespaces.
2287
- *
2288
- * `key` is the stable child-call identity for idempotency and traceability.
2289
- *
2290
- * @param key - Child call id.
2291
- * @param playRef - Play name or handle.
2292
- * @param input - Child input.
2293
- * @param options - Run options.
2294
- * @returns Child play output.
2295
- */
2296
- runPlay(key: string, playRef: string | PlayReferenceLike, input: Record<string, unknown>, options: {
2296
+ runPlay<TOutput = unknown>(key: string, playRef: string | PlayReferenceLike, input: Record<string, unknown>, options: {
2297
2297
  description?: string;
2298
2298
  staleAfterSeconds?: number;
2299
- }): Promise<Record<string, unknown>>;
2299
+ }): Promise<TOutput>;
2300
2300
  /**
2301
2301
  * Emit a log line visible in `play tail` and the play's progress logs.
2302
2302
  *
@@ -2910,4 +2910,4 @@ declare function writeCsvOutputFile(rows: Array<Record<string, unknown>>, stem:
2910
2910
  */
2911
2911
  declare function extractSummaryFields(payload: unknown): Record<string, Scalar>;
2912
2912
 
2913
- export { AuthError, type ClearPlayHistoryRequest, type ClearPlayHistoryResult, type ColumnMap, type ConditionalStepResolver, ConfigError, type CsvInput, Deepline, DeeplineClient, type DeeplineClientOptions, DeeplineContext, DeeplineError, type DeeplineNamedPlay, type DeeplinePlayRuntimeContext, type DefinePlayConfig, type DefinedPlay, type FileInput, type LiveEventEnvelope, type MapStepBuilder, type MapStepResolver, PROD_URL, type PlayBindings, type PlayDataset, type PlayDatasetInput, type PlayInputContract, type PlayJob, type PlayListItem, type PlayLiveEvent, type PlayRevisionSummary, type PlayRunResult, type PlayRunStart, type PlayStatus, type PlayStepProgramStep, type PrebuiltPlayRef, type PublishPlayVersionRequest, type PublishPlayVersionResult, RateLimitError, type ResolvedConfig, SDK_API_CONTRACT, SDK_VERSION, type StartPlayRunRequest, type StepProgram, type StepProgramResolver, type StepResolver, type ToolDefinition, type ToolExecuteResult, type ToolExecution, type ToolMetadata, defineInput, definePlay, defineWorkflow, extractSummaryFields, getDefinedPlayMetadata, resolveConfig, steps, tryConvertToList, when, writeCsvOutputFile, writeJsonOutputFile };
2913
+ export { AuthError, type ClearPlayHistoryRequest, type ClearPlayHistoryResult, type ColumnMap, type ConditionalStepResolver, ConfigError, type CsvInput, DEEPLINE_TOOL_CATEGORIES, Deepline, DeeplineClient, type DeeplineClientOptions, DeeplineContext, DeeplineError, type DeeplineNamedPlay, type DeeplinePlayRuntimeContext, type DeeplineToolCategory, type DefinePlayConfig, type DefinedPlay, type FileInput, type LiveEventEnvelope, type MapStepBuilder, type MapStepResolver, PLAY_BOOTSTRAP_COMPANY_FIELDS, PLAY_BOOTSTRAP_COMPANY_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_CONTACT_FIELDS, PLAY_BOOTSTRAP_FINDER_KINDS, PLAY_BOOTSTRAP_OUTPUT_FIELD_BY_FINDER, PLAY_BOOTSTRAP_PEOPLE_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_PROVIDER_CATEGORY_BY_FINDER, PLAY_BOOTSTRAP_SOURCE_KINDS, PLAY_BOOTSTRAP_STAGE_KINDS, PLAY_BOOTSTRAP_TEMPLATES, PROD_URL, type PlayBindings, type PlayBootstrapEntityKind, type PlayBootstrapFinderKind, type PlayDataset, type PlayDatasetInput, type PlayInputContract, type PlayJob, type PlayListItem, type PlayLiveEvent, type PlayRevisionSummary, type PlayRunResult, type PlayRunStart, type PlayStatus, type PlayStepProgramStep, type PrebuiltPlayRef, type PublishPlayVersionRequest, type PublishPlayVersionResult, RateLimitError, type ResolvedConfig, SDK_API_CONTRACT, SDK_VERSION, type StartPlayRunRequest, type StepProgram, type StepProgramResolver, type StepResolver, type ToolDefinition, type ToolExecuteResult, type ToolExecution, type ToolMetadata, defineInput, definePlay, defineWorkflow, extractSummaryFields, formatPlayBootstrapFinderKinds, formatPlayBootstrapFinderKindsForSentence, formatPlayBootstrapTemplates, getDefinedPlayMetadata, isPlayBootstrapFinderKind, isPlayBootstrapTemplate, resolveConfig, steps, tryConvertToList, when, writeCsvOutputFile, writeJsonOutputFile };