@dench.com/cli 3.0.4-staging.289 → 3.2.0-staging.294

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/README.md CHANGED
@@ -201,6 +201,50 @@ dench signin --staging
201
201
  dench signin --host https://staging.dench.com
202
202
  ```
203
203
 
204
+ ## Saved prospect lists
205
+
206
+ People found with `dench leads find` stay in saved lists, not the CRM.
207
+ Open the list in Find, select profiles, and choose **Enrich selected**.
208
+ The lead-finding skill establishes `/workspace/ICP.md` on first use and
209
+ reads it before later searches. There is no mandatory per-profile ICP decision.
210
+ A teammate confirms the contact fields
211
+ and credit spend; progress and results remain in the saved list.
212
+
213
+ ```bash
214
+ dench leads find --titles "VP Sales" --save-as "Q3 targets" --json
215
+ dench lists save --title "10 RevOps leaders" --people-file /tmp/shortlist.json --json
216
+ dench lists --search "Q3 targets" --limit 25 --json
217
+ dench lists rows <artifactId> --enrichment enriched --limit 100 --json
218
+ dench lists rows <artifactId> --enrichment enriched --limit 100 --cursor <continueCursor> --json
219
+ ```
220
+
221
+ `lists save` takes a non-empty JSON array of person rows (`name` or
222
+ `fullName` required), consolidating selected discoveries into a new list
223
+ without searching, enriching, or importing CRM rows. It leaves source lists
224
+ unchanged. Optional `--filters-json` stores criteria/source evidence metadata.
225
+ In chat, explicitly present the final list; research batches stay in activity
226
+ details instead of becoming competing result sets.
227
+
228
+ Directory and row reads return `page`, `continueCursor`, and `isDone`.
229
+ Follow cursors even through empty filtered pages. Lists survive new chats;
230
+ read fresh rows and contacts instead of an old transcript or CSV. Each row
231
+ has its original zero-based `index`. Enriched means a contact was returned,
232
+ not merely that a lookup completed. Never resubmit pending/uncertain jobs.
233
+
234
+ Only when the user explicitly asks to import the selected profiles:
235
+
236
+ ```bash
237
+ dench artifacts import <artifactId> --to lead --rows 0,4,9 --status "Contacted" --view "Q3 outbound" --pin
238
+ ```
239
+
240
+ This imports exactly those original indices and known contacts, reusing existing
241
+ CRM records. Inspect the actual Lead status options first. Omit `--status`
242
+ to keep the default New; use `--enrichment enriched` for contact-bearing rows.
243
+ Enrichment is optional for explicit imports. Import sets status only, even
244
+ Qualified: it never purchases contacts, sends outreach, or converts records.
245
+ See the [lead-finding workflow](../convex/lib/seedSkills/lead-finding.md)
246
+ and [sales pipeline playbook](../public/references/SALES.md).
247
+
204
248
  ## Outreach campaigns
205
249
 
206
250
  `dench campaign` runs email + LinkedIn outreach campaigns (the Outreach →
package/app-sdk.d.ts CHANGED
@@ -79,10 +79,31 @@ export interface ApiRequests {
79
79
  limit?: number;
80
80
  };
81
81
  /** List saved searches (find-result lists) in the workspace, newest first. — `dench lists` — GET /api/v1/lists */
82
- "lists.list": Record<string, unknown>;
82
+ "lists.list": {
83
+ search?: string;
84
+ cursor?: string;
85
+ limit?: number;
86
+ };
87
+ /** Read saved rows with current enrichment results and original indices; cursor-paged, without repeating a search. — `dench lists rows` — GET /api/v1/lists/{artifactId}/rows */
88
+ "lists.rows": {
89
+ artifactId: string;
90
+ cursor?: string;
91
+ limit?: number;
92
+ enrichment?: "all" | "enriched" | "in_progress" | "no_contacts" | "failed" | "not_enriched";
93
+ };
94
+ /** Explicitly import selected saved profiles, optionally filtered by enrichment, with a configured Lead status. Reuses CRM records; never sends outreach or triggers conversion. — `dench artifacts import` — POST /api/v1/lists/{artifactId}/import */
95
+ "lists.import": {
96
+ artifactId: string;
97
+ to: "lead" | "company" | "job_posting";
98
+ rowIndexes?: number[];
99
+ status?: string;
100
+ enrichment?: "all" | "enriched" | "in_progress" | "no_contacts" | "failed" | "not_enriched";
101
+ viewName?: string;
102
+ pin?: boolean;
103
+ };
83
104
  /** Get one saved search / list by artifact id. — `dench lists show` — GET /api/v1/lists/{artifactId} */
84
105
  "lists.get": Record<string, unknown>;
85
- /** Save find results as a named list (rows + filters become a workspace artifact). — `dench leads find --save-as "Name"` — POST /api/v1/lists */
106
+ /** Save find results as a named list (rows + filters become a workspace artifact). — `dench lists save` — POST /api/v1/lists */
86
107
  "lists.save": Record<string, unknown>;
87
108
  /** Update a saved list in place (title, filters, and/or replacement rows). — `dench lists update` — PATCH /api/v1/lists/{artifactId} */
88
109
  "lists.update": Record<string, unknown>;
@@ -90,6 +111,21 @@ export interface ApiRequests {
90
111
  "lists.rename": Record<string, unknown>;
91
112
  /** Delete a saved search / list, its exported CSV/JSONL files, and any linked watch. — `dench lists delete` — DELETE /api/v1/lists/{artifactId} */
92
113
  "lists.delete": Record<string, unknown>;
114
+ /** Read durable enrichment activity (legacy review metadata remains readable). Use lists rows for current saved profiles and contacts. — `dench lists reviews` — GET /api/v1/lists/{artifactId}/reviews */
115
+ "lists.prospects.reviews": {
116
+ artifactId: string;
117
+ limit?: number;
118
+ cursor?: string;
119
+ };
120
+ /** Suggest ICP fit for one profile. Never changes a human review decision. — `dench lists assess` — POST /api/v1/lists/{artifactId}/assess */
121
+ "lists.prospects.assess": {
122
+ artifactId: string;
123
+ row: Record<string, unknown>;
124
+ suggestion: {
125
+ fit: "likely_fit" | "unlikely_fit" | "unknown";
126
+ reason: string;
127
+ };
128
+ };
93
129
  /** Search durable workspace memory. — `dench memory search` — GET /api/v1/memory/search */
94
130
  "memory.search": {
95
131
  /** Full-text query. */
@@ -2778,11 +2814,15 @@ export interface ApiResponses {
2778
2814
  updatedAt: number;
2779
2815
  }>;
2780
2816
  "lists.list": unknown;
2817
+ "lists.rows": unknown;
2818
+ "lists.import": unknown;
2781
2819
  "lists.get": unknown;
2782
2820
  "lists.save": unknown;
2783
2821
  "lists.update": unknown;
2784
2822
  "lists.rename": unknown;
2785
2823
  "lists.delete": unknown;
2824
+ "lists.prospects.reviews": unknown;
2825
+ "lists.prospects.assess": unknown;
2786
2826
  "memory.search": Array<{
2787
2827
  _id: string;
2788
2828
  _creationTime: number;
@@ -6473,11 +6513,21 @@ export type DenchApiTree = {
6473
6513
  delete(args: Req<"lists.delete">): Promise<Res<"lists.delete">>;
6474
6514
  /** Get one saved search / list by artifact id. (`dench lists show`) */
6475
6515
  get(args: Req<"lists.get">): Promise<Res<"lists.get">>;
6516
+ /** Explicitly import selected saved profiles, optionally filtered by enrichment, with a configured Lead status. Reuses CRM records; never sends outreach or triggers conversion. (`dench artifacts import`) */
6517
+ import(args: Req<"lists.import">): Promise<Res<"lists.import">>;
6476
6518
  /** List saved searches (find-result lists) in the workspace, newest first. (`dench lists`) */
6477
6519
  list(args?: Req<"lists.list">): Promise<Res<"lists.list">>;
6520
+ prospects: {
6521
+ /** Suggest ICP fit for one profile. Never changes a human review decision. (`dench lists assess`) */
6522
+ assess(args: Req<"lists.prospects.assess">): Promise<Res<"lists.prospects.assess">>;
6523
+ /** Read durable enrichment activity (legacy review metadata remains readable). Use lists rows for current saved profiles and contacts. (`dench lists reviews`) */
6524
+ reviews(args: Req<"lists.prospects.reviews">): Promise<Res<"lists.prospects.reviews">>;
6525
+ };
6478
6526
  /** Rename a saved search / list. (`dench lists rename`) */
6479
6527
  rename(args: Req<"lists.rename">): Promise<Res<"lists.rename">>;
6480
- /** Save find results as a named list (rows + filters become a workspace artifact). (`dench leads find --save-as "Name"`) */
6528
+ /** Read saved rows with current enrichment results and original indices; cursor-paged, without repeating a search. (`dench lists rows`) */
6529
+ rows(args: Req<"lists.rows">): Promise<Res<"lists.rows">>;
6530
+ /** Save find results as a named list (rows + filters become a workspace artifact). (`dench lists save`) */
6481
6531
  save(args: Req<"lists.save">): Promise<Res<"lists.save">>;
6482
6532
  /** Update a saved list in place (title, filters, and/or replacement rows). (`dench lists update`) */
6483
6533
  update(args: Req<"lists.update">): Promise<Res<"lists.update">>;
package/dench.ts CHANGED
@@ -501,6 +501,7 @@ Usage:
501
501
  dench artifacts import <id> --to lead|company|job_posting [--view "Q3 outbound"] [--pin] [--json]
502
502
  dench lists [--limit 25] [--json]
503
503
  dench lists show <id> [--json]
504
+ dench lists save --title "Shortlist" --people-file <people.json> [--json]
504
505
  dench lists rename <id> "New name" [--json]
505
506
  dench lists update <id> [--title "New name"] [--filters-json '{...}'] [--json]
506
507
  dench lists delete <id> [--json]
@@ -827,6 +828,7 @@ function listsCliHelp() {
827
828
  Usage:
828
829
  dench lists [--limit 25] [--json]
829
830
  dench lists show <id> [--json]
831
+ dench lists save --title "Shortlist" --people-file <people.json> [--json]
830
832
  dench lists rename <id> "New name" [--json]
831
833
  dench lists update <id> [--title "New name"] [--filters-json '{"titles":["CTO"]}'] [--json]
832
834
  dench lists delete <id> [--json]
package/leads.ts CHANGED
@@ -3,6 +3,8 @@
3
3
  * list/show/import. Find writes a durable table artifact; import is the
4
4
  * same path as the chat card.
5
5
  */
6
+
7
+ import { readFile } from "node:fs/promises";
6
8
  import type { ConvexHttpClient } from "convex/browser";
7
9
  import { makeFunctionReference } from "convex/server";
8
10
  import {
@@ -50,7 +52,15 @@ const api = {
50
52
  "functions/workspaceArtifacts:remove",
51
53
  ),
52
54
  list: makeFunctionReference<"query">("functions/workspaceArtifacts:list"),
55
+ listSaved: makeFunctionReference<"query">(
56
+ "functions/workspaceArtifacts:listSaved",
57
+ ),
58
+ listRows: makeFunctionReference<"action">(
59
+ "functions/workspaceArtifacts:listRows",
60
+ ),
53
61
  get: makeFunctionReference<"query">("functions/workspaceArtifacts:get"),
62
+ reviews: makeFunctionReference<"query">("functions/prospectReviews:list"),
63
+ assess: makeFunctionReference<"mutation">("functions/prospectReviews:assess"),
54
64
  importArtifact: makeFunctionReference<"action">(
55
65
  "functions/workspaceArtifacts:importArtifact",
56
66
  ),
@@ -59,14 +69,22 @@ const api = {
59
69
  ),
60
70
  };
61
71
 
62
- /** createdFrom values that mark an artifact as a saved search / list. */
63
- const LIST_CREATED_FROM = new Set([
64
- "find_people",
65
- "find_companies",
66
- "find_jobs",
67
- "mixed",
68
- "watch_fire",
69
- ]);
72
+ const ENRICHMENT_FILTERS = [
73
+ "all",
74
+ "enriched",
75
+ "in_progress",
76
+ "no_contacts",
77
+ "failed",
78
+ "not_enriched",
79
+ ];
80
+ function enrichmentFlag(args: string[]): string | undefined {
81
+ const value = getFlag(args, "--enrichment");
82
+ if (value !== undefined && !ENRICHMENT_FILTERS.includes(value))
83
+ throw new FindCliError(
84
+ "--enrichment must be " + ENRICHMENT_FILTERS.join("|"),
85
+ );
86
+ return value;
87
+ }
70
88
 
71
89
  function shift(args: string[], expected: string): string {
72
90
  try {
@@ -492,7 +510,7 @@ Usage:
492
510
  dench artifacts [--limit 25] [--json]
493
511
  dench artifacts list [--limit 25] [--json]
494
512
  dench artifacts show <id> [--json]
495
- dench artifacts import <id> --to lead|company|job_posting [--view "Q3 outbound"] [--pin] [--json]
513
+ dench artifacts import <id> --to lead|company|job_posting [--rows 0,4,9] [--enrichment enriched] [--status "Contacted"] [--view "Q3 outbound"] [--pin] [--json]
496
514
 
497
515
  \`list\` / \`show\` / \`import\` operate on find results (lead lists and job
498
516
  searches). Bare \`dench artifacts\` still lists agent suggested-work artifacts.
@@ -504,14 +522,25 @@ export function listsHelp(): void {
504
522
  console.log(`Dench lists
