@dench.com/cli 3.2.0-staging.294 → 3.2.1-staging.295

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
@@ -204,11 +204,16 @@ dench signin --host https://staging.dench.com
204
204
  ## Saved prospect lists
205
205
 
206
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
207
  The lead-finding skill establishes `/workspace/ICP.md` on first use and
209
208
  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.
209
+ In Find, click **Find** in a Work email, Phone, or Personal email cell to
210
+ request that field. The control discloses credit use; the lookup starts directly.
211
+ Different people run concurrently; wait for a person's current lookup before
212
+ starting another field. The cell shimmers with **Enriching**, then shows the
213
+ returned value or **Not found**. Header play targets selected profiles, or the
214
+ whole saved list when none are selected, with credit confirmation inline.
215
+ Bulk progress floats temporarily and disappears when finished, including misses.
216
+ Contact results persist in the list; other columns remain under View settings.
212
217
 
213
218
  ```bash
214
219
  dench leads find --titles "VP Sales" --save-as "Q3 targets" --json
@@ -225,6 +230,22 @@ unchanged. Optional `--filters-json` stores criteria/source evidence metadata.
225
230
  In chat, explicitly present the final list; research batches stay in activity
226
231
  details instead of becoming competing result sets.
227
232
 
233
+ Before presenting a shortlist, the skill saves an ICP relevance score (0–100)
234
+ and short reason for each profile using the confirmed brief. These appear as
235
+ **ICP fit** and **Why this lead** in Find and in CSV exports. Scores are not
236
+ conversion probabilities or CRM statuses. To save assessments for canonical
237
+ rows returned by `lists rows`, create a JSON array of
238
+ `{row, suggestion: {fit, score, reason}}` (1–100 items per file):
239
+
240
+ ```bash
241
+ dench lists assess <artifactId> --assessments-file /tmp/icp-assessments.json --json
242
+ ```
243
+
244
+ `fit` is `likely_fit`, `unlikely_fit`, or `unknown`; `score` is a whole number
245
+ from 0 to 100. The CLI validates the file before writes and reports partial
246
+ failures; retrying updates existing assessments. Re-read rows to verify every
247
+ saved score and reason. Older unscored profiles remain **Not scored** until assessed.
248
+
228
249
  Directory and row reads return `page`, `continueCursor`, and `isDone`.
229
250
  Follow cursors even through empty filtered pages. Lists survive new chats;
230
251
  read fresh rows and contacts instead of an old transcript or CSV. Each row
package/app-sdk.d.ts CHANGED
@@ -123,6 +123,8 @@ export interface ApiRequests {
123
123
  row: Record<string, unknown>;
124
124
  suggestion: {
125
125
  fit: "likely_fit" | "unlikely_fit" | "unknown";
126
+ /** AI relevance to the saved ICP, not conversion probability. */
127
+ score?: number;
126
128
  reason: string;
127
129
  };
128
130
  };
package/leads.ts CHANGED
@@ -22,6 +22,7 @@ import {
22
22
  searchPeople,
23
23
  } from "./lib/enrichment-gateway";
24
24
  import { FIND_FILTER_OPTION_CATALOG } from "./lib/find-filter-options.generated";
25
+ import { parseProspectAssessments } from "./lib/prospect-assessment";
25
26
 
26
27
  class FindCliError extends Error {
27
28
  constructor(message: string) {
@@ -536,7 +537,10 @@ there is no mandatory per-profile ICP decision. Import only on explicit request,
536
537
  requested configured CRM status. Follow pagination until isDone, even across
537
538
  empty filtered pages. --rows uses original zero-based indices from lists rows.
538
539
  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]
540
+ dench lists assess <id> --row-json '<profile>' --fit likely_fit|unlikely_fit|unknown --score 0-100 --reason '<short ICP reason>' [--json]
541
+ dench lists assess <id> --assessments-file <assessments.json> [--json]
542
+ Assessments files contain 1–100 {row, suggestion: {fit, score, reason}} items.
543
+ Scores are AI relevance to the saved ICP, not conversion probabilities or CRM qualification.
540
544
  Create one with \`dench leads|companies|jobs find --save-as "Name"\`.
541
545
  Consolidate selected search profiles with \`dench lists save\`: --people-file
542
546
  is a JSON array of person rows, not a CSV or a whole tool response. It saves
@@ -679,9 +683,48 @@ export async function runListsCommand(opts: {
679
683
  if (verb === "assess") {
680
684
  const artifactId = shift(args, "list id");
681
685
  const rowJson = getFlag(args, "--row-json");
686
+ const assessmentsFile = getFlag(args, "--assessments-file");
682
687
  const fit = getFlag(args, "--fit");
688
+ const scoreRaw = getFlag(args, "--score");
683
689
  const reason = getFlag(args, "--reason");
684
690
  assertNoUnknownFlags(args, "lists assess");
691
+ if (assessmentsFile) {
692
+ if (
693
+ rowJson !== undefined ||
694
+ fit !== undefined ||
695
+ scoreRaw !== undefined ||
696
+ reason !== undefined
697
+ )
698
+ throw new FindCliError(
699
+ "Use --assessments-file alone, or --row-json with --fit, --score, and --reason.",
700
+ );
701
+ let input: unknown;
702
+ try {
703
+ input = JSON.parse(await readFile(assessmentsFile, "utf-8"));
704
+ } catch {
705
+ throw new FindCliError(
706
+ "--assessments-file must be a readable JSON array of assessments.",
707
+ );
708
+ }
709
+ const assessments = parseProspectAssessments(input);
710
+ let saved = 0;
711
+ try {
712
+ for (const assessment of assessments) {
713
+ await ctx.convex.mutation(api.assess, {
714
+ artifactId,
715
+ ...assessment,
716
+ ...(ctx.sessionToken ? { sessionToken: ctx.sessionToken } : {}),
717
+ } as never);
718
+ saved++;
719
+ }
720
+ } catch (error) {
721
+ throw new FindCliError(
722
+ `Saved ${saved} of ${assessments.length} assessments. Retry the file to continue; assessments are replaced, not duplicated. ${error instanceof Error ? error.message : "Assessment failed."}`,
723
+ );
724
+ }
725
+ out(ctx, { assessed: saved });
726
+ return true;
727
+ }
685
728
  if (
686
729
  !rowJson ||
687
730
  !reason ||
@@ -701,8 +744,18 @@ export async function runListsCommand(opts: {
701
744
  ctx,
702
745
  await ctx.convex.mutation(api.assess, {
703
746
  artifactId,
704
- row,
705
- suggestion: { fit, reason },
747
+ ...parseProspectAssessments([
748
+ {
749
+ row,
750
+ suggestion: {
751
+ fit,
752
+ reason,
753
+ ...(scoreRaw !== undefined
754
+ ? { score: scoreRaw.trim() ? Number(scoreRaw) : NaN }
755
+ : {}),
756
+ },
757
+ },
758
+ ])[0],
706
759
  ...(ctx.sessionToken ? { sessionToken: ctx.sessionToken } : {}),
707
760
  } as never),
708
761
  );
@@ -510,6 +510,15 @@ const rawApiOperations = [
510
510
  row: z.record(z.string(), z.unknown()),
511
511
  suggestion: z.object({
512
512
  fit: z.enum(["likely_fit", "unlikely_fit", "unknown"]),
513
+ score: z
514
+ .number()
515
+ .int()
516
+ .min(0)
517
+ .max(100)
518
+ .optional()
519
+ .describe(
520
+ "AI relevance to the saved ICP, not conversion probability.",
521
+ ),
513
522
  reason: z.string().min(1).max(2000),
514
523
  }),
515
524
  }),
@@ -0,0 +1,50 @@
1
+ export type ProspectAssessment = {
2
+ row: Record<string, unknown>;
3
+ suggestion: {
4
+ fit: "likely_fit" | "unlikely_fit" | "unknown";
5
+ score?: number;
6
+ reason: string;
7
+ };
8
+ };
9
+
10
+ /** Validate the entire file before the first write, including optional legacy scores. */
11
+ export function parseProspectAssessments(input: unknown): ProspectAssessment[] {
12
+ if (!Array.isArray(input) || !input.length || input.length > 100)
13
+ throw new Error("Provide 1–100 assessments containing row and suggestion.");
14
+ return input.map((entry) => {
15
+ const row = entry?.row;
16
+ const suggestion = entry?.suggestion;
17
+ if (
18
+ !row ||
19
+ typeof row !== "object" ||
20
+ Array.isArray(row) ||
21
+ !suggestion ||
22
+ !["likely_fit", "unlikely_fit", "unknown"].includes(suggestion.fit) ||
23
+ typeof suggestion.reason !== "string" ||
24
+ !suggestion.reason.trim() ||
25
+ suggestion.reason.length > 2000
26
+ )
27
+ throw new Error(
28
+ "Each assessment needs a profile row, fit (likely_fit|unlikely_fit|unknown), and a reason of 1–2000 characters.",
29
+ );
30
+ const score = suggestion.score;
31
+ if (
32
+ score !== undefined &&
33
+ (typeof score !== "number" ||
34
+ !Number.isInteger(score) ||
35
+ score < 0 ||
36
+ score > 100)
37
+ )
38
+ throw new Error(
39
+ "ICP relevance score must be a whole number from 0 to 100.",
40
+ );
41
+ return {
42
+ row,
43
+ suggestion: {
44
+ fit: suggestion.fit,
45
+ reason: suggestion.reason.trim(),
46
+ ...(score !== undefined ? { score } : {}),
47
+ },
48
+ };
49
+ });
50
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dench.com/cli",
3
- "version": "3.2.0-staging.294",
3
+ "version": "3.2.1-staging.295",
4
4
  "description": "Dench agent workspace CLI.",
5
5
  "type": "module",
6
6
  "bin": {