@dench.com/cli 3.2.4 → 3.3.0-staging.314
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 +95 -0
- package/app-sdk.d.ts +132 -0
- package/dench.ts +67 -42
- package/lib/app-sdk-catalog.generated.ts +11 -0
- package/lib/command-registry.ts +65 -0
- package/lib/signal-agents.ts +454 -0
- package/lib/unipile-toolkits.ts +55 -0
- package/package.json +2 -1
- package/signals.ts +109 -0
- package/tools.ts +125 -15
package/README.md
CHANGED
|
@@ -172,6 +172,20 @@ dench tool search "list recent gmail emails" --toolkit gmail
|
|
|
172
172
|
dench tool run <composio_tool_slug> --args '{"key":"value"}' --json
|
|
173
173
|
```
|
|
174
174
|
|
|
175
|
+
`dench tool connect gmail`, `outlook`, `linkedin`, and `calendar` print Unipile
|
|
176
|
+
hosted-auth links using the same application, scopes, and callback as the web
|
|
177
|
+
app. Sign in with `dench signin` or use a member-owned Dench API key, then open
|
|
178
|
+
the returned link to authorize your account. New mailbox and LinkedIn
|
|
179
|
+
connections are private by default. An organization-only key cannot own a
|
|
180
|
+
personal connection.
|
|
181
|
+
|
|
182
|
+
Check the result with `dench tool status <toolkit> --json`. `calendar` shows
|
|
183
|
+
both Google and Outlook calendars; `google-calendar` (`googlecalendar`) and
|
|
184
|
+
`outlook-calendar` (`outlookcalendar`, `microsoft-calendar`) select one provider.
|
|
185
|
+
These status checks use Unipile-backed state without requiring Composio.
|
|
186
|
+
Other toolkits keep their existing connection provider. `--callback-url` is
|
|
187
|
+
only supported for Composio connections; Unipile uses Dench's managed callback.
|
|
188
|
+
|
|
175
189
|
Start with compact `dench tool search` output. It lists ranked tools with slug,
|
|
176
190
|
toolkit, connection status, and read-only/approval hints. Add `--json` only when
|
|
177
191
|
you need full raw schemas or exact argument details.
|
|
@@ -280,6 +294,87 @@ Qualified: it never purchases contacts, sends outreach, or converts records.
|
|
|
280
294
|
See the [lead-finding workflow](../convex/lib/seedSkills/lead-finding.md)
|
|
281
295
|
and [sales pipeline playbook](../public/references/SALES.md).
|
|
282
296
|
|
|
297
|
+
## Signal Agents
|
|
298
|
+
|
|
299
|
+
Signal Agents continuously update their own prospect lists from saved audiences
|
|
300
|
+
and business signals. Open `~find` in the app to configure them; **Manual search**
|
|
301
|
+
opens `~find/people`. Existing list enrichment and explicit CRM import stay separate.
|
|
302
|
+
Supported signals are hiring, funding, job changes, company news, relevant content,
|
|
303
|
+
and engagement on tracked LinkedIn profiles, company pages and individual posts.
|
|
304
|
+
|
|
305
|
+
Start by checking existing agents and accessible, running LinkedIn connections:
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
dench signals list --json
|
|
309
|
+
dench signals catalog --json
|
|
310
|
+
dench signals template --json > signal-agent.template.json
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
Choose the intended account from `catalog.connections` by its name and `id`;
|
|
314
|
+
never invent an ID or assume the first account is the right one. If none is
|
|
315
|
+
available, connect or share an account in **Outreach → Accounts**. LinkedIn is
|
|
316
|
+
required and searched first. People & company data is also required to verify
|
|
317
|
+
the audience; web/news is supporting discovery.
|
|
318
|
+
|
|
319
|
+
The template is an incomplete starting point, not a ready-to-save config. This
|
|
320
|
+
example uses `jq` to keep every required field while setting the account,
|
|
321
|
+
audience and hiring keywords. Replace `<connection-id>` and edit the criteria,
|
|
322
|
+
timezone, schedule and budgets for the intended agent before saving:
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
jq --arg account '<connection-id>' '
|
|
326
|
+
.linkedinAccountId = $account |
|
|
327
|
+
.audience.titles = ["VP Sales", "Head of Sales"] |
|
|
328
|
+
.signals = [{type: "hiring", keywords: ["sales operations", "revenue operations"], targets: [], lookbackDays: 30}] |
|
|
329
|
+
.schedule.timezone = "America/New_York"
|
|
330
|
+
' signal-agent.template.json > signal-agent.json
|
|
331
|
+
dench signals create --name "Sales hiring signals" --file signal-agent.json --json
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
Hiring, funding, company news and content need keywords. Post engagement needs
|
|
335
|
+
`targets` containing LinkedIn `/in/` profile URLs, `/company/` page URLs, or
|
|
336
|
+
post/feed-update URLs with activity IDs (10 URLs combined). For example:
|
|
337
|
+
`{"type":"post_engagement","keywords":[],"targets":["https://www.linkedin.com/in/example/","https://www.linkedin.com/company/example/"],"lookbackDays":30}`.
|
|
338
|
+
The agent rotates one target per run. For a profile/company, it resolves the page,
|
|
339
|
+
reads up to three recent original posts, and rotates one for engagement checks.
|
|
340
|
+
Those pages are discovery sources, not an employer restriction on leads; use
|
|
341
|
+
the audience's company filters for that. Resolution and post reads share the
|
|
342
|
+
same account limits as every other LinkedIn call.
|
|
343
|
+
Keep the complete config: API examples showing `config: {}` are placeholders,
|
|
344
|
+
not valid `SignalAgentConfig` values. `--config '<JSON>'` can replace `--file`.
|
|
345
|
+
|
|
346
|
+
Create and update default to **paused**. If create returns `saved: false` with
|
|
347
|
+
`issues`, review those warnings, adjust the config if needed, then repeat that
|
|
348
|
+
same create command with `--accept-warnings` only after approval. Do not repeat
|
|
349
|
+
a successful create; use its returned `agentId` for subsequent commands:
|
|
350
|
+
|
|
351
|
+
```bash
|
|
352
|
+
dench signals get <agentId> --json
|
|
353
|
+
dench signals update <agentId> --name "Sales hiring signals" --file signal-agent.json --json
|
|
354
|
+
# Only after reviewing the config, warnings, schedule and account activity:
|
|
355
|
+
dench signals resume <agentId> --json
|
|
356
|
+
dench signals run <agentId> --json
|
|
357
|
+
dench signals runs <agentId> --json
|
|
358
|
+
dench signals pause <agentId> --json
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
Update replaces the entire config and pauses the agent unless `--active` is
|
|
362
|
+
explicitly passed. It uses the same warning/`--accept-warnings` flow as create.
|
|
363
|
+
Resume enables scheduled execution; run requires an active agent and queues a
|
|
364
|
+
run, not a completed result. Read run history for results and deferred work.
|
|
365
|
+
|
|
366
|
+
Checks are bounded, not exhaustive. LinkedIn defaults to 20 reads per day shared
|
|
367
|
+
across Signal Agents on the same physical account and at least 60-second
|
|
368
|
+
spacing, with method limits, working hours, outreach spacing and cooldowns.
|
|
369
|
+
These controls do not guarantee protection from account restrictions. Repeated
|
|
370
|
+
matches update evidence without duplicating a person or changing their original
|
|
371
|
+
Added date. Pausing retains the list and unfinished evidence.
|
|
372
|
+
|
|
373
|
+
API keys need `crons:read` / `crons:write`; embedded apps declare `signals:read` /
|
|
374
|
+
`signals:write` and use the generated `dench.api.call("signals.create", args)`
|
|
375
|
+
surface. See the [runtime and release notes](../docs/agent-notes/signal-agents.md)
|
|
376
|
+
and the [built-in execution skill](../convex/lib/seedSkills/signal-agents.md).
|
|
377
|
+
|
|
283
378
|
## Outreach campaigns
|
|
284
379
|
|
|
285
380
|
`dench campaign` runs email + LinkedIn outreach campaigns (the Outreach →
|
package/app-sdk.d.ts
CHANGED
|
@@ -1934,6 +1934,109 @@ export interface ApiRequests {
|
|
|
1934
1934
|
"campaigns.archive": {
|
|
1935
1935
|
sequenceId: string;
|
|
1936
1936
|
};
|
|
1937
|
+
/** list signal agents and their discovery configuration. — `dench signals list` — GET /api/v1/signals */
|
|
1938
|
+
"signals.list": Record<string, never>;
|
|
1939
|
+
/** catalog signal agents and their discovery configuration. — `dench signals catalog` — GET /api/v1/signals/catalog */
|
|
1940
|
+
"signals.catalog": Record<string, never>;
|
|
1941
|
+
/** get signal agents and their discovery configuration. — `dench signals get` — GET /api/v1/signals/{agentId} */
|
|
1942
|
+
"signals.get": {
|
|
1943
|
+
agentId: string;
|
|
1944
|
+
};
|
|
1945
|
+
/** runs signal agents and their discovery configuration. — `dench signals runs` — GET /api/v1/signals/{agentId}/runs */
|
|
1946
|
+
"signals.runs": {
|
|
1947
|
+
agentId: string;
|
|
1948
|
+
};
|
|
1949
|
+
/** Save a complete per-agent configuration. Warnings require acknowledgement; new agents default to paused. — `dench signals create` — POST /api/v1/signals */
|
|
1950
|
+
"signals.create": {
|
|
1951
|
+
name: string;
|
|
1952
|
+
config: {
|
|
1953
|
+
audience: {
|
|
1954
|
+
titles: string[];
|
|
1955
|
+
locations: string[];
|
|
1956
|
+
industries: string[];
|
|
1957
|
+
headcountRanges: Array<"1-10" | "11-50" | "51-200" | "201-500" | "501-1000" | "1001-5000" | "5001-10000" | "10001+">;
|
|
1958
|
+
companyTypes: string[];
|
|
1959
|
+
companyDomains: string[];
|
|
1960
|
+
excludeCompanyDomains: string[];
|
|
1961
|
+
excludeKeywords: string[];
|
|
1962
|
+
additionalCriteria: string;
|
|
1963
|
+
};
|
|
1964
|
+
signals: Array<{
|
|
1965
|
+
type: "hiring" | "funding" | "job_change" | "company_news" | "content" | "post_engagement";
|
|
1966
|
+
keywords: string[];
|
|
1967
|
+
/** For post_engagement: LinkedIn /in/ profiles, /company/ pages or individual post URLs. One target is checked per run. Other signals use keywords, not targets. */
|
|
1968
|
+
targets: string[];
|
|
1969
|
+
lookbackDays: number;
|
|
1970
|
+
}>;
|
|
1971
|
+
/** Must include linkedin (primary, searched first) and data (audience verification). Web is supporting discovery. */
|
|
1972
|
+
sources: Array<"web" | "data" | "linkedin">;
|
|
1973
|
+
/** Required to save or run an agent. Choose an accessible running LinkedIn account ID from signals.catalog; may be omitted only in an incomplete editor/template. */
|
|
1974
|
+
linkedinAccountId?: string;
|
|
1975
|
+
signalMatch: "any" | "all";
|
|
1976
|
+
matchingMode: "precision" | "discovery";
|
|
1977
|
+
schedule: {
|
|
1978
|
+
cadence: "daily" | "weekly" | "every_6_hours";
|
|
1979
|
+
timezone: string;
|
|
1980
|
+
hour: number;
|
|
1981
|
+
};
|
|
1982
|
+
maxLeadsPerRun: number;
|
|
1983
|
+
maxProviderCalls: number;
|
|
1984
|
+
};
|
|
1985
|
+
status?: "active" | "paused";
|
|
1986
|
+
acknowledgeWarnings?: boolean;
|
|
1987
|
+
};
|
|
1988
|
+
/** Save a complete per-agent configuration. Warnings require acknowledgement; new agents default to paused. — `dench signals update` — PATCH /api/v1/signals/{agentId} */
|
|
1989
|
+
"signals.update": {
|
|
1990
|
+
agentId: string;
|
|
1991
|
+
name: string;
|
|
1992
|
+
config: {
|
|
1993
|
+
audience: {
|
|
1994
|
+
titles: string[];
|
|
1995
|
+
locations: string[];
|
|
1996
|
+
industries: string[];
|
|
1997
|
+
headcountRanges: Array<"1-10" | "11-50" | "51-200" | "201-500" | "501-1000" | "1001-5000" | "5001-10000" | "10001+">;
|
|
1998
|
+
companyTypes: string[];
|
|
1999
|
+
companyDomains: string[];
|
|
2000
|
+
excludeCompanyDomains: string[];
|
|
2001
|
+
excludeKeywords: string[];
|
|
2002
|
+
additionalCriteria: string;
|
|
2003
|
+
};
|
|
2004
|
+
signals: Array<{
|
|
2005
|
+
type: "hiring" | "funding" | "job_change" | "company_news" | "content" | "post_engagement";
|
|
2006
|
+
keywords: string[];
|
|
2007
|
+
/** For post_engagement: LinkedIn /in/ profiles, /company/ pages or individual post URLs. One target is checked per run. Other signals use keywords, not targets. */
|
|
2008
|
+
targets: string[];
|
|
2009
|
+
lookbackDays: number;
|
|
2010
|
+
}>;
|
|
2011
|
+
/** Must include linkedin (primary, searched first) and data (audience verification). Web is supporting discovery. */
|
|
2012
|
+
sources: Array<"web" | "data" | "linkedin">;
|
|
2013
|
+
/** Required to save or run an agent. Choose an accessible running LinkedIn account ID from signals.catalog; may be omitted only in an incomplete editor/template. */
|
|
2014
|
+
linkedinAccountId?: string;
|
|
2015
|
+
signalMatch: "any" | "all";
|
|
2016
|
+
matchingMode: "precision" | "discovery";
|
|
2017
|
+
schedule: {
|
|
2018
|
+
cadence: "daily" | "weekly" | "every_6_hours";
|
|
2019
|
+
timezone: string;
|
|
2020
|
+
hour: number;
|
|
2021
|
+
};
|
|
2022
|
+
maxLeadsPerRun: number;
|
|
2023
|
+
maxProviderCalls: number;
|
|
2024
|
+
};
|
|
2025
|
+
status?: "active" | "paused";
|
|
2026
|
+
acknowledgeWarnings?: boolean;
|
|
2027
|
+
};
|
|
2028
|
+
/** pause a signal agent. Paused agents retain their leads. — `dench signals pause` — POST /api/v1/signals/{agentId}/pause */
|
|
2029
|
+
"signals.pause": {
|
|
2030
|
+
agentId: string;
|
|
2031
|
+
};
|
|
2032
|
+
/** resume a signal agent. Paused agents retain their leads. — `dench signals resume` — POST /api/v1/signals/{agentId}/resume */
|
|
2033
|
+
"signals.resume": {
|
|
2034
|
+
agentId: string;
|
|
2035
|
+
};
|
|
2036
|
+
/** run a signal agent. Paused agents retain their leads. — `dench signals run` — POST /api/v1/signals/{agentId}/run */
|
|
2037
|
+
"signals.run": {
|
|
2038
|
+
agentId: string;
|
|
2039
|
+
};
|
|
1937
2040
|
/** The campaign's activity log, newest first (sent, accepted, replied, skipped, failed, paused, stopped). — `dench campaign events` — GET /api/v1/campaigns/{sequenceId}/events */
|
|
1938
2041
|
"campaigns.events": {
|
|
1939
2042
|
sequenceId: string;
|
|
@@ -4886,6 +4989,15 @@ export interface ApiResponses {
|
|
|
4886
4989
|
"campaigns.archive": {
|
|
4887
4990
|
ok: boolean;
|
|
4888
4991
|
};
|
|
4992
|
+
"signals.list": unknown;
|
|
4993
|
+
"signals.catalog": unknown;
|
|
4994
|
+
"signals.get": unknown;
|
|
4995
|
+
"signals.runs": unknown;
|
|
4996
|
+
"signals.create": unknown;
|
|
4997
|
+
"signals.update": unknown;
|
|
4998
|
+
"signals.pause": unknown;
|
|
4999
|
+
"signals.resume": unknown;
|
|
5000
|
+
"signals.run": unknown;
|
|
4889
5001
|
"campaigns.events": {
|
|
4890
5002
|
page: Record<string, unknown>[];
|
|
4891
5003
|
isDone: boolean;
|
|
@@ -6678,6 +6790,26 @@ export type DenchApiTree = {
|
|
|
6678
6790
|
/** Search the web through the Dench gateway. (`dench search`) */
|
|
6679
6791
|
web(args: Req<"search.web">): Promise<Res<"search.web">>;
|
|
6680
6792
|
};
|
|
6793
|
+
signals: {
|
|
6794
|
+
/** catalog signal agents and their discovery configuration. (`dench signals catalog`) */
|
|
6795
|
+
catalog(args?: Req<"signals.catalog">): Promise<Res<"signals.catalog">>;
|
|
6796
|
+
/** Save a complete per-agent configuration. Warnings require acknowledgement; new agents default to paused. (`dench signals create`) */
|
|
6797
|
+
create(args: Req<"signals.create">): Promise<Res<"signals.create">>;
|
|
6798
|
+
/** get signal agents and their discovery configuration. (`dench signals get`) */
|
|
6799
|
+
get(args: Req<"signals.get">): Promise<Res<"signals.get">>;
|
|
6800
|
+
/** list signal agents and their discovery configuration. (`dench signals list`) */
|
|
6801
|
+
list(args?: Req<"signals.list">): Promise<Res<"signals.list">>;
|
|
6802
|
+
/** pause a signal agent. Paused agents retain their leads. (`dench signals pause`) */
|
|
6803
|
+
pause(args: Req<"signals.pause">): Promise<Res<"signals.pause">>;
|
|
6804
|
+
/** resume a signal agent. Paused agents retain their leads. (`dench signals resume`) */
|
|
6805
|
+
resume(args: Req<"signals.resume">): Promise<Res<"signals.resume">>;
|
|
6806
|
+
/** run a signal agent. Paused agents retain their leads. (`dench signals run`) */
|
|
6807
|
+
run(args: Req<"signals.run">): Promise<Res<"signals.run">>;
|
|
6808
|
+
/** runs signal agents and their discovery configuration. (`dench signals runs`) */
|
|
6809
|
+
runs(args: Req<"signals.runs">): Promise<Res<"signals.runs">>;
|
|
6810
|
+
/** Save a complete per-agent configuration. Warnings require acknowledgement; new agents default to paused. (`dench signals update`) */
|
|
6811
|
+
update(args: Req<"signals.update">): Promise<Res<"signals.update">>;
|
|
6812
|
+
};
|
|
6681
6813
|
tool: {
|
|
6682
6814
|
/** Create a tool OAuth connection link. Slack is in-house, never Composio: for toolkit slack the CLI prints the first-party install URL (/api/slack/install?slug=<workspace>, org admin) instead of calling this endpoint. (`dench tool connect`) */
|
|
6683
6815
|
connect(args: Req<"tool.connect">): Promise<Res<"tool.connect">>;
|
package/dench.ts
CHANGED
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
STAGING_HOST,
|
|
30
30
|
} from "./host";
|
|
31
31
|
import { resolveOrganizationBySelector } from "./lib/organizationSelector";
|
|
32
|
+
import { normalizeUnipileToolkitSlug } from "./lib/unipile-toolkits";
|
|
32
33
|
import { formatApprovalOpenMessage, openUrl } from "./openUrl";
|
|
33
34
|
import {
|
|
34
35
|
explicitSessionKeyInput,
|
|
@@ -49,6 +50,7 @@ import {
|
|
|
49
50
|
fetchConnectedAppsSummary,
|
|
50
51
|
fetchUnipileConnections,
|
|
51
52
|
runToolCommand,
|
|
53
|
+
toolHelp,
|
|
52
54
|
} from "./tools";
|
|
53
55
|
|
|
54
56
|
type JsonRecord = Record<string, unknown>;
|
|
@@ -748,36 +750,6 @@ Advanced:
|
|
|
748
750
|
`);
|
|
749
751
|
}
|
|
750
752
|
|
|
751
|
-
function toolHelp() {
|
|
752
|
-
console.log(`Dench tool commands
|
|
753
|
-
|
|
754
|
-
Usage:
|
|
755
|
-
dench integrations [--json]
|
|
756
|
-
dench tool status [toolkit] [--json]
|
|
757
|
-
dench tool connect <toolkit> [--callback-url <url>] [--json]
|
|
758
|
-
dench tool search "create github issue" [--toolkit github] [--limit 20] [--compact] [--json]
|
|
759
|
-
dench tool run <composio_tool_slug> --args '{"key":"value"}' [--account <connectedAccountId>] [--json]
|
|
760
|
-
dench tool disconnect <connectionId> [--json]
|
|
761
|
-
|
|
762
|
-
Auth:
|
|
763
|
-
All commands authenticate with the active \`dench signin\` agent
|
|
764
|
-
session OR with DENCH_API_KEY (Bearer), whichever is set. Inside a
|
|
765
|
-
Dench sandbox DENCH_API_KEY is baked into the env automatically; on
|
|
766
|
-
a developer machine \`dench signin\` to a paid workspace works the
|
|
767
|
-
same way (the CLI exchanges the session for a gateway key on demand).
|
|
768
|
-
|
|
769
|
-
Notes:
|
|
770
|
-
dench integrations is an alias for dench tool status.
|
|
771
|
-
dench tool connect prints the OAuth redirect URL for the human to open.
|
|
772
|
-
Slack is Dench's IN-HOUSE integration (never Composio): \`dench tool connect
|
|
773
|
-
slack\` prints the first-party install URL, and SLACK_* tools (send with
|
|
774
|
-
Block Kit blocks/buttons, read history, list channels/users) run through
|
|
775
|
-
the org's own Slack app and can post to / read any channel.
|
|
776
|
-
dench tool run output is redacted for display; pass --json for raw JSON.
|
|
777
|
-
Override the gateway base with DENCH_GATEWAY_URL or GATEWAY_URL.
|
|
778
|
-
`);
|
|
779
|
-
}
|
|
780
|
-
|
|
781
753
|
function contextHelp() {
|
|
782
754
|
console.log(`Dench context
|
|
783
755
|
|
|
@@ -956,14 +928,17 @@ Lists every app connected to this organization, from both brokers:
|
|
|
956
928
|
connected-account id, but they run through the SAME \`dench tool
|
|
957
929
|
search\` / \`dench tool run\` — find the slug and run it. \`dench tool
|
|
958
930
|
connect slack\` prints the in-house Slack install URL (org admin);
|
|
959
|
-
|
|
931
|
+
\`dench tool connect <gmail|outlook|linkedin|calendar>\` prints a
|
|
932
|
+
Unipile hosted-auth link using the web app's configuration. Open
|
|
933
|
+
that link to authorize the account, then check \`dench tool status\`.
|
|
960
934
|
Slack is ALWAYS in-house (never Composio): SLACK_* tools can post
|
|
961
935
|
to / read any channel, with Block Kit blocks and buttons.
|
|
962
936
|
For reading, the CRM is usually better: calendar events sync into
|
|
963
937
|
\`calendar_event\` and recordings into \`meeting\`.
|
|
964
938
|
|
|
965
|
-
|
|
966
|
-
|
|
939
|
+
Other toolkits connect through Composio. If \`unipileAvailable\` is
|
|
940
|
+
false, native status could not be checked; do not assume an account
|
|
941
|
+
is disconnected. Any Composio lookup failure is reported separately.
|
|
967
942
|
|
|
968
943
|
Authenticates with the active \`dench signin\` agent session or
|
|
969
944
|
DENCH_API_KEY (Bearer), whichever is set. Same output as
|
|
@@ -2884,6 +2859,17 @@ function gatewayAuthError(
|
|
|
2884
2859
|
});
|
|
2885
2860
|
}
|
|
2886
2861
|
|
|
2862
|
+
function gatewayAuthFailureReason(error: unknown): string {
|
|
2863
|
+
const nextActions =
|
|
2864
|
+
error instanceof CliError ? error.payload.nextActions : [];
|
|
2865
|
+
return [
|
|
2866
|
+
errorMessage(error),
|
|
2867
|
+
...(Array.isArray(nextActions)
|
|
2868
|
+
? nextActions.filter((action) => typeof action === "string")
|
|
2869
|
+
: []),
|
|
2870
|
+
].join(" ");
|
|
2871
|
+
}
|
|
2872
|
+
|
|
2887
2873
|
async function resolveGatewayCommandAuth(
|
|
2888
2874
|
runtime: Runtime,
|
|
2889
2875
|
command: string,
|
|
@@ -4828,16 +4814,19 @@ async function main() {
|
|
|
4828
4814
|
// search/run/connect stay under `dench tool`.
|
|
4829
4815
|
if (command === "integrations") {
|
|
4830
4816
|
const runtime = await getRuntime();
|
|
4817
|
+
let gatewayAuthError: string | undefined;
|
|
4831
4818
|
const gatewayAuth = await resolveGatewayCommandAuth(
|
|
4832
4819
|
runtime,
|
|
4833
4820
|
"dench integrations",
|
|
4834
|
-
)
|
|
4821
|
+
).catch((error) => {
|
|
4822
|
+
gatewayAuthError = gatewayAuthFailureReason(error);
|
|
4823
|
+
return null;
|
|
4824
|
+
});
|
|
4835
4825
|
await runToolCommand({
|
|
4836
4826
|
args: ["status"],
|
|
4837
4827
|
jsonOutput: json,
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
gatewayHeaders: gatewayAuth.gatewayHeaders,
|
|
4828
|
+
...(gatewayAuth ?? {}),
|
|
4829
|
+
gatewayAuthError,
|
|
4841
4830
|
...unipileQueryAuth(runtime),
|
|
4842
4831
|
});
|
|
4843
4832
|
return;
|
|
@@ -4879,19 +4868,28 @@ async function main() {
|
|
|
4879
4868
|
return;
|
|
4880
4869
|
}
|
|
4881
4870
|
const runtime = await getRuntime();
|
|
4882
|
-
// `connect slack` never touches the gateway — it prints the in-house
|
|
4883
|
-
// install URL — so don't fail the whole command on gateway auth there.
|
|
4884
4871
|
const isSlackConnect =
|
|
4885
4872
|
sub === "connect" &&
|
|
4886
4873
|
["slack", "slackbot"].includes(
|
|
4887
4874
|
(filteredSubArgs[1] ?? "").trim().toLowerCase(),
|
|
4888
4875
|
);
|
|
4889
|
-
const
|
|
4890
|
-
|
|
4891
|
-
|
|
4876
|
+
const isUnipileCommand =
|
|
4877
|
+
(sub === "connect" || sub === "status") &&
|
|
4878
|
+
normalizeUnipileToolkitSlug(filteredSubArgs[1] ?? "") !== null;
|
|
4879
|
+
let gatewayAuth: GatewayCommandAuth | null = null;
|
|
4880
|
+
let gatewayAuthError: string | undefined;
|
|
4881
|
+
if (!isSlackConnect && !isUnipileCommand) {
|
|
4882
|
+
try {
|
|
4883
|
+
gatewayAuth = await resolveGatewayCommandAuth(runtime, "dench tool");
|
|
4884
|
+
} catch (error) {
|
|
4885
|
+
if (sub !== "status") throw error;
|
|
4886
|
+
gatewayAuthError = gatewayAuthFailureReason(error);
|
|
4887
|
+
}
|
|
4888
|
+
}
|
|
4892
4889
|
await runToolCommand({
|
|
4893
4890
|
args: filteredSubArgs,
|
|
4894
4891
|
jsonOutput: json,
|
|
4892
|
+
gatewayAuthError,
|
|
4895
4893
|
...(gatewayAuth
|
|
4896
4894
|
? {
|
|
4897
4895
|
bearerToken: gatewayAuth.bearerToken,
|
|
@@ -5063,6 +5061,33 @@ async function main() {
|
|
|
5063
5061
|
return;
|
|
5064
5062
|
}
|
|
5065
5063
|
|
|
5064
|
+
if (command === "signals") {
|
|
5065
|
+
const subArgs = stripRuntimeFlags(args.slice(args.indexOf(command) + 1));
|
|
5066
|
+
const { runSignalsCommand } = await import("./signals");
|
|
5067
|
+
if (
|
|
5068
|
+
!subArgs.length ||
|
|
5069
|
+
["help", "--help", "-h", "template"].includes(subArgs[0])
|
|
5070
|
+
) {
|
|
5071
|
+
await runSignalsCommand({
|
|
5072
|
+
convex: {} as never,
|
|
5073
|
+
args: subArgs,
|
|
5074
|
+
jsonOutput: json,
|
|
5075
|
+
});
|
|
5076
|
+
return;
|
|
5077
|
+
}
|
|
5078
|
+
const runtime = requireAuthenticatedRuntime(
|
|
5079
|
+
await getRuntime(),
|
|
5080
|
+
"dench signals",
|
|
5081
|
+
);
|
|
5082
|
+
await runSignalsCommand({
|
|
5083
|
+
convex: runtime.client,
|
|
5084
|
+
args: subArgs,
|
|
5085
|
+
sessionToken: runtime.sessionToken,
|
|
5086
|
+
jsonOutput: json,
|
|
5087
|
+
});
|
|
5088
|
+
return;
|
|
5089
|
+
}
|
|
5090
|
+
|
|
5066
5091
|
// `dench campaign` — outreach campaigns (email + LinkedIn steps). Convex
|
|
5067
5092
|
// RPC only, member-attributed auth (an organization-only key is refused
|
|
5068
5093
|
// server-side; normalizeCliError explains what to do).
|
|
@@ -70,6 +70,8 @@ export const APP_SDK_SCOPES = [
|
|
|
70
70
|
"notifications:read",
|
|
71
71
|
"notifications:write",
|
|
72
72
|
"search:read",
|
|
73
|
+
"signals:read",
|
|
74
|
+
"signals:write",
|
|
73
75
|
"store:read",
|
|
74
76
|
"store:write",
|
|
75
77
|
"ui",
|
|
@@ -326,6 +328,15 @@ export const APP_SDK_OPERATIONS: readonly AppSdkOperationInfo[] = [
|
|
|
326
328
|
{"id":"campaigns.pause","group":"campaigns","summary":"Pause an active campaign.","cli":"dench campaign pause","method":"POST","path":"/campaigns/{sequenceId}/pause","permission":"campaigns:write","pathParams":["sequenceId"]},
|
|
327
329
|
{"id":"campaigns.resume","group":"campaigns","summary":"Resume a paused campaign.","cli":"dench campaign resume","method":"POST","path":"/campaigns/{sequenceId}/resume","permission":"campaigns:write","pathParams":["sequenceId"]},
|
|
328
330
|
{"id":"campaigns.archive","group":"campaigns","summary":"Archive a campaign and stop everyone still in flight.","cli":"dench campaign archive","method":"POST","path":"/campaigns/{sequenceId}/archive","permission":"campaigns:write","pathParams":["sequenceId"]},
|
|
331
|
+
{"id":"signals.list","group":"signals","summary":"list signal agents and their discovery configuration.","cli":"dench signals list","method":"GET","path":"/signals","permission":"signals:read","pathParams":[]},
|
|
332
|
+
{"id":"signals.catalog","group":"signals","summary":"catalog signal agents and their discovery configuration.","cli":"dench signals catalog","method":"GET","path":"/signals/catalog","permission":"signals:read","pathParams":[]},
|
|
333
|
+
{"id":"signals.get","group":"signals","summary":"get signal agents and their discovery configuration.","cli":"dench signals get","method":"GET","path":"/signals/{agentId}","permission":"signals:read","pathParams":["agentId"]},
|
|
334
|
+
{"id":"signals.runs","group":"signals","summary":"runs signal agents and their discovery configuration.","cli":"dench signals runs","method":"GET","path":"/signals/{agentId}/runs","permission":"signals:read","pathParams":["agentId"]},
|
|
335
|
+
{"id":"signals.create","group":"signals","summary":"Save a complete per-agent configuration. Warnings require acknowledgement; new agents default to paused.","cli":"dench signals create","method":"POST","path":"/signals","permission":"signals:write","pathParams":[]},
|
|
336
|
+
{"id":"signals.update","group":"signals","summary":"Save a complete per-agent configuration. Warnings require acknowledgement; new agents default to paused.","cli":"dench signals update","method":"PATCH","path":"/signals/{agentId}","permission":"signals:write","pathParams":["agentId"]},
|
|
337
|
+
{"id":"signals.pause","group":"signals","summary":"pause a signal agent. Paused agents retain their leads.","cli":"dench signals pause","method":"POST","path":"/signals/{agentId}/pause","permission":"signals:write","pathParams":["agentId"]},
|
|
338
|
+
{"id":"signals.resume","group":"signals","summary":"resume a signal agent. Paused agents retain their leads.","cli":"dench signals resume","method":"POST","path":"/signals/{agentId}/resume","permission":"signals:write","pathParams":["agentId"]},
|
|
339
|
+
{"id":"signals.run","group":"signals","summary":"run a signal agent. Paused agents retain their leads.","cli":"dench signals run","method":"POST","path":"/signals/{agentId}/run","permission":"signals:write","pathParams":["agentId"]},
|
|
329
340
|
{"id":"campaigns.events","group":"campaigns","summary":"The campaign's activity log, newest first (sent, accepted, replied, skipped, failed, paused, stopped).","cli":"dench campaign events","method":"GET","path":"/campaigns/{sequenceId}/events","permission":"campaigns:read","pathParams":["sequenceId"]},
|
|
330
341
|
{"id":"campaigns.people.stop","group":"campaigns","summary":"Stop one person: nothing more is sent to them from this campaign.","cli":"dench campaign stop","method":"POST","path":"/campaigns/people/{enrollmentId}/stop","permission":"campaigns:write","pathParams":["enrollmentId"]},
|
|
331
342
|
{"id":"campaigns.people.resume","group":"campaigns","summary":"Resume one paused person in an active campaign.","cli":"dench campaign resume-person","method":"POST","path":"/campaigns/people/{enrollmentId}/resume","permission":"campaigns:write","pathParams":["enrollmentId"]},
|
package/lib/command-registry.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ZodTypeAny, z } from "zod";
|
|
2
2
|
import { convexExtras, requestSchemas, responseSchemas } from "./api-schemas";
|
|
3
|
+
import { signalAgentConfigSchema } from "./signal-agents";
|
|
3
4
|
|
|
4
5
|
export type ApiAuthMode = "none" | "bearer" | "optional";
|
|
5
6
|
|
|
@@ -3337,6 +3338,70 @@ const rawApiOperations = [
|
|
|
3337
3338
|
responseSchema: anyResponse,
|
|
3338
3339
|
backend: convex("mutation", "functions/outreachSequences:archiveSequence"),
|
|
3339
3340
|
}),
|
|
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
|
+
),
|
|
3340
3405
|
op({
|
|
3341
3406
|
id: "campaigns.events",
|
|
3342
3407
|
group: "campaigns",
|