@hy-sde-org/dsh-av 0.1.2-rc.1
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/LICENSE +32 -0
- package/README.md +55 -0
- package/cordis.patch.yml +23 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/service.d.ts +119 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +254 -0
- package/dist/service.js.map +1 -0
- package/dist/types.d.ts +120 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -0
- package/examples/agent-preset/agent.cordis.yml +19 -0
- package/examples/agent-preset/preset.yml +3 -0
- package/package.json +79 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 hy-sde
|
|
4
|
+
|
|
5
|
+
This repository ports the fork-only Automic Vault surface
|
|
6
|
+
(@deepseek-ai/dsh-av host service + @deepseek-ai/dsh-tool-av model tools)
|
|
7
|
+
onto the DeepSeek Harness service seam as standalone packages
|
|
8
|
+
(@hy-sde-org/dsh-av + @hy-sde-org/dsh-tool-av). The ported portions are
|
|
9
|
+
distributed under the same MIT license as their origin:
|
|
10
|
+
|
|
11
|
+
Copyright (c) 2026 DeepSeek
|
|
12
|
+
|
|
13
|
+
Parts of this repository are derived from DeepSeek Harness
|
|
14
|
+
(https://github.com/deepseek-ai/deepseek-harness), MIT License.
|
|
15
|
+
|
|
16
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
17
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
18
|
+
in the Software without restriction, including without limitation the rights
|
|
19
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
20
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
21
|
+
furnished to do so, subject to the following conditions:
|
|
22
|
+
|
|
23
|
+
The above copyright notice and this permission notice shall be included in all
|
|
24
|
+
copies or substantial portions of the Software.
|
|
25
|
+
|
|
26
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
27
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
28
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
29
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
30
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
31
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
32
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# @hy-sde-org/dsh-av
|
|
2
|
+
|
|
3
|
+
The host-plane, **read-only** Automic Vault (`av`) CLI wrapper for DeepSeek
|
|
4
|
+
Harness: `ctx.av` resolves the `av` executable (config → `DSH_AV_PATH` →
|
|
5
|
+
PATH), probes it with `av --version`, and parses the JSON surfaces
|
|
6
|
+
`av scan --json`, `av doctor [tool] --json`, `av detectors --json`,
|
|
7
|
+
`av hardeners --json`, plus `av list` (secret **names only**). The
|
|
8
|
+
model-facing tools in `@hy-sde-org/dsh-tool-av` resolve this exact service.
|
|
9
|
+
Ported standalone from the fork-only `@deepseek-ai/dsh-av` — no upstream
|
|
10
|
+
harness changes required.
|
|
11
|
+
|
|
12
|
+
## Executed commands
|
|
13
|
+
|
|
14
|
+
| Method | CLI invocation | Purpose |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| `probe` | `av --version` | reachability + version, never throws |
|
|
17
|
+
| `scan` | `av scan --json [detectors…]` | audit the Mac for credential exposures and hazards |
|
|
18
|
+
| `doctor` | `av doctor [tool] --json` | verify installed hardening |
|
|
19
|
+
| `detectors` | `av detectors --json` | detector catalog (feed `scan` filters) |
|
|
20
|
+
| `hardeners` | `av hardeners --json` | hardener catalog with hardened/applicable status |
|
|
21
|
+
| `list` | `av list` | saved secret names only |
|
|
22
|
+
|
|
23
|
+
All commands run through `ctx.subprocess` with bounded stdout/stderr
|
|
24
|
+
collection, a wall-clock timeout, and SIGTERM→SIGKILL grace. A non-zero exit
|
|
25
|
+
is returned as data on the run; only launch failure, signal kill, or timeout
|
|
26
|
+
throws `AvCommandError`.
|
|
27
|
+
|
|
28
|
+
## Security boundary
|
|
29
|
+
|
|
30
|
+
Never invoked from this service: `av inject` / `av proxy` / `av save` /
|
|
31
|
+
`av harden`. No stored Secret Value ever reaches model context or an argv
|
|
32
|
+
here — the value-touching verbs stay human-in-the-loop in a terminal the
|
|
33
|
+
user controls. `list` is a hard limit to secret **names**.
|
|
34
|
+
|
|
35
|
+
## Configuration
|
|
36
|
+
|
|
37
|
+
| config | env fallback | default | meaning |
|
|
38
|
+
|---|---|---|---|
|
|
39
|
+
| `avPath` | `DSH_AV_PATH` | `av` (PATH) | executable name or absolute path |
|
|
40
|
+
| `timeoutMs` | — | `120000` | per-command wall-clock budget |
|
|
41
|
+
| `maxStdoutBytes` | — | `8 MiB` | in-memory cap on collected stdout |
|
|
42
|
+
| `maxStderrBytes` | — | `64 KiB` | retained stderr tail |
|
|
43
|
+
| `graceMs` | — | `5000` | SIGTERM→SIGKILL grace |
|
|
44
|
+
|
|
45
|
+
## Install
|
|
46
|
+
|
|
47
|
+
Service row ships as `cordis.patch.yml` (stock `insert` form); `dsh plugin
|
|
48
|
+
add @hy-sde-org/dsh-av @hy-sde-org/dsh-tool-av` inserts it into the profile's
|
|
49
|
+
base composition. The tool row mounts at the agent plane from the ready-made
|
|
50
|
+
preset in `examples/agent-preset/`.
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pnpm --filter @hy-sde-org/dsh-av test # fake-av-CLI service tests
|
|
54
|
+
pnpm --filter @hy-sde-org/dsh-av build # tsc -> dist
|
|
55
|
+
```
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# @hy-sde-org/dsh-av — install surface for the read-only Automic Vault
|
|
2
|
+
# service.
|
|
3
|
+
#
|
|
4
|
+
# The `ctx.av` SERVICE is host-plane: it is a stateless, read-only wrapper
|
|
5
|
+
# around the `av` CLI (scan / doctor / detectors / hardeners / list over the
|
|
6
|
+
# subprocess seam) with no durable state and no value-releasing verbs, so one
|
|
7
|
+
# instance across sessions is correct — this bundle inserts one row into the
|
|
8
|
+
# profile's base composition. The model-facing av_scan / av_doctor /
|
|
9
|
+
# av_catalog / av_list tools live in @hy-sde-org/dsh-tool-av and mount at the
|
|
10
|
+
# AGENT plane from a user agent preset (they resolve this host instance) —
|
|
11
|
+
# see examples/agent-preset/ in the package for the ready-to-copy preset.
|
|
12
|
+
#
|
|
13
|
+
# `insert` is the stock harness patch form for rows that don't exist in the
|
|
14
|
+
# deployment's composition (a plain `id:`+`name:` entry is a modification of
|
|
15
|
+
# an existing row). This patch INSERTS a new row only — it touches no existing
|
|
16
|
+
# row, so `dsh plugin add @hy-sde-org/dsh-av` never breaks boot on a stock
|
|
17
|
+
# DeepSeek Harness (0.1.1-rc.2 and later). Without the preset row you get the
|
|
18
|
+
# service but no tools; without this row the preset tools fail loudly
|
|
19
|
+
# ("av: no av service") the first time they run.
|
|
20
|
+
|
|
21
|
+
- insert:
|
|
22
|
+
- id: av
|
|
23
|
+
name: '@hy-sde-org/dsh-av'
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic Automic Vault plumbing for the DeepSeek Harness: `ctx.av`, a
|
|
3
|
+
* host-plane, read-only Automic Vault CLI service (scan / doctor / detectors /
|
|
4
|
+
* hardeners / list over the subprocess seam) that the vault tools in
|
|
5
|
+
* `@hy-sde-org/dsh-tool-av` resolve.
|
|
6
|
+
*
|
|
7
|
+
* The service is stateless per call, so it lives in the base bundle like
|
|
8
|
+
* `ctx.git` / `ctx.browser`. It never releases stored Secret Values: the
|
|
9
|
+
* value-touching verbs (`av inject` / `av proxy` / `av save` / `av harden`)
|
|
10
|
+
* stay human-in-the-loop in a terminal the user controls.
|
|
11
|
+
* @module @hy-sde-org/dsh-av
|
|
12
|
+
*/
|
|
13
|
+
import { Context } from '@deepseek-ai/cordis';
|
|
14
|
+
import { AvService } from './service.ts';
|
|
15
|
+
import type { Config } from './service.ts';
|
|
16
|
+
export * from './types.ts';
|
|
17
|
+
export * from './service.ts';
|
|
18
|
+
declare module '@deepseek-ai/cordis' {
|
|
19
|
+
interface Context {
|
|
20
|
+
/** The av service: read-only Automic Vault CLI queries over subprocess. */
|
|
21
|
+
av: AvService;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export { AvCommandError } from './service.ts';
|
|
25
|
+
/**
|
|
26
|
+
* Register `ctx.av`. Host-plane row: the service owns no durable state and
|
|
27
|
+
* shells out per call, so one instance across sessions is correct.
|
|
28
|
+
* @param ctx - the host or agent-plane context (needs the `subprocess` seam).
|
|
29
|
+
* @param config - service configuration (av path, timeouts, caps).
|
|
30
|
+
*/
|
|
31
|
+
export declare function apply(ctx: Context, config?: Config): void;
|
|
32
|
+
/** Cordis plugin name for loader diagnostics. */
|
|
33
|
+
export declare const name = "av";
|
|
34
|
+
/**
|
|
35
|
+
* The plugin core: registers the av services.
|
|
36
|
+
*
|
|
37
|
+
*/
|
|
38
|
+
declare const _default: {
|
|
39
|
+
name: string;
|
|
40
|
+
apply: typeof apply;
|
|
41
|
+
};
|
|
42
|
+
export default _default;
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAE5B,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,OAAO;QACf,2EAA2E;QAC3E,EAAE,EAAE,SAAS,CAAA;KACd;CACF;AAED,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,MAAW,GAAG,IAAI,CAE7D;AAED,iDAAiD;AACjD,eAAO,MAAM,IAAI,OAAO,CAAA;AAExB;;;GAGG;;;;;AACH,wBAA8B"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic Automic Vault plumbing for the DeepSeek Harness: `ctx.av`, a
|
|
3
|
+
* host-plane, read-only Automic Vault CLI service (scan / doctor / detectors /
|
|
4
|
+
* hardeners / list over the subprocess seam) that the vault tools in
|
|
5
|
+
* `@hy-sde-org/dsh-tool-av` resolve.
|
|
6
|
+
*
|
|
7
|
+
* The service is stateless per call, so it lives in the base bundle like
|
|
8
|
+
* `ctx.git` / `ctx.browser`. It never releases stored Secret Values: the
|
|
9
|
+
* value-touching verbs (`av inject` / `av proxy` / `av save` / `av harden`)
|
|
10
|
+
* stay human-in-the-loop in a terminal the user controls.
|
|
11
|
+
* @module @hy-sde-org/dsh-av
|
|
12
|
+
*/
|
|
13
|
+
import { AvService } from "./service.js";
|
|
14
|
+
export * from "./types.js";
|
|
15
|
+
export * from "./service.js";
|
|
16
|
+
export { AvCommandError } from "./service.js";
|
|
17
|
+
/**
|
|
18
|
+
* Register `ctx.av`. Host-plane row: the service owns no durable state and
|
|
19
|
+
* shells out per call, so one instance across sessions is correct.
|
|
20
|
+
* @param ctx - the host or agent-plane context (needs the `subprocess` seam).
|
|
21
|
+
* @param config - service configuration (av path, timeouts, caps).
|
|
22
|
+
*/
|
|
23
|
+
export function apply(ctx, config = {}) {
|
|
24
|
+
new AvService(ctx, config);
|
|
25
|
+
}
|
|
26
|
+
/** Cordis plugin name for loader diagnostics. */
|
|
27
|
+
export const name = 'av';
|
|
28
|
+
/**
|
|
29
|
+
* The plugin core: registers the av services.
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
export default { name, apply };
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAGxC,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAS5B,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C;;;;;GAKG;AACH,MAAM,UAAU,KAAK,CAAC,GAAY,EAAE,SAAiB,EAAE;IACrD,IAAI,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;AAC5B,CAAC;AAED,iDAAiD;AACjD,MAAM,CAAC,MAAM,IAAI,GAAG,IAAI,CAAA;AAExB;;;GAGG;AACH,eAAe,EAAE,IAAI,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `ctx.av` service: a thin, read-only wrapper around the Automic Vault CLI
|
|
3
|
+
* via the `ctx.subprocess` seam. Host-plane — the service holds no durable
|
|
4
|
+
* state and shells out per call, so one instance serves every session; the
|
|
5
|
+
* model-facing tools live in `@hy-sde-org/dsh-tool-av` and resolve this host
|
|
6
|
+
* instance.
|
|
7
|
+
*
|
|
8
|
+
* The service resolves the `av` executable (config → `DSH_AV_PATH` → PATH),
|
|
9
|
+
* probes it once per call with `av --version`, and parses the JSON surfaces
|
|
10
|
+
* `av scan --json`, `av doctor [tool] --json`, `av detectors --json` and
|
|
11
|
+
* `av hardeners --json`, plus `av list` (secret NAMES only — a hard limit).
|
|
12
|
+
* It never invokes the value-releasing verbs (`av inject` / `av proxy` /
|
|
13
|
+
* `av save` / `av harden`): those stay human-in-the-loop in a terminal the
|
|
14
|
+
* user controls.
|
|
15
|
+
* @module @hy-sde-org/dsh-av/service
|
|
16
|
+
*/
|
|
17
|
+
import { Service, type Context } from '@deepseek-ai/cordis';
|
|
18
|
+
import type { AvProbe, DetectorsReport, DoctorReport, HardenersReport, ScanReport } from './types.ts';
|
|
19
|
+
/** Plugin configuration for the av service. */
|
|
20
|
+
export interface Config {
|
|
21
|
+
/** `av` executable name or path (default `av`, resolved through PATH). */
|
|
22
|
+
avPath?: string;
|
|
23
|
+
/** Per-command wall-clock budget in ms (default 120000). */
|
|
24
|
+
timeoutMs?: number;
|
|
25
|
+
/** In-memory cap on one collected stdout (default 8 MiB). */
|
|
26
|
+
maxStdoutBytes?: number;
|
|
27
|
+
/** Retained stderr tail bytes (default 64 KiB). */
|
|
28
|
+
maxStderrBytes?: number;
|
|
29
|
+
/** SIGTERM→SIGKILL grace in ms (default 5000). */
|
|
30
|
+
graceMs?: number;
|
|
31
|
+
}
|
|
32
|
+
/** A failed `av` invocation: exit status plus stderr retained for the agent. */
|
|
33
|
+
export declare class AvCommandError extends Error {
|
|
34
|
+
/** Process exit code of the failed av command (null when the process never exited). */
|
|
35
|
+
readonly exitCode: number | null;
|
|
36
|
+
/** Captured stderr of the failed av command. */
|
|
37
|
+
readonly stderr: string;
|
|
38
|
+
constructor(message: string, options: {
|
|
39
|
+
exitCode: number | null;
|
|
40
|
+
stderr: string;
|
|
41
|
+
cause?: unknown;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/** One completed subprocess run. */
|
|
45
|
+
export interface CommandRun {
|
|
46
|
+
stdout: string;
|
|
47
|
+
exitCode: number;
|
|
48
|
+
killed: boolean;
|
|
49
|
+
stderr: string;
|
|
50
|
+
}
|
|
51
|
+
/** Default per-command timeout. */
|
|
52
|
+
export declare const DEFAULT_TIMEOUT_MS = 120000;
|
|
53
|
+
/** Default stdout collection cap. */
|
|
54
|
+
export declare const DEFAULT_MAX_STDOUT_BYTES: number;
|
|
55
|
+
/** The `ctx.av` service. */
|
|
56
|
+
export declare class AvService extends Service {
|
|
57
|
+
private readonly avPath;
|
|
58
|
+
private readonly timeoutMs;
|
|
59
|
+
private readonly maxStdoutBytes;
|
|
60
|
+
private readonly maxStderrBytes;
|
|
61
|
+
private readonly graceMs;
|
|
62
|
+
constructor(ctx: Context, config?: Config);
|
|
63
|
+
/**
|
|
64
|
+
* Check whether the `av` CLI is reachable and answering `av --version`.
|
|
65
|
+
* Never throws: an unavailable binary, launch failure, or timeout surfaces
|
|
66
|
+
* as `{ available: false, reason }`.
|
|
67
|
+
* @returns reachability, CLI version when present, and a human reason on failure.
|
|
68
|
+
*/
|
|
69
|
+
probe(): Promise<AvProbe>;
|
|
70
|
+
/**
|
|
71
|
+
* Audit the Mac for supported credential exposures and hazards
|
|
72
|
+
* (`av scan --json`).
|
|
73
|
+
* @param detectors - optional detector-name filter (from `detectors()`); empty means all.
|
|
74
|
+
* @returns the parsed `av scan --json` report.
|
|
75
|
+
*/
|
|
76
|
+
scan(detectors?: readonly string[]): Promise<ScanReport>;
|
|
77
|
+
/**
|
|
78
|
+
* Verify installed hardening (`av doctor [tool] --json`).
|
|
79
|
+
* @param selector - optional tool name (e.g. `gh`); empty means all.
|
|
80
|
+
* @returns the parsed `av doctor [tool] --json` report.
|
|
81
|
+
*/
|
|
82
|
+
doctor(selector?: string): Promise<DoctorReport>;
|
|
83
|
+
/**
|
|
84
|
+
* Print detector metadata (`av detectors --json`).
|
|
85
|
+
* @returns the parsed report.
|
|
86
|
+
*/
|
|
87
|
+
detectors(): Promise<DetectorsReport>;
|
|
88
|
+
/**
|
|
89
|
+
* Print hardener metadata (`av hardeners --json`).
|
|
90
|
+
* @returns the parsed report.
|
|
91
|
+
*/
|
|
92
|
+
hardeners(): Promise<HardenersReport>;
|
|
93
|
+
/**
|
|
94
|
+
* List saved secret names (`av list`). NAMES only — never values; the
|
|
95
|
+
* value-releasing verbs are deliberately out of this service's surface.
|
|
96
|
+
* @returns sorted saved secret names (only names, never values).
|
|
97
|
+
*/
|
|
98
|
+
list(): Promise<string[]>;
|
|
99
|
+
private subprocess;
|
|
100
|
+
/**
|
|
101
|
+
* Run one `av` command. A non-zero exit code is returned as data on the run
|
|
102
|
+
* (callers decide whether it is an error); only a launch failure, a signal
|
|
103
|
+
* kill, or a timeout throws {@link AvCommandError}.
|
|
104
|
+
* @param argv - av arguments (never shell-interpreted).
|
|
105
|
+
* @param options - cwd (required), abort signal, stdin text, timeout override.
|
|
106
|
+
* @returns exit code, collected stdout/stderr, and killed flag; throws {@link AvCommandError} on launch/timeout/signal failures.
|
|
107
|
+
*/
|
|
108
|
+
run(argv: readonly string[], options: {
|
|
109
|
+
cwd: string;
|
|
110
|
+
signal?: AbortSignal | undefined;
|
|
111
|
+
stdin?: string | undefined;
|
|
112
|
+
timeoutMs?: number;
|
|
113
|
+
}): Promise<CommandRun>;
|
|
114
|
+
/** Run one `av` command and require a clean exit (exit 0). */
|
|
115
|
+
private runChecked;
|
|
116
|
+
/** Parse one JSON surface; keep the report shape terse on failure. */
|
|
117
|
+
private parseJson;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAO3D,OAAO,KAAK,EACV,OAAO,EACP,eAAe,EACf,YAAY,EACZ,eAAe,EACf,UAAU,EACX,MAAM,YAAY,CAAA;AAEnB,+CAA+C;AAC/C,MAAM,WAAW,MAAM;I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,CAAC,OAAO,CAAC;IAmB/B;;;;;OAKG;IACG,IAAI,CAAC,SAAS,GAAE,SAAS,MAAM,EAAO,GAAG,OAAO,CAAC,UAAU,CAAC;IAMlE;;;;OAIG;IACG,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAMtD;;;OAGG;IACG,SAAS,IAAI,OAAO,CAAC,eAAe,CAAC;IAK3C;;;OAGG;IACG,SAAS,IAAI,OAAO,CAAC,eAAe,CAAC;IAK3C;;;;OAIG;IACG,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAO/B,OAAO,CAAC,UAAU;IAQlB;;;;;;;OAOG;IACG,GAAG,CACP,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GACzG,OAAO,CAAC,UAAU,CAAC;IAuFtB,8DAA8D;YAChD,UAAU;IAcxB,sEAAsE;IACtE,OAAO,CAAC,SAAS;CAUlB"}
|
package/dist/service.js
ADDED
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `ctx.av` service: a thin, read-only wrapper around the Automic Vault CLI
|
|
3
|
+
* via the `ctx.subprocess` seam. Host-plane — the service holds no durable
|
|
4
|
+
* state and shells out per call, so one instance serves every session; the
|
|
5
|
+
* model-facing tools live in `@hy-sde-org/dsh-tool-av` and resolve this host
|
|
6
|
+
* instance.
|
|
7
|
+
*
|
|
8
|
+
* The service resolves the `av` executable (config → `DSH_AV_PATH` → PATH),
|
|
9
|
+
* probes it once per call with `av --version`, and parses the JSON surfaces
|
|
10
|
+
* `av scan --json`, `av doctor [tool] --json`, `av detectors --json` and
|
|
11
|
+
* `av hardeners --json`, plus `av list` (secret NAMES only — a hard limit).
|
|
12
|
+
* It never invokes the value-releasing verbs (`av inject` / `av proxy` /
|
|
13
|
+
* `av save` / `av harden`): those stay human-in-the-loop in a terminal the
|
|
14
|
+
* user controls.
|
|
15
|
+
* @module @hy-sde-org/dsh-av/service
|
|
16
|
+
*/
|
|
17
|
+
import { Service } from '@deepseek-ai/cordis';
|
|
18
|
+
/** A failed `av` invocation: exit status plus stderr retained for the agent. */
|
|
19
|
+
export class AvCommandError extends Error {
|
|
20
|
+
/** Process exit code of the failed av command (null when the process never exited). */
|
|
21
|
+
exitCode;
|
|
22
|
+
/** Captured stderr of the failed av command. */
|
|
23
|
+
stderr;
|
|
24
|
+
constructor(message, options) {
|
|
25
|
+
super(message, options.cause !== undefined ? { cause: options.cause } : undefined);
|
|
26
|
+
this.exitCode = options.exitCode;
|
|
27
|
+
this.stderr = options.stderr;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/** Default per-command timeout. */
|
|
31
|
+
export const DEFAULT_TIMEOUT_MS = 120_000;
|
|
32
|
+
/** Default stdout collection cap. */
|
|
33
|
+
export const DEFAULT_MAX_STDOUT_BYTES = 8 * 1024 * 1024;
|
|
34
|
+
const DEFAULT_MAX_STDERR_BYTES = 64 * 1024;
|
|
35
|
+
const DEFAULT_GRACE_MS = 5_000;
|
|
36
|
+
const VERSION_PREFIX = 'av ';
|
|
37
|
+
/** The `ctx.av` service. */
|
|
38
|
+
export class AvService extends Service {
|
|
39
|
+
avPath;
|
|
40
|
+
timeoutMs;
|
|
41
|
+
maxStdoutBytes;
|
|
42
|
+
maxStderrBytes;
|
|
43
|
+
graceMs;
|
|
44
|
+
constructor(ctx, config = {}) {
|
|
45
|
+
super(ctx, 'av');
|
|
46
|
+
this.avPath = config.avPath ?? process.env.DSH_AV_PATH ?? 'av';
|
|
47
|
+
this.timeoutMs = config.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
48
|
+
this.maxStdoutBytes = config.maxStdoutBytes ?? DEFAULT_MAX_STDOUT_BYTES;
|
|
49
|
+
this.maxStderrBytes = config.maxStderrBytes ?? DEFAULT_MAX_STDERR_BYTES;
|
|
50
|
+
this.graceMs = config.graceMs ?? DEFAULT_GRACE_MS;
|
|
51
|
+
}
|
|
52
|
+
/* ── availability probe ──────────────────────────────────────────────── */
|
|
53
|
+
/**
|
|
54
|
+
* Check whether the `av` CLI is reachable and answering `av --version`.
|
|
55
|
+
* Never throws: an unavailable binary, launch failure, or timeout surfaces
|
|
56
|
+
* as `{ available: false, reason }`.
|
|
57
|
+
* @returns reachability, CLI version when present, and a human reason on failure.
|
|
58
|
+
*/
|
|
59
|
+
async probe() {
|
|
60
|
+
try {
|
|
61
|
+
const run = await this.run(['--version'], { cwd: process.cwd() });
|
|
62
|
+
if (run.exitCode !== 0) {
|
|
63
|
+
return { available: false, reason: `av --version exited ${run.exitCode}: ${run.stderr.trim()}` };
|
|
64
|
+
}
|
|
65
|
+
const firstLine = run.stdout.split('\n', 1)[0] ?? '';
|
|
66
|
+
const version = firstLine.startsWith(VERSION_PREFIX) ? firstLine.slice(VERSION_PREFIX.length).trim() : firstLine.trim();
|
|
67
|
+
return { available: true, ...version.length > 0 ? { version } : {} };
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
return {
|
|
71
|
+
available: false,
|
|
72
|
+
reason: error instanceof Error ? error.message : String(error),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/* ── read-only surfaces ──────────────────────────────────────────────── */
|
|
77
|
+
/**
|
|
78
|
+
* Audit the Mac for supported credential exposures and hazards
|
|
79
|
+
* (`av scan --json`).
|
|
80
|
+
* @param detectors - optional detector-name filter (from `detectors()`); empty means all.
|
|
81
|
+
* @returns the parsed `av scan --json` report.
|
|
82
|
+
*/
|
|
83
|
+
async scan(detectors = []) {
|
|
84
|
+
const argv = detectors.length > 0 ? ['scan', '--json', ...detectors] : ['scan', '--json'];
|
|
85
|
+
const run = await this.runChecked(argv, { cwd: process.cwd() });
|
|
86
|
+
return this.parseJson(run.stdout, 'av scan');
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Verify installed hardening (`av doctor [tool] --json`).
|
|
90
|
+
* @param selector - optional tool name (e.g. `gh`); empty means all.
|
|
91
|
+
* @returns the parsed `av doctor [tool] --json` report.
|
|
92
|
+
*/
|
|
93
|
+
async doctor(selector) {
|
|
94
|
+
const argv = selector === undefined || selector.length === 0 ? ['doctor', '--json'] : ['doctor', selector, '--json'];
|
|
95
|
+
const run = await this.runChecked(argv, { cwd: process.cwd() });
|
|
96
|
+
return this.parseJson(run.stdout, 'av doctor');
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Print detector metadata (`av detectors --json`).
|
|
100
|
+
* @returns the parsed report.
|
|
101
|
+
*/
|
|
102
|
+
async detectors() {
|
|
103
|
+
const run = await this.runChecked(['detectors', '--json'], { cwd: process.cwd() });
|
|
104
|
+
return this.parseJson(run.stdout, 'av detectors');
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Print hardener metadata (`av hardeners --json`).
|
|
108
|
+
* @returns the parsed report.
|
|
109
|
+
*/
|
|
110
|
+
async hardeners() {
|
|
111
|
+
const run = await this.runChecked(['hardeners', '--json'], { cwd: process.cwd() });
|
|
112
|
+
return this.parseJson(run.stdout, 'av hardeners');
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* List saved secret names (`av list`). NAMES only — never values; the
|
|
116
|
+
* value-releasing verbs are deliberately out of this service's surface.
|
|
117
|
+
* @returns sorted saved secret names (only names, never values).
|
|
118
|
+
*/
|
|
119
|
+
async list() {
|
|
120
|
+
const run = await this.runChecked(['list'], { cwd: process.cwd() });
|
|
121
|
+
return run.stdout.split('\n').map(line => line.trim()).filter(line => line.length > 0);
|
|
122
|
+
}
|
|
123
|
+
/* ── low-level runner ─────────────────────────────────────────────────── */
|
|
124
|
+
subprocess() {
|
|
125
|
+
const subprocess = this.ctx.get('subprocess');
|
|
126
|
+
if (subprocess === undefined) {
|
|
127
|
+
throw new Error('av service requires the subprocess seam: load @deepseek-ai/dsh-subprocess-local');
|
|
128
|
+
}
|
|
129
|
+
return subprocess;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Run one `av` command. A non-zero exit code is returned as data on the run
|
|
133
|
+
* (callers decide whether it is an error); only a launch failure, a signal
|
|
134
|
+
* kill, or a timeout throws {@link AvCommandError}.
|
|
135
|
+
* @param argv - av arguments (never shell-interpreted).
|
|
136
|
+
* @param options - cwd (required), abort signal, stdin text, timeout override.
|
|
137
|
+
* @returns exit code, collected stdout/stderr, and killed flag; throws {@link AvCommandError} on launch/timeout/signal failures.
|
|
138
|
+
*/
|
|
139
|
+
async run(argv, options) {
|
|
140
|
+
const { cwd, signal, stdin } = options;
|
|
141
|
+
if (signal?.aborted) {
|
|
142
|
+
throw new AvCommandError('av command was aborted before it could start', { exitCode: null, stderr: '' });
|
|
143
|
+
}
|
|
144
|
+
const limit = options.timeoutMs ?? this.timeoutMs;
|
|
145
|
+
const controller = new AbortController();
|
|
146
|
+
// Mutable through the timeout closure; a record keeps the flag out of TS's
|
|
147
|
+
// synchronous narrowing so the concurrent timer branch stays reachable.
|
|
148
|
+
const state = { timedOut: false };
|
|
149
|
+
const timer = setTimeout(() => {
|
|
150
|
+
state.timedOut = true;
|
|
151
|
+
controller.abort();
|
|
152
|
+
}, limit);
|
|
153
|
+
const forward = () => {
|
|
154
|
+
controller.abort();
|
|
155
|
+
};
|
|
156
|
+
if (signal !== undefined) {
|
|
157
|
+
signal.addEventListener('abort', forward, { once: true });
|
|
158
|
+
}
|
|
159
|
+
let handle;
|
|
160
|
+
try {
|
|
161
|
+
handle = this.subprocess().spawn({
|
|
162
|
+
argv: [this.avPath, ...argv],
|
|
163
|
+
cwd,
|
|
164
|
+
graceMs: this.graceMs,
|
|
165
|
+
stdio: {
|
|
166
|
+
stdin: stdin === undefined ? 'ignore' : { data: stdin },
|
|
167
|
+
stdout: { maxBytes: this.maxStdoutBytes },
|
|
168
|
+
stderr: { maxBytes: this.maxStderrBytes },
|
|
169
|
+
},
|
|
170
|
+
signal: controller.signal,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
catch (error) {
|
|
174
|
+
clearTimeout(timer);
|
|
175
|
+
if (signal !== undefined)
|
|
176
|
+
signal.removeEventListener('abort', forward);
|
|
177
|
+
if (signal?.aborted) {
|
|
178
|
+
throw new AvCommandError('av command was aborted before completion', { exitCode: null, stderr: '', cause: error });
|
|
179
|
+
}
|
|
180
|
+
if (state.timedOut) {
|
|
181
|
+
throw new AvCommandError(`av ${argv[0] ?? ''} timed out after ${limit}ms`, { exitCode: null, stderr: '', cause: error });
|
|
182
|
+
}
|
|
183
|
+
throw new AvCommandError(`av ${argv[0] ?? ''} could not start (launch failed)`, {
|
|
184
|
+
exitCode: null,
|
|
185
|
+
stderr: '',
|
|
186
|
+
cause: error,
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
let outcome;
|
|
190
|
+
try {
|
|
191
|
+
outcome = await handle.done;
|
|
192
|
+
}
|
|
193
|
+
catch (error) {
|
|
194
|
+
clearTimeout(timer);
|
|
195
|
+
if (signal !== undefined)
|
|
196
|
+
signal.removeEventListener('abort', forward);
|
|
197
|
+
if (state.timedOut) {
|
|
198
|
+
throw new AvCommandError(`av ${argv[0] ?? ''} timed out after ${limit}ms`, { exitCode: null, stderr: '', cause: error });
|
|
199
|
+
}
|
|
200
|
+
throw new AvCommandError(`av ${argv[0] ?? ''} could not start (launch failed)`, {
|
|
201
|
+
exitCode: null,
|
|
202
|
+
stderr: '',
|
|
203
|
+
cause: error,
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
clearTimeout(timer);
|
|
207
|
+
if (signal !== undefined)
|
|
208
|
+
signal.removeEventListener('abort', forward);
|
|
209
|
+
const stdout = handle.collected.stdout?.readFrom(0);
|
|
210
|
+
const stderr = handle.collected.stderr?.readFrom(0);
|
|
211
|
+
if (stdout === undefined || stderr === undefined) {
|
|
212
|
+
throw new AvCommandError(`av ${argv[0] ?? ''} produced no collected output streams`, {
|
|
213
|
+
exitCode: null,
|
|
214
|
+
stderr: '',
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
if (state.timedOut) {
|
|
218
|
+
throw new AvCommandError(`av ${argv[0] ?? ''} timed out after ${limit}ms`, { exitCode: null, stderr: stderr.text });
|
|
219
|
+
}
|
|
220
|
+
if (outcome.signal !== null) {
|
|
221
|
+
throw new AvCommandError(`av ${argv[0] ?? ''} was killed by signal ${outcome.signal}`, {
|
|
222
|
+
exitCode: outcome.exitCode,
|
|
223
|
+
stderr: stderr.text,
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
// After the signal-kill branch above, the process exited on its own:
|
|
227
|
+
// the signal is null and the exit code is a real number.
|
|
228
|
+
return { stdout: stdout.text, exitCode: outcome.exitCode ?? 0, killed: false, stderr: stderr.text };
|
|
229
|
+
}
|
|
230
|
+
/** Run one `av` command and require a clean exit (exit 0). */
|
|
231
|
+
async runChecked(argv, options) {
|
|
232
|
+
const run = await this.run(argv, options);
|
|
233
|
+
if (run.exitCode !== 0) {
|
|
234
|
+
throw new AvCommandError(`av ${argv[0] ?? ''} exited ${run.exitCode}: ${run.stderr.trim() || run.stdout.trim()}`, {
|
|
235
|
+
exitCode: run.exitCode,
|
|
236
|
+
stderr: run.stderr,
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
return run;
|
|
240
|
+
}
|
|
241
|
+
/** Parse one JSON surface; keep the report shape terse on failure. */
|
|
242
|
+
parseJson(stdout, surface) {
|
|
243
|
+
try {
|
|
244
|
+
return JSON.parse(stdout);
|
|
245
|
+
}
|
|
246
|
+
catch (error) {
|
|
247
|
+
throw new AvCommandError(`${surface} produced unparseable output`, {
|
|
248
|
+
exitCode: null,
|
|
249
|
+
stderr: error instanceof Error ? error.message : String(error),
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|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KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAC/D,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type shapes for the `ctx.av` service, mirroring the JSON payloads of the
|
|
3
|
+
* Automic Vault CLI (`av scan --json`, `av doctor [tool] --json`,
|
|
4
|
+
* `av detectors --json`, `av hardeners --json`, `av list`). Field names are
|
|
5
|
+
* kept 1:1 with the CLI contract so a newer `av` release shows up as parsing
|
|
6
|
+
* data rather than a schema drift.
|
|
7
|
+
* @module @hy-sde-org/dsh-av/types
|
|
8
|
+
*/
|
|
9
|
+
/** One credential exposure or hazard found by `av scan`. */
|
|
10
|
+
export interface AvFinding {
|
|
11
|
+
/** Detector / tool name that produced the finding (e.g. `gh_cli`). */
|
|
12
|
+
source: string;
|
|
13
|
+
/** `high`, `medium` or `low`. */
|
|
14
|
+
severity: string;
|
|
15
|
+
/** Upstream project homepage (may be absent). */
|
|
16
|
+
homepage?: string;
|
|
17
|
+
/** Why this is a problem. */
|
|
18
|
+
explanation: string;
|
|
19
|
+
/** Remediation steps. */
|
|
20
|
+
solution: string;
|
|
21
|
+
/** Files and lines the finding touches (line may be absent). */
|
|
22
|
+
affected: {
|
|
23
|
+
path: string;
|
|
24
|
+
line?: number | null;
|
|
25
|
+
}[];
|
|
26
|
+
/** Automic Vault docs URL for the finding (may be absent). */
|
|
27
|
+
docs_url?: string;
|
|
28
|
+
/** Detector names that independently produced the finding. */
|
|
29
|
+
detectors: string[];
|
|
30
|
+
}
|
|
31
|
+
/** `av scan --json` payload. */
|
|
32
|
+
export interface ScanReport {
|
|
33
|
+
findings: AvFinding[];
|
|
34
|
+
}
|
|
35
|
+
/** One hardening-verification outcome from `av doctor`. */
|
|
36
|
+
export interface AvDoctorIssue {
|
|
37
|
+
kind: string;
|
|
38
|
+
command?: string;
|
|
39
|
+
message: string;
|
|
40
|
+
remediation?: string;
|
|
41
|
+
stub_path?: string;
|
|
42
|
+
target_path?: string;
|
|
43
|
+
resolved_path?: string;
|
|
44
|
+
}
|
|
45
|
+
/** One hardener's doctor result. */
|
|
46
|
+
export interface AvDoctorResult {
|
|
47
|
+
name: string;
|
|
48
|
+
commands: string[];
|
|
49
|
+
issues: AvDoctorIssue[];
|
|
50
|
+
}
|
|
51
|
+
/** `av doctor [tool] --json` payload. */
|
|
52
|
+
export interface DoctorReport {
|
|
53
|
+
results: AvDoctorResult[];
|
|
54
|
+
}
|
|
55
|
+
/** Watch scope a detector uses. */
|
|
56
|
+
export interface AvWatchScope {
|
|
57
|
+
path: string;
|
|
58
|
+
recursive: boolean;
|
|
59
|
+
}
|
|
60
|
+
/** `av detectors --json` entry. */
|
|
61
|
+
export interface AvDetector {
|
|
62
|
+
name: string;
|
|
63
|
+
homepage?: string;
|
|
64
|
+
docs_url?: string;
|
|
65
|
+
documentation?: string;
|
|
66
|
+
watch_scopes: AvWatchScope[];
|
|
67
|
+
}
|
|
68
|
+
/** `av detectors --json` payload. */
|
|
69
|
+
export interface DetectorsReport {
|
|
70
|
+
detectors: AvDetector[];
|
|
71
|
+
}
|
|
72
|
+
/** A command managed by a hardener. */
|
|
73
|
+
export interface AvHardenedCommand {
|
|
74
|
+
name: string;
|
|
75
|
+
hardened: boolean;
|
|
76
|
+
stub_path?: string;
|
|
77
|
+
target_path?: string;
|
|
78
|
+
required_paths: string[];
|
|
79
|
+
}
|
|
80
|
+
/** Route descriptor of a Secret Gate. */
|
|
81
|
+
export interface AvSecretGateRoute {
|
|
82
|
+
operation: string;
|
|
83
|
+
script_path?: string;
|
|
84
|
+
target_path?: string;
|
|
85
|
+
caller_identifiers?: string[];
|
|
86
|
+
key_patterns: string[];
|
|
87
|
+
replace_existing_env?: boolean;
|
|
88
|
+
allow_missing_keys?: boolean;
|
|
89
|
+
}
|
|
90
|
+
/** Secret Gate descriptor. */
|
|
91
|
+
export interface AvSecretGate {
|
|
92
|
+
id: string;
|
|
93
|
+
key_patterns: string[];
|
|
94
|
+
routes: AvSecretGateRoute[];
|
|
95
|
+
}
|
|
96
|
+
/** `av hardeners --json` entry. */
|
|
97
|
+
export interface AvHardener {
|
|
98
|
+
name: string;
|
|
99
|
+
documentation?: string;
|
|
100
|
+
hardened: boolean;
|
|
101
|
+
applicable: boolean;
|
|
102
|
+
stub_path?: string;
|
|
103
|
+
target_path?: string;
|
|
104
|
+
commands: AvHardenedCommand[];
|
|
105
|
+
secret_gate?: AvSecretGate;
|
|
106
|
+
}
|
|
107
|
+
/** `av hardeners --json` payload. */
|
|
108
|
+
export interface HardenersReport {
|
|
109
|
+
hardeners: AvHardener[];
|
|
110
|
+
}
|
|
111
|
+
/** Capabilities present when the service was reached. */
|
|
112
|
+
export interface AvProbe {
|
|
113
|
+
/** Whether the `av` CLI is reachable and answers `av --version`. */
|
|
114
|
+
available: boolean;
|
|
115
|
+
/** CLI-reported version (e.g. `3.16.0`) when available. */
|
|
116
|
+
version?: string;
|
|
117
|
+
/** Human-readable failure reason when unavailable. */
|
|
118
|
+
reason?: string;
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,4DAA4D;AAC5D,MAAM,WAAW,SAAS;IACxB,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAA;IACd,iCAAiC;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,6BAA6B;IAC7B,WAAW,EAAE,MAAM,CAAA;IACnB,yBAAyB;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,gEAAgE;IAChE,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CA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 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type shapes for the `ctx.av` service, mirroring the JSON payloads of the
|
|
3
|
+
* Automic Vault CLI (`av scan --json`, `av doctor [tool] --json`,
|
|
4
|
+
* `av detectors --json`, `av hardeners --json`, `av list`). Field names are
|
|
5
|
+
* kept 1:1 with the CLI contract so a newer `av` release shows up as parsing
|
|
6
|
+
* data rather than a schema drift.
|
|
7
|
+
* @module @hy-sde-org/dsh-av/types
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# User agent preset for @hy-sde-org/dsh-av on OFFICIAL DeepSeek Harness
|
|
2
|
+
# releases (dsh-v0.1.2-rc.1 and later).
|
|
3
|
+
#
|
|
4
|
+
# Install: copy this directory to ~/.dsh/.agent-presets/<id>/ (pick any id),
|
|
5
|
+
# then select the preset in the Web UI preset picker (or `dsh agent` CLI).
|
|
6
|
+
#
|
|
7
|
+
# The `av` SERVICE row is added host-wide by the plugin's own
|
|
8
|
+
# cordis.patch.yml when you run `dsh plugin add`; this preset contributes
|
|
9
|
+
# ONLY the model-facing tool row. `@hy-sde-org/dsh-tool-av` registers no
|
|
10
|
+
# service of its own — it resolves the host instance across the plane
|
|
11
|
+
# boundary, so no realm/isolate is needed here.
|
|
12
|
+
#
|
|
13
|
+
# Copy any other rows from the preset you normally use (persona, bash, todo,
|
|
14
|
+
# ask-user, skills, ...) next to these; only the tool-av row is special. If
|
|
15
|
+
# the package isn't installed, the loader reports the missing plugin on boot.
|
|
16
|
+
|
|
17
|
+
- id: tool-av
|
|
18
|
+
name: '@hy-sde-org/dsh-tool-av'
|
|
19
|
+
config: {}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
name: Automic Vault Auditor
|
|
2
|
+
description: Coding agent with read-only Automic Vault tools — av_scan / av_doctor / av_catalog / av_list over the host ctx.av service (audits for exposed credentials, verifies hardening, never releases secret values). For stock DeepSeek Harness releases (0.1.2-rc.1+).
|
|
3
|
+
order: 9
|
package/package.json
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hy-sde-org/dsh-av",
|
|
3
|
+
"version": "0.1.2-rc.1",
|
|
4
|
+
"description": "Read-only Automic Vault plumbing for DeepSeek Harness: the host ctx.av service (av CLI resolution + probe, scan/doctor/detectors/hardeners/list over the subprocess seam) backing the read-only vault tools in @hy-sde-org/dsh-tool-av — a standalone plugin with no upstream harness changes required.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./types": {
|
|
14
|
+
"types": "./dist/types.d.ts",
|
|
15
|
+
"default": "./dist/types.js"
|
|
16
|
+
},
|
|
17
|
+
"./service": {
|
|
18
|
+
"types": "./dist/service.d.ts",
|
|
19
|
+
"default": "./dist/service.js"
|
|
20
|
+
},
|
|
21
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
22
|
+
"./package.json": "./package.json"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"cordis.patch.yml",
|
|
27
|
+
"examples/agent-preset/agent.cordis.yml",
|
|
28
|
+
"examples/agent-preset/preset.yml",
|
|
29
|
+
"README.md",
|
|
30
|
+
"LICENSE"
|
|
31
|
+
],
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=22.19.0"
|
|
34
|
+
},
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "git+https://github.com/hy-sde/dsh-av.git"
|
|
41
|
+
},
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"dsh": {
|
|
44
|
+
"bundle": {
|
|
45
|
+
"patch": "./cordis.patch.yml"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@deepseek-ai/cordis": "^4.0.2"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
53
|
+
"@deepseek-ai/dsh-subprocess": "^0.1.2-rc.1"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
57
|
+
"@deepseek-ai/dsh-subprocess": "^0.1.2-rc.1",
|
|
58
|
+
"@deepseek-ai/dsh-subprocess-local": "^0.1.2-rc.1",
|
|
59
|
+
"@types/node": "^24.0.0",
|
|
60
|
+
"typescript": "^5.9.3",
|
|
61
|
+
"vitest": "^3.2.7"
|
|
62
|
+
},
|
|
63
|
+
"keywords": [
|
|
64
|
+
"deepseek",
|
|
65
|
+
"agent",
|
|
66
|
+
"harness",
|
|
67
|
+
"dsh-plugin",
|
|
68
|
+
"automic-vault",
|
|
69
|
+
"secrets",
|
|
70
|
+
"hardening",
|
|
71
|
+
"audit"
|
|
72
|
+
],
|
|
73
|
+
"scripts": {
|
|
74
|
+
"clean": "rm -rf dist",
|
|
75
|
+
"build": "tsc -p tsconfig.build.json",
|
|
76
|
+
"check": "tsc -p tsconfig.json --noEmit",
|
|
77
|
+
"test": "vitest run"
|
|
78
|
+
}
|
|
79
|
+
}
|