505
523
 
506
524
  Usage:
507
- dench lists [--limit 25] [--json]
525
+ dench lists [--search "September"] [--limit 25] [--cursor <cursor>] [--json]
508
526
  dench lists show <id> [--json]
527
+ dench lists save --title "Shortlist" --people-file <people.json> [--filters-json '{...}'] [--json]
528
+ dench lists rows <id> [--enrichment all|enriched|in_progress|no_contacts|failed|not_enriched] [--limit 100] [--cursor <cursor>] [--json]
509
529
  dench lists rename <id> "New name" [--json]
510
530
  dench lists update <id> [--title "New name"] [--filters-json '{"titles":["CTO"]}'] [--json]
511
531
  dench lists delete <id> [--json]
512
532
 
513
533
  Lists are saved searches from Find (people / companies / job postings).
534
+ People lists are not Leads. Select profiles in Find and confirm enrichment;
535
+ there is no mandatory per-profile ICP decision. Import only on explicit request, with the
536
+ requested configured CRM status. Follow pagination until isDone, even across
537
+ empty filtered pages. --rows uses original zero-based indices from lists rows.
538
+ dench lists reviews <id> [--limit 100] [--cursor <cursor>] [--json]
539
+ dench lists assess <id> --row-json '<profile>' --fit likely_fit|unlikely_fit|unknown --reason '<evidence and unknowns>' [--json]
514
540
  Create one with \`dench leads|companies|jobs find --save-as "Name"\`.
541
+ Consolidate selected search profiles with \`dench lists save\`: --people-file
542
+ is a JSON array of person rows, not a CSV or a whole tool response. It saves
543
+ a new list without searching, enriching, changing source lists, or importing CRM rows.
515
544
  Delete removes the list, its exported CSV/JSONL files, and any linked watch.
516
545
  CRM lists (saved views on Leads/Companies/Job Postings) are managed with
517
546
  \`dench crm views list|get|create|rename|delete\`.
@@ -539,30 +568,146 @@ export async function runListsCommand(opts: {
539
568
  if (verb === "help" || verb === "--help") return false;
540
569
  if (verb === undefined || verb === "list" || verb?.startsWith("--")) {
541
570
  if (verb === "list") args.shift();
542
- const limitRaw = getFlag(args, "--limit");
543
- const limit = limitRaw ? Number(limitRaw) : 25;
571
+ const limit = Number(getFlag(args, "--limit") ?? 25);
572
+ const cursor = getFlag(args, "--cursor") ?? null;
573
+ const search = getFlag(args, "--search");
574
+ if (!Number.isInteger(limit) || limit < 1 || limit > 100)
575
+ throw new FindCliError("--limit must be between 1 and 100");
544
576
  assertNoUnknownFlags(args, "lists");
545
- const rows = (await callQuery(ctx, api.list, {
546
- kind: "table",
547
- // Over-fetch: the query filters by kind only; saved searches are
548
- // the table artifacts whose createdFrom is a find/watch source.
549
- limit: Math.min(Math.max(limit * 2, limit), 200),
550
- })) as Array<Record<string, unknown>>;
551
- const lists = rows
552
- .filter((row) => LIST_CREATED_FROM.has(String(row.createdFrom)))
553
- .slice(0, limit)
554
- .map((row) => ({
555
- _id: row._id,
556
- title: row.title,
557
- createdFrom: row.createdFrom,
558
- rowCount: row.rowCount,
559
- createdAt: row.createdAt,
560
- watchId: row.watchId,
561
- }));
562
- out(ctx, lists);
577
+ out(
578
+ ctx,
579
+ await callQuery(ctx, api.listSaved, {
580
+ paginationOpts: { numItems: limit, cursor },
581
+ search,
582
+ }),
583
+ );
563
584
  return true;
564
585
  }
565
586
  args.shift();
587
+ if (verb === "save") {
588
+ const title = getFlag(args, "--title")?.trim();
589
+ const peopleFile = getFlag(args, "--people-file");
590
+ const filtersJson = getFlag(args, "--filters-json");
591
+ assertNoUnknownFlags(args, "lists save");
592
+ if (!title || !peopleFile) {
593
+ throw new FindCliError(
594
+ "dench lists save requires --title and --people-file",
595
+ );
596
+ }
597
+ let people: unknown;
598
+ let filters: unknown;
599
+ try {
600
+ people = JSON.parse(await readFile(peopleFile, "utf-8"));
601
+ } catch {
602
+ throw new FindCliError(
603
+ "--people-file must be a readable JSON file containing an array of person rows",
604
+ );
605
+ }
606
+ if (
607
+ !Array.isArray(people) ||
608
+ people.length === 0 ||
609
+ people.some(
610
+ (person) =>
611
+ !person ||
612
+ typeof person !== "object" ||
613
+ Array.isArray(person) ||
614
+ ![person.fullName, person.name].some(
615
+ (name) => typeof name === "string" && name.trim(),
616
+ ),
617
+ )
618
+ ) {
619
+ throw new FindCliError(
620
+ "--people-file must contain a non-empty array of person rows, each with name or fullName",
621
+ );
622
+ }
623
+ if (filtersJson !== undefined) {
624
+ try {
625
+ filters = JSON.parse(filtersJson);
626
+ } catch {
627
+ throw new FindCliError("--filters-json must be a JSON object");
628
+ }
629
+ if (!filters || typeof filters !== "object" || Array.isArray(filters)) {
630
+ throw new FindCliError("--filters-json must be a JSON object");
631
+ }
632
+ }
633
+ out(
634
+ ctx,
635
+ await callAction(ctx, api.saveFind, {
636
+ createdFrom: "find_people",
637
+ title,
638
+ people,
639
+ ...(filters !== undefined ? { filters } : {}),
640
+ }),
641
+ );
642
+ return true;
643
+ }
644
+ if (verb === "rows") {
645
+ const artifactId = shift(args, "list id");
646
+ const limit = Number(getFlag(args, "--limit") ?? 100);
647
+ const cursor = getFlag(args, "--cursor");
648
+ const enrichment = enrichmentFlag(args);
649
+ if (!Number.isInteger(limit) || limit < 1 || limit > 100)
650
+ throw new FindCliError("--limit must be between 1 and 100");
651
+ assertNoUnknownFlags(args, "lists rows");
652
+ out(
653
+ ctx,
654
+ await callAction(ctx, api.listRows, {
655
+ artifactId,
656
+ limit,
657
+ cursor,
658
+ enrichment,
659
+ }),
660
+ );
661
+ return true;
662
+ }
663
+ if (verb === "reviews") {
664
+ const artifactId = shift(args, "list id");
665
+ const limit = Number(getFlag(args, "--limit") ?? 50);
666
+ const cursor = getFlag(args, "--cursor") ?? null;
667
+ if (!Number.isInteger(limit) || limit < 1 || limit > 100)
668
+ throw new FindCliError("--limit must be between 1 and 100");
669
+ assertNoUnknownFlags(args, "lists reviews");
670
+ out(
671
+ ctx,
672
+ await callQuery(ctx, api.reviews, {
673
+ artifactId,
674
+ paginationOpts: { numItems: limit, cursor },
675
+ }),
676
+ );
677
+ return true;
678
+ }
679
+ if (verb === "assess") {
680
+ const artifactId = shift(args, "list id");
681
+ const rowJson = getFlag(args, "--row-json");
682
+ const fit = getFlag(args, "--fit");
683
+ const reason = getFlag(args, "--reason");
684
+ assertNoUnknownFlags(args, "lists assess");
685
+ if (
686
+ !rowJson ||
687
+ !reason ||
688
+ !fit ||
689
+ !["likely_fit", "unlikely_fit", "unknown"].includes(fit)
690
+ )
691
+ throw new FindCliError(
692
+ "Use --row-json, --fit likely_fit|unlikely_fit|unknown, and --reason. This records an AI suggestion, not human approval.",
693
+ );
694
+ let row: unknown;
695
+ try {
696
+ row = JSON.parse(rowJson);
697
+ } catch {
698
+ throw new FindCliError("--row-json must be valid JSON");
699
+ }
700
+ out(
701
+ ctx,
702
+ await ctx.convex.mutation(api.assess, {
703
+ artifactId,
704
+ row,
705
+ suggestion: { fit, reason },
706
+ ...(ctx.sessionToken ? { sessionToken: ctx.sessionToken } : {}),
707
+ } as never),
708
+ );
709
+ return true;
710
+ }
566
711
  if (verb === "show") {
567
712
  const artifactId = shift(args, "list id");
568
713
  assertNoUnknownFlags(args, "lists show");
@@ -1021,6 +1166,22 @@ export async function runWorkspaceArtifactsCommand(opts: {
1021
1166
  }
1022
1167
  const viewName = getFlag(args, "--view");
1023
1168
  const pin = hasFlag(args, "--pin");
1169
+ const status = getFlag(args, "--status");
1170
+ const enrichment = enrichmentFlag(args);
1171
+ const rowsFlag = getFlag(args, "--rows");
1172
+ const rowIndexes =
1173
+ rowsFlag === undefined
1174
+ ? undefined
1175
+ : rowsFlag.split(",").map((value) => {
1176
+ if (!/^\d+$/.test(value.trim()))
1177
+ throw new FindCliError(
1178
+ "--rows must be comma-separated original zero-based row indices",
1179
+ );
1180
+ const index = Number(value);
1181
+ if (!Number.isSafeInteger(index))
1182
+ throw new FindCliError("Invalid row index");
1183
+ return index;
1184
+ });
1024
1185
  assertNoUnknownFlags(args, "artifacts import");
1025
1186
  out(
1026
1187
  ctx,
@@ -1029,6 +1190,9 @@ export async function runWorkspaceArtifactsCommand(opts: {
1029
1190
  to,
1030
1191
  viewName,
1031
1192
  pin,
1193
+ status,
1194
+ enrichment,
1195
+ rowIndexes,
1032
1196
  }),
1033
1197
  );
1034
1198
  return true;
@@ -95,11 +95,15 @@ export const APP_SDK_OPERATIONS: readonly AppSdkOperationInfo[] = [
95
95
  {"id":"workspace.artifacts.list","group":"workspace","summary":"List artifacts for the authenticated workspace.","cli":"dench artifacts","method":"GET","path":"/artifacts","permission":"workspace:read","pathParams":[]},
96
96
  {"id":"workspace.suggestedWork.list","group":"workspace","summary":"List draft suggested-work artifacts.","cli":"dench suggested-work","method":"GET","path":"/suggested-work","permission":"workspace:read","pathParams":[]},
97
97
  {"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":[]},
98
+ {"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"]},
99
+ {"id":"lists.import","group":"lists","summary":"Explicitly import selected saved profiles, optionally filtered by enrichment, with a configured Lead status. Reuses CRM records; never sends outreach or triggers conversion.","cli":"dench artifacts import","method":"POST","path":"/lists/{artifactId}/import","permission":"lists:write","pathParams":["artifactId"]},
98
100
  {"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"]},
99
- {"id":"lists.save","group":"lists","summary":"Save find results as a named list (rows + filters become a workspace artifact).","cli":"dench leads find --save-as \"Name\"","method":"POST","path":"/lists","permission":"lists:write","pathParams":[]},
101
+ {"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":[]},
100
102
  {"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"]},
101
103
  {"id":"lists.rename","group":"lists","summary":"Rename a saved search / list.","cli":"dench lists rename","method":"POST","path":"/lists/{artifactId}/rename","permission":"lists:write","pathParams":["artifactId"]},
102
104
  {"id":"lists.delete","group":"lists","summary":"Delete a saved search / list, its exported CSV/JSONL files, and any linked watch.","cli":"dench lists delete","method":"DELETE","path":"/lists/{artifactId}","permission":"lists:write","pathParams":["artifactId"]},
105
+ {"id":"lists.prospects.reviews","group":"lists","summary":"Read durable enrichment activity (legacy review metadata remains readable). Use lists rows for current saved profiles and contacts.","cli":"dench lists reviews","method":"GET","path":"/lists/{artifactId}/reviews","permission":"lists:read","pathParams":["artifactId"]},
106
+ {"id":"lists.prospects.assess","group":"lists","summary":"Suggest ICP fit for one profile. Never changes a human review decision.","cli":"dench lists assess","method":"POST","path":"/lists/{artifactId}/assess","permission":"lists:write","pathParams":["artifactId"]},
103
107
  {"id":"memory.search","group":"memory","summary":"Search durable workspace memory.","cli":"dench memory search","method":"GET","path":"/memory/search","permission":"memory:read","pathParams":[]},
104
108
  {"id":"memory.save","group":"memory","summary":"Save a durable workspace memory fact.","cli":"dench memory save","method":"POST","path":"/memory","permission":"memory:write","pathParams":[]},
105
109
  {"id":"approval.request","group":"approvals","summary":"Request human approval.","cli":"dench approval request","method":"POST","path":"/approvals","permission":"approvals:write","pathParams":[]},
@@ -346,9 +346,74 @@ const rawApiOperations = [
346
346
  aliases: ["dench lists list"],
347
347
  method: "GET",
348
348
  path: "/lists",
349
- requestSchema: noBody,
349
+ requestSchema: z.object({
350
+ search: z.string().optional(),
351
+ cursor: z.string().optional(),
352
+ limit: z.coerce.number().int().min(1).max(100).optional(),
353
+ }),
354
+ responseSchema: anyResponse,
355
+ backend: {
356
+ ...convex("query", "functions/workspaceArtifacts:listSaved"),
357
+ transformArgs: (input) => ({
358
+ search: input.search,
359
+ paginationOpts: paginationOptsFrom(input, 25),
360
+ }),
361
+ },
362
+ }),
363
+ op({
364
+ id: "lists.rows",
365
+ group: "lists",
366
+ summary:
367
+ "Read saved rows with current enrichment results and original indices; cursor-paged, without repeating a search.",
368
+ cli: "dench lists rows",
369
+ method: "GET",
370
+ path: "/lists/{artifactId}/rows",
371
+ requestSchema: z.object({
372
+ artifactId: z.string().min(1),
373
+ cursor: z.string().optional(),
374
+ limit: z.coerce.number().int().min(1).max(100).optional(),
375
+ enrichment: z
376
+ .enum([
377
+ "all",
378
+ "enriched",
379
+ "in_progress",
380
+ "no_contacts",
381
+ "failed",
382
+ "not_enriched",
383
+ ])
384
+ .optional(),
385
+ }),
386
+ responseSchema: anyResponse,
387
+ backend: convex("action", "functions/workspaceArtifacts:listRows"),
388
+ }),
389
+ op({
390
+ id: "lists.import",
391
+ group: "lists",
392
+ summary:
393
+ "Explicitly import selected saved profiles, optionally filtered by enrichment, with a configured Lead status. Reuses CRM records; never sends outreach or triggers conversion.",
394
+ cli: "dench artifacts import",
395
+ method: "POST",
396
+ path: "/lists/{artifactId}/import",
397
+ requestSchema: z.object({
398
+ artifactId: z.string().min(1),
399
+ to: z.enum(["lead", "company", "job_posting"]),
400
+ rowIndexes: z.array(z.number().int().min(0)).optional(),
401
+ status: z.string().min(1).optional(),
402
+ enrichment: z
403
+ .enum([
404
+ "all",
405
+ "enriched",
406
+ "in_progress",
407
+ "no_contacts",
408
+ "failed",
409
+ "not_enriched",
410
+ ])
411
+ .optional(),
412
+ viewName: z.string().optional(),
413
+ pin: z.boolean().optional(),
414
+ }),
350
415
  responseSchema: anyResponse,
351
- backend: convex("query", "functions/workspaceArtifacts:list"),
416
+ backend: convex("action", "functions/workspaceArtifacts:importArtifact"),
352
417
  }),
353
418
  op({
354
419
  id: "lists.get",
@@ -366,7 +431,8 @@ const rawApiOperations = [
366
431
  group: "lists",
367
432
  summary:
368
433
  "Save find results as a named list (rows + filters become a workspace artifact).",
369
- cli: 'dench leads find --save-as "Name"',
434
+ cli: "dench lists save",
435
+ aliases: ['dench leads find --save-as "Name"'],
370
436
  method: "POST",
371
437
  path: "/lists",
372
438
  requestSchema: anyObject,
@@ -409,6 +475,48 @@ const rawApiOperations = [
409
475
  backend: convex("mutation", "functions/workspaceArtifacts:remove"),
410
476
  }),
411
477
 
478
+ op({
479
+ id: "lists.prospects.reviews",
480
+ group: "lists",
481
+ summary:
482
+ "Read durable enrichment activity (legacy review metadata remains readable). Use lists rows for current saved profiles and contacts.",
483
+ cli: "dench lists reviews",
484
+ method: "GET",
485
+ path: "/lists/{artifactId}/reviews",
486
+ requestSchema: z.object({
487
+ artifactId: z.string().min(1),
488
+ limit: z.coerce.number().int().min(1).max(100).optional(),
489
+ cursor: z.string().optional(),
490
+ }),
491
+ responseSchema: anyResponse,
492
+ backend: {
493
+ ...convex("query", "functions/prospectReviews:list"),
494
+ transformArgs: (input) => ({
495
+ artifactId: input.artifactId,
496
+ paginationOpts: paginationOptsFrom(input, 50),
497
+ }),
498
+ },
499
+ }),
500
+ op({
501
+ id: "lists.prospects.assess",
502
+ group: "lists",
503
+ summary:
504
+ "Suggest ICP fit for one profile. Never changes a human review decision.",
505
+ cli: "dench lists assess",
506
+ method: "POST",
507
+ path: "/lists/{artifactId}/assess",
508
+ requestSchema: z.object({
509
+ artifactId: z.string().min(1),
510
+ row: z.record(z.string(), z.unknown()),
511
+ suggestion: z.object({
512
+ fit: z.enum(["likely_fit", "unlikely_fit", "unknown"]),
513
+ reason: z.string().min(1).max(2000),
514
+ }),
515
+ }),
516
+ responseSchema: anyResponse,
517
+ backend: convex("mutation", "functions/prospectReviews:assess"),
518
+ }),
519
+
412
520
  // Memory and approvals.
413
521
  op({
414
522
  id: "memory.search",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dench.com/cli",
3
- "version": "3.0.4-staging.289",
3
+ "version": "3.2.0-staging.294",
4
4
  "description": "Dench agent workspace CLI.",
5
5
  "type": "module",
6
6
  "bin": {