@dench.com/cli 3.3.0-staging.314 → 3.5.0-staging.327
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 +0 -81
- package/app-sdk.d.ts +147 -131
- package/crm-comments.ts +444 -1
- package/crm-detections.ts +261 -0
- package/crm.ts +223 -13
- package/cron.ts +54 -15
- package/dench.ts +39 -28
- package/lib/api-schemas.ts +82 -0
- package/lib/app-sdk-catalog.generated.ts +20 -11
- package/lib/app-sdk-surface.ts +12 -0
- package/lib/command-registry.ts +321 -65
- package/meetings.ts +82 -1
- package/package.json +3 -2
- package/settings.ts +229 -0
- package/lib/signal-agents.ts +0 -454
- package/signals.ts +0 -109
package/lib/command-registry.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type ZodTypeAny, z } from "zod";
|
|
2
2
|
import { convexExtras, requestSchemas, responseSchemas } from "./api-schemas";
|
|
3
|
-
import { signalAgentConfigSchema } from "./signal-agents";
|
|
4
3
|
|
|
5
4
|
export type ApiAuthMode = "none" | "bearer" | "optional";
|
|
6
5
|
|
|
@@ -1155,6 +1154,134 @@ const rawApiOperations = [
|
|
|
1155
1154
|
responseSchema: anyResponse,
|
|
1156
1155
|
backend: convex("query", "functions/crm/entries:get"),
|
|
1157
1156
|
}),
|
|
1157
|
+
op({
|
|
1158
|
+
id: "crm.entries.syncHistory",
|
|
1159
|
+
group: "crm",
|
|
1160
|
+
summary:
|
|
1161
|
+
"Queue a full, paged pull of the record's email history from every connected mailbox; the ledger fills as pages land.",
|
|
1162
|
+
cli: "dench crm entries sync-history",
|
|
1163
|
+
method: "POST",
|
|
1164
|
+
path: "/crm/objects/{objectName}/entries/{entryId}/sync-history",
|
|
1165
|
+
requestSchema: noBody,
|
|
1166
|
+
responseSchema: anyResponse,
|
|
1167
|
+
backend: {
|
|
1168
|
+
...convex("mutation", "functions/emailIdentityHistory:requestForEntry"),
|
|
1169
|
+
transformArgs: (input) => ({
|
|
1170
|
+
objectName: input.objectName,
|
|
1171
|
+
entryId: input.entryId,
|
|
1172
|
+
}),
|
|
1173
|
+
},
|
|
1174
|
+
}),
|
|
1175
|
+
op({
|
|
1176
|
+
id: "crm.entries.syncHistoryStatus",
|
|
1177
|
+
group: "crm",
|
|
1178
|
+
summary:
|
|
1179
|
+
"Has Dench read this record's email history? One row per address per mailbox.",
|
|
1180
|
+
cli: "dench crm entries sync-history --status",
|
|
1181
|
+
method: "GET",
|
|
1182
|
+
path: "/crm/objects/{objectName}/entries/{entryId}/sync-history",
|
|
1183
|
+
requestSchema: noBody,
|
|
1184
|
+
responseSchema: anyResponse,
|
|
1185
|
+
backend: {
|
|
1186
|
+
...convex("query", "functions/emailIdentityHistory:statusForEntry"),
|
|
1187
|
+
transformArgs: (input) => ({
|
|
1188
|
+
objectName: input.objectName,
|
|
1189
|
+
entryId: input.entryId,
|
|
1190
|
+
}),
|
|
1191
|
+
},
|
|
1192
|
+
}),
|
|
1193
|
+
op({
|
|
1194
|
+
id: "crm.entries.dossier.get",
|
|
1195
|
+
group: "crm",
|
|
1196
|
+
summary:
|
|
1197
|
+
"Status of the account's research dossier — the delimited `dench:dossier` section Dench keeps in the record's Notes: status, when it was written, how many dated updates followed, the last error.",
|
|
1198
|
+
cli: "dench crm entries dossier",
|
|
1199
|
+
method: "GET",
|
|
1200
|
+
path: "/crm/entries/{entryId}/dossier",
|
|
1201
|
+
requestSchema: noBody,
|
|
1202
|
+
responseSchema: anyResponse,
|
|
1203
|
+
backend: {
|
|
1204
|
+
...convex("query", "functions/crm/dossier:getForEntry"),
|
|
1205
|
+
transformArgs: (input) => ({ entryId: input.entryId }),
|
|
1206
|
+
},
|
|
1207
|
+
}),
|
|
1208
|
+
op({
|
|
1209
|
+
id: "crm.entries.dossier.regenerate",
|
|
1210
|
+
group: "crm",
|
|
1211
|
+
summary:
|
|
1212
|
+
"Research the account again and append a fresh dossier section to its Notes (needs a Website / Domain on the record).",
|
|
1213
|
+
cli: "dench crm entries dossier --regenerate",
|
|
1214
|
+
method: "POST",
|
|
1215
|
+
path: "/crm/entries/{entryId}/dossier/regenerate",
|
|
1216
|
+
requestSchema: noBody,
|
|
1217
|
+
responseSchema: anyResponse,
|
|
1218
|
+
backend: {
|
|
1219
|
+
...convex("mutation", "functions/crm/dossier:regenerate"),
|
|
1220
|
+
transformArgs: (input) => ({ entryId: input.entryId }),
|
|
1221
|
+
},
|
|
1222
|
+
}),
|
|
1223
|
+
// Account detection (plan §4): the verdicts Dench took on counterparties
|
|
1224
|
+
// that emailed the workspace, the LinkedIn resolver's rows on the same
|
|
1225
|
+
// table, and the ONE rollback for everything the ingestion jobs created
|
|
1226
|
+
// (§13 #38): detections (email + sweep), linkedin, email-tasks.
|
|
1227
|
+
op({
|
|
1228
|
+
id: "crm.detections.list",
|
|
1229
|
+
group: "crm",
|
|
1230
|
+
summary:
|
|
1231
|
+
"List account-detection verdicts — why a domain (or personal address) did or did not become an account: verdict, counterparty type, probabilities, evidence threads, the rows created. `kind` picks the creator: `detections` (email + sweep), `linkedin` (the LinkedIn resolver's rows) or `all` (default). Newest first.",
|
|
1232
|
+
cli: "dench crm detections list",
|
|
1233
|
+
method: "GET",
|
|
1234
|
+
path: "/crm/detections",
|
|
1235
|
+
requestSchema: noBody,
|
|
1236
|
+
responseSchema: anyResponse,
|
|
1237
|
+
backend: {
|
|
1238
|
+
...convex("query", "functions/crm/accountDetection:list"),
|
|
1239
|
+
transformArgs: (input) => ({
|
|
1240
|
+
...(typeof input.verdict === "string"
|
|
1241
|
+
? { verdict: input.verdict }
|
|
1242
|
+
: {}),
|
|
1243
|
+
...(input.kind === "detections" ||
|
|
1244
|
+
input.kind === "linkedin" ||
|
|
1245
|
+
input.kind === "all"
|
|
1246
|
+
? { kind: input.kind }
|
|
1247
|
+
: {}),
|
|
1248
|
+
...(typeof input.since === "number" ? { since: input.since } : {}),
|
|
1249
|
+
...(typeof input.limit === "number"
|
|
1250
|
+
? { limit: Math.min(Math.max(Math.floor(input.limit), 1), 200) }
|
|
1251
|
+
: {}),
|
|
1252
|
+
}),
|
|
1253
|
+
},
|
|
1254
|
+
}),
|
|
1255
|
+
op({
|
|
1256
|
+
id: "crm.detections.undo",
|
|
1257
|
+
group: "crm",
|
|
1258
|
+
summary:
|
|
1259
|
+
"Undo what the ingestion jobs created since a timestamp (admin): `kind` = `detections` (accounts + contacts from the email detector and the sweep), `linkedin` (the LinkedIn resolver's contacts + accounts; their conversations are unlinked and parked), `email-tasks` (auto-created tasks and cases) or `all` (default). Deletes only rows no human has touched and marks the verdicts / decisions rolled_back so they are never re-created. `dryRun` lists what would go; per-kind counts in `kinds`.",
|
|
1260
|
+
cli: "dench crm detections undo",
|
|
1261
|
+
method: "POST",
|
|
1262
|
+
path: "/crm/detections/undo",
|
|
1263
|
+
requestSchema: z.object({
|
|
1264
|
+
since: z
|
|
1265
|
+
.number()
|
|
1266
|
+
.describe("Only verdicts / decisions at or after this ms timestamp."),
|
|
1267
|
+
kind: z
|
|
1268
|
+
.enum(["detections", "linkedin", "email-tasks", "all"])
|
|
1269
|
+
.optional()
|
|
1270
|
+
.describe("Which creator's rows to undo. Default `all`."),
|
|
1271
|
+
dryRun: z.boolean().optional(),
|
|
1272
|
+
limit: z.number().int().min(1).max(50).optional(),
|
|
1273
|
+
}),
|
|
1274
|
+
responseSchema: anyResponse,
|
|
1275
|
+
backend: {
|
|
1276
|
+
...convex("mutation", "functions/crm/accountDetection:undo"),
|
|
1277
|
+
transformArgs: (input) => ({
|
|
1278
|
+
since: input.since,
|
|
1279
|
+
...(typeof input.kind === "string" ? { kind: input.kind } : {}),
|
|
1280
|
+
...(input.dryRun === true ? { dryRun: true } : {}),
|
|
1281
|
+
...(typeof input.limit === "number" ? { limit: input.limit } : {}),
|
|
1282
|
+
}),
|
|
1283
|
+
},
|
|
1284
|
+
}),
|
|
1158
1285
|
op({
|
|
1159
1286
|
id: "crm.entries.history",
|
|
1160
1287
|
group: "crm",
|
|
@@ -1187,6 +1314,141 @@ const rawApiOperations = [
|
|
|
1187
1314
|
},
|
|
1188
1315
|
}),
|
|
1189
1316
|
|
|
1317
|
+
// CRM activity ledger — one timeline per record: notes, comments, field
|
|
1318
|
+
// changes and every external touch (email, calendar, meeting, Slack,
|
|
1319
|
+
// LinkedIn). Newest first by default; only rows the caller may read.
|
|
1320
|
+
op({
|
|
1321
|
+
id: "crm.activity.list",
|
|
1322
|
+
group: "crm",
|
|
1323
|
+
summary:
|
|
1324
|
+
"List a CRM entry's activity ledger (comments, notes, field changes, emails, meetings, Slack, LinkedIn) in one timeline, newest first by default.",
|
|
1325
|
+
cli: "dench crm activity",
|
|
1326
|
+
method: "GET",
|
|
1327
|
+
path: "/crm/objects/{objectName}/entries/{entryId}/activity",
|
|
1328
|
+
requestSchema: noBody,
|
|
1329
|
+
responseSchema: anyResponse,
|
|
1330
|
+
backend: {
|
|
1331
|
+
...convex("query", "functions/crm/activity:listForEntry"),
|
|
1332
|
+
transformArgs: (input) => {
|
|
1333
|
+
const limit =
|
|
1334
|
+
typeof input.limit === "number"
|
|
1335
|
+
? Math.min(Math.max(Math.floor(input.limit), 1), 200)
|
|
1336
|
+
: 40;
|
|
1337
|
+
const kinds =
|
|
1338
|
+
typeof input.kinds === "string"
|
|
1339
|
+
? input.kinds
|
|
1340
|
+
.split(",")
|
|
1341
|
+
.map((k: string) => k.trim())
|
|
1342
|
+
.filter(Boolean)
|
|
1343
|
+
: Array.isArray(input.kinds)
|
|
1344
|
+
? input.kinds
|
|
1345
|
+
: undefined;
|
|
1346
|
+
return {
|
|
1347
|
+
objectName: input.objectName,
|
|
1348
|
+
entryId: input.entryId,
|
|
1349
|
+
order: input.order === "asc" ? "asc" : "desc",
|
|
1350
|
+
limit,
|
|
1351
|
+
includeSystem: input.includeSystem === true,
|
|
1352
|
+
...(kinds && kinds.length > 0 ? { kinds } : {}),
|
|
1353
|
+
...(typeof input.before === "number" ? { before: input.before } : {}),
|
|
1354
|
+
...(typeof input.after === "number" ? { after: input.after } : {}),
|
|
1355
|
+
};
|
|
1356
|
+
},
|
|
1357
|
+
},
|
|
1358
|
+
}),
|
|
1359
|
+
op({
|
|
1360
|
+
id: "crm.brief.get",
|
|
1361
|
+
group: "crm",
|
|
1362
|
+
summary:
|
|
1363
|
+
"The record's generated Brief: health, who owes the next move, open threads, commitments, risks, next step, with provenance. Read this before the ledger.",
|
|
1364
|
+
cli: "dench crm brief",
|
|
1365
|
+
method: "GET",
|
|
1366
|
+
path: "/crm/objects/{objectName}/entries/{entryId}/brief",
|
|
1367
|
+
requestSchema: noBody,
|
|
1368
|
+
responseSchema: anyResponse,
|
|
1369
|
+
backend: {
|
|
1370
|
+
...convex("query", "functions/crm/intelligence:getForEntry"),
|
|
1371
|
+
transformArgs: (input) => ({
|
|
1372
|
+
objectName: input.objectName,
|
|
1373
|
+
entryId: input.entryId,
|
|
1374
|
+
}),
|
|
1375
|
+
},
|
|
1376
|
+
}),
|
|
1377
|
+
op({
|
|
1378
|
+
id: "crm.brief.regenerate",
|
|
1379
|
+
group: "crm",
|
|
1380
|
+
summary: "Rebuild a record's Brief from the current timeline.",
|
|
1381
|
+
cli: "dench crm brief --regenerate",
|
|
1382
|
+
method: "POST",
|
|
1383
|
+
path: "/crm/objects/{objectName}/entries/{entryId}/brief/regenerate",
|
|
1384
|
+
requestSchema: noBody,
|
|
1385
|
+
responseSchema: anyResponse,
|
|
1386
|
+
backend: {
|
|
1387
|
+
...convex("mutation", "functions/crm/intelligence:regenerate"),
|
|
1388
|
+
transformArgs: (input) => ({
|
|
1389
|
+
objectName: input.objectName,
|
|
1390
|
+
entryId: input.entryId,
|
|
1391
|
+
}),
|
|
1392
|
+
},
|
|
1393
|
+
}),
|
|
1394
|
+
op({
|
|
1395
|
+
id: "crm.activity.count",
|
|
1396
|
+
group: "crm",
|
|
1397
|
+
summary: "Bounded per-source counts of a CRM entry's activity ledger.",
|
|
1398
|
+
cli: "dench crm activity",
|
|
1399
|
+
method: "GET",
|
|
1400
|
+
path: "/crm/objects/{objectName}/entries/{entryId}/activity/count",
|
|
1401
|
+
requestSchema: noBody,
|
|
1402
|
+
responseSchema: anyResponse,
|
|
1403
|
+
backend: {
|
|
1404
|
+
...convex("query", "functions/crm/activity:countForEntry"),
|
|
1405
|
+
transformArgs: (input) => ({
|
|
1406
|
+
objectName: input.objectName,
|
|
1407
|
+
entryId: input.entryId,
|
|
1408
|
+
includeSystem: input.includeSystem === true,
|
|
1409
|
+
}),
|
|
1410
|
+
},
|
|
1411
|
+
}),
|
|
1412
|
+
op({
|
|
1413
|
+
id: "crm.notes.list",
|
|
1414
|
+
group: "crm",
|
|
1415
|
+
summary:
|
|
1416
|
+
"List a CRM entry's notes (titled, document-style comments), newest first.",
|
|
1417
|
+
cli: "dench crm notes list",
|
|
1418
|
+
method: "GET",
|
|
1419
|
+
path: "/crm/objects/{objectName}/entries/{entryId}/notes",
|
|
1420
|
+
requestSchema: noBody,
|
|
1421
|
+
responseSchema: anyResponse,
|
|
1422
|
+
backend: {
|
|
1423
|
+
...convex("query", "functions/crm/activity:listNotesForEntry"),
|
|
1424
|
+
transformArgs: (input) => ({
|
|
1425
|
+
objectName: input.objectName,
|
|
1426
|
+
entryId: input.entryId,
|
|
1427
|
+
limit:
|
|
1428
|
+
typeof input.limit === "number"
|
|
1429
|
+
? Math.min(Math.max(Math.floor(input.limit), 1), 200)
|
|
1430
|
+
: 50,
|
|
1431
|
+
}),
|
|
1432
|
+
},
|
|
1433
|
+
}),
|
|
1434
|
+
op({
|
|
1435
|
+
id: "crm.notes.create",
|
|
1436
|
+
group: "crm",
|
|
1437
|
+
summary:
|
|
1438
|
+
"Add a titled note to a CRM entry's activity timeline (markdown body). Research goes here, never into the Notes document.",
|
|
1439
|
+
cli: "dench crm notes create",
|
|
1440
|
+
method: "POST",
|
|
1441
|
+
path: "/crm/objects/{objectName}/entries/{entryId}/notes",
|
|
1442
|
+
requestSchema: anyObject,
|
|
1443
|
+
responseSchema: anyResponse,
|
|
1444
|
+
backend: {
|
|
1445
|
+
...convex("mutation", "functions/crm/comments:create", "bearer", {
|
|
1446
|
+
includeRunId: true,
|
|
1447
|
+
}),
|
|
1448
|
+
transformArgs: (input) => ({ ...input, kind: "note" }),
|
|
1449
|
+
},
|
|
1450
|
+
}),
|
|
1451
|
+
|
|
1190
1452
|
// CRM comments — threaded conversation on a record, merged with history
|
|
1191
1453
|
// into the record's Activity feed. `@Dench` in a body summons the agent.
|
|
1192
1454
|
op({
|
|
@@ -2637,6 +2899,30 @@ const rawApiOperations = [
|
|
|
2637
2899
|
responseSchema: anyResponse,
|
|
2638
2900
|
backend: convex("mutation", "functions/meetings/importer:setParticipants"),
|
|
2639
2901
|
}),
|
|
2902
|
+
op({
|
|
2903
|
+
id: "meetings.sharing.get",
|
|
2904
|
+
group: "meetings",
|
|
2905
|
+
summary:
|
|
2906
|
+
"Whether a meeting is shared with the whole workspace, and whether you may change that.",
|
|
2907
|
+
cli: "dench meetings share",
|
|
2908
|
+
method: "GET",
|
|
2909
|
+
path: "/meetings/{meetingEntryId}/sharing",
|
|
2910
|
+
requestSchema: noBody,
|
|
2911
|
+
responseSchema: anyResponse,
|
|
2912
|
+
backend: convex("query", "functions/meetings/sharing:getMeetingSharing"),
|
|
2913
|
+
}),
|
|
2914
|
+
op({
|
|
2915
|
+
id: "meetings.sharing.set",
|
|
2916
|
+
group: "meetings",
|
|
2917
|
+
summary:
|
|
2918
|
+
"Share one meeting with the workspace, or take it back to owner + invitees.",
|
|
2919
|
+
cli: "dench meetings share --workspace",
|
|
2920
|
+
method: "PUT",
|
|
2921
|
+
path: "/meetings/{meetingEntryId}/sharing",
|
|
2922
|
+
requestSchema: anyObject,
|
|
2923
|
+
responseSchema: anyResponse,
|
|
2924
|
+
backend: convex("mutation", "functions/meetings/sharing:setMeetingSharing"),
|
|
2925
|
+
}),
|
|
2640
2926
|
op({
|
|
2641
2927
|
id: "meetings.import",
|
|
2642
2928
|
group: "local",
|
|
@@ -3338,70 +3624,6 @@ const rawApiOperations = [
|
|
|
3338
3624
|
responseSchema: anyResponse,
|
|
3339
3625
|
backend: convex("mutation", "functions/outreachSequences:archiveSequence"),
|
|
3340
3626
|
}),
|
|
3341
|
-
...(["list", "catalog", "get", "runs"] as const).map((command) =>
|
|
3342
|
-
op({
|
|
3343
|
-
id: `signals.${command}`,
|
|
3344
|
-
group: "signals",
|
|
3345
|
-
summary: `${command} signal agents and their discovery configuration.`,
|
|
3346
|
-
cli: `dench signals ${command}`,
|
|
3347
|
-
method: "GET",
|
|
3348
|
-
path:
|
|
3349
|
-
command === "list"
|
|
3350
|
-
? "/signals"
|
|
3351
|
-
: command === "catalog"
|
|
3352
|
-
? "/signals/catalog"
|
|
3353
|
-
: command === "get"
|
|
3354
|
-
? "/signals/{agentId}"
|
|
3355
|
-
: "/signals/{agentId}/runs",
|
|
3356
|
-
requestSchema:
|
|
3357
|
-
command === "list" || command === "catalog"
|
|
3358
|
-
? z.object({}).strict()
|
|
3359
|
-
: z.object({ agentId: z.string().min(1) }).strict(),
|
|
3360
|
-
responseSchema: anyResponse,
|
|
3361
|
-
backend: convex("query", `functions/signalAgents:${command}`),
|
|
3362
|
-
}),
|
|
3363
|
-
),
|
|
3364
|
-
...(["create", "update"] as const).map((command) =>
|
|
3365
|
-
op({
|
|
3366
|
-
id: `signals.${command}`,
|
|
3367
|
-
group: "signals",
|
|
3368
|
-
summary:
|
|
3369
|
-
"Save a complete per-agent configuration. Warnings require acknowledgement; new agents default to paused.",
|
|
3370
|
-
cli: `dench signals ${command}`,
|
|
3371
|
-
method: command === "create" ? "POST" : "PATCH",
|
|
3372
|
-
path: command === "create" ? "/signals" : "/signals/{agentId}",
|
|
3373
|
-
requestSchema: z
|
|
3374
|
-
.object({
|
|
3375
|
-
...(command === "update" ? { agentId: z.string().min(1) } : {}),
|
|
3376
|
-
name: z.string().trim().min(1).max(120),
|
|
3377
|
-
config: signalAgentConfigSchema,
|
|
3378
|
-
status: z.enum(["active", "paused"]).default("paused"),
|
|
3379
|
-
acknowledgeWarnings: z.boolean().optional(),
|
|
3380
|
-
})
|
|
3381
|
-
.strict(),
|
|
3382
|
-
responseSchema: anyResponse,
|
|
3383
|
-
backend: convex("mutation", "functions/signalAgents:save"),
|
|
3384
|
-
}),
|
|
3385
|
-
),
|
|
3386
|
-
...(["pause", "resume", "run"] as const).map((command) =>
|
|
3387
|
-
op({
|
|
3388
|
-
id: `signals.${command}`,
|
|
3389
|
-
group: "signals",
|
|
3390
|
-
summary: `${command} a signal agent. Paused agents retain their leads.`,
|
|
3391
|
-
cli: `dench signals ${command}`,
|
|
3392
|
-
method: "POST",
|
|
3393
|
-
path: `/signals/{agentId}/${command}`,
|
|
3394
|
-
requestSchema: z.object({ agentId: z.string().min(1) }).strict(),
|
|
3395
|
-
responseSchema: anyResponse,
|
|
3396
|
-
backend:
|
|
3397
|
-
command === "run"
|
|
3398
|
-
? convex("mutation", "functions/signalAgents:run")
|
|
3399
|
-
: {
|
|
3400
|
-
...convex("mutation", "functions/signalAgents:setStatus"),
|
|
3401
|
-
fixedArgs: { status: command === "pause" ? "paused" : "active" },
|
|
3402
|
-
},
|
|
3403
|
-
}),
|
|
3404
|
-
),
|
|
3405
3627
|
op({
|
|
3406
3628
|
id: "campaigns.events",
|
|
3407
3629
|
group: "campaigns",
|
|
@@ -4447,6 +4669,40 @@ const rawApiOperations = [
|
|
|
4447
4669
|
"functions/notifications:updateMyNotificationPreferences",
|
|
4448
4670
|
),
|
|
4449
4671
|
}),
|
|
4672
|
+
|
|
4673
|
+
// Workspace settings — Settings → Sync: the eight switches for what Dench
|
|
4674
|
+
// does on its own with email, calendar, Slack and LinkedIn. Reads for any
|
|
4675
|
+
// member; the write is admin-only server-side.
|
|
4676
|
+
op({
|
|
4677
|
+
id: "settings.sync.get",
|
|
4678
|
+
group: "settings",
|
|
4679
|
+
summary:
|
|
4680
|
+
"Read the workspace's Sync switches (accounts from email, contacts from LinkedIn, Slack Connect, calendar, dossier, tasks from email, lead auto-qualify, summaries and Brief). All on by default.",
|
|
4681
|
+
cli: "dench settings sync",
|
|
4682
|
+
method: "GET",
|
|
4683
|
+
path: "/settings/sync",
|
|
4684
|
+
requestSchema: noBody,
|
|
4685
|
+
responseSchema: anyResponse,
|
|
4686
|
+
backend: convex("query", "functions/organizations:getMySyncSettings"),
|
|
4687
|
+
}),
|
|
4688
|
+
op({
|
|
4689
|
+
id: "settings.sync.update",
|
|
4690
|
+
group: "settings",
|
|
4691
|
+
summary:
|
|
4692
|
+
"Flip Sync switches (admin). Partial patch: only the keys sent change. Off stops new work; nothing already created is removed.",
|
|
4693
|
+
cli: "dench settings sync set",
|
|
4694
|
+
method: "PATCH",
|
|
4695
|
+
path: "/settings/sync",
|
|
4696
|
+
requestSchema: anyObject,
|
|
4697
|
+
responseSchema: anyResponse,
|
|
4698
|
+
backend: {
|
|
4699
|
+
...convex(
|
|
4700
|
+
"mutation",
|
|
4701
|
+
"functions/organizations:updateMyOrganizationSyncSettings",
|
|
4702
|
+
),
|
|
4703
|
+
transformArgs: (input) => ({ patch: input }),
|
|
4704
|
+
},
|
|
4705
|
+
}),
|
|
4450
4706
|
] as const satisfies readonly ApiOperation[];
|
|
4451
4707
|
|
|
4452
4708
|
/**
|
package/meetings.ts
CHANGED
|
@@ -74,6 +74,14 @@ const api = {
|
|
|
74
74
|
"functions/meetings/participantLinks:listMeetingParticipantRoster",
|
|
75
75
|
),
|
|
76
76
|
},
|
|
77
|
+
sharing: {
|
|
78
|
+
get: makeFunctionReference<"query">(
|
|
79
|
+
"functions/meetings/sharing:getMeetingSharing",
|
|
80
|
+
),
|
|
81
|
+
set: makeFunctionReference<"mutation">(
|
|
82
|
+
"functions/meetings/sharing:setMeetingSharing",
|
|
83
|
+
),
|
|
84
|
+
},
|
|
77
85
|
importer: {
|
|
78
86
|
clearTranscript: makeFunctionReference<"mutation">(
|
|
79
87
|
"functions/meetings/importer:clearTranscript",
|
|
@@ -130,6 +138,8 @@ export async function runMeetingsCommand(opts: {
|
|
|
130
138
|
case "participants":
|
|
131
139
|
case "attendees":
|
|
132
140
|
return await runParticipants(ctx);
|
|
141
|
+
case "share":
|
|
142
|
+
return await runShare(ctx);
|
|
133
143
|
case "import":
|
|
134
144
|
return await runImport(ctx);
|
|
135
145
|
default:
|
|
@@ -143,6 +153,7 @@ export async function runMeetingsCommand(opts: {
|
|
|
143
153
|
|
|
144
154
|
async function runList(ctx: CrmCliContext): Promise<void> {
|
|
145
155
|
const limitRaw = getFlag(ctx.args, "--limit");
|
|
156
|
+
const sharedOnly = hasFlag(ctx.args, "--shared");
|
|
146
157
|
assertNoUnknownFlags(ctx.args, "meetings list");
|
|
147
158
|
const numItems = limitRaw ? Number(limitRaw) : 50;
|
|
148
159
|
if (!Number.isFinite(numItems) || numItems <= 0) {
|
|
@@ -150,6 +161,7 @@ async function runList(ctx: CrmCliContext): Promise<void> {
|
|
|
150
161
|
}
|
|
151
162
|
const result = (await callQuery(ctx, api.library.listMeetings, {
|
|
152
163
|
paginationOpts: { numItems, cursor: null },
|
|
164
|
+
...(sharedOnly ? { sharedOnly: true } : {}),
|
|
153
165
|
})) as { page?: unknown[] } | null;
|
|
154
166
|
out(ctx, result?.page ?? []);
|
|
155
167
|
}
|
|
@@ -165,6 +177,64 @@ async function runGet(ctx: CrmCliContext): Promise<void> {
|
|
|
165
177
|
out(ctx, entry);
|
|
166
178
|
}
|
|
167
179
|
|
|
180
|
+
// ── share ──────────────────────────────────────────────────────────────────
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* `dench meetings share <id> [--workspace|--private]`
|
|
184
|
+
*
|
|
185
|
+
* With no flag this READS the current state rather than guessing a
|
|
186
|
+
* direction: "share" is a permission change, and a bare command that
|
|
187
|
+
* silently published a call would be the wrong default for a verb someone
|
|
188
|
+
* might run to check what a meeting is.
|
|
189
|
+
*/
|
|
190
|
+
async function runShare(ctx: CrmCliContext): Promise<void> {
|
|
191
|
+
const meetingEntryId = shift(ctx.args, "meeting id");
|
|
192
|
+
const toWorkspace = hasFlag(ctx.args, "--workspace");
|
|
193
|
+
const toPrivate = hasFlag(ctx.args, "--private");
|
|
194
|
+
assertNoUnknownFlags(ctx.args, "meetings share");
|
|
195
|
+
if (toWorkspace && toPrivate) {
|
|
196
|
+
throw new CrmCliError(
|
|
197
|
+
"Pass either --workspace or --private, not both. With neither, the current sharing is printed.",
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
if (!toWorkspace && !toPrivate) {
|
|
202
|
+
const current = (await callQuery(ctx, api.sharing.get, {
|
|
203
|
+
meetingEntryId,
|
|
204
|
+
})) as { sharedWithWorkspace: boolean; canShare: boolean } | null;
|
|
205
|
+
if (!current) throw new CrmCliError(`Meeting not found: ${meetingEntryId}`);
|
|
206
|
+
if (ctx.jsonOutput) {
|
|
207
|
+
out(ctx, current);
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
console.log(
|
|
211
|
+
current.sharedWithWorkspace
|
|
212
|
+
? "Shared with the workspace — every member can read this meeting."
|
|
213
|
+
: "Private — the owner plus the members who were on the invite.",
|
|
214
|
+
);
|
|
215
|
+
if (!current.canShare) {
|
|
216
|
+
console.log(
|
|
217
|
+
"You cannot change this: only the meeting's owner or a workspace admin can.",
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
const result = (await callMutation(ctx, api.sharing.set, {
|
|
224
|
+
meetingEntryId,
|
|
225
|
+
shared: toWorkspace,
|
|
226
|
+
})) as { sharedWithWorkspace: boolean };
|
|
227
|
+
if (ctx.jsonOutput) {
|
|
228
|
+
out(ctx, result);
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
console.log(
|
|
232
|
+
result.sharedWithWorkspace
|
|
233
|
+
? "Shared with the workspace."
|
|
234
|
+
: "Made private — the owner plus the members who were on the invite.",
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
|
|
168
238
|
// ── transcript ─────────────────────────────────────────────────────────────
|
|
169
239
|
|
|
170
240
|
async function runTranscript(ctx: CrmCliContext): Promise<void> {
|
|
@@ -658,9 +728,20 @@ create, update and delete it with \`dench crm entries … meeting\`, query it
|
|
|
658
728
|
with \`dench crm query meeting\`, list its fields with \`dench crm fields list
|
|
659
729
|
meeting\`. These verbs add the parts that live beside the record:
|
|
660
730
|
|
|
661
|
-
dench meetings list [--limit N] [--json]
|
|
731
|
+
dench meetings list [--limit N] [--shared] [--json]
|
|
662
732
|
dench meetings get <meetingId> [--json]
|
|
663
733
|
|
|
734
|
+
You see a meeting if you own it, if you were on the invite, or if it has
|
|
735
|
+
been shared with the workspace. \`--shared\` narrows the list to the last of
|
|
736
|
+
those — the calls anyone on the team can read.
|
|
737
|
+
|
|
738
|
+
Sharing:
|
|
739
|
+
dench meetings share <meetingId> print who can read it
|
|
740
|
+
dench meetings share <meetingId> --workspace open it to every member
|
|
741
|
+
dench meetings share <meetingId> --private back to owner + invitees
|
|
742
|
+
Only the meeting's owner or a workspace admin can change this. To
|
|
743
|
+
change the default for NEW recordings, use Settings › Meetings.
|
|
744
|
+
|
|
664
745
|
Transcript (meetingTranscriptSegments):
|
|
665
746
|
dench meetings transcript get <meetingId> [--json|--text]
|
|
666
747
|
dench meetings transcript set <meetingId> --text notes.txt | --jsonl segments.jsonl | --file segments.json [--append]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dench.com/cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0-staging.327",
|
|
4
4
|
"description": "Dench agent workspace CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -32,12 +32,13 @@
|
|
|
32
32
|
"crm.ts",
|
|
33
33
|
"crm-comments.ts",
|
|
34
34
|
"crm-analytics.ts",
|
|
35
|
+
"crm-detections.ts",
|
|
35
36
|
"meetings.ts",
|
|
36
37
|
"email.ts",
|
|
37
38
|
"campaign.ts",
|
|
38
|
-
"signals.ts",
|
|
39
39
|
"members.ts",
|
|
40
40
|
"notifications.ts",
|
|
41
|
+
"settings.ts",
|
|
41
42
|
"cron.ts",
|
|
42
43
|
"browser.ts",
|
|
43
44
|
"ads.ts",
|