@dench.com/cli 3.6.6-staging.386 → 3.7.0-staging.387
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/agent-config.ts +17 -3
- package/app-sdk.d.ts +248 -10
- package/crm.ts +92 -24
- package/dench.ts +128 -19
- package/email-inbox.ts +169 -0
- package/email.ts +103 -21
- package/lib/api-schemas.ts +156 -14
- package/lib/app-sdk-catalog.generated.ts +9 -3
- package/lib/bundled-references.ts +17 -0
- package/lib/cli-args.ts +30 -3
- package/lib/command-args.ts +237 -0
- package/lib/command-help.ts +78 -0
- package/lib/command-registry.ts +75 -3
- package/lib/native-email-wait.ts +75 -0
- package/lib/public-error.ts +82 -0
- package/lib/references.generated.json +66 -0
- package/package.json +3 -1
- package/reference.ts +47 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dench.com/cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0-staging.387",
|
|
4
4
|
"description": "Dench agent workspace CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -37,6 +37,8 @@
|
|
|
37
37
|
"crm-privacy.ts",
|
|
38
38
|
"meetings.ts",
|
|
39
39
|
"email.ts",
|
|
40
|
+
"email-inbox.ts",
|
|
41
|
+
"reference.ts",
|
|
40
42
|
"campaign.ts",
|
|
41
43
|
"members.ts",
|
|
42
44
|
"notifications.ts",
|
package/reference.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
bundledReferenceIndex,
|
|
3
|
+
getBundledReference,
|
|
4
|
+
referenceRevision,
|
|
5
|
+
} from "./lib/bundled-references";
|
|
6
|
+
import { assertNoUnknownFlags, CliArgError, hasFlag } from "./lib/cli-args";
|
|
7
|
+
|
|
8
|
+
export const REFERENCE_HELP = `Usage: dench reference <name> [--json]
|
|
9
|
+
dench reference dench Read the bundled SKILL.md
|
|
10
|
+
dench reference crm Read the bundled CRM reference
|
|
11
|
+
dench reference --list [--json] List exact bundled paths and revision
|
|
12
|
+
References match this installed CLI version and are read locally without signing in.`;
|
|
13
|
+
|
|
14
|
+
export async function runReferenceCommand(argv: string[]): Promise<void> {
|
|
15
|
+
const args = [...argv];
|
|
16
|
+
const json = hasFlag(args, "--json");
|
|
17
|
+
const list = hasFlag(args, "--list");
|
|
18
|
+
assertNoUnknownFlags(args, "reference");
|
|
19
|
+
if (list) {
|
|
20
|
+
if (args.length)
|
|
21
|
+
throw new CliArgError("--list does not accept a reference name");
|
|
22
|
+
const index = bundledReferenceIndex();
|
|
23
|
+
console.log(
|
|
24
|
+
json
|
|
25
|
+
? JSON.stringify(index)
|
|
26
|
+
: `Revision: ${index.revision}\n${index.references.map((entry) => entry.path).join("\n")}`,
|
|
27
|
+
);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (args.length !== 1) throw new CliArgError(REFERENCE_HELP);
|
|
31
|
+
const name = args[0];
|
|
32
|
+
const path = /^(dench|skill(?:\.md)?)$/i.test(name)
|
|
33
|
+
? "SKILL.md"
|
|
34
|
+
: /^[A-Za-z0-9_-]+(?:\.md)?$/i.test(name)
|
|
35
|
+
? `references/${name.replace(/\.md$/i, "").toUpperCase()}.md`
|
|
36
|
+
: name;
|
|
37
|
+
const content = getBundledReference(path);
|
|
38
|
+
if (content === undefined)
|
|
39
|
+
throw new CliArgError(
|
|
40
|
+
`Unknown bundled reference: ${name}. Run dench reference --list.`,
|
|
41
|
+
);
|
|
42
|
+
console.log(
|
|
43
|
+
json
|
|
44
|
+
? JSON.stringify({ path, revision: referenceRevision, content })
|
|
45
|
+
: content,
|
|
46
|
+
);
|
|
47
|
+
}
|