@dench.com/cli 3.7.0-staging.387 → 3.8.1-staging.390
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 +5 -55
- package/app-sdk.d.ts +253 -43
- package/campaign.ts +335 -54
- package/chat-spawn.ts +11 -2
- package/chat.ts +3 -5
- package/context-settings.ts +86 -0
- package/cron.ts +19 -0
- package/dench.ts +202 -83
- package/environments.ts +694 -0
- package/lib/api-schemas.ts +190 -20
- package/lib/app-sdk-catalog.generated.ts +34 -20
- package/lib/campaign-steps.ts +474 -12
- package/lib/campaign-timeline.ts +69 -4
- package/lib/command-args.ts +19 -4
- package/lib/command-help.ts +17 -2
- package/lib/command-registry.ts +225 -11
- 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/parent-argv.ts +20 -0
- package/lib/references.generated.json +26 -18
- package/package.json +5 -3
- package/workspace-secrets.ts +231 -0
- package/agent.ts +0 -37
package/README.md
CHANGED
|
@@ -112,9 +112,8 @@ next commands. Add `--json` for structured output.
|
|
|
112
112
|
|
|
113
113
|
Browse and search the user's past chat threads in this workspace (own +
|
|
114
114
|
shared). Useful for pulling in earlier context when the user refers to
|
|
115
|
-
something they discussed before. The chat
|
|
116
|
-
|
|
117
|
-
`read_past_chat`); this CLI surface is the same data accessed via bash.
|
|
115
|
+
something they discussed before. The shared chat harness uses these same CLI
|
|
116
|
+
commands through its execution tool; there is no separate agent-only chat-history command family.
|
|
118
117
|
|
|
119
118
|
```bash
|
|
120
119
|
dench chat list [--query <substr>] [--limit N] [--include-archived] [--json]
|
|
@@ -391,54 +390,53 @@ Outreach needs a workspace member's credentials (a `dench signin` session, a
|
|
|
391
390
|
member-bound `DENCH_API_KEY`, or an agent session); an organization-only key
|
|
392
391
|
is refused.
|
|
393
392
|
|
|
394
|
-
## Workspace
|
|
393
|
+
## Workspace files and reusable setup
|
|
395
394
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
395
|
+
Use `dench files` for saved workspace documents and `dench stage` for outputs.
|
|
396
|
+
Harness A keeps a separate scratch directory per job. The old filesystem and
|
|
397
|
+
home-sync daemons are legacy compatibility infrastructure; they are not needed
|
|
398
|
+
to execute a command or restore a saved environment.
|
|
400
399
|
|
|
401
|
-
```
|
|
402
|
-
dench
|
|
403
|
-
dench
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
| `daemon.healthy` | The process is alive and cached progress passes freshness checks, with a short startup grace before the first scan. |
|
|
409
|
-
| `daemon.workspaceMatches` | The cached daemon serves the requested workspace root. A mismatch also makes `healthy` false. |
|
|
410
|
-
| `daemon.state.mountWorker` | Cached worker state, PID, last progress time, restart count, and error. |
|
|
411
|
-
| `counts.onDisk` | Last successful scan's count, only for the matching root; `null` when unavailable. Not a fresh count. |
|
|
412
|
-
| `counts.inConvex`, `counts.onlyOnDisk`, `counts.onlyInConvex`, `counts.hashMismatches` | `null`: these counts are unknown, not zero. |
|
|
413
|
-
| `driftStatus`, `drift` | `"not_checked"` and `[]`; an empty list does not prove that files match. |
|
|
414
|
-
|
|
415
|
-
Status exits **1** when the daemon is missing, dead, stale, stalled, or
|
|
416
|
-
serves a different root, including with `--json`; exit **0** means cached
|
|
417
|
-
health passed, not that every pending write has synced. The legacy
|
|
418
|
-
`--no-hash` and `--drift-limit N` flags remain accepted but have no effect.
|
|
419
|
-
|
|
420
|
-
To pull a workspace file through the running daemon:
|
|
421
|
-
|
|
422
|
-
```bash
|
|
423
|
-
dench fs pull "/reports/example.csv" --wait --timeout-ms 10000 --json
|
|
400
|
+
```sh
|
|
401
|
+
dench files cat /reports/example.md
|
|
402
|
+
dench env list --json
|
|
403
|
+
dench env save openai-report --path ./openai-report --json
|
|
404
|
+
dench env show openai-report --json
|
|
405
|
+
dench env run openai-report -- node report.mjs
|
|
406
|
+
dench secrets set OPENAI_API_KEY --stdin < /private/path/key.txt
|
|
424
407
|
```
|
|
425
408
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
409
|
+
A saved directory requires `dench-env.json`, `SKILL.md`, an explicit file allowlist
|
|
410
|
+
and verification commands. It builds dependencies once, publishes a ready
|
|
411
|
+
revision, and reuses the prepared snapshot or compatible bundle. Only the chosen
|
|
412
|
+
environment is loaded. Secrets are encrypted separately and injected into the
|
|
413
|
+
executing process; they never become dependency archives or memory facts.
|
|
414
|
+
|
|
415
|
+
New automation runs select the latest ready revision; active jobs and their
|
|
416
|
+
children retain the resolved revision. State is isolated by job or automation
|
|
417
|
+
unless an explicit shared state key is chosen. State writes and refreshed
|
|
418
|
+
credential files use compare-and-set versions; conflicts do not replay business
|
|
419
|
+
operations. Rotate credentials without reinstalling packages.
|
|
420
|
+
|
|
421
|
+
On a different local OS/runtime, explicitly prepare a separate platform cache
|
|
422
|
+
once using `dench env run openai-report --prepare-local -- node report.mjs`.
|
|
423
|
+
Normal ready runs never invoke a package installer. The local executor provides
|
|
424
|
+
separate directories, not operating-system isolation.
|
|
425
|
+
|
|
426
|
+
See [the environment reference](https://dench.com/references/ENVIRONMENTS.md)
|
|
427
|
+
for the manifest, cold-start costs, mutable state and recovery receipts. Use
|
|
428
|
+
`dench memory search/save` for facts and preferences, `dench context set` for
|
|
429
|
+
standing context, and `dench secrets` for credentials. An old memory claiming
|
|
430
|
+
that a service is configured cannot replace a successful storage receipt.
|
|
434
431
|
|
|
435
432
|
## Sandbox / API key auth (no `dench signin` required)
|
|
436
433
|
|
|
437
434
|
Inside a Dench sandbox the Dench API key is set in the environment when the
|
|
438
435
|
sandbox starts. When `DENCH_API_KEY` is present, the CLI skips the
|
|
439
436
|
`dench signin` flow entirely and uses the key as a bearer for every org-scoped
|
|
440
|
-
command — `dench crm`, `dench files`,
|
|
441
|
-
|
|
437
|
+
command — `dench crm`, `dench files`, and other workspace operations. The
|
|
438
|
+
selected connection determines the backend; hosted credentials stay scoped to
|
|
439
|
+
the authorized workspace and job.
|
|
442
440
|
|
|
443
441
|
```bash
|
|
444
442
|
export DENCH_API_KEY=dench_pk_live_…
|
|
@@ -477,7 +475,8 @@ dench context --sections organisation,user,memory --json
|
|
|
477
475
|
```
|
|
478
476
|
|
|
479
477
|
Section names are `identity`, `organisation`, `user`, `memory`, `rules`, and
|
|
480
|
-
`tools`. Multiple names use one query.
|
|
481
|
-
|
|
482
|
-
|
|
478
|
+
`tools`. Multiple names use one query. Reading never fills profiles or writes
|
|
479
|
+
memory. Edit the selected context with
|
|
480
|
+
`dench context set <identity|organisation|user|tools|rules> --stdin`; older profile
|
|
481
|
+
aliases remain compatibility paths. Personal USER context is unavailable to shared
|
|
483
482
|
channel sessions. `dench context --json` keeps its existing workspace overview.
|
package/agent-config.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `dench identity / organisation / user / bootstrap / model /
|
|
2
|
+
* `dench identity / organisation / user / bootstrap / model /
|
|
3
3
|
* mem aggregate` — CLI surface for the OpenClaw-
|
|
4
4
|
* parity self-updating harness.
|
|
5
5
|
*
|
|
@@ -15,14 +15,13 @@
|
|
|
15
15
|
* identity show | edit
|
|
16
16
|
* organisation show | edit
|
|
17
17
|
* user show | edit
|
|
18
|
-
* tools show |
|
|
18
|
+
* tools show | edit
|
|
19
19
|
* memory show | append <text> | set (MEMORY.md aggregate)
|
|
20
20
|
* bootstrap status | complete | reopen | template
|
|
21
21
|
* model default <id> | model default clear |
|
|
22
22
|
* model thread <threadId> <id> | model thread <threadId> clear
|
|
23
|
-
* daily today | daily show <YYYY-MM-DD> | daily append <text>
|
|
24
23
|
*
|
|
25
|
-
* `edit` / `
|
|
24
|
+
* `edit` / `template` open the
|
|
26
25
|
* user's `$EDITOR` (default `vi`) to capture the new body. The
|
|
27
26
|
* stdin path is also supported via `--stdin`, useful in scripts.
|
|
28
27
|
*/
|
|
@@ -496,66 +495,17 @@ export async function runModelCommand(ctx: CliCtx): Promise<void> {
|
|
|
496
495
|
await handleModel(ctx, ctx.args);
|
|
497
496
|
}
|
|
498
497
|
|
|
499
|
-
/**
|
|
500
|
-
* Daily activity log subcommands (real fileTree files under
|
|
501
|
-
* `/workspace/daily/`). Today / show <YYYY-MM-DD> read the inline
|
|
502
|
-
* cache; append delegates to the agent action so timestamps and
|
|
503
|
-
* heading wrappers stay consistent.
|
|
504
|
-
*/
|
|
505
|
-
export async function runDailyCommand(ctx: CliCtx): Promise<void> {
|
|
506
|
-
consumeOutputFlag(ctx);
|
|
507
|
-
const sub = ctx.args[0];
|
|
508
|
-
if (!sub || sub === "today") {
|
|
509
|
-
const today = new Date();
|
|
510
|
-
const yyyy = today.getUTCFullYear();
|
|
511
|
-
const mm = String(today.getUTCMonth() + 1).padStart(2, "0");
|
|
512
|
-
const dd = String(today.getUTCDate()).padStart(2, "0");
|
|
513
|
-
const path = `/daily/${yyyy}-${mm}-${dd}.md`;
|
|
514
|
-
// Daily logs are real files — fetch via the workspace file API
|
|
515
|
-
// hop so the same auth (Convex Auth or API key) works.
|
|
516
|
-
out(
|
|
517
|
-
ctx,
|
|
518
|
-
ctx.jsonOutput
|
|
519
|
-
? { path }
|
|
520
|
-
: `Today's daily log lives at ${path}. Use \`dench fs cat ${path}\` to read it, or open it in the workspace UI.`,
|
|
521
|
-
);
|
|
522
|
-
return;
|
|
523
|
-
}
|
|
524
|
-
if (sub === "show") {
|
|
525
|
-
const date = ctx.args[1];
|
|
526
|
-
if (!date) {
|
|
527
|
-
throw new AgentConfigCliError("Usage: dench daily show <YYYY-MM-DD>");
|
|
528
|
-
}
|
|
529
|
-
out(
|
|
530
|
-
ctx,
|
|
531
|
-
ctx.jsonOutput
|
|
532
|
-
? { path: `/daily/${date}.md` }
|
|
533
|
-
: `Daily log for ${date} lives at /daily/${date}.md. Use \`dench fs cat\` to read it.`,
|
|
534
|
-
);
|
|
535
|
-
return;
|
|
536
|
-
}
|
|
537
|
-
if (sub === "append") {
|
|
538
|
-
throw new AgentConfigCliError(
|
|
539
|
-
"Daily append is currently only available via the agent's `append_daily_log` tool. Use the chat to log entries with timestamps.",
|
|
540
|
-
);
|
|
541
|
-
}
|
|
542
|
-
throw new AgentConfigCliError(
|
|
543
|
-
`Unknown daily subcommand: "${sub}". Try "today", "show <YYYY-MM-DD>".`,
|
|
544
|
-
);
|
|
545
|
-
}
|
|
546
|
-
|
|
547
498
|
export function printAgentConfigCliHelp(): void {
|
|
548
499
|
console.log(
|
|
549
|
-
`
|
|
500
|
+
`Workspace context compatibility aliases (prefer dench context --sections / context set):
|
|
550
501
|
|
|
551
502
|
dench identity show | edit IDENTITY.md (org-wide)
|
|
552
503
|
dench organisation show | edit ORGANISATION.md
|
|
553
504
|
dench user show | edit USER.md (per-member)
|
|
554
|
-
dench tools show |
|
|
505
|
+
dench tools show | edit TOOLS.md notes section
|
|
555
506
|
dench mem show | append <text> | set MEMORY.md aggregate
|
|
556
507
|
dench bootstrap status | complete | reopen | template
|
|
557
508
|
dench model default <id|clear> | model thread <threadId> <id|clear>
|
|
558
|
-
dench daily today | show <YYYY-MM-DD> Activity log paths
|
|
559
509
|
|
|
560
510
|
Editing flags:
|
|
561
511
|
--content "<markdown>" Inline body
|