@dench.com/cli 3.6.6-staging.386 → 3.8.0-staging.389
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 +43 -44
- package/agent-config.ts +21 -57
- package/app-sdk.d.ts +367 -24
- package/chat-spawn.ts +11 -2
- package/chat.ts +1 -1
- package/context-settings.ts +86 -0
- package/crm.ts +92 -24
- package/cron.ts +19 -0
- package/dench.ts +318 -90
- package/email-inbox.ts +169 -0
- package/email.ts +103 -21
- package/environments.ts +694 -0
- package/lib/api-schemas.ts +160 -14
- package/lib/app-sdk-catalog.generated.ts +39 -19
- package/lib/bundled-references.ts +17 -0
- package/lib/cli-args.ts +30 -3
- package/lib/command-args.ts +252 -0
- package/lib/command-help.ts +93 -0
- package/lib/command-registry.ts +296 -10
- package/lib/environment-archive.ts +255 -0
- package/lib/environment-cli-args.ts +96 -0
- package/lib/environment-contract.ts +237 -0
- package/lib/environment-execution.ts +769 -0
- package/lib/environment-source.ts +165 -0
- package/lib/load-dev-env.mjs +3 -1
- package/lib/load-dev-env.test.mjs +26 -9
- package/lib/native-email-wait.ts +75 -0
- package/lib/parent-argv.ts +20 -0
- package/lib/public-error.ts +82 -0
- package/lib/references.generated.json +74 -0
- package/package.json +7 -3
- package/reference.ts +47 -0
- package/workspace-secrets.ts +231 -0
- package/agent.ts +0 -37
package/app-sdk.d.ts
CHANGED
|
@@ -12,6 +12,67 @@
|
|
|
12
12
|
// ── Operation request/response types (from cli/lib/api-schemas.ts) ──────
|
|
13
13
|
|
|
14
14
|
export interface ApiRequests {
|
|
15
|
+
/** List workspace-shared reusable setups and ready revisions (metadata only). — `dench env list` — GET /api/v1/environments */
|
|
16
|
+
"environments.list": {
|
|
17
|
+
limit?: number;
|
|
18
|
+
cursor?: string;
|
|
19
|
+
};
|
|
20
|
+
/** Inspect a saved setup, its manifest, and an optional immutable revision. — `dench env show` — GET /api/v1/environments/{name} */
|
|
21
|
+
"environments.get": {
|
|
22
|
+
name: string;
|
|
23
|
+
revision?: string;
|
|
24
|
+
};
|
|
25
|
+
/** Reserve an owner-bound source upload. Prefix the uploaded bytes with the returned proof before saving. — `dench env save` — POST /api/v1/environments/uploads */
|
|
26
|
+
"environments.upload": {
|
|
27
|
+
kind: "source";
|
|
28
|
+
size: number;
|
|
29
|
+
sha256: string;
|
|
30
|
+
};
|
|
31
|
+
/** Publish an explicitly saved source and manifest for one-time preparation. Returns pending/building until verified; does not run the task. — `dench env save` — POST /api/v1/environments/{name} */
|
|
32
|
+
"environments.save": {
|
|
33
|
+
name: string;
|
|
34
|
+
manifest: {
|
|
35
|
+
version: 1;
|
|
36
|
+
name: string;
|
|
37
|
+
purpose: string;
|
|
38
|
+
files: string[];
|
|
39
|
+
prepare: string[];
|
|
40
|
+
verify: string[];
|
|
41
|
+
env?: Record<string, string>;
|
|
42
|
+
secretEnv?: Record<string, string>;
|
|
43
|
+
secretFiles?: {
|
|
44
|
+
path: string;
|
|
45
|
+
secret: string;
|
|
46
|
+
mutable?: boolean;
|
|
47
|
+
}[];
|
|
48
|
+
statePaths?: string[];
|
|
49
|
+
portable?: boolean;
|
|
50
|
+
};
|
|
51
|
+
uploadId: string;
|
|
52
|
+
storageId: string;
|
|
53
|
+
sha256: string;
|
|
54
|
+
};
|
|
55
|
+
/** Retire a saved setup from new selection; retain immutable revisions and active job evidence. — `dench env delete` — DELETE /api/v1/environments/{name} */
|
|
56
|
+
"environments.delete": {
|
|
57
|
+
name: string;
|
|
58
|
+
};
|
|
59
|
+
/** List workspace-shared credential names, kinds and versions; never values. — `dench secrets list` — GET /api/v1/secrets */
|
|
60
|
+
"secrets.list": {
|
|
61
|
+
limit?: number;
|
|
62
|
+
cursor?: string;
|
|
63
|
+
};
|
|
64
|
+
/** Encrypt a workspace credential. Use CLI stdin or the secure chat form; return metadata only. Do not put values in chat, manifests or scripts. — `dench secrets set` — PUT /api/v1/secrets/{name} */
|
|
65
|
+
"secrets.set": {
|
|
66
|
+
name: string;
|
|
67
|
+
kind: "env" | "file";
|
|
68
|
+
value: string;
|
|
69
|
+
expectedVersion?: number;
|
|
70
|
+
};
|
|
71
|
+
/** Revoke a workspace credential for future resolution, optionally checking its version. — `dench secrets delete` — DELETE /api/v1/secrets/{name} */
|
|
72
|
+
"secrets.delete": {
|
|
73
|
+
name: string;
|
|
74
|
+
expectedVersion?: number;
|
|
75
|
+
};
|
|
15
76
|
/** Create an idempotent empty campaign draft with the caller's available sender pools. Does not launch or send. — `dench campaign draft` — POST /api/v1/campaigns/drafts */
|
|
16
77
|
"campaigns.drafts.create": {
|
|
17
78
|
/** Your stable id for this request, 8-64 characters. Retrying with the same id returns the same draft instead of creating another. */
|
|
@@ -699,6 +760,7 @@ export interface ApiRequests {
|
|
|
699
760
|
};
|
|
700
761
|
/** Start a new chat-turn workflow. — `dench chat new` — POST /api/v1/chat/threads */
|
|
701
762
|
"chat.new": {
|
|
763
|
+
environment?: string;
|
|
702
764
|
/** The user message that starts the turn. */
|
|
703
765
|
prompt: string;
|
|
704
766
|
model?: string;
|
|
@@ -722,6 +784,8 @@ export interface ApiRequests {
|
|
|
722
784
|
};
|
|
723
785
|
/** List CRM objects. — `dench crm objects list` — GET /api/v1/crm/objects */
|
|
724
786
|
"crm.objects.list": Record<string, unknown>;
|
|
787
|
+
/** List names, display labels, visibility and workspace counts without internal state. — `dench crm objects list --compact` — GET /api/v1/crm/catalog/objects */
|
|
788
|
+
"crm.objects.listCompact": Record<string, unknown>;
|
|
725
789
|
/** Get a CRM object. — `dench crm objects get` — GET /api/v1/crm/objects/{name} */
|
|
726
790
|
"crm.objects.get": {
|
|
727
791
|
name: string;
|
|
@@ -883,6 +947,10 @@ export interface ApiRequests {
|
|
|
883
947
|
"crm.fields.list": {
|
|
884
948
|
objectName: string;
|
|
885
949
|
};
|
|
950
|
+
/** List field names, types and effective constraints without indexing or enrichment internals. — `dench crm fields list --compact` — GET /api/v1/crm/catalog/objects/{objectName}/fields */
|
|
951
|
+
"crm.fields.listCompact": {
|
|
952
|
+
objectName: string;
|
|
953
|
+
};
|
|
886
954
|
/** Create a CRM field or read-only campaign activity boolean column. — `dench crm fields create` — POST /api/v1/crm/objects/{objectName}/fields */
|
|
887
955
|
"crm.fields.create": {
|
|
888
956
|
objectName: string;
|
|
@@ -1374,6 +1442,16 @@ export interface ApiRequests {
|
|
|
1374
1442
|
objectName?: string;
|
|
1375
1443
|
limit?: number;
|
|
1376
1444
|
};
|
|
1445
|
+
/** Search bounded pages of readable CRM entries, optionally projecting cells. Always follow continueCursor until isDone. — `dench crm search --page` — GET /api/v1/crm/search/page */
|
|
1446
|
+
"crm.search.page": {
|
|
1447
|
+
/** Full-text query over readable entries. */
|
|
1448
|
+
text: string;
|
|
1449
|
+
objectName?: string;
|
|
1450
|
+
select?: string[];
|
|
1451
|
+
limit?: number;
|
|
1452
|
+
/** Use the preceding continueCursor, with the same query and projection. */
|
|
1453
|
+
cursor?: string;
|
|
1454
|
+
};
|
|
1377
1455
|
/** List CRM statuses. — `dench crm statuses list` — GET /api/v1/crm/objects/{objectName}/statuses */
|
|
1378
1456
|
"crm.statuses.list": {
|
|
1379
1457
|
objectName: string;
|
|
@@ -2179,6 +2257,32 @@ export interface ApiRequests {
|
|
|
2179
2257
|
/** Identity id, sender email, or domain (deletes every sender on the domain). Permanent: re-adding requires re-verification. */
|
|
2180
2258
|
identity: string;
|
|
2181
2259
|
};
|
|
2260
|
+
/** Search authorized synced mailbox headers with bounded cursor pagination. isDone covers stored records, not provider completeness. — `dench email inbox search` — GET /api/v1/email/inbox/search */
|
|
2261
|
+
"email.inbox.search": {
|
|
2262
|
+
limit?: number;
|
|
2263
|
+
cursor?: string;
|
|
2264
|
+
mailbox?: string;
|
|
2265
|
+
from?: string;
|
|
2266
|
+
to?: string;
|
|
2267
|
+
subject?: string;
|
|
2268
|
+
/** Inclusive Unix milliseconds; missing sentAt falls back to createdAt. */
|
|
2269
|
+
after?: number;
|
|
2270
|
+
/** Exclusive Unix milliseconds. */
|
|
2271
|
+
before?: number;
|
|
2272
|
+
direction?: "inbound" | "outbound";
|
|
2273
|
+
};
|
|
2274
|
+
/** Read a bounded page of synced headers using an exact thread handle from inbox search; bodies remain on demand. — `dench email inbox thread` — GET /api/v1/email/inbox/threads/{threadHandle} */
|
|
2275
|
+
"email.inbox.thread": {
|
|
2276
|
+
limit?: number;
|
|
2277
|
+
cursor?: string;
|
|
2278
|
+
threadHandle: string;
|
|
2279
|
+
};
|
|
2280
|
+
/** Read a bounded stored body using an exact message handle from inbox search; rechecks mailbox and record privacy. — `dench email inbox message` — GET /api/v1/email/inbox/messages/{messageHandle} */
|
|
2281
|
+
"email.inbox.message": {
|
|
2282
|
+
messageHandle: string;
|
|
2283
|
+
format?: "text" | "html";
|
|
2284
|
+
maxBytes?: number;
|
|
2285
|
+
};
|
|
2182
2286
|
/** Create an editable Dench email draft and synchronize its selected native mailbox asynchronously. Use a stable requestId for retries. — `dench email draft create` — POST /api/v1/email/drafts */
|
|
2183
2287
|
"email.drafts.create": {
|
|
2184
2288
|
organizationId?: string;
|
|
@@ -2261,13 +2365,13 @@ export interface ApiRequests {
|
|
|
2261
2365
|
"email.drafts.signature": {
|
|
2262
2366
|
draftId: string;
|
|
2263
2367
|
};
|
|
2264
|
-
/** Send through a native Gmail or Outlook mailbox with a durable request receipt. Only use for an explicit send request. — `dench email send --mailbox` — POST /api/v1/email/native/send */
|
|
2368
|
+
/** Send through a native Gmail or Outlook mailbox with a durable request receipt. Only use for an explicit send request. — `dench email send [--mailbox <id/email>]` — POST /api/v1/email/native/send */
|
|
2265
2369
|
"email.native.send": {
|
|
2266
2370
|
organizationId?: string;
|
|
2267
2371
|
threadId?: string;
|
|
2268
2372
|
mailbox?: string;
|
|
2269
2373
|
requestId: string;
|
|
2270
|
-
to
|
|
2374
|
+
to: {
|
|
2271
2375
|
email: string;
|
|
2272
2376
|
name?: string;
|
|
2273
2377
|
}[];
|
|
@@ -2289,7 +2393,7 @@ export interface ApiRequests {
|
|
|
2289
2393
|
size: number;
|
|
2290
2394
|
}[];
|
|
2291
2395
|
};
|
|
2292
|
-
/** Send one raw email (no campaign): to/cc/bcc, custom from-name and reply-to, optional reply threading via replyToMessageId. — `dench email send
|
|
2396
|
+
/** Send one raw email (no campaign): to/cc/bcc, custom from-name and reply-to, optional reply threading via replyToMessageId. — `dench email send --from <verified-email>` — POST /api/v1/email/send */
|
|
2293
2397
|
"email.send": {
|
|
2294
2398
|
/** Verified sender mailbox. */
|
|
2295
2399
|
fromEmail: string;
|
|
@@ -3165,7 +3269,7 @@ export interface ApiRequests {
|
|
|
3165
3269
|
/** Execution ref from a prior search, OR pass session_id+tool_slug. */
|
|
3166
3270
|
execution_ref?: string;
|
|
3167
3271
|
session_id?: string;
|
|
3168
|
-
/** Tool slug, e.g.
|
|
3272
|
+
/** Tool slug, e.g. SLACK_LIST_CHANNELS. */
|
|
3169
3273
|
tool_slug?: string;
|
|
3170
3274
|
/** Tool arguments object. */
|
|
3171
3275
|
arguments?: Record<string, unknown>;
|
|
@@ -3193,30 +3297,34 @@ export interface ApiRequests {
|
|
|
3193
3297
|
"browser.session.status": Record<string, unknown>;
|
|
3194
3298
|
/** Stop a Dench Browser session and release the remote browser. — `dench browser session stop` — DELETE /api/v1/browser/sessions/{sessionId} */
|
|
3195
3299
|
"browser.session.stop": Record<string, unknown>;
|
|
3196
|
-
/** Read IDENTITY.md. — `dench identity
|
|
3300
|
+
/** Read IDENTITY.md. — `dench context --sections identity` — GET /api/v1/agent-config/identity */
|
|
3197
3301
|
"agentConfig.identity.show": Record<string, unknown>;
|
|
3198
|
-
/** Update IDENTITY.md. — `dench identity
|
|
3302
|
+
/** Update IDENTITY.md. — `dench context set identity` — PUT /api/v1/agent-config/identity */
|
|
3199
3303
|
"agentConfig.identity.edit": {
|
|
3200
3304
|
content: string;
|
|
3201
3305
|
};
|
|
3202
|
-
/** Read ORGANISATION.md. — `dench organisation
|
|
3306
|
+
/** Read ORGANISATION.md. — `dench context --sections organisation` — GET /api/v1/agent-config/organisation */
|
|
3203
3307
|
"agentConfig.organisation.show": Record<string, unknown>;
|
|
3204
|
-
/** Update ORGANISATION.md. — `dench organisation
|
|
3308
|
+
/** Update ORGANISATION.md. — `dench context set organisation` — PUT /api/v1/agent-config/organisation */
|
|
3205
3309
|
"agentConfig.organisation.edit": {
|
|
3206
3310
|
content: string;
|
|
3207
3311
|
};
|
|
3208
|
-
/** Read USER.md. — `dench user
|
|
3312
|
+
/** Read USER.md. — `dench context --sections user` — GET /api/v1/agent-config/user */
|
|
3209
3313
|
"agentConfig.user.show": Record<string, unknown>;
|
|
3210
|
-
/** Update USER.md. — `dench user
|
|
3314
|
+
/** Update USER.md. — `dench context set user` — PUT /api/v1/agent-config/user */
|
|
3211
3315
|
"agentConfig.user.edit": {
|
|
3212
3316
|
content: string;
|
|
3213
3317
|
};
|
|
3214
|
-
/** Read tool notes. — `dench tools
|
|
3318
|
+
/** Read tool notes. — `dench context --sections tools` — GET /api/v1/agent-config/tools */
|
|
3215
3319
|
"agentConfig.tools.show": Record<string, unknown>;
|
|
3216
|
-
/** Update tool notes. — `dench tools
|
|
3320
|
+
/** Update tool notes. — `dench context set tools` — PUT /api/v1/agent-config/tools */
|
|
3217
3321
|
"agentConfig.tools.edit": {
|
|
3218
3322
|
content: string;
|
|
3219
3323
|
};
|
|
3324
|
+
/** Update standing workspace rules; credentials belong in secrets and runnable setup in environments. — `dench context set rules` — PUT /api/v1/context/rules */
|
|
3325
|
+
"workspace.context.rules.set": {
|
|
3326
|
+
content: string;
|
|
3327
|
+
};
|
|
3220
3328
|
/** Read aggregate memory. — `dench mem show` — GET /api/v1/agent-config/mem */
|
|
3221
3329
|
"agentConfig.mem.show": Record<string, unknown>;
|
|
3222
3330
|
/** Update aggregate memory. — `dench mem set` — PUT /api/v1/agent-config/mem */
|
|
@@ -3305,6 +3413,20 @@ export interface ApiRequests {
|
|
|
3305
3413
|
}
|
|
3306
3414
|
|
|
3307
3415
|
export interface ApiResponses {
|
|
3416
|
+
"environments.list": unknown;
|
|
3417
|
+
"environments.get": unknown;
|
|
3418
|
+
"environments.upload": unknown;
|
|
3419
|
+
"environments.save": unknown;
|
|
3420
|
+
"environments.delete": unknown;
|
|
3421
|
+
"secrets.list": unknown;
|
|
3422
|
+
"secrets.set": {
|
|
3423
|
+
name: string;
|
|
3424
|
+
kind: "env" | "file";
|
|
3425
|
+
version: number;
|
|
3426
|
+
revision: number;
|
|
3427
|
+
status: "stored";
|
|
3428
|
+
};
|
|
3429
|
+
"secrets.delete": unknown;
|
|
3308
3430
|
"campaigns.drafts.create": {
|
|
3309
3431
|
sequenceId: string;
|
|
3310
3432
|
};
|
|
@@ -4097,6 +4219,16 @@ export interface ApiResponses {
|
|
|
4097
4219
|
updatedAt: number;
|
|
4098
4220
|
[key: string]: unknown;
|
|
4099
4221
|
}>;
|
|
4222
|
+
"crm.objects.listCompact": Array<{
|
|
4223
|
+
_id: string;
|
|
4224
|
+
name: string;
|
|
4225
|
+
displayName: string;
|
|
4226
|
+
description?: string;
|
|
4227
|
+
entryCount: number | null;
|
|
4228
|
+
countScope: "workspace" | "private_unknown";
|
|
4229
|
+
visibility: "workspace" | "owner_only" | "owner_plus_members";
|
|
4230
|
+
archived: boolean;
|
|
4231
|
+
}>;
|
|
4100
4232
|
"crm.objects.get": {
|
|
4101
4233
|
_id: string;
|
|
4102
4234
|
_creationTime: number;
|
|
@@ -4235,6 +4367,18 @@ export interface ApiResponses {
|
|
|
4235
4367
|
updatedAt: number;
|
|
4236
4368
|
[key: string]: unknown;
|
|
4237
4369
|
}>;
|
|
4370
|
+
"crm.fields.listCompact": {
|
|
4371
|
+
_id: string;
|
|
4372
|
+
name: string;
|
|
4373
|
+
type: string;
|
|
4374
|
+
required: boolean;
|
|
4375
|
+
readOnly: boolean;
|
|
4376
|
+
defaultValue?: string;
|
|
4377
|
+
enumValues?: string[];
|
|
4378
|
+
enumMultiple: boolean;
|
|
4379
|
+
relatedObjectId?: string;
|
|
4380
|
+
relationshipType?: string;
|
|
4381
|
+
}[];
|
|
4238
4382
|
"crm.fields.create": {
|
|
4239
4383
|
id: string;
|
|
4240
4384
|
};
|
|
@@ -4576,6 +4720,19 @@ export interface ApiResponses {
|
|
|
4576
4720
|
updatedBy: string;
|
|
4577
4721
|
[key: string]: unknown;
|
|
4578
4722
|
}[];
|
|
4723
|
+
"crm.search.page": {
|
|
4724
|
+
page: {
|
|
4725
|
+
_id: string;
|
|
4726
|
+
objectId: string;
|
|
4727
|
+
/** Field-name -> cell value map. */
|
|
4728
|
+
data: Record<string, unknown>;
|
|
4729
|
+
}[];
|
|
4730
|
+
isDone: boolean;
|
|
4731
|
+
continueCursor: string | null;
|
|
4732
|
+
returnedCount: number;
|
|
4733
|
+
selectedFields: string[] | null;
|
|
4734
|
+
completeness: "page";
|
|
4735
|
+
};
|
|
4579
4736
|
"crm.statuses.list": {
|
|
4580
4737
|
_id: string;
|
|
4581
4738
|
_creationTime: number;
|
|
@@ -5447,6 +5604,150 @@ export interface ApiResponses {
|
|
|
5447
5604
|
disabled: boolean;
|
|
5448
5605
|
}[];
|
|
5449
5606
|
};
|
|
5607
|
+
"email.inbox.search": {
|
|
5608
|
+
page: Array<{
|
|
5609
|
+
messageHandle: string;
|
|
5610
|
+
threadHandle: string;
|
|
5611
|
+
mailboxId: string;
|
|
5612
|
+
from: {
|
|
5613
|
+
email: string;
|
|
5614
|
+
name?: string;
|
|
5615
|
+
};
|
|
5616
|
+
to: {
|
|
5617
|
+
email: string;
|
|
5618
|
+
name?: string;
|
|
5619
|
+
}[];
|
|
5620
|
+
subject: string;
|
|
5621
|
+
at: number;
|
|
5622
|
+
dateSource: "sentAt" | "createdAt";
|
|
5623
|
+
direction: "inbound" | "outbound";
|
|
5624
|
+
status: string;
|
|
5625
|
+
hasAttachments: boolean;
|
|
5626
|
+
headersTruncated: boolean;
|
|
5627
|
+
}>;
|
|
5628
|
+
continueCursor: string | null;
|
|
5629
|
+
isDone: boolean;
|
|
5630
|
+
coverage: {
|
|
5631
|
+
source: "synced";
|
|
5632
|
+
scope: "mailbox_linked_messages";
|
|
5633
|
+
mailboxId: string;
|
|
5634
|
+
mailboxEmail: string;
|
|
5635
|
+
mailboxStatus: string;
|
|
5636
|
+
ingestionMode: string;
|
|
5637
|
+
phase: string;
|
|
5638
|
+
syncStatus: string | null;
|
|
5639
|
+
lastPolledAt: number | null;
|
|
5640
|
+
lastBackfillCompletedAt: number | null;
|
|
5641
|
+
oldestSeenAt: number | null;
|
|
5642
|
+
backfillStatus: string | null;
|
|
5643
|
+
backfillCapped: boolean;
|
|
5644
|
+
providerComplete: false;
|
|
5645
|
+
privacyLimited: boolean;
|
|
5646
|
+
};
|
|
5647
|
+
order: "sentAt_desc_then_undated";
|
|
5648
|
+
};
|
|
5649
|
+
"email.inbox.thread": {
|
|
5650
|
+
page: Array<{
|
|
5651
|
+
messageHandle: string;
|
|
5652
|
+
threadHandle: string;
|
|
5653
|
+
mailboxId: string;
|
|
5654
|
+
from: {
|
|
5655
|
+
email: string;
|
|
5656
|
+
name?: string;
|
|
5657
|
+
};
|
|
5658
|
+
to: {
|
|
5659
|
+
email: string;
|
|
5660
|
+
name?: string;
|
|
5661
|
+
}[];
|
|
5662
|
+
subject: string;
|
|
5663
|
+
at: number;
|
|
5664
|
+
dateSource: "sentAt" | "createdAt";
|
|
5665
|
+
direction: "inbound" | "outbound";
|
|
5666
|
+
status: string;
|
|
5667
|
+
hasAttachments: boolean;
|
|
5668
|
+
headersTruncated: boolean;
|
|
5669
|
+
}>;
|
|
5670
|
+
continueCursor: string | null;
|
|
5671
|
+
isDone: boolean;
|
|
5672
|
+
coverage: {
|
|
5673
|
+
source: "synced";
|
|
5674
|
+
scope: "mailbox_linked_messages";
|
|
5675
|
+
mailboxId: string;
|
|
5676
|
+
mailboxEmail: string;
|
|
5677
|
+
mailboxStatus: string;
|
|
5678
|
+
ingestionMode: string;
|
|
5679
|
+
phase: string;
|
|
5680
|
+
syncStatus: string | null;
|
|
5681
|
+
lastPolledAt: number | null;
|
|
5682
|
+
lastBackfillCompletedAt: number | null;
|
|
5683
|
+
oldestSeenAt: number | null;
|
|
5684
|
+
backfillStatus: string | null;
|
|
5685
|
+
backfillCapped: boolean;
|
|
5686
|
+
providerComplete: false;
|
|
5687
|
+
privacyLimited: boolean;
|
|
5688
|
+
};
|
|
5689
|
+
order: "sentAt_desc_then_undated";
|
|
5690
|
+
};
|
|
5691
|
+
"email.inbox.message": {
|
|
5692
|
+
header: {
|
|
5693
|
+
messageHandle: string;
|
|
5694
|
+
threadHandle: string;
|
|
5695
|
+
mailboxId: string;
|
|
5696
|
+
from: {
|
|
5697
|
+
email: string;
|
|
5698
|
+
name?: string;
|
|
5699
|
+
};
|
|
5700
|
+
to: {
|
|
5701
|
+
email: string;
|
|
5702
|
+
name?: string;
|
|
5703
|
+
}[];
|
|
5704
|
+
subject: string;
|
|
5705
|
+
at: number;
|
|
5706
|
+
dateSource: "sentAt" | "createdAt";
|
|
5707
|
+
direction: "inbound" | "outbound";
|
|
5708
|
+
status: string;
|
|
5709
|
+
hasAttachments: boolean;
|
|
5710
|
+
headersTruncated: boolean;
|
|
5711
|
+
};
|
|
5712
|
+
coverage: {
|
|
5713
|
+
source: "synced";
|
|
5714
|
+
scope: "mailbox_linked_messages";
|
|
5715
|
+
mailboxId: string;
|
|
5716
|
+
mailboxEmail: string;
|
|
5717
|
+
mailboxStatus: string;
|
|
5718
|
+
ingestionMode: string;
|
|
5719
|
+
phase: string;
|
|
5720
|
+
syncStatus: string | null;
|
|
5721
|
+
lastPolledAt: number | null;
|
|
5722
|
+
lastBackfillCompletedAt: number | null;
|
|
5723
|
+
oldestSeenAt: number | null;
|
|
5724
|
+
backfillStatus: string | null;
|
|
5725
|
+
backfillCapped: boolean;
|
|
5726
|
+
providerComplete: false;
|
|
5727
|
+
privacyLimited: boolean;
|
|
5728
|
+
};
|
|
5729
|
+
body: {
|
|
5730
|
+
format: "text" | "html";
|
|
5731
|
+
content: string;
|
|
5732
|
+
truncated: boolean;
|
|
5733
|
+
totalBytes: number;
|
|
5734
|
+
};
|
|
5735
|
+
recipients: {
|
|
5736
|
+
to: {
|
|
5737
|
+
email: string;
|
|
5738
|
+
name?: string;
|
|
5739
|
+
}[];
|
|
5740
|
+
cc: {
|
|
5741
|
+
email: string;
|
|
5742
|
+
name?: string;
|
|
5743
|
+
}[];
|
|
5744
|
+
bcc: {
|
|
5745
|
+
email: string;
|
|
5746
|
+
name?: string;
|
|
5747
|
+
}[];
|
|
5748
|
+
truncated: boolean;
|
|
5749
|
+
};
|
|
5750
|
+
};
|
|
5450
5751
|
"email.drafts.create": {
|
|
5451
5752
|
ok: boolean;
|
|
5452
5753
|
kind: "email";
|
|
@@ -7034,6 +7335,7 @@ export interface ApiResponses {
|
|
|
7034
7335
|
template?: string;
|
|
7035
7336
|
};
|
|
7036
7337
|
};
|
|
7338
|
+
"workspace.context.rules.set": unknown;
|
|
7037
7339
|
"agentConfig.mem.show": {
|
|
7038
7340
|
agentConfig: {
|
|
7039
7341
|
identity: {
|
|
@@ -7345,9 +7647,9 @@ export type DenchApiTree = {
|
|
|
7345
7647
|
today(args?: Req<"agentConfig.daily.today">): Promise<Res<"agentConfig.daily.today">>;
|
|
7346
7648
|
};
|
|
7347
7649
|
identity: {
|
|
7348
|
-
/** Update IDENTITY.md. (`dench identity
|
|
7650
|
+
/** Update IDENTITY.md. (`dench context set identity`) */
|
|
7349
7651
|
edit(args: Req<"agentConfig.identity.edit">): Promise<Res<"agentConfig.identity.edit">>;
|
|
7350
|
-
/** Read IDENTITY.md. (`dench identity
|
|
7652
|
+
/** Read IDENTITY.md. (`dench context --sections identity`) */
|
|
7351
7653
|
show(args?: Req<"agentConfig.identity.show">): Promise<Res<"agentConfig.identity.show">>;
|
|
7352
7654
|
};
|
|
7353
7655
|
mem: {
|
|
@@ -7363,21 +7665,21 @@ export type DenchApiTree = {
|
|
|
7363
7665
|
thread(args: Req<"agentConfig.model.thread">): Promise<Res<"agentConfig.model.thread">>;
|
|
7364
7666
|
};
|
|
7365
7667
|
organisation: {
|
|
7366
|
-
/** Update ORGANISATION.md. (`dench organisation
|
|
7668
|
+
/** Update ORGANISATION.md. (`dench context set organisation`) */
|
|
7367
7669
|
edit(args: Req<"agentConfig.organisation.edit">): Promise<Res<"agentConfig.organisation.edit">>;
|
|
7368
|
-
/** Read ORGANISATION.md. (`dench organisation
|
|
7670
|
+
/** Read ORGANISATION.md. (`dench context --sections organisation`) */
|
|
7369
7671
|
show(args?: Req<"agentConfig.organisation.show">): Promise<Res<"agentConfig.organisation.show">>;
|
|
7370
7672
|
};
|
|
7371
7673
|
tools: {
|
|
7372
|
-
/** Update tool notes. (`dench tools
|
|
7674
|
+
/** Update tool notes. (`dench context set tools`) */
|
|
7373
7675
|
edit(args: Req<"agentConfig.tools.edit">): Promise<Res<"agentConfig.tools.edit">>;
|
|
7374
|
-
/** Read tool notes. (`dench tools
|
|
7676
|
+
/** Read tool notes. (`dench context --sections tools`) */
|
|
7375
7677
|
show(args?: Req<"agentConfig.tools.show">): Promise<Res<"agentConfig.tools.show">>;
|
|
7376
7678
|
};
|
|
7377
7679
|
user: {
|
|
7378
|
-
/** Update USER.md. (`dench user
|
|
7680
|
+
/** Update USER.md. (`dench context set user`) */
|
|
7379
7681
|
edit(args: Req<"agentConfig.user.edit">): Promise<Res<"agentConfig.user.edit">>;
|
|
7380
|
-
/** Read USER.md. (`dench user
|
|
7682
|
+
/** Read USER.md. (`dench context --sections user`) */
|
|
7381
7683
|
show(args?: Req<"agentConfig.user.show">): Promise<Res<"agentConfig.user.show">>;
|
|
7382
7684
|
};
|
|
7383
7685
|
};
|
|
@@ -7770,6 +8072,8 @@ export type DenchApiTree = {
|
|
|
7770
8072
|
};
|
|
7771
8073
|
/** List fields for a CRM object, including read-only calculation metadata. (`dench crm fields list`) */
|
|
7772
8074
|
list(args: Req<"crm.fields.list">): Promise<Res<"crm.fields.list">>;
|
|
8075
|
+
/** List field names, types and effective constraints without indexing or enrichment internals. (`dench crm fields list --compact`) */
|
|
8076
|
+
listCompact(args: Req<"crm.fields.listCompact">): Promise<Res<"crm.fields.listCompact">>;
|
|
7773
8077
|
/** Reorder CRM fields. (`dench crm fields reorder`) */
|
|
7774
8078
|
reorder(args: Req<"crm.fields.reorder">): Promise<Res<"crm.fields.reorder">>;
|
|
7775
8079
|
/** Update a CRM field or change/explicitly clear an existing campaign calculation. (`dench crm fields update`) */
|
|
@@ -7796,6 +8100,8 @@ export type DenchApiTree = {
|
|
|
7796
8100
|
get(args: Req<"crm.objects.get">): Promise<Res<"crm.objects.get">>;
|
|
7797
8101
|
/** List CRM objects. (`dench crm objects list`) */
|
|
7798
8102
|
list(args?: Req<"crm.objects.list">): Promise<Res<"crm.objects.list">>;
|
|
8103
|
+
/** List names, display labels, visibility and workspace counts without internal state. (`dench crm objects list --compact`) */
|
|
8104
|
+
listCompact(args?: Req<"crm.objects.listCompact">): Promise<Res<"crm.objects.listCompact">>;
|
|
7799
8105
|
/** Rename a CRM object. (`dench crm objects rename`) */
|
|
7800
8106
|
rename(args: Req<"crm.objects.rename">): Promise<Res<"crm.objects.rename">>;
|
|
7801
8107
|
/** Restore a CRM object's workspace sidebar row. Admin-only. (`dench crm objects unarchive`) */
|
|
@@ -7821,8 +8127,13 @@ export type DenchApiTree = {
|
|
|
7821
8127
|
/** Generate a CRM report. (`dench crm reports generate`) */
|
|
7822
8128
|
generate(args: Req<"crm.reports.generate">): Promise<Res<"crm.reports.generate">>;
|
|
7823
8129
|
};
|
|
7824
|
-
|
|
7825
|
-
|
|
8130
|
+
search: {
|
|
8131
|
+
/** Search CRM entries. (`dench crm search`) */
|
|
8132
|
+
(args?: Req<"crm.search">): Promise<Res<"crm.search">>;
|
|
8133
|
+
$call(args?: Req<"crm.search">): Promise<Res<"crm.search">>;
|
|
8134
|
+
/** Search bounded pages of readable CRM entries, optionally projecting cells. Always follow continueCursor until isDone. (`dench crm search --page`) */
|
|
8135
|
+
page(args?: Req<"crm.search.page">): Promise<Res<"crm.search.page">>;
|
|
8136
|
+
};
|
|
7826
8137
|
sidebar: {
|
|
7827
8138
|
groups: {
|
|
7828
8139
|
/** Create a named sidebar group (e.g. "Hiring") in the workspace-shared Library. Open to any member. (`dench crm sidebar group create`) */
|
|
@@ -8035,6 +8346,14 @@ export type DenchApiTree = {
|
|
|
8035
8346
|
/** Start Dench Emailing Service sender verification. (`dench email identity verify`) */
|
|
8036
8347
|
verify(args: Req<"email.identity.verify">): Promise<Res<"email.identity.verify">>;
|
|
8037
8348
|
};
|
|
8349
|
+
inbox: {
|
|
8350
|
+
/** Read a bounded stored body using an exact message handle from inbox search; rechecks mailbox and record privacy. (`dench email inbox message`) */
|
|
8351
|
+
message(args: Req<"email.inbox.message">): Promise<Res<"email.inbox.message">>;
|
|
8352
|
+
/** Search authorized synced mailbox headers with bounded cursor pagination. isDone covers stored records, not provider completeness. (`dench email inbox search`) */
|
|
8353
|
+
search(args?: Req<"email.inbox.search">): Promise<Res<"email.inbox.search">>;
|
|
8354
|
+
/** Read a bounded page of synced headers using an exact thread handle from inbox search; bodies remain on demand. (`dench email inbox thread`) */
|
|
8355
|
+
thread(args: Req<"email.inbox.thread">): Promise<Res<"email.inbox.thread">>;
|
|
8356
|
+
};
|
|
8038
8357
|
message: {
|
|
8039
8358
|
/** Read a raw email message's status and open/click counters. (`dench email message status`) */
|
|
8040
8359
|
get(args: Req<"email.message.get">): Promise<Res<"email.message.get">>;
|
|
@@ -8042,10 +8361,10 @@ export type DenchApiTree = {
|
|
|
8042
8361
|
list(args?: Req<"email.message.list">): Promise<Res<"email.message.list">>;
|
|
8043
8362
|
};
|
|
8044
8363
|
native: {
|
|
8045
|
-
/** Send through a native Gmail or Outlook mailbox with a durable request receipt. Only use for an explicit send request. (`dench email send --mailbox`) */
|
|
8364
|
+
/** Send through a native Gmail or Outlook mailbox with a durable request receipt. Only use for an explicit send request. (`dench email send [--mailbox <id/email>]`) */
|
|
8046
8365
|
send(args: Req<"email.native.send">): Promise<Res<"email.native.send">>;
|
|
8047
8366
|
};
|
|
8048
|
-
/** Send one raw email (no campaign): to/cc/bcc, custom from-name and reply-to, optional reply threading via replyToMessageId. (`dench email send
|
|
8367
|
+
/** Send one raw email (no campaign): to/cc/bcc, custom from-name and reply-to, optional reply threading via replyToMessageId. (`dench email send --from <verified-email>`) */
|
|
8049
8368
|
send(args: Req<"email.send">): Promise<Res<"email.send">>;
|
|
8050
8369
|
sequence: {
|
|
8051
8370
|
/** Activate a sequence so its enrollments begin sending. (`dench email sequence activate`) */
|
|
@@ -8124,6 +8443,18 @@ export type DenchApiTree = {
|
|
|
8124
8443
|
preview(args: Req<"enrichment.search.preview">): Promise<Res<"enrichment.search.preview">>;
|
|
8125
8444
|
};
|
|
8126
8445
|
};
|
|
8446
|
+
environments: {
|
|
8447
|
+
/** Retire a saved setup from new selection; retain immutable revisions and active job evidence. (`dench env delete`) */
|
|
8448
|
+
delete(args: Req<"environments.delete">): Promise<Res<"environments.delete">>;
|
|
8449
|
+
/** Inspect a saved setup, its manifest, and an optional immutable revision. (`dench env show`) */
|
|
8450
|
+
get(args: Req<"environments.get">): Promise<Res<"environments.get">>;
|
|
8451
|
+
/** List workspace-shared reusable setups and ready revisions (metadata only). (`dench env list`) */
|
|
8452
|
+
list(args?: Req<"environments.list">): Promise<Res<"environments.list">>;
|
|
8453
|
+
/** Publish an explicitly saved source and manifest for one-time preparation. Returns pending/building until verified; does not run the task. (`dench env save`) */
|
|
8454
|
+
save(args: Req<"environments.save">): Promise<Res<"environments.save">>;
|
|
8455
|
+
/** Reserve an owner-bound source upload. Prefix the uploaded bytes with the returned proof before saving. (`dench env save`) */
|
|
8456
|
+
upload(args: Req<"environments.upload">): Promise<Res<"environments.upload">>;
|
|
8457
|
+
};
|
|
8127
8458
|
files: {
|
|
8128
8459
|
/** Read a workspace file's text. (`dench files cat`) */
|
|
8129
8460
|
content(args?: Req<"files.content">): Promise<Res<"files.content">>;
|
|
@@ -8268,6 +8599,14 @@ export type DenchApiTree = {
|
|
|
8268
8599
|
/** Search the web through the Dench gateway. (`dench search`) */
|
|
8269
8600
|
web(args: Req<"search.web">): Promise<Res<"search.web">>;
|
|
8270
8601
|
};
|
|
8602
|
+
secrets: {
|
|
8603
|
+
/** Revoke a workspace credential for future resolution, optionally checking its version. (`dench secrets delete`) */
|
|
8604
|
+
delete(args: Req<"secrets.delete">): Promise<Res<"secrets.delete">>;
|
|
8605
|
+
/** List workspace-shared credential names, kinds and versions; never values. (`dench secrets list`) */
|
|
8606
|
+
list(args?: Req<"secrets.list">): Promise<Res<"secrets.list">>;
|
|
8607
|
+
/** Encrypt a workspace credential. Use CLI stdin or the secure chat form; return metadata only. Do not put values in chat, manifests or scripts. (`dench secrets set`) */
|
|
8608
|
+
set(args: Req<"secrets.set">): Promise<Res<"secrets.set">>;
|
|
8609
|
+
};
|
|
8271
8610
|
settings: {
|
|
8272
8611
|
sync: {
|
|
8273
8612
|
/** 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. (`dench settings sync`) */
|
|
@@ -8337,6 +8676,10 @@ export type DenchApiTree = {
|
|
|
8337
8676
|
/** Return the current Dench workspace context for the bearer. (`dench context`) */
|
|
8338
8677
|
(args?: Req<"workspace.context">): Promise<Res<"workspace.context">>;
|
|
8339
8678
|
$call(args?: Req<"workspace.context">): Promise<Res<"workspace.context">>;
|
|
8679
|
+
rules: {
|
|
8680
|
+
/** Update standing workspace rules; credentials belong in secrets and runnable setup in environments. (`dench context set rules`) */
|
|
8681
|
+
set(args: Req<"workspace.context.rules.set">): Promise<Res<"workspace.context.rules.set">>;
|
|
8682
|
+
};
|
|
8340
8683
|
/** Read selected scoped workspace documents and a compact context index without writes. (`dench context --sections`) */
|
|
8341
8684
|
sections(args?: Req<"workspace.context.sections">): Promise<Res<"workspace.context.sections">>;
|
|
8342
8685
|
};
|
package/chat-spawn.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* (`/api/chat/[runId]/stream`) and pretty-prints text deltas + tool
|
|
17
17
|
* calls until the workflow finishes.
|
|
18
18
|
*/
|
|
19
|
-
import { hasFlag } from "./lib/cli-args";
|
|
19
|
+
import { assertNoUnknownFlags, hasFlag } from "./lib/cli-args";
|
|
20
20
|
|
|
21
21
|
class ChatSpawnError extends Error {}
|
|
22
22
|
|
|
@@ -47,6 +47,10 @@ function consumeFlagValue(args: string[], name: string): string | undefined {
|
|
|
47
47
|
const idx = args.indexOf(name);
|
|
48
48
|
if (idx === -1) return undefined;
|
|
49
49
|
const value = args[idx + 1];
|
|
50
|
+
if (!value || value.startsWith("--"))
|
|
51
|
+
throw new ChatSpawnError(`${name} requires a value.`);
|
|
52
|
+
if (args.indexOf(name, idx + 1) !== -1)
|
|
53
|
+
throw new ChatSpawnError(`Duplicate flag: ${name}`);
|
|
50
54
|
args.splice(idx, 2);
|
|
51
55
|
return value;
|
|
52
56
|
}
|
|
@@ -372,17 +376,21 @@ function joinPositionalsExceptFlags(args: string[]): string {
|
|
|
372
376
|
}
|
|
373
377
|
|
|
374
378
|
async function runChatNew(ctx: ChatSpawnContext): Promise<void> {
|
|
379
|
+
const environment = consumeFlagValue(ctx.args, "--environment");
|
|
380
|
+
if (environment !== undefined && !/^[a-z][a-z0-9-]{0,63}$/.test(environment))
|
|
381
|
+
throw new ChatSpawnError("Invalid environment name");
|
|
375
382
|
const model = consumeFlagValue(ctx.args, "--model");
|
|
376
383
|
const fileContextPath = consumeFlagValue(ctx.args, "--file-context");
|
|
377
384
|
const visibility = consumeFlagValue(ctx.args, "--visibility");
|
|
378
385
|
const title = consumeFlagValue(ctx.args, "--title");
|
|
379
386
|
const yolo = consumeFlag(ctx.args, "--yolo");
|
|
380
387
|
const follow = consumeFlag(ctx.args, "--follow");
|
|
388
|
+
assertNoUnknownFlags(ctx.args, "chat new");
|
|
381
389
|
|
|
382
390
|
const prompt = joinPositionalsExceptFlags(ctx.args);
|
|
383
391
|
if (!prompt) {
|
|
384
392
|
throw new ChatSpawnError(
|
|
385
|
-
'Usage: dench chat new "<prompt>" [--model M] [--file-context PATH] [--visibility private|shared] [--title T] [--yolo] [--follow] [--json]',
|
|
393
|
+
'Usage: dench chat new "<prompt>" [--environment NAME] [--model M] [--file-context PATH] [--visibility private|shared] [--title T] [--yolo] [--follow] [--json]',
|
|
386
394
|
);
|
|
387
395
|
}
|
|
388
396
|
|
|
@@ -391,6 +399,7 @@ async function runChatNew(ctx: ChatSpawnContext): Promise<void> {
|
|
|
391
399
|
ctx.runtime.bearerToken,
|
|
392
400
|
{
|
|
393
401
|
prompt,
|
|
402
|
+
...(environment ? { environment } : {}),
|
|
394
403
|
model,
|
|
395
404
|
fileContextPath,
|
|
396
405
|
visibility,
|
package/chat.ts
CHANGED
|
@@ -145,7 +145,7 @@ PERMANENTLY delete one or more past chat threads (and all their messages):
|
|
|
145
145
|
server REFUSES to delete them unless \`--include-automated\` is set.
|
|
146
146
|
|
|
147
147
|
Spawn a new chat-turn workflow (same agent loop as the web UI):
|
|
148
|
-
dench chat new "<prompt>" [--model <m>] [--file-context <path>] [--visibility private|shared] [--title T] [--yolo] [--follow] [--json]
|
|
148
|
+
dench chat new "<prompt>" [--environment NAME] [--model <m>] [--file-context <path>] [--visibility private|shared] [--title T] [--yolo] [--follow] [--json]
|
|
149
149
|
dench chat send <thread-id> "<message>" [--model <m>] [--yolo] [--follow] [--json]
|
|
150
150
|
dench chat follow <thread-id> [--json]
|
|
151
151
|
dench chat tree [<root-thread-id>] [--limit N] [--json]
|