@dench.com/cli 3.12.30-staging.1461 → 3.12.32-staging.1473
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.
- package/app-sdk.d.ts +412 -3
- package/crm-columns.ts +982 -0
- package/crm.ts +40 -5
- package/dench.ts +15 -9
- package/environments.ts +48 -8
- package/leads.ts +204 -40
- package/lib/api-schemas.ts +12 -1
- package/lib/app-sdk-catalog.generated.ts +18 -1
- package/lib/app-sdk-surface.ts +3 -0
- package/lib/command-registry.ts +655 -2
- package/lib/references.generated.json +6 -6
- package/members.ts +7 -6
- package/package.json +2 -1
package/leads.ts
CHANGED
|
@@ -74,6 +74,12 @@ const api = {
|
|
|
74
74
|
resolveCompanyList: makeFunctionReference<"action">(
|
|
75
75
|
"functions/companyLists:resolveCompanyList",
|
|
76
76
|
),
|
|
77
|
+
listStagingLists: makeFunctionReference<"query">(
|
|
78
|
+
"functions/crm/columns:listStagingLists",
|
|
79
|
+
),
|
|
80
|
+
createStagingList: makeFunctionReference<"mutation">(
|
|
81
|
+
"functions/crm/columns:createStagingList",
|
|
82
|
+
),
|
|
77
83
|
};
|
|
78
84
|
|
|
79
85
|
const ENRICHMENT_FILTERS = [
|
|
@@ -209,6 +215,8 @@ type LeadsFindFlags = {
|
|
|
209
215
|
foundedYears?: LeadsFindRange;
|
|
210
216
|
keywords?: string;
|
|
211
217
|
companyList?: string;
|
|
218
|
+
fitOnly?: boolean;
|
|
219
|
+
intoList?: string;
|
|
212
220
|
exactMatch?: boolean;
|
|
213
221
|
limit?: number;
|
|
214
222
|
pageToken?: string;
|
|
@@ -268,6 +276,8 @@ function parseLeadsFindFlags(args: string[]): LeadsFindFlags {
|
|
|
268
276
|
foundedYears: rangeFlag(args, "--founded-years"),
|
|
269
277
|
keywords: getFlag(args, "--keywords"),
|
|
270
278
|
companyList: getFlag(args, "--company-list"),
|
|
279
|
+
fitOnly: hasFlag(args, "--fit-only") ? true : undefined,
|
|
280
|
+
intoList: getFlag(args, "--into-list"),
|
|
271
281
|
// Free-text filters default to substring matching. `--exact` restores
|
|
272
282
|
// whole-string matching for a caller who wants the narrow list.
|
|
273
283
|
exactMatch: hasFlag(args, "--exact") ? true : undefined,
|
|
@@ -278,9 +288,18 @@ function parseLeadsFindFlags(args: string[]): LeadsFindFlags {
|
|
|
278
288
|
assertNoUnknownFlags(args, "leads find");
|
|
279
289
|
const hasFilter = Object.entries(flags).some(
|
|
280
290
|
([key, value]) =>
|
|
281
|
-
![
|
|
282
|
-
|
|
291
|
+
![
|
|
292
|
+
"limit",
|
|
293
|
+
"pageToken",
|
|
294
|
+
"name",
|
|
295
|
+
"exactMatch",
|
|
296
|
+
"fitOnly",
|
|
297
|
+
"intoList",
|
|
298
|
+
].includes(key) && value !== undefined,
|
|
283
299
|
);
|
|
300
|
+
if (flags.fitOnly && !flags.companyList) {
|
|
301
|
+
throw new FindCliError("--fit-only requires --company-list <list>");
|
|
302
|
+
}
|
|
284
303
|
if (!hasFilter) {
|
|
285
304
|
throw new FindCliError(
|
|
286
305
|
"dench leads find requires at least one of --titles, --locations, --company-domain, --keywords, --industries, --seniorities (or any other filter flag — run `dench leads help`)",
|
|
@@ -435,52 +454,145 @@ function asArray(value: unknown): unknown[] {
|
|
|
435
454
|
return Array.isArray(value) ? value : [];
|
|
436
455
|
}
|
|
437
456
|
|
|
438
|
-
/* ─── Company-list filter (--company-list) ─── */
|
|
457
|
+
/* ─── Company-list filter (--company-list) & list seeding (--into-list) ─── */
|
|
439
458
|
|
|
440
459
|
type ResolvedCompanyList = {
|
|
441
|
-
source: "artifact" | "view";
|
|
460
|
+
source: "artifact" | "view" | "entries" | "fit_checks";
|
|
442
461
|
title: string;
|
|
443
462
|
domains: string[];
|
|
444
463
|
names: string[];
|
|
445
464
|
totalCompanies: number;
|
|
446
465
|
truncated: boolean;
|
|
466
|
+
skippedNoDomain?: number;
|
|
467
|
+
objectName?: string;
|
|
468
|
+
fitOnly?: boolean;
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
type StagingListRow = {
|
|
472
|
+
name: string;
|
|
473
|
+
displayName?: string;
|
|
474
|
+
stagingEntityKind?: "company" | "person";
|
|
447
475
|
};
|
|
448
476
|
|
|
449
477
|
/** Convex document ids are long lowercase alphanumeric strings. */
|
|
450
478
|
const COMPANY_LIST_ID_RE = /^[a-z0-9]{25,40}$/;
|
|
451
479
|
|
|
480
|
+
async function findStagingListByRef(
|
|
481
|
+
ctx: FindCliContext,
|
|
482
|
+
ref: string,
|
|
483
|
+
): Promise<StagingListRow | null> {
|
|
484
|
+
try {
|
|
485
|
+
const lists = (await callQuery(
|
|
486
|
+
ctx,
|
|
487
|
+
api.listStagingLists,
|
|
488
|
+
{},
|
|
489
|
+
)) as StagingListRow[];
|
|
490
|
+
const lower = ref.toLowerCase();
|
|
491
|
+
return (
|
|
492
|
+
lists.find(
|
|
493
|
+
(item) =>
|
|
494
|
+
item.name.toLowerCase() === lower ||
|
|
495
|
+
(item.displayName && item.displayName.toLowerCase() === lower),
|
|
496
|
+
) ?? null
|
|
497
|
+
);
|
|
498
|
+
} catch {
|
|
499
|
+
return null;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
async function resolveOrCreateStagingList(
|
|
504
|
+
ctx: FindCliContext,
|
|
505
|
+
nameOrSlug: string,
|
|
506
|
+
entityKind: "company" | "person",
|
|
507
|
+
): Promise<{ objectName: string; displayName: string; created: boolean }> {
|
|
508
|
+
const trimmed = nameOrSlug.trim();
|
|
509
|
+
if (!trimmed) {
|
|
510
|
+
throw new FindCliError("--into-list requires a list name or slug");
|
|
511
|
+
}
|
|
512
|
+
const existing = await findStagingListByRef(ctx, trimmed);
|
|
513
|
+
if (existing) {
|
|
514
|
+
return {
|
|
515
|
+
objectName: existing.name,
|
|
516
|
+
displayName: existing.displayName ?? existing.name,
|
|
517
|
+
created: false,
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
const created = (await ctx.convex.mutation(api.createStagingList, {
|
|
521
|
+
displayName: trimmed,
|
|
522
|
+
entityKind,
|
|
523
|
+
...(ctx.sessionToken ? { sessionToken: ctx.sessionToken } : {}),
|
|
524
|
+
} as never)) as { objectName: string; displayName: string };
|
|
525
|
+
return {
|
|
526
|
+
objectName: created.objectName,
|
|
527
|
+
displayName: created.displayName,
|
|
528
|
+
created: true,
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
|
|
452
532
|
/**
|
|
453
|
-
* `--company-list` accepts
|
|
454
|
-
*
|
|
455
|
-
*
|
|
456
|
-
*
|
|
533
|
+
* `--company-list` accepts:
|
|
534
|
+
* - a list slug or display name (with optional `--fit-only` to target Fit Check matches)
|
|
535
|
+
* - a saved-search artifact id (from `dench companies find` / `dench lists`)
|
|
536
|
+
* - a Company saved-view name
|
|
457
537
|
*/
|
|
458
538
|
async function resolveCompanyListFlag(
|
|
459
539
|
ctx: FindCliContext,
|
|
460
540
|
value: string,
|
|
541
|
+
opts?: { fitOnly?: boolean },
|
|
461
542
|
): Promise<ResolvedCompanyList> {
|
|
462
543
|
const trimmed = value.trim();
|
|
463
544
|
if (!trimmed) {
|
|
464
545
|
throw new FindCliError(
|
|
465
|
-
"--company-list requires a list artifact id or
|
|
546
|
+
"--company-list requires a list slug/name, artifact id, or Company view name",
|
|
466
547
|
);
|
|
467
548
|
}
|
|
549
|
+
if (opts?.fitOnly) {
|
|
550
|
+
const matched = await findStagingListByRef(ctx, trimmed);
|
|
551
|
+
const objectName = matched?.name ?? trimmed;
|
|
552
|
+
try {
|
|
553
|
+
const resolved = (await callAction(ctx, api.resolveCompanyList, {
|
|
554
|
+
objectName,
|
|
555
|
+
fitOnly: true,
|
|
556
|
+
domainsOnly: true,
|
|
557
|
+
})) as ResolvedCompanyList;
|
|
558
|
+
return { ...resolved, objectName, fitOnly: true };
|
|
559
|
+
} catch (error) {
|
|
560
|
+
throw new FindCliError(
|
|
561
|
+
error instanceof Error ? error.message : String(error),
|
|
562
|
+
);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
468
565
|
if (COMPANY_LIST_ID_RE.test(trimmed)) {
|
|
469
566
|
try {
|
|
470
567
|
return (await callAction(ctx, api.resolveCompanyList, {
|
|
471
568
|
artifactId: trimmed,
|
|
472
569
|
})) as ResolvedCompanyList;
|
|
473
570
|
} catch {
|
|
474
|
-
// Not an artifact (or not ours) — fall through to view
|
|
571
|
+
// Not an artifact (or not ours) — fall through to view/list lookup.
|
|
475
572
|
}
|
|
476
573
|
}
|
|
477
574
|
try {
|
|
478
575
|
return (await callAction(ctx, api.resolveCompanyList, {
|
|
479
576
|
viewName: trimmed,
|
|
480
577
|
})) as ResolvedCompanyList;
|
|
481
|
-
} catch (
|
|
578
|
+
} catch (viewError) {
|
|
579
|
+
const matched = await findStagingListByRef(ctx, trimmed);
|
|
580
|
+
if (matched) {
|
|
581
|
+
try {
|
|
582
|
+
const resolved = (await callAction(ctx, api.resolveCompanyList, {
|
|
583
|
+
objectName: matched.name,
|
|
584
|
+
fitOnly: true,
|
|
585
|
+
domainsOnly: true,
|
|
586
|
+
})) as ResolvedCompanyList;
|
|
587
|
+
return { ...resolved, objectName: matched.name, fitOnly: true };
|
|
588
|
+
} catch (listError) {
|
|
589
|
+
throw new FindCliError(
|
|
590
|
+
listError instanceof Error ? listError.message : String(listError),
|
|
591
|
+
);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
482
594
|
throw new FindCliError(
|
|
483
|
-
|
|
595
|
+
viewError instanceof Error ? viewError.message : String(viewError),
|
|
484
596
|
);
|
|
485
597
|
}
|
|
486
598
|
}
|
|
@@ -490,6 +602,14 @@ function companyListFilterEntry(
|
|
|
490
602
|
ref: string,
|
|
491
603
|
resolved: ResolvedCompanyList,
|
|
492
604
|
): Record<string, unknown> {
|
|
605
|
+
if (resolved.source === "fit_checks" || resolved.source === "entries") {
|
|
606
|
+
return {
|
|
607
|
+
objectName: resolved.objectName ?? ref.trim(),
|
|
608
|
+
...(resolved.fitOnly ? { fitOnly: true } : {}),
|
|
609
|
+
domainsOnly: true,
|
|
610
|
+
title: resolved.title,
|
|
611
|
+
};
|
|
612
|
+
}
|
|
493
613
|
return resolved.source === "artifact"
|
|
494
614
|
? { artifactId: ref.trim(), title: resolved.title }
|
|
495
615
|
: { viewName: ref.trim(), title: resolved.title };
|
|
@@ -503,6 +623,9 @@ function companyListInfo(resolved: ResolvedCompanyList) {
|
|
|
503
623
|
companiesUsed: resolved.domains.length + resolved.names.length,
|
|
504
624
|
totalCompanies: resolved.totalCompanies,
|
|
505
625
|
truncated: resolved.truncated,
|
|
626
|
+
...(typeof resolved.skippedNoDomain === "number"
|
|
627
|
+
? { skippedNoDomain: resolved.skippedNoDomain }
|
|
628
|
+
: {}),
|
|
506
629
|
};
|
|
507
630
|
}
|
|
508
631
|
|
|
@@ -546,7 +669,7 @@ export function leadsHelp(): void {
|
|
|
546
669
|
Usage:
|
|
547
670
|
dench leads find --titles "VP Sales" --locations "San Francisco" [--company-domain acme.com] [--save-as "Q3 targets"] [--limit 500] [--page-token <token>] [--json]
|
|
548
671
|
dench leads find --keywords "fintech" [--industries SaaS] [--seniorities director,vp] [--json]
|
|
549
|
-
dench leads find --company-list <artifactId|"Company view name"> --titles "VP Sales" [--json]
|
|
672
|
+
dench leads find --company-list <list|artifactId|"Company view name"> [--fit-only] --titles "VP Sales" [--into-list "Q3 buyers"] [--json]
|
|
550
673
|
dench leads filters [--filter titles|locations|company-hq|universities|skills|keywords|seniorities|functions|sub-functions|industries|headcount|company-types|languages] [--search "query"] [--json]
|
|
551
674
|
|
|
552
675
|
Filter flags (all comma-separated lists unless noted):
|
|
@@ -557,10 +680,12 @@ Filter flags (all comma-separated lists unless noted):
|
|
|
557
680
|
--company-domains --company-hq --company-types --industries
|
|
558
681
|
--company-keywords (business focus: SaaS, B2B, Cloud)
|
|
559
682
|
--headcount (buckets like 11-50,51-200)
|
|
560
|
-
List: --company-list <artifactId|view name> — filter
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
683
|
+
List: --company-list <list|artifactId|view name> [--fit-only] — filter
|
|
684
|
+
by a qualified list slug/name (pass --fit-only to target companies
|
|
685
|
+
marked Fits across all Fit Check columns), a \`dench companies find\`
|
|
686
|
+
artifact, or a Company saved view.
|
|
687
|
+
--into-list <name|slug> — also save returned rows directly into a
|
|
688
|
+
workspace list (creates it if new).
|
|
564
689
|
Ranges: --years-in-role --years-at-company --days-since-job-change
|
|
565
690
|
--founded-years (min:max, e.g. 2:10, 2: or :10)
|
|
566
691
|
Query: --keywords "Engineer" (current-title text only)
|
|
@@ -672,15 +797,15 @@ export function companiesHelp(): void {
|
|
|
672
797
|
|
|
673
798
|
Usage:
|
|
674
799
|
dench companies related --domain acme.com --kind employees|founders|funding|investors|acquisitions|investments [--limit 25] [--page-token <token>] [--json]
|
|
675
|
-
dench companies find --name "Acme" [--domain acme.com] [--keywords fintech] [--industries SaaS] [--locations "San Francisco"] [--linkedin https://linkedin.com/company/acme] [--exact] [--save-as "Target accounts"] [--limit 500] [--page-token <token>] [--json]
|
|
800
|
+
dench companies find --name "Acme" [--domain acme.com] [--keywords fintech] [--industries SaaS] [--locations "San Francisco"] [--linkedin https://linkedin.com/company/acme] [--exact] [--save-as "Target accounts"] [--into-list "Q4 Fintech"] [--limit 500] [--page-token <token>] [--json]
|
|
676
801
|
Rows include a headquarters line (street where the provider has one).
|
|
677
802
|
|
|
678
803
|
Finds companies through Dench search and writes a workspace list artifact.
|
|
679
|
-
Pass --
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
804
|
+
Pass --into-list "<Name>" to also seed (or append to) a workspace list ready
|
|
805
|
+
for AI research columns (\`dench crm columns create-ai\`).
|
|
806
|
+
Manage lists with \`dench lists\`; import with \`dench artifacts import <id> --to <company|list_slug>\`.
|
|
807
|
+
The artifact id (or list slug) doubles as a company list: pass it to
|
|
808
|
+
\`dench leads find --company-list <list> [--fit-only]\` or \`dench jobs find --company-list <list> [--fit-only]\`.
|
|
684
809
|
`);
|
|
685
810
|
}
|
|
686
811
|
|
|
@@ -689,12 +814,12 @@ export function jobsHelp(): void {
|
|
|
689
814
|
|
|
690
815
|
Usage:
|
|
691
816
|
dench jobs find --titles "Account Executive" --locations "San Francisco" [--company-domain acme.com] [--keywords remote] [--save-as "AE openings"] [--limit 500] [--page-token <token>] [--json]
|
|
692
|
-
dench jobs find --company-list <artifactId|"Company view name"> [--titles "Account Executive"] [--posted-after 2026-09-01] [--posted-before 2026-09-30] [--json]
|
|
817
|
+
dench jobs find --company-list <list|artifactId|"Company view name"> [--fit-only] [--titles "Account Executive"] [--posted-after 2026-09-01] [--posted-before 2026-09-30] [--json]
|
|
693
818
|
|
|
694
819
|
Company filters: --company (name), --company-domain (single),
|
|
695
|
-
--company-domains (comma-separated), or --company-list (a
|
|
696
|
-
|
|
697
|
-
resolved to its current companies on each run).
|
|
820
|
+
--company-domains (comma-separated), or --company-list (a qualified list slug/name
|
|
821
|
+
with optional --fit-only, a \`dench companies find\` artifact id, or a Company
|
|
822
|
+
saved-view name — resolved to its current companies on each run).
|
|
698
823
|
|
|
699
824
|
Finds job postings through Dench search and writes a workspace list artifact.
|
|
700
825
|
Pass --save-as to name the list (otherwise a title is generated).
|
|
@@ -709,7 +834,7 @@ Usage:
|
|
|
709
834
|
dench artifacts [--limit 25] [--json]
|
|
710
835
|
dench artifacts list [--limit 25] [--json]
|
|
711
836
|
dench artifacts show <id> [--json]
|
|
712
|
-
dench artifacts import <id> --to lead|company|job_posting [--rows 0,4,9] [--enrichment enriched] [--status "Contacted"] [--view "Q3 outbound"] [--pin] [--json]
|
|
837
|
+
dench artifacts import <id> --to lead|company|job_posting|<list_slug> [--rows 0,4,9] [--enrichment enriched] [--status "Contacted"] [--view "Q3 outbound"] [--pin] [--json]
|
|
713
838
|
|
|
714
839
|
\`list\` / \`show\` / \`import\` operate on find results (lead lists and job
|
|
715
840
|
searches). Bare \`dench artifacts\` still lists agent suggested-work artifacts.
|
|
@@ -1231,12 +1356,17 @@ export async function runLeadsCommand(opts: {
|
|
|
1231
1356
|
if (verb !== "find") {
|
|
1232
1357
|
throw new FindCliError(`Unknown leads verb: ${verb}`);
|
|
1233
1358
|
}
|
|
1234
|
-
const {
|
|
1359
|
+
const {
|
|
1360
|
+
name: listName,
|
|
1361
|
+
intoList,
|
|
1362
|
+
fitOnly,
|
|
1363
|
+
...flags
|
|
1364
|
+
} = parseLeadsFindFlags(args);
|
|
1235
1365
|
// Resolve --company-list fresh per search so the filter tracks the
|
|
1236
1366
|
// list's CURRENT companies (domains exact, name fallback for rows
|
|
1237
1367
|
// without a domain).
|
|
1238
1368
|
const companyList = flags.companyList
|
|
1239
|
-
? await resolveCompanyListFlag(ctx, flags.companyList)
|
|
1369
|
+
? await resolveCompanyListFlag(ctx, flags.companyList, { fitOnly })
|
|
1240
1370
|
: undefined;
|
|
1241
1371
|
try {
|
|
1242
1372
|
const result = await searchPeople(
|
|
@@ -1291,7 +1421,7 @@ export async function runLeadsCommand(opts: {
|
|
|
1291
1421
|
companyList,
|
|
1292
1422
|
);
|
|
1293
1423
|
}
|
|
1294
|
-
const artifact = await persist(ctx, {
|
|
1424
|
+
const artifact = (await persist(ctx, {
|
|
1295
1425
|
createdFrom: "find_people",
|
|
1296
1426
|
title:
|
|
1297
1427
|
listName ??
|
|
@@ -1303,14 +1433,28 @@ export async function runLeadsCommand(opts: {
|
|
|
1303
1433
|
]),
|
|
1304
1434
|
filters: savedFilters,
|
|
1305
1435
|
people,
|
|
1306
|
-
})
|
|
1436
|
+
})) as Record<string, unknown>;
|
|
1437
|
+
let seededList: Record<string, unknown> | undefined;
|
|
1438
|
+
if (intoList && typeof artifact.artifactId === "string") {
|
|
1439
|
+
const target = await resolveOrCreateStagingList(ctx, intoList, "person");
|
|
1440
|
+
const imported = (await callAction(ctx, api.importArtifact, {
|
|
1441
|
+
artifactId: artifact.artifactId,
|
|
1442
|
+
to: target.objectName,
|
|
1443
|
+
})) as Record<string, unknown>;
|
|
1444
|
+
seededList = {
|
|
1445
|
+
...target,
|
|
1446
|
+
added: imported.added ?? imported.imported ?? 0,
|
|
1447
|
+
skippedDuplicate: imported.skippedDuplicate ?? imported.reused ?? 0,
|
|
1448
|
+
};
|
|
1449
|
+
}
|
|
1307
1450
|
// metadata carries total / nextPageToken — pass the token back via
|
|
1308
1451
|
// --page-token to continue where this page stopped.
|
|
1309
1452
|
out(ctx, {
|
|
1310
|
-
...
|
|
1453
|
+
...artifact,
|
|
1311
1454
|
metadata: result.metadata,
|
|
1312
1455
|
billing: result.billing ?? null,
|
|
1313
1456
|
...(companyList ? { companyList: companyListInfo(companyList) } : {}),
|
|
1457
|
+
...(seededList ? { list: seededList } : {}),
|
|
1314
1458
|
});
|
|
1315
1459
|
} catch (error) {
|
|
1316
1460
|
throw new FindCliError(
|
|
@@ -1354,10 +1498,14 @@ export async function runJobsCommand(opts: {
|
|
|
1354
1498
|
const postedAfter = getFlag(args, "--posted-after");
|
|
1355
1499
|
const postedBefore = getFlag(args, "--posted-before");
|
|
1356
1500
|
const companyListRef = getFlag(args, "--company-list");
|
|
1501
|
+
const fitOnly = hasFlag(args, "--fit-only") ? true : undefined;
|
|
1357
1502
|
const limit = parseLimit(args);
|
|
1358
1503
|
const pageToken = getFlag(args, "--page-token");
|
|
1359
1504
|
const listName = getFlag(args, "--save-as");
|
|
1360
1505
|
assertNoUnknownFlags(args, "jobs find");
|
|
1506
|
+
if (fitOnly && !companyListRef) {
|
|
1507
|
+
throw new FindCliError("--fit-only requires --company-list <list>");
|
|
1508
|
+
}
|
|
1361
1509
|
if (
|
|
1362
1510
|
!titles &&
|
|
1363
1511
|
!locations &&
|
|
@@ -1374,7 +1522,7 @@ export async function runJobsCommand(opts: {
|
|
|
1374
1522
|
);
|
|
1375
1523
|
}
|
|
1376
1524
|
const companyList = companyListRef
|
|
1377
|
-
? await resolveCompanyListFlag(ctx, companyListRef)
|
|
1525
|
+
? await resolveCompanyListFlag(ctx, companyListRef, { fitOnly })
|
|
1378
1526
|
: undefined;
|
|
1379
1527
|
try {
|
|
1380
1528
|
const result = await searchJobs(
|
|
@@ -1509,6 +1657,7 @@ export async function runCompaniesCommand(opts: {
|
|
|
1509
1657
|
const limit = parseLimit(args);
|
|
1510
1658
|
const pageToken = getFlag(args, "--page-token");
|
|
1511
1659
|
const listName = getFlag(args, "--save-as");
|
|
1660
|
+
const intoList = getFlag(args, "--into-list");
|
|
1512
1661
|
assertNoUnknownFlags(args, "companies find");
|
|
1513
1662
|
if (
|
|
1514
1663
|
!domain &&
|
|
@@ -1539,10 +1688,11 @@ export async function runCompaniesCommand(opts: {
|
|
|
1539
1688
|
},
|
|
1540
1689
|
ctx.enrichmentGateway,
|
|
1541
1690
|
);
|
|
1542
|
-
const artifact = await persist(ctx, {
|
|
1691
|
+
const artifact = (await persist(ctx, {
|
|
1543
1692
|
createdFrom: "find_companies",
|
|
1544
1693
|
title:
|
|
1545
1694
|
listName ??
|
|
1695
|
+
intoList ??
|
|
1546
1696
|
findTitle("companies", [name ?? "", domain ?? "", keywords ?? ""]),
|
|
1547
1697
|
filters: {
|
|
1548
1698
|
domain,
|
|
@@ -1555,11 +1705,25 @@ export async function runCompaniesCommand(opts: {
|
|
|
1555
1705
|
limit,
|
|
1556
1706
|
},
|
|
1557
1707
|
companies: asArray(result.companies),
|
|
1558
|
-
})
|
|
1708
|
+
})) as Record<string, unknown>;
|
|
1709
|
+
let seededList: Record<string, unknown> | undefined;
|
|
1710
|
+
if (intoList && typeof artifact.artifactId === "string") {
|
|
1711
|
+
const target = await resolveOrCreateStagingList(ctx, intoList, "company");
|
|
1712
|
+
const imported = (await callAction(ctx, api.importArtifact, {
|
|
1713
|
+
artifactId: artifact.artifactId,
|
|
1714
|
+
to: target.objectName,
|
|
1715
|
+
})) as Record<string, unknown>;
|
|
1716
|
+
seededList = {
|
|
1717
|
+
...target,
|
|
1718
|
+
added: imported.added ?? imported.imported ?? 0,
|
|
1719
|
+
skippedDuplicate: imported.skippedDuplicate ?? imported.reused ?? 0,
|
|
1720
|
+
};
|
|
1721
|
+
}
|
|
1559
1722
|
out(ctx, {
|
|
1560
|
-
...
|
|
1723
|
+
...artifact,
|
|
1561
1724
|
metadata: result.metadata,
|
|
1562
1725
|
billing: result.billing ?? null,
|
|
1726
|
+
...(seededList ? { list: seededList } : {}),
|
|
1563
1727
|
});
|
|
1564
1728
|
} catch (error) {
|
|
1565
1729
|
throw new FindCliError(
|
|
@@ -1602,10 +1766,10 @@ export async function runWorkspaceArtifactsCommand(opts: {
|
|
|
1602
1766
|
return true;
|
|
1603
1767
|
}
|
|
1604
1768
|
const artifactId = shift(args, "artifact id");
|
|
1605
|
-
const to = getFlag(args, "--to");
|
|
1606
|
-
if (to
|
|
1769
|
+
const to = getFlag(args, "--to")?.trim();
|
|
1770
|
+
if (!to) {
|
|
1607
1771
|
throw new FindCliError(
|
|
1608
|
-
"dench artifacts import <id> --to lead|company|job_posting [--view ...] [--pin]",
|
|
1772
|
+
"dench artifacts import <id> --to lead|company|job_posting|<list_slug> [--view ...] [--pin]",
|
|
1609
1773
|
);
|
|
1610
1774
|
}
|
|
1611
1775
|
const viewName = getFlag(args, "--view");
|
package/lib/api-schemas.ts
CHANGED
|
@@ -2650,7 +2650,16 @@ const peopleSearch = z.object({
|
|
|
2650
2650
|
),
|
|
2651
2651
|
companyNames: z.array(searchFilterItem).max(50).optional(),
|
|
2652
2652
|
pastCompanyNames: z.array(searchFilterItem).max(50).optional(),
|
|
2653
|
-
companyDomains: z.array(searchFilterItem).max(
|
|
2653
|
+
companyDomains: z.array(searchFilterItem).max(1000).optional(),
|
|
2654
|
+
companyScope: z
|
|
2655
|
+
.object({
|
|
2656
|
+
domains: z.array(z.string()).max(1000).optional(),
|
|
2657
|
+
names: z.array(z.string()).max(50).optional(),
|
|
2658
|
+
})
|
|
2659
|
+
.optional()
|
|
2660
|
+
.describe(
|
|
2661
|
+
"Resolved company-list membership (OR across domains and fallback company names).",
|
|
2662
|
+
),
|
|
2654
2663
|
companyHeadquarters: z
|
|
2655
2664
|
.array(searchFilterItem)
|
|
2656
2665
|
.max(50)
|
|
@@ -3049,7 +3058,9 @@ const jobsSearch = z.object({
|
|
|
3049
3058
|
`Cities, states, countries, or metros (free text). ${FILTER_OPTIONS_NOTE}`,
|
|
3050
3059
|
),
|
|
3051
3060
|
companyDomain: z.string().optional(),
|
|
3061
|
+
companyDomains: z.array(z.string()).max(1000).optional(),
|
|
3052
3062
|
companyName: z.string().optional(),
|
|
3063
|
+
companyNames: z.array(z.string()).max(50).optional(),
|
|
3053
3064
|
companyLinkedinUrl: z.string().optional(),
|
|
3054
3065
|
keywords: z.string().optional(),
|
|
3055
3066
|
postedAfter: z.string().optional(),
|
|
@@ -141,7 +141,8 @@ export const APP_SDK_OPERATIONS: readonly AppSdkOperationInfo[] = [
|
|
|
141
141
|
{"id":"lists.list","group":"lists","summary":"List saved searches (find-result lists) in the workspace, newest first.","cli":"dench lists","method":"GET","path":"/lists","permission":"lists:read","pathParams":[]},
|
|
142
142
|
{"id":"lists.rows","group":"lists","summary":"Read saved rows with current enrichment results and original indices; cursor-paged, without repeating a search.","cli":"dench lists rows","method":"GET","path":"/lists/{artifactId}/rows","permission":"lists:read","pathParams":["artifactId"]},
|
|
143
143
|
{"id":"lists.enrich","group":"lists","summary":"Buy contact details for 1–100 saved profiles and save them to the list. Skips fields already found, looked up empty, or in flight. Requires a signed-in member or their personal agent.","cli":"dench lists enrich","method":"POST","path":"/lists/{artifactId}/enrich","permission":"lists:write","pathParams":["artifactId"]},
|
|
144
|
-
{"id":"lists.import","group":"lists","summary":"Explicitly import
|
|
144
|
+
{"id":"lists.import","group":"lists","summary":"Explicitly import saved find rows into lead, company, job_posting, or a list slug (e.g. list_q4_fintech). Reuses existing records; never sends outreach or triggers conversion.","cli":"dench artifacts import","method":"POST","path":"/lists/{artifactId}/import","permission":"lists:write","pathParams":["artifactId"]},
|
|
145
|
+
{"id":"lists.resolveCompanies","group":"lists","summary":"Resolve a saved Find company list, Company saved view, or qualified list (optionally fitOnly) into canonical company domains for people/job searches.","cli":"dench leads find --company-list","method":"POST","path":"/lists/resolve-companies","permission":"lists:read","pathParams":[]},
|
|
145
146
|
{"id":"lists.get","group":"lists","summary":"Get one saved search / list by artifact id.","cli":"dench lists show","method":"GET","path":"/lists/{artifactId}","permission":"lists:read","pathParams":["artifactId"]},
|
|
146
147
|
{"id":"lists.save","group":"lists","summary":"Save find results as a named list (rows + filters become a workspace artifact).","cli":"dench lists save","method":"POST","path":"/lists","permission":"lists:write","pathParams":[]},
|
|
147
148
|
{"id":"lists.update","group":"lists","summary":"Update a saved list in place (title, filters, and/or replacement rows).","cli":"dench lists update","method":"PATCH","path":"/lists/{artifactId}","permission":"lists:write","pathParams":["artifactId"]},
|
|
@@ -305,6 +306,22 @@ export const APP_SDK_OPERATIONS: readonly AppSdkOperationInfo[] = [
|
|
|
305
306
|
{"id":"crm.analytics.collapse","group":"crm","summary":"Collapse the analytics strip above the object's table (team-shared, like saved views).","cli":"dench crm analytics collapse","method":"POST","path":"/crm/objects/{objectName}/analytics/collapse","permission":"crm:write","pathParams":["objectName"]},
|
|
306
307
|
{"id":"crm.analytics.expand","group":"crm","summary":"Expand the analytics strip above the object's table.","cli":"dench crm analytics expand","method":"POST","path":"/crm/objects/{objectName}/analytics/expand","permission":"crm:write","pathParams":["objectName"]},
|
|
307
308
|
{"id":"crm.analytics.scope","group":"crm","summary":"Give a saved view its own dashboard (mode \"own\": starts as a copy of the object's panels) or hand it back to the object's shared one (mode \"shared\").","cli":"dench crm analytics scope","method":"POST","path":"/crm/objects/{objectName}/views/{viewName}/analytics/scope","permission":"crm:write","pathParams":["objectName","viewName"]},
|
|
309
|
+
{"id":"crm.columns.listStagingLists","group":"crm","summary":"List active workspace staging lists with row counts and management permissions.","cli":"dench crm columns lists","method":"GET","path":"/crm/columns/lists","permission":"crm:read","pathParams":[]},
|
|
310
|
+
{"id":"crm.columns.createStagingList","group":"crm","summary":"Create a staging list CRM object pre-seeded with canonical company or person columns and Notes.","cli":"dench crm columns create-list","method":"POST","path":"/crm/columns/lists","permission":"crm:write","pathParams":[]},
|
|
311
|
+
{"id":"crm.columns.deleteStagingListCascade","group":"crm","summary":"Archive a staging list immediately, stop active AI column runs, and schedule bounded cascade deletion (creator or admin).","cli":"dench crm columns delete-list","method":"DELETE","path":"/crm/columns/lists/{objectName}","permission":"crm:write","pathParams":["objectName"]},
|
|
312
|
+
{"id":"crm.columns.createAi","group":"crm","summary":"Create a typed AI Research column (fit_check, text, enum, number, or url) on a staging list or CRM object without autorunning.","cli":"dench crm columns create-ai","method":"POST","path":"/crm/objects/{objectName}/columns/ai","permission":"crm:write","pathParams":["objectName"]},
|
|
313
|
+
{"id":"crm.columns.updateAi","group":"crm","summary":"Update an AI Research column's prompt, enum options, description, or required input fields without autorunning.","cli":"dench crm columns update-ai","method":"PATCH","path":"/crm/objects/{objectName}/columns/ai/{fieldName}","permission":"crm:write","pathParams":["objectName","fieldName"]},
|
|
314
|
+
{"id":"crm.columns.deleteAi","group":"crm","summary":"Delete an AI Research column, stop any active run, and schedule bounded cell provenance cleanup.","cli":"dench crm columns delete-ai","method":"DELETE","path":"/crm/objects/{objectName}/columns/ai/{fieldName}","permission":"crm:write","pathParams":["objectName","fieldName"]},
|
|
315
|
+
{"id":"crm.columns.estimateRun","group":"crm","summary":"Estimate eligible rows and exact AI credit cost (2 AI credits/row) before starting an AI Research column run.","cli":"dench crm columns estimate-run","method":"POST","path":"/crm/objects/{objectName}/columns/{fieldName}/estimate","permission":"crm:read","pathParams":["objectName","fieldName"]},
|
|
316
|
+
{"id":"crm.columns.startRun","group":"crm","summary":"Start a durable AI Research column run with explicit row scope and optional hard AI credit ceiling.","cli":"dench crm columns start-run","method":"POST","path":"/crm/objects/{objectName}/columns/{fieldName}/runs","permission":"crm:write","pathParams":["objectName","fieldName"]},
|
|
317
|
+
{"id":"crm.columns.pauseRun","group":"crm","summary":"Pause a pending or running AI Research column run.","cli":"dench crm columns pause-run","method":"POST","path":"/crm/columns/runs/{runId}/pause","permission":"crm:write","pathParams":["runId"]},
|
|
318
|
+
{"id":"crm.columns.resumeRun","group":"crm","summary":"Resume a paused or capped AI Research column run, optionally raising or clearing creditStopCeiling.","cli":"dench crm columns resume-run","method":"POST","path":"/crm/columns/runs/{runId}/resume","permission":"crm:write","pathParams":["runId"]},
|
|
319
|
+
{"id":"crm.columns.stopRun","group":"crm","summary":"Permanently stop an active, paused, or capped AI Research column run.","cli":"dench crm columns stop-run","method":"POST","path":"/crm/columns/runs/{runId}/stop","permission":"crm:write","pathParams":["runId"]},
|
|
320
|
+
{"id":"crm.columns.getRunStatus","group":"crm","summary":"Read active AI Research column runs on an object and optionally inspect a specific column or run ID.","cli":"dench crm columns run-status","method":"GET","path":"/crm/objects/{objectName}/columns/runs","permission":"crm:read","pathParams":["objectName"]},
|
|
321
|
+
{"id":"crm.columns.overrideCell","group":"crm","summary":"Manually override (or clear with null) an AI Research cell, locking it as user_override and clearing stale citations.","cli":"dench crm columns override-cell","method":"PUT","path":"/crm/objects/{objectName}/entries/{entryId}/columns/{fieldName}/override","permission":"crm:write","pathParams":["objectName","entryId","fieldName"]},
|
|
322
|
+
{"id":"crm.columns.rerunSingleCell","group":"crm","summary":"Re-run a single AI Research cell live (2 AI credits; 0 DB writes on error; set unlockOverride to replace a manual override).","cli":"dench crm columns rerun-cell","method":"POST","path":"/crm/objects/{objectName}/entries/{entryId}/columns/{fieldName}/rerun","permission":"crm:write","pathParams":["objectName","entryId","fieldName"]},
|
|
323
|
+
{"id":"crm.columns.getCellProvenanceBatch","group":"crm","summary":"Read page-scoped AI Research cell citations, statuses, and override state for up to 100 entry IDs.","cli":"dench crm columns provenance","method":"POST","path":"/crm/objects/{objectName}/columns/provenance","permission":"crm:read","pathParams":["objectName"]},
|
|
324
|
+
{"id":"crm.columns.getStagingTriageSummary","group":"crm","summary":"Read O(1) Fit Check triage counts (Fits, Does not fit, Unknown, Not run) and domain-ready Fit count for a list.","cli":"dench crm columns summary","method":"GET","path":"/crm/objects/{objectName}/columns/summary","permission":"crm:read","pathParams":["objectName"]},
|
|
308
325
|
{"id":"crm.enrich.cell","group":"crm","summary":"Request enrichment for one CRM cell.","cli":"dench crm enrich cell","method":"POST","path":"/crm/enrich/cell","permission":"crm:write","pathParams":[]},
|
|
309
326
|
{"id":"crm.enrich.object","group":"crm","summary":"Request enrichment for a CRM object.","cli":"dench crm enrich object","method":"POST","path":"/crm/enrich/object","permission":"crm:write","pathParams":[]},
|
|
310
327
|
{"id":"crm.people.search","group":"crm","summary":"Search for people through the enrichment gateway. `companyDomains` takes up to 1000 domains (e.g. a resolved company list; `dench leads find --company-list <id|view>` resolves one for you) — the gateway fans large lists out as sequential vendor-safe chunks behind one `nextPageToken` stream.","cli":"dench crm people search","method":"POST","path":"/enrichment/people/search","permission":"crm:read","pathParams":[]},
|
package/lib/app-sdk-surface.ts
CHANGED
|
@@ -1757,6 +1757,9 @@ export const READ_OPERATION_OVERRIDES = new Set<string>([
|
|
|
1757
1757
|
"crm.sql",
|
|
1758
1758
|
"crm.aggregate",
|
|
1759
1759
|
"crm.analytics.compute",
|
|
1760
|
+
"crm.columns.estimateRun",
|
|
1761
|
+
"crm.columns.getCellProvenanceBatch",
|
|
1762
|
+
"lists.resolveCompanies",
|
|
1760
1763
|
"crm.people.search",
|
|
1761
1764
|
"crm.companies.search",
|
|
1762
1765
|
"enrichment.jobs.search",
|