@clawvard/sdk 0.14.0 → 0.15.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/README.md +45 -0
- package/dist/errors.d.ts +3 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +8 -3
- package/dist/errors.js.map +1 -1
- package/dist/generated.d.ts +9 -6
- package/dist/generated.d.ts.map +1 -1
- package/dist/generated.js +15 -11
- package/dist/generated.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/pentest.d.ts +150 -0
- package/dist/pentest.d.ts.map +1 -0
- package/dist/pentest.js +585 -0
- package/dist/pentest.js.map +1 -0
- package/dist/service-types.d.ts +232 -69
- package/dist/service-types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -120,6 +120,51 @@ const cv = new Clawvard({
|
|
|
120
120
|
await cv.video.extractFrames({ url, every: "1s" });
|
|
121
121
|
```
|
|
122
122
|
|
|
123
|
+
## Course-specific SDK surfaces
|
|
124
|
+
|
|
125
|
+
### `cv.security.pentestRun` — AI pen-test on a target you own
|
|
126
|
+
|
|
127
|
+
Runs the open-source `strix-agent` CLI locally against a target the
|
|
128
|
+
caller owns (OWASP Juice Shop, self-hosted staging, ...). The Clawvard
|
|
129
|
+
backend mints a scoped, one-time LLM credential per run; the SDK
|
|
130
|
+
spawns Strix with the credential exposed as `LLM_API_KEY`; the
|
|
131
|
+
credential is revoked when the run resolves so it cannot keep grinding
|
|
132
|
+
credits in the background. Built for the `agent-pentest` course.
|
|
133
|
+
|
|
134
|
+
Node-only — browsers throw `SandboxMissingError` early.
|
|
135
|
+
|
|
136
|
+
```ts
|
|
137
|
+
import { Clawvard, TargetUnreachableError } from "@clawvard/sdk";
|
|
138
|
+
|
|
139
|
+
const cv = new Clawvard({ apiKey: process.env.CLAW_API_KEY! });
|
|
140
|
+
|
|
141
|
+
try {
|
|
142
|
+
const result = await cv.security.pentestRun({
|
|
143
|
+
targetUrl: "http://localhost:3000",
|
|
144
|
+
allowedHosts: ["localhost:3000"],
|
|
145
|
+
ownership: {
|
|
146
|
+
confirmed: true,
|
|
147
|
+
statement: "OWASP Juice Shop, self-hosted, MIT license.",
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
console.log(`${result.findings.length} findings — see ${result.reportHtmlPath}`);
|
|
151
|
+
for (const f of result.findings) {
|
|
152
|
+
console.log(` [${f.cvss.severity}] ${f.owaspCategory} — ${f.title}`);
|
|
153
|
+
}
|
|
154
|
+
} catch (err) {
|
|
155
|
+
if (err instanceof TargetUnreachableError) {
|
|
156
|
+
console.error("Start `docker run --rm -p 3000:3000 bkimminich/juice-shop` first.");
|
|
157
|
+
} else {
|
|
158
|
+
throw err;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Prerequisites: Docker running + `pipx install strix-agent` on PATH +
|
|
164
|
+
`CLAW_API_KEY` set to your key from https://clawvard.school. Only run
|
|
165
|
+
against apps you own or are authorised to test — the SDK rejects
|
|
166
|
+
runs where `ownership.confirmed` is not `true`.
|
|
167
|
+
|
|
123
168
|
## Resources
|
|
124
169
|
|
|
125
170
|
- Docs: [clawvard.school/docs](https://clawvard.school/docs)
|
package/dist/errors.d.ts
CHANGED
|
@@ -11,6 +11,9 @@ export declare class ClawvardError extends Error {
|
|
|
11
11
|
* Raised when a remote method is called but no API key was supplied at
|
|
12
12
|
* construction. Local-only methods (e.g., `cv.video.extractFrames()`) do
|
|
13
13
|
* not raise this — they don't need a key.
|
|
14
|
+
*
|
|
15
|
+
* Mint or copy your key at https://clawvard.school, then pass it to
|
|
16
|
+
* `new Clawvard({ apiKey: process.env.CLAW_API_KEY })`.
|
|
14
17
|
*/
|
|
15
18
|
export declare class MissingApiKeyError extends ClawvardError {
|
|
16
19
|
constructor(operation: string);
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,qBAAa,aAAc,SAAQ,KAAK;aACO,IAAI,EAAE,MAAM;gBAA7C,OAAO,EAAE,MAAM,EAAkB,IAAI,EAAE,MAAM;CAI1D;AAED
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,qBAAa,aAAc,SAAQ,KAAK;aACO,IAAI,EAAE,MAAM;gBAA7C,OAAO,EAAE,MAAM,EAAkB,IAAI,EAAE,MAAM;CAI1D;AAED;;;;;;;GAOG;AACH,qBAAa,kBAAmB,SAAQ,aAAa;gBACvC,SAAS,EAAE,MAAM;CAW9B"}
|
package/dist/errors.js
CHANGED
|
@@ -15,12 +15,17 @@ export class ClawvardError extends Error {
|
|
|
15
15
|
* Raised when a remote method is called but no API key was supplied at
|
|
16
16
|
* construction. Local-only methods (e.g., `cv.video.extractFrames()`) do
|
|
17
17
|
* not raise this — they don't need a key.
|
|
18
|
+
*
|
|
19
|
+
* Mint or copy your key at https://clawvard.school, then pass it to
|
|
20
|
+
* `new Clawvard({ apiKey: process.env.CLAW_API_KEY })`.
|
|
18
21
|
*/
|
|
19
22
|
export class MissingApiKeyError extends ClawvardError {
|
|
20
23
|
constructor(operation) {
|
|
21
|
-
super(`Clawvard: apiKey is required to call \`${operation}\`.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
super(`Clawvard: apiKey is required to call \`${operation}\`. ` +
|
|
25
|
+
`Mint or copy your key at https://clawvard.school, then pass it to ` +
|
|
26
|
+
`\`new Clawvard({ apiKey: process.env.CLAW_API_KEY })\` — or call ` +
|
|
27
|
+
`only local helpers (e.g. \`cv.video.*\`, \`cv.subtitle.*\`) that ` +
|
|
28
|
+
`don't need a key.`, "missing_api_key");
|
|
24
29
|
this.name = "MissingApiKeyError";
|
|
25
30
|
}
|
|
26
31
|
}
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,OAAO,aAAc,SAAQ,KAAK;IACO;IAA7C,YAAY,OAAe,EAAkB,IAAY;QACvD,KAAK,CAAC,OAAO,CAAC,CAAC;QAD4B,SAAI,GAAJ,IAAI,CAAQ;QAEvD,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AAED
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,OAAO,aAAc,SAAQ,KAAK;IACO;IAA7C,YAAY,OAAe,EAAkB,IAAY;QACvD,KAAK,CAAC,OAAO,CAAC,CAAC;QAD4B,SAAI,GAAJ,IAAI,CAAQ;QAEvD,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AAED;;;;;;;GAOG;AACH,MAAM,OAAO,kBAAmB,SAAQ,aAAa;IACnD,YAAY,SAAiB;QAC3B,KAAK,CACH,0CAA0C,SAAS,MAAM;YACvD,oEAAoE;YACpE,mEAAmE;YACnE,mEAAmE;YACnE,mBAAmB,EACrB,iBAAiB,CAClB,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF"}
|
package/dist/generated.d.ts
CHANGED
|
@@ -36,6 +36,12 @@ export declare class PlatformNamespace {
|
|
|
36
36
|
/** platform.pricing (local) — generated. */
|
|
37
37
|
pricing(...args: InputArgs<"platform.pricing">): Promise<OutputOf<"platform.pricing">>;
|
|
38
38
|
}
|
|
39
|
+
export declare class SecurityNamespace {
|
|
40
|
+
private readonly c;
|
|
41
|
+
constructor(c: HttpClient);
|
|
42
|
+
/** security.mint-pentest-credential (local) — generated. */
|
|
43
|
+
mintPentestCredential(...args: InputArgs<"security.mint-pentest-credential">): Promise<OutputOf<"security.mint-pentest-credential">>;
|
|
44
|
+
}
|
|
39
45
|
export declare class TextNamespace {
|
|
40
46
|
private readonly c;
|
|
41
47
|
constructor(c: HttpClient);
|
|
@@ -47,12 +53,8 @@ export declare class TextNamespace {
|
|
|
47
53
|
generateDialogue(...args: InputArgs<"text.generate-dialogue">): Job<OutputOf<"text.generate-dialogue">>;
|
|
48
54
|
/** text.lecture-notes (proxy) — generated. */
|
|
49
55
|
lectureNotes(...args: InputArgs<"text.lecture-notes">): Promise<OutputOf<"text.lecture-notes">>;
|
|
50
|
-
/** text.
|
|
51
|
-
|
|
52
|
-
/** text.generate-consumer-demo (proxy) — generated. */
|
|
53
|
-
generateConsumerDemo(...args: InputArgs<"text.generate-consumer-demo">): Promise<OutputOf<"text.generate-consumer-demo">>;
|
|
54
|
-
/** text.improve-sdk-naming (proxy) — generated. */
|
|
55
|
-
improveSdkNaming(...args: InputArgs<"text.improve-sdk-naming">): Promise<OutputOf<"text.improve-sdk-naming">>;
|
|
56
|
+
/** text.release-notes (proxy) — generated. */
|
|
57
|
+
releaseNotes(...args: InputArgs<"text.release-notes">): Promise<OutputOf<"text.release-notes">>;
|
|
56
58
|
}
|
|
57
59
|
export declare class UrlNamespace {
|
|
58
60
|
private readonly c;
|
|
@@ -80,6 +82,7 @@ export declare class GeneratedClient {
|
|
|
80
82
|
readonly image: ImageNamespace;
|
|
81
83
|
readonly media: MediaNamespace;
|
|
82
84
|
readonly platform: PlatformNamespace;
|
|
85
|
+
readonly security: SecurityNamespace;
|
|
83
86
|
readonly text: TextNamespace;
|
|
84
87
|
readonly url: UrlNamespace;
|
|
85
88
|
readonly util: UtilNamespace;
|
package/dist/generated.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generated.d.ts","sourceRoot":"","sources":["../src/generated.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,U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AAQ,CAAC,iBAAiB,CAAC,CAAC;CAGnF;AAED,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAAD,CAAC,EAAE,UAAU;IAE1C,mCAAmC;IACnC,KAAK,CAAC,GAAG,IAAI,EAAE,SAAS,CAAC,WAAW,CAAC,GAAG,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;CAGnE;AAED,qBAAa,eAAe;IAC1B,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,GAAG,EAAE,YAAY,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,GAAG,EAAE,YAAY,CAAC;gBAEf,MAAM,EAAE,UAAU;CAU/B"}
|
package/dist/generated.js
CHANGED
|
@@ -57,6 +57,16 @@ export class PlatformNamespace {
|
|
|
57
57
|
return this.c.invoke("platform", "pricing", args[0]);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
+
export class SecurityNamespace {
|
|
61
|
+
c;
|
|
62
|
+
constructor(c) {
|
|
63
|
+
this.c = c;
|
|
64
|
+
}
|
|
65
|
+
/** security.mint-pentest-credential (local) — generated. */
|
|
66
|
+
mintPentestCredential(...args) {
|
|
67
|
+
return this.c.invoke("security", "mintPentestCredential", args[0]);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
60
70
|
export class TextNamespace {
|
|
61
71
|
c;
|
|
62
72
|
constructor(c) {
|
|
@@ -78,17 +88,9 @@ export class TextNamespace {
|
|
|
78
88
|
lectureNotes(...args) {
|
|
79
89
|
return this.c.invoke("text", "lectureNotes", args[0]);
|
|
80
90
|
}
|
|
81
|
-
/** text.
|
|
82
|
-
|
|
83
|
-
return this.c.invoke("text", "
|
|
84
|
-
}
|
|
85
|
-
/** text.generate-consumer-demo (proxy) — generated. */
|
|
86
|
-
generateConsumerDemo(...args) {
|
|
87
|
-
return this.c.invoke("text", "generateConsumerDemo", args[0]);
|
|
88
|
-
}
|
|
89
|
-
/** text.improve-sdk-naming (proxy) — generated. */
|
|
90
|
-
improveSdkNaming(...args) {
|
|
91
|
-
return this.c.invoke("text", "improveSdkNaming", args[0]);
|
|
91
|
+
/** text.release-notes (proxy) — generated. */
|
|
92
|
+
releaseNotes(...args) {
|
|
93
|
+
return this.c.invoke("text", "releaseNotes", args[0]);
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
96
|
export class UrlNamespace {
|
|
@@ -133,6 +135,7 @@ export class GeneratedClient {
|
|
|
133
135
|
image;
|
|
134
136
|
media;
|
|
135
137
|
platform;
|
|
138
|
+
security;
|
|
136
139
|
text;
|
|
137
140
|
url;
|
|
138
141
|
util;
|
|
@@ -141,6 +144,7 @@ export class GeneratedClient {
|
|
|
141
144
|
this.image = new ImageNamespace(client);
|
|
142
145
|
this.media = new MediaNamespace(client);
|
|
143
146
|
this.platform = new PlatformNamespace(client);
|
|
147
|
+
this.security = new SecurityNamespace(client);
|
|
144
148
|
this.text = new TextNamespace(client);
|
|
145
149
|
this.url = new UrlNamespace(client);
|
|
146
150
|
this.util = new UtilNamespace(client);
|
package/dist/generated.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generated.js","sourceRoot":"","sources":["../src/generated.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,MAAM,OAAO,cAAc;IACI;IAA7B,YAA6B,CAAa;QAAb,MAAC,GAAD,CAAC,CAAY;IAAG,CAAC;IAE9C,iDAAiD;IACjD,eAAe,CAAC,GAAG,IAA0C;QAC3D,OAAO,IAAI,CAAC,CAAC,CAAC,SAAS,CAAsC,OAAO,EAAE,iBAAiB,EAAE,IAAI,CAAC,CAA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AAM,CAAC,CAAC;QACxC,IAAI,CAAC,QAAQ,GAAG,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC9C,IAAI,CAAC,QAAQ,GAAG,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC9C,IAAI,CAAC,IAAI,GAAG,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,CAAC,GAAG,GAAG,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,CAAC,IAAI,GAAG,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,CAAC,GAAG,GAAG,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -44,13 +44,15 @@ export { Job } from "./job.js";
|
|
|
44
44
|
export { HttpClient } from "./http-client.js";
|
|
45
45
|
export type { InvokeOptions } from "./http-client.js";
|
|
46
46
|
export type { ServiceTypeMap, InputOf, OutputOf, InputArgs, } from "./service-types.js";
|
|
47
|
-
export type { IdPhotoSpec, IdPhotoSheet, IdPhotoFaceDetector, IdPhotoMattingModel, ImageIdPhotoGenerateInput, ImageIdPhotoGenerateOutput, ImageIdPhotoLayoutInput, ImageIdPhotoLayoutOutput, DialogueSourceKind, DialogueLanguage, DialogueSpeaker, DialogueTurn, DialogueChapter, TextGenerateDialogueInput, TextGenerateDialogueOutput, TextLectureNotesLanguage, TextLectureNotesSegment, TextLectureNotesKeyframe, TextLectureNotesInput, TextLectureNotesSection, TextLectureNotesTerm, TextLectureNotesOutput,
|
|
47
|
+
export type { IdPhotoSpec, IdPhotoSheet, IdPhotoFaceDetector, IdPhotoMattingModel, ImageIdPhotoGenerateInput, ImageIdPhotoGenerateOutput, ImageIdPhotoLayoutInput, ImageIdPhotoLayoutOutput, DialogueSourceKind, DialogueLanguage, DialogueSpeaker, DialogueTurn, DialogueChapter, TextGenerateDialogueInput, TextGenerateDialogueOutput, TextLectureNotesLanguage, TextLectureNotesSegment, TextLectureNotesKeyframe, TextLectureNotesInput, TextLectureNotesSection, TextLectureNotesTerm, TextLectureNotesOutput, TextReleaseNotesAudience, TextReleaseNotesLanguage, TextReleaseNotesCommitType, TextReleaseNotesCommitAuthor, TextReleaseNotesCommit, TextReleaseNotesProject, TextReleaseNotesInput, TextReleaseNotesView, TextReleaseNotesReleaseBody, TextReleaseNotesFingerprint, TextReleaseNotesOutput, SecurityPentestLlmModel, SecurityPentestOwnership, SecurityPentestFinding, SecurityPentestPoc, SecurityPentestPatch, SecurityPentestRunInput, SecurityPentestRunOutput, SecurityMintPentestCredentialOutput, } from "./service-types.js";
|
|
48
48
|
export type { ClawvardPlugin, ClawvardInstance } from "./plugin.js";
|
|
49
49
|
export { ClawvardError, MissingApiKeyError } from "./errors.js";
|
|
50
50
|
export { IdPhotoError, NoFaceDetectedError, MultipleFacesError, FaceNotCenteredError, FaceTooSmallError, MattingFailedError, UnsupportedSpecError, IdPhotoWorkerUnavailableError, } from "./id-photo.js";
|
|
51
51
|
export type { IdPhotoErrorCode } from "./id-photo.js";
|
|
52
52
|
export { LectureNotesError, TranscriptTooLongError, EmptyTranscriptError, InvalidTimestampOrderError, UnsupportedLanguageError, LectureNotesWorkerUnavailableError, renderLectureNotesMarkdown, mapLectureNotesError, parseLectureNotesCodeFromMessage, } from "./lecture-notes.js";
|
|
53
53
|
export type { LectureNotesErrorCode } from "./lecture-notes.js";
|
|
54
|
+
export { PentestError, TargetUnreachableError, InvalidTargetHostError, SandboxMissingError, OwnershipUnconfirmedError, LlmQuotaError, PentestTimeoutError, StrixCrashedError, PentestServiceNotLiveError, mapPentestError, parsePentestCodeFromMessage, renderPentestReportHtml, } from "./pentest.js";
|
|
55
|
+
export type { PentestErrorCode } from "./pentest.js";
|
|
54
56
|
export interface ClawvardConfig {
|
|
55
57
|
/** Token Relay-issued `sk-xxx` API key. Mint or list yours at
|
|
56
58
|
* https://clawvard.school/token-relay. The same key works for the
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAWjD,OAAO,QAAQ,gBAAgB,CAAC;IAC9B,UAAU,cAAc;QACtB;2EACmE;QACnE,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;KACpC;CACF;AAED,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,YAAY,EACV,cAAc,EACd,OAAO,EACP,QAAQ,EACR,SAAS,GACV,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,0BAA0B,EAC1B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AAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;IACpF,QAAQ,EAAE,YAAY,EAAE,CAAC;CAC1B;AAED,qCAAqC;AACrC,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,yDAAyD;AACzD,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,CAAC,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,YAAY,CAAC;IACtB,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAC9B"}
|
package/dist/index.js
CHANGED
|
@@ -31,11 +31,13 @@
|
|
|
31
31
|
import { HttpClient } from "./http-client.js";
|
|
32
32
|
import { GeneratedClient } from "./generated.js";
|
|
33
33
|
import { IdPhotoNamespace } from "./id-photo.js";
|
|
34
|
+
import { installPentestRun } from "./pentest.js";
|
|
34
35
|
export { Job } from "./job.js";
|
|
35
36
|
export { HttpClient } from "./http-client.js";
|
|
36
37
|
export { ClawvardError, MissingApiKeyError } from "./errors.js";
|
|
37
38
|
export { IdPhotoError, NoFaceDetectedError, MultipleFacesError, FaceNotCenteredError, FaceTooSmallError, MattingFailedError, UnsupportedSpecError, IdPhotoWorkerUnavailableError, } from "./id-photo.js";
|
|
38
39
|
export { LectureNotesError, TranscriptTooLongError, EmptyTranscriptError, InvalidTimestampOrderError, UnsupportedLanguageError, LectureNotesWorkerUnavailableError, renderLectureNotesMarkdown, mapLectureNotesError, parseLectureNotesCodeFromMessage, } from "./lecture-notes.js";
|
|
40
|
+
export { PentestError, TargetUnreachableError, InvalidTargetHostError, SandboxMissingError, OwnershipUnconfirmedError, LlmQuotaError, PentestTimeoutError, StrixCrashedError, PentestServiceNotLiveError, mapPentestError, parsePentestCodeFromMessage, renderPentestReportHtml, } from "./pentest.js";
|
|
39
41
|
const DEFAULT_BASE_URL = "https://clawvard.school";
|
|
40
42
|
const DEFAULT_POLL_MS = 2000;
|
|
41
43
|
/** The main SDK client. Composes the auto-generated namespace methods
|
|
@@ -71,6 +73,10 @@ export class Clawvard extends GeneratedClient {
|
|
|
71
73
|
super(http);
|
|
72
74
|
this.client = http;
|
|
73
75
|
this.workflow = new WorkflowNamespace(http);
|
|
76
|
+
// Attach the hand-written `cv.security.pentestRun` orchestration
|
|
77
|
+
// to the auto-generated `SecurityNamespace` prototype. Idempotent
|
|
78
|
+
// — safe to call once per Clawvard construction.
|
|
79
|
+
installPentestRun(http);
|
|
74
80
|
// Mount the `idPhoto` sub-namespace on the auto-generated
|
|
75
81
|
// ImageNamespace so `cv.image.idPhoto.generate(...)` works as the
|
|
76
82
|
// course material advertises. The flat `cv.image.idPhotoGenerate`
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AAEjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAkBjD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AAEjE,OAAO,EAAE,gBAAgB,EAAE,M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AAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QAC/E,OAAO,IAAI,CAAC,CAAC,CAAC,SAAS,CAAI,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IACnD,CAAC;CACF"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `cv.security.pentestRun` — hand-written orchestration for the
|
|
3
|
+
* `agent-pentest` course.
|
|
4
|
+
*
|
|
5
|
+
* The pentest agent (open-source `strix-agent`, Apache-2.0) runs
|
|
6
|
+
* locally against a target the user owns — usually a self-hosted
|
|
7
|
+
* OWASP Juice Shop or a staging build of their own web app. The SDK
|
|
8
|
+
* mints a one-time LLM credential scoped to this run via
|
|
9
|
+
* `service.clawvard`, spawns the `strix` CLI as a subprocess with the
|
|
10
|
+
* credential exposed as `LLM_API_KEY`, and normalises the
|
|
11
|
+
* `strix_runs/<name>/` directory into the typed
|
|
12
|
+
* `SecurityPentestRunOutput` shape when the process exits.
|
|
13
|
+
*
|
|
14
|
+
* Node-only. Attempting to call `pentestRun` in a browser (or any
|
|
15
|
+
* environment without `child_process`) throws
|
|
16
|
+
* `SandboxMissingError` early — Strix launches its agent sandbox in a
|
|
17
|
+
* local Docker container.
|
|
18
|
+
*
|
|
19
|
+
* The credential handed to Strix expires when the run resolves or
|
|
20
|
+
* hits the wall-clock timeout. The SDK does NOT hard-code an
|
|
21
|
+
* OpenAI-compatible relay base URL in the run — the endpoint is
|
|
22
|
+
* chosen by `service.clawvard` at mint time.
|
|
23
|
+
*
|
|
24
|
+
* Callers can pattern-match on the SDK-side error subclasses:
|
|
25
|
+
*
|
|
26
|
+
* try {
|
|
27
|
+
* await cv.security.pentestRun({...});
|
|
28
|
+
* } catch (err) {
|
|
29
|
+
* if (err instanceof TargetUnreachableError) { ... }
|
|
30
|
+
* if (err instanceof InvalidTargetHostError) { ... }
|
|
31
|
+
* if (err instanceof SandboxMissingError) { ... }
|
|
32
|
+
* if (err instanceof OwnershipUnconfirmedError) { ... }
|
|
33
|
+
* if (err instanceof LlmQuotaError) { ... }
|
|
34
|
+
* if (err instanceof PentestTimeoutError) { ... }
|
|
35
|
+
* if (err instanceof StrixCrashedError) { ... }
|
|
36
|
+
* }
|
|
37
|
+
*/
|
|
38
|
+
import type { HttpClient } from "./http-client.js";
|
|
39
|
+
import { ClawvardError } from "./errors.js";
|
|
40
|
+
import type { SecurityPentestRunInput, SecurityPentestRunOutput } from "./service-types.js";
|
|
41
|
+
/** Public error codes surfaced on `PentestError.code`. Uppercase `E_`-
|
|
42
|
+
* prefixed shape per the course PRD so consumers can pattern-match
|
|
43
|
+
* without normalising case. See `mapPentestError` for the two-way
|
|
44
|
+
* mapping against server-side envelopes (which may still use the
|
|
45
|
+
* lowercase `snake_case` form to be robust to older backends). */
|
|
46
|
+
export declare const PENTEST_ERROR_CODES: readonly ["E_TARGET_UNREACHABLE", "E_INVALID_TARGET_HOST", "E_SANDBOX_MISSING", "E_OWNERSHIP_UNCONFIRMED", "E_LLM_QUOTA", "E_TIMEOUT", "E_STRIX_CRASHED", "E_SERVICE_NOT_LIVE"];
|
|
47
|
+
export type PentestErrorCode = (typeof PENTEST_ERROR_CODES)[number];
|
|
48
|
+
/** Base class for any error surfaced by `cv.security.pentestRun`. */
|
|
49
|
+
export declare class PentestError extends ClawvardError {
|
|
50
|
+
constructor(code: PentestErrorCode, message: string);
|
|
51
|
+
}
|
|
52
|
+
/** `HEAD <targetUrl>` failed before Strix could be spawned. Usually
|
|
53
|
+
* means the user forgot to `docker run` the target, or bound it to a
|
|
54
|
+
* port other than the one they wrote in the prompt. */
|
|
55
|
+
export declare class TargetUnreachableError extends PentestError {
|
|
56
|
+
constructor(message?: string);
|
|
57
|
+
}
|
|
58
|
+
/** Either the input `targetUrl` isn't in `allowedHosts`, or Strix
|
|
59
|
+
* tried to reach a host outside the whitelist mid-run. The SDK kills
|
|
60
|
+
* the run instead of letting a coerced prompt escape the sandbox. */
|
|
61
|
+
export declare class InvalidTargetHostError extends PentestError {
|
|
62
|
+
constructor(message?: string);
|
|
63
|
+
}
|
|
64
|
+
/** Local Docker daemon is missing or unreachable, `strix` is not on
|
|
65
|
+
* PATH, or the environment cannot spawn subprocesses (browser). */
|
|
66
|
+
export declare class SandboxMissingError extends PentestError {
|
|
67
|
+
constructor(message?: string);
|
|
68
|
+
}
|
|
69
|
+
/** `ownership.confirmed` was missing or `false`. The service will not
|
|
70
|
+
* attack a target the caller has not declared they own or are
|
|
71
|
+
* authorised to test. */
|
|
72
|
+
export declare class OwnershipUnconfirmedError extends PentestError {
|
|
73
|
+
constructor(message?: string);
|
|
74
|
+
}
|
|
75
|
+
/** The caller's Clawvard credits balance is below the per-run budget
|
|
76
|
+
* the SDK reserved. Top up at https://clawvard.school and retry. */
|
|
77
|
+
export declare class LlmQuotaError extends PentestError {
|
|
78
|
+
constructor(message?: string);
|
|
79
|
+
}
|
|
80
|
+
/** Wall-clock timeout hit before Strix marked the run complete. The
|
|
81
|
+
* scoped LLM credential is revoked at this point so the run cannot
|
|
82
|
+
* keep grinding credits in the background. */
|
|
83
|
+
export declare class PentestTimeoutError extends PentestError {
|
|
84
|
+
constructor(message?: string);
|
|
85
|
+
}
|
|
86
|
+
/** Strix subprocess exited non-zero. Message carries the tail of
|
|
87
|
+
* Strix's stderr so the caller can see what actually broke — usually
|
|
88
|
+
* a docker-in-docker permissions issue or an interrupted run. */
|
|
89
|
+
export declare class StrixCrashedError extends PentestError {
|
|
90
|
+
constructor(message: string);
|
|
91
|
+
}
|
|
92
|
+
/** The Clawvard tenant the caller's key resolves to does not yet have
|
|
93
|
+
* the pentest service live — usually means the closed beta hasn't
|
|
94
|
+
* been rolled out to their account. Contact support at
|
|
95
|
+
* https://clawvard.school to request access. Callers can pattern-
|
|
96
|
+
* match this to fall back to a manual Strix invocation if they need
|
|
97
|
+
* a result today. */
|
|
98
|
+
export declare class PentestServiceNotLiveError extends PentestError {
|
|
99
|
+
constructor(message?: string);
|
|
100
|
+
}
|
|
101
|
+
/** Map a backend error envelope (`{ error: code, message }`) to the
|
|
102
|
+
* matching SDK class. Accepts both the canonical `E_UPPERCASE_SNAKE`
|
|
103
|
+
* form and the older `lowercase_snake` shape some backends still
|
|
104
|
+
* emit, so a mid-flight backend rollout doesn't spike into generic
|
|
105
|
+
* `PentestError`. `service_not_found` (dispatcher-level 404 for a
|
|
106
|
+
* route the tenant hasn't been enrolled in yet) is folded into
|
|
107
|
+
* `PentestServiceNotLiveError` so callers get an actionable message
|
|
108
|
+
* instead of a raw dispatcher code. */
|
|
109
|
+
export declare function mapPentestError(code: string, message: string): PentestError;
|
|
110
|
+
/** Declaration merging: augment the auto-generated `SecurityNamespace`
|
|
111
|
+
* with the hand-written `pentestRun` method. `mintPentestCredential`
|
|
112
|
+
* (the auto-generated low-level primitive) stays as-is; `pentestRun`
|
|
113
|
+
* composes it with local Strix orchestration. */
|
|
114
|
+
declare module "./generated.js" {
|
|
115
|
+
interface SecurityNamespace {
|
|
116
|
+
/** Run a real Strix pen-test against a target the caller owns.
|
|
117
|
+
* The Clawvard backend mints a one-time LLM credential scoped to
|
|
118
|
+
* this run; the SDK spawns Strix locally with that credential and
|
|
119
|
+
* returns the typed findings + PoCs + patch when Strix exits.
|
|
120
|
+
*
|
|
121
|
+
* ⚠️ Only run against apps you own or have written permission to
|
|
122
|
+
* test. Runs where `ownership.confirmed` is not `true` fail with
|
|
123
|
+
* `OwnershipUnconfirmedError` before hitting the network. */
|
|
124
|
+
pentestRun(input: SecurityPentestRunInput): Promise<SecurityPentestRunOutput>;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/** Attach the hand-written `pentestRun` to the SecurityNamespace
|
|
128
|
+
* prototype. Called from the Clawvard constructor so browsers still
|
|
129
|
+
* see the method (even if calling it throws SandboxMissingError). */
|
|
130
|
+
export declare function installPentestRun(_client: HttpClient): void;
|
|
131
|
+
/** Pull `{ code, message }` out of a `"<code>|<message>"` job-failure
|
|
132
|
+
* message. Mirrors the id-photo convention so a future job-runtime
|
|
133
|
+
* handler can surface typed failures via the same channel. Accepts
|
|
134
|
+
* both canonical `E_UPPERCASE_SNAKE` and legacy `lowercase_snake`
|
|
135
|
+
* prefixes and returns the canonical form. */
|
|
136
|
+
export declare function parsePentestCodeFromMessage(msg: string): {
|
|
137
|
+
code: PentestErrorCode;
|
|
138
|
+
message: string;
|
|
139
|
+
} | null;
|
|
140
|
+
/** Deterministic renderer — turns a `SecurityPentestRunOutput` into
|
|
141
|
+
* the three-panel HTML report the course showcase renders (findings
|
|
142
|
+
* card / PoC replay accordion / patch diff viewer). Exposed on the
|
|
143
|
+
* SDK so course pipelines don't have to re-derive the layout in user
|
|
144
|
+
* code. Emits a self-contained HTML document: inlined CSS, no
|
|
145
|
+
* external dependencies, deterministic node order, safe to
|
|
146
|
+
* `iframe`-embed. */
|
|
147
|
+
export declare function renderPentestReportHtml(out: SecurityPentestRunOutput, options?: {
|
|
148
|
+
title?: string;
|
|
149
|
+
}): string;
|
|
150
|
+
//# sourceMappingURL=pentest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pentest.d.ts","sourceRoot":"","sources":["../src/pentest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,KAAK,EACV,uBAAuB,EACvB,wBAAwB,EAKzB,MAAM,oBAAoB,CAAC;AAE5B;;;;mEAImE;AACnE,eAAO,MAAM,mBAAmB,iLAStB,CAAC;AACX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE,qEAAqE;AACrE,qBAAa,YAAa,S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