dsh-pentester 0.0.1 → 1.0.0

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.
Files changed (62) hide show
  1. package/README.md +39 -5
  2. package/agents/impact/profile.yml +19 -0
  3. package/agents/recon/profile.yml +23 -0
  4. package/agents/reporting/REPORT_TEMPLATE.md +333 -0
  5. package/agents/reporting/profile.yml +45 -0
  6. package/agents/threat-model/profile.yml +19 -0
  7. package/agents/validation/profile.yml +20 -0
  8. package/agents/vulnerability/profile.yml +19 -0
  9. package/agents/web/profile.yml +19 -0
  10. package/cordis.dev.patch.yml +16 -0
  11. package/cordis.patch.yml +2 -0
  12. package/docker/README.md +60 -0
  13. package/docker/kali/Dockerfile +881 -0
  14. package/docker/kali/README.md +104 -0
  15. package/docker/kali/REPORT_TEMPLATE.md +333 -0
  16. package/docker/kali/TOOL_PROMPT.md +362 -0
  17. package/docker/kali/bin/clone-kb +39 -0
  18. package/docker/kali/bin/entrypoint.sh +9 -0
  19. package/docker/kali/bin/gen-tools-json.sh +246 -0
  20. package/docker/kali/bin/record-traffic.sh +32 -0
  21. package/docker/kali/bin/tool-info +31 -0
  22. package/docker/kali/bin/tool-list +17 -0
  23. package/lib/catalog-BmeOyr6n.js +231 -0
  24. package/lib/catalog-BmeOyr6n.js.map +1 -0
  25. package/lib/catalog-DhE_r18k.js +231 -0
  26. package/lib/catalog-DhE_r18k.js.map +1 -0
  27. package/lib/client.js +15234 -0
  28. package/lib/client.js.map +7 -0
  29. package/lib/container-listing-BI6Xj8l2.js +56 -0
  30. package/lib/container-listing-BI6Xj8l2.js.map +1 -0
  31. package/lib/container-listing-BWZoBnN_.js +56 -0
  32. package/lib/container-listing-BWZoBnN_.js.map +1 -0
  33. package/lib/container-listing-CE5t-Y_H.js +56 -0
  34. package/lib/container-listing-CE5t-Y_H.js.map +1 -0
  35. package/lib/container-listing-DZPBvrLD.js +56 -0
  36. package/lib/container-listing-DZPBvrLD.js.map +1 -0
  37. package/lib/docker-tar-_wf8UrSj.js +66 -0
  38. package/lib/docker-tar-_wf8UrSj.js.map +1 -0
  39. package/lib/engagement-container-store-B9D8g0wq.js +641 -0
  40. package/lib/engagement-container-store-B9D8g0wq.js.map +1 -0
  41. package/lib/engagement-container-store-Cf-h0B4F.js +641 -0
  42. package/lib/engagement-container-store-Cf-h0B4F.js.map +1 -0
  43. package/lib/engagement-container-store-Cu1wuur1.js +639 -0
  44. package/lib/engagement-container-store-Cu1wuur1.js.map +1 -0
  45. package/lib/engagement-container-store-L_Gms-zi.js +632 -0
  46. package/lib/engagement-container-store-L_Gms-zi.js.map +1 -0
  47. package/lib/index.d.ts +41 -0
  48. package/lib/index.js +3200 -0
  49. package/lib/index.js.map +1 -0
  50. package/lib/model-CZoiogVs.js +149 -0
  51. package/lib/model-CZoiogVs.js.map +1 -0
  52. package/lib/model-DKZ5Rjik.js +145 -0
  53. package/lib/model-DKZ5Rjik.js.map +1 -0
  54. package/lib/worker-events-jFvaBp9x.js +351 -0
  55. package/lib/worker-events-jFvaBp9x.js.map +1 -0
  56. package/lib/worker-events-juSf0EDW.js +347 -0
  57. package/lib/worker-events-juSf0EDW.js.map +1 -0
  58. package/package.json +89 -8
  59. package/presets/pentester/agent.cordis.yml +194 -0
  60. package/presets/pentester/preset.yml +2 -0
  61. package/presets/pentester/run-state.mjs +210 -0
  62. package/index.js +0 -5
@@ -0,0 +1,351 @@
1
+ import { c as FINDING_SEVERITIES, g as brand, l as FINDING_STATUSES, n as ARTIFACT_KINDS, s as EVIDENCE_KINDS } from "./model-DKZ5Rjik.js";
2
+ import { z } from "zod";
3
+ //#region \0rolldown/runtime.js
4
+ var __defProp = Object.defineProperty;
5
+ var __exportAll = (all, no_symbols) => {
6
+ let target = {};
7
+ for (var name in all) __defProp(target, name, {
8
+ get: all[name],
9
+ enumerable: true
10
+ });
11
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
12
+ return target;
13
+ };
14
+ //#endregion
15
+ //#region src/runtime/worker-events.ts
16
+ /**
17
+ * runtime/worker-events.ts — consolidated module (Wave 5; see docs/refactor/wave-5-mapping.md).
18
+ */
19
+ var worker_events_exports = /* @__PURE__ */ __exportAll({
20
+ AGENT_PROGRESS_STATUSES: () => AGENT_PROGRESS_STATUSES,
21
+ PTAP_EVENT_TYPES: () => PTAP_EVENT_TYPES,
22
+ PTAP_PAYLOAD_SCHEMAS: () => PTAP_PAYLOAD_SCHEMAS,
23
+ PTAP_PROTOCOL: () => PTAP_PROTOCOL,
24
+ PTAP_VERSION: () => 1,
25
+ PtapValidationError: () => PtapValidationError,
26
+ artifactProducedSchema: () => artifactProducedSchema,
27
+ artifactSubmissionSchema: () => artifactSubmissionSchema,
28
+ assertNever: () => assertNever,
29
+ checkPtapCompatibility: () => checkPtapCompatibility,
30
+ createPtapMessage: () => createPtapMessage,
31
+ createPtapMessageId: () => createPtapMessageId,
32
+ delegateRequestedSchema: () => delegateRequestedSchema,
33
+ evidenceProducedSchema: () => evidenceProducedSchema,
34
+ evidenceSubmissionSchema: () => evidenceSubmissionSchema,
35
+ fail: () => fail,
36
+ findingProducedSchema: () => findingProducedSchema,
37
+ findingSubmissionSchema: () => findingSubmissionSchema,
38
+ inputRefsSchema: () => inputRefsSchema,
39
+ isPtapEvent: () => isPtapEvent,
40
+ isPtapEventType: () => isPtapEventType,
41
+ isPtapMessageType: () => isPtapMessageType,
42
+ isRecord: () => isRecord,
43
+ occurrenceSubmissionSchema: () => occurrenceSubmissionSchema,
44
+ progressUpdatedSchema: () => progressUpdatedSchema,
45
+ taskBlockedSchema: () => taskBlockedSchema,
46
+ taskCompletedSchema: () => taskCompletedSchema,
47
+ taskFailedSchema: () => taskFailedSchema,
48
+ validatePtapMessage: () => validatePtapMessage
49
+ });
50
+ /**
51
+ * Canonical PTAP v1 contract. Types live only here.
52
+ * Runtime parse/validate/create: `src/ptap`.
53
+ */
54
+ const PTAP_PROTOCOL = "ptap";
55
+ const PTAP_EVENT_TYPES = [
56
+ "progress.updated",
57
+ "artifact.produced",
58
+ "evidence.produced",
59
+ "finding.produced",
60
+ "delegate.requested",
61
+ "task.completed",
62
+ "task.failed",
63
+ "task.blocked"
64
+ ];
65
+ const AGENT_PROGRESS_STATUSES = [
66
+ "planning",
67
+ "working",
68
+ "waiting",
69
+ "blocked",
70
+ "finalizing"
71
+ ];
72
+ function assertNever(value, message) {
73
+ throw new Error(message ?? `Unexpected value: ${String(value)}`);
74
+ }
75
+ var PtapValidationError = class extends Error {
76
+ code;
77
+ path;
78
+ /** Expected values for enum/const mismatches (actionable model feedback). */
79
+ expected;
80
+ /** The received value that failed validation. */
81
+ received;
82
+ constructor(code, message, path, expected, received) {
83
+ super(message);
84
+ this.name = "PtapValidationError";
85
+ this.code = code;
86
+ if (path !== void 0) this.path = path;
87
+ if (expected !== void 0) this.expected = expected;
88
+ if (received !== void 0) this.received = received;
89
+ }
90
+ };
91
+ function fail(code, message, path, expected, received) {
92
+ return {
93
+ ok: false,
94
+ error: new PtapValidationError(code, message, path, expected, received)
95
+ };
96
+ }
97
+ /**
98
+ * Canonical PTAP event schemas — SINGLE SOURCE OF TRUTH.
99
+ *
100
+ * Worker → Pentester event contract. One zod schema per payload derives:
101
+ * - the TypeScript payload type (`z.infer`)
102
+ * - runtime validation (`safeParse`)
103
+ * - the model-facing JSON Schema (`toJSONSchema`)
104
+ *
105
+ * The PTAP tool names stay (`ptap_progress`, `ptap_produce_artifact`, …) —
106
+ * only the internal representation is unified here.
107
+ */
108
+ const nonEmptyString = z.string().min(1);
109
+ const optionalString = z.string().optional();
110
+ const optionalBoolean = z.boolean().optional();
111
+ const optionalStringArray = z.array(z.string().min(1)).optional();
112
+ const inputRefsSchema = z.object({
113
+ assets: optionalStringArray,
114
+ artifacts: optionalStringArray,
115
+ evidence: optionalStringArray,
116
+ findings: optionalStringArray
117
+ }).passthrough().optional();
118
+ const evidenceRefsSchema = optionalStringArray;
119
+ const artifactSubmissionSchema = z.object({
120
+ kind: z.enum(ARTIFACT_KINDS),
121
+ summary: nonEmptyString,
122
+ assetValue: optionalString,
123
+ assetId: optionalString,
124
+ protocol: optionalString,
125
+ port: z.number().int().min(0).max(65535).optional(),
126
+ serviceId: optionalString,
127
+ method: optionalString,
128
+ path: optionalString,
129
+ ownerRef: optionalString,
130
+ technologyName: optionalString,
131
+ evidenceRefs: evidenceRefsSchema
132
+ }).passthrough();
133
+ const evidenceSubmissionSchema = z.object({
134
+ kind: z.enum(EVIDENCE_KINDS),
135
+ summary: nonEmptyString,
136
+ content: optionalString,
137
+ ref: optionalString,
138
+ mediaType: z.string().min(1).optional()
139
+ }).passthrough();
140
+ const occurrenceSubmissionSchema = z.object({
141
+ assetId: nonEmptyString,
142
+ endpoint: optionalString,
143
+ serviceId: optionalString,
144
+ evidenceRefs: evidenceRefsSchema,
145
+ reproductionContext: optionalString
146
+ }).passthrough();
147
+ const findingSubmissionSchema = z.object({
148
+ title: nonEmptyString,
149
+ severity: z.enum(FINDING_SEVERITIES),
150
+ confidence: z.number(),
151
+ status: z.enum(FINDING_STATUSES),
152
+ summary: optionalString,
153
+ category: optionalString,
154
+ weakness: optionalString,
155
+ cwe: optionalString,
156
+ occurrence: occurrenceSubmissionSchema.optional()
157
+ }).passthrough();
158
+ const progressUpdatedSchema = z.object({
159
+ status: z.enum(AGENT_PROGRESS_STATUSES),
160
+ summary: nonEmptyString,
161
+ currentAction: optionalString
162
+ }).passthrough();
163
+ const artifactProducedSchema = z.object({
164
+ artifact: artifactSubmissionSchema,
165
+ summary: optionalString,
166
+ reportWorthy: optionalBoolean
167
+ }).passthrough();
168
+ const evidenceProducedSchema = z.object({
169
+ evidence: evidenceSubmissionSchema,
170
+ summary: optionalString,
171
+ reportWorthy: optionalBoolean
172
+ }).passthrough();
173
+ const findingProducedSchema = z.object({
174
+ finding: findingSubmissionSchema,
175
+ summary: optionalString,
176
+ reportWorthy: optionalBoolean
177
+ }).passthrough();
178
+ const delegateRequestedSchema = z.object({
179
+ requestId: nonEmptyString,
180
+ goal: nonEmptyString,
181
+ reason: nonEmptyString,
182
+ preferredAgentTemplateId: optionalString,
183
+ inputRefs: inputRefsSchema
184
+ }).passthrough();
185
+ const producedRefsSchema = z.object({
186
+ artifacts: optionalStringArray,
187
+ evidence: optionalStringArray,
188
+ findings: optionalStringArray
189
+ }).passthrough().optional();
190
+ const suggestedTaskSchema = z.object({
191
+ goal: nonEmptyString,
192
+ reason: optionalString,
193
+ preferredAgentTemplateId: optionalString
194
+ }).passthrough();
195
+ const exitConditionSchema = z.object({
196
+ code: nonEmptyString,
197
+ satisfiedCriteria: z.array(z.string().min(1))
198
+ }).passthrough().optional();
199
+ const taskCompletedSchema = z.object({
200
+ summary: nonEmptyString,
201
+ produced: producedRefsSchema,
202
+ suggestedTasks: z.array(suggestedTaskSchema).optional(),
203
+ exitCondition: exitConditionSchema
204
+ }).passthrough();
205
+ const taskFailedSchema = z.object({
206
+ summary: nonEmptyString,
207
+ code: optionalString,
208
+ retryable: z.boolean(),
209
+ details: optionalString
210
+ }).passthrough();
211
+ const taskBlockedSchema = z.object({
212
+ summary: nonEmptyString,
213
+ reasonCode: nonEmptyString,
214
+ recoverable: z.boolean(),
215
+ diagnostics: z.array(z.string()).optional()
216
+ }).passthrough();
217
+ /** payload schema per PTAP event type. */
218
+ const PTAP_PAYLOAD_SCHEMAS = {
219
+ "progress.updated": progressUpdatedSchema,
220
+ "artifact.produced": artifactProducedSchema,
221
+ "evidence.produced": evidenceProducedSchema,
222
+ "finding.produced": findingProducedSchema,
223
+ "delegate.requested": delegateRequestedSchema,
224
+ "task.completed": taskCompletedSchema,
225
+ "task.failed": taskFailedSchema,
226
+ "task.blocked": taskBlockedSchema
227
+ };
228
+ const EVENT_TYPE_SET = new Set(PTAP_EVENT_TYPES);
229
+ function isPtapEventType(type) {
230
+ return EVENT_TYPE_SET.has(type);
231
+ }
232
+ function isPtapMessageType(type) {
233
+ return isPtapEventType(type);
234
+ }
235
+ function isPtapEvent(message) {
236
+ return isPtapEventType(message.type);
237
+ }
238
+ const ISO_8601_UTC = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/;
239
+ function isNonEmptyString(value) {
240
+ return typeof value === "string" && value.length > 0;
241
+ }
242
+ function isIso8601Utc(value) {
243
+ if (!ISO_8601_UTC.test(value)) return false;
244
+ return !Number.isNaN(Date.parse(value));
245
+ }
246
+ function ok(value) {
247
+ return {
248
+ ok: true,
249
+ value
250
+ };
251
+ }
252
+ function invalidPayload(message, path, expected, received) {
253
+ return fail("invalid_payload", message, path, expected, received);
254
+ }
255
+ function validatePayload(type, payload) {
256
+ const schema = PTAP_PAYLOAD_SCHEMAS[type];
257
+ if (schema === void 0) return invalidPayload(`Unknown PTAP payload type`, "payload");
258
+ const parsed = schema.passthrough().safeParse(payload);
259
+ if (!parsed.success) {
260
+ const issue = parsed.error.issues[0];
261
+ const path = issue === void 0 ? "payload" : `payload.${issue.path.join(".")}`;
262
+ const anyIssue = issue;
263
+ const expected = anyIssue?.values ?? anyIssue?.options;
264
+ let received;
265
+ if (anyIssue?.path !== void 0 && anyIssue.path.length > 0) {
266
+ let cursor = payload;
267
+ for (const segment of anyIssue.path) {
268
+ if (cursor === null || typeof cursor !== "object") {
269
+ cursor = void 0;
270
+ break;
271
+ }
272
+ cursor = cursor[String(segment)];
273
+ }
274
+ received = cursor;
275
+ }
276
+ return invalidPayload(`${path}: ${issue?.message ?? "invalid payload"}`, path, expected, received);
277
+ }
278
+ return ok(parsed.data);
279
+ }
280
+ function validatePtapMessage(input) {
281
+ const compatibility = checkPtapCompatibility(input);
282
+ if (!compatibility.ok) {
283
+ if (compatibility.reason === "invalid_protocol") return fail("invalid_protocol", "protocol must be \"ptap\"", "protocol");
284
+ return fail("unsupported_version", "version must be exactly 1", "version");
285
+ }
286
+ if (!isRecord(input)) return fail("invalid_envelope", "message must be an object");
287
+ if (!isNonEmptyString(input.messageId)) return fail("missing_field", "messageId must be a non-empty string", "messageId");
288
+ if (!isNonEmptyString(input.type) || !isPtapMessageType(input.type)) return fail("unknown_type", "unknown PTAP message type", "type");
289
+ if (!isNonEmptyString(input.engagementId)) return fail("missing_field", "engagementId must be a non-empty string", "engagementId");
290
+ if (!isNonEmptyString(input.stageId)) return fail("missing_field", "stageId must be a non-empty string", "stageId");
291
+ if (!isNonEmptyString(input.taskId)) return fail("missing_field", "taskId must be a non-empty string", "taskId");
292
+ if (!isNonEmptyString(input.agentRunId)) return fail("missing_field", "agentRunId must be a non-empty string", "agentRunId");
293
+ if (typeof input.timestamp !== "string" || !isIso8601Utc(input.timestamp)) return fail("invalid_timestamp", "timestamp must be an ISO-8601 UTC datetime", "timestamp");
294
+ if (!isRecord(input.payload)) return fail("invalid_payload", "payload must be an object", "payload");
295
+ const payload = validatePayload(input.type, input.payload);
296
+ if (!payload.ok) return payload;
297
+ return {
298
+ ok: true,
299
+ value: {
300
+ protocol: PTAP_PROTOCOL,
301
+ version: 1,
302
+ messageId: brand(input.messageId),
303
+ type: input.type,
304
+ engagementId: brand(input.engagementId),
305
+ stageId: brand(input.stageId),
306
+ taskId: brand(input.taskId),
307
+ agentRunId: brand(input.agentRunId),
308
+ timestamp: input.timestamp,
309
+ payload: payload.value
310
+ }
311
+ };
312
+ }
313
+ function createPtapMessageId() {
314
+ return brand(crypto.randomUUID());
315
+ }
316
+ function createPtapMessage(input) {
317
+ return {
318
+ protocol: PTAP_PROTOCOL,
319
+ version: 1,
320
+ messageId: createPtapMessageId(),
321
+ type: input.type,
322
+ engagementId: input.engagementId,
323
+ stageId: input.stageId,
324
+ taskId: input.taskId,
325
+ agentRunId: input.agentRunId,
326
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
327
+ payload: input.payload
328
+ };
329
+ }
330
+ function isRecord(value) {
331
+ return typeof value === "object" && value !== null && !Array.isArray(value);
332
+ }
333
+ function checkPtapCompatibility(input) {
334
+ if (!isRecord(input)) return {
335
+ ok: false,
336
+ reason: "invalid_protocol"
337
+ };
338
+ if (input.protocol !== "ptap") return {
339
+ ok: false,
340
+ reason: "invalid_protocol"
341
+ };
342
+ if (input.version !== 1) return {
343
+ ok: false,
344
+ reason: "unsupported_version"
345
+ };
346
+ return { ok: true };
347
+ }
348
+ //#endregion
349
+ export { isPtapEvent as a, __exportAll as c, createPtapMessage as i, PtapValidationError as n, validatePtapMessage as o, assertNever as r, worker_events_exports as s, PTAP_PAYLOAD_SCHEMAS as t };
350
+
351
+ //# sourceMappingURL=worker-events-jFvaBp9x.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worker-events-jFvaBp9x.js","names":[],"sources":["../src/runtime/worker-events.ts"],"sourcesContent":["/**\n * runtime/worker-events.ts — consolidated module (Wave 5; see docs/refactor/wave-5-mapping.md).\n */\nimport { z } from 'zod'\nimport { type ArtifactSubmission, type EvidenceSubmission, type FindingSubmission, type AgentRunId, type AgentTemplateId, type ArtifactId, type AssetId, type EngagementId, type EvidenceId, type FindingId, type StageId, type TaskId, ARTIFACT_KINDS, EVIDENCE_KINDS, FINDING_SEVERITIES, FINDING_STATUSES, brand } from '../core/model.js'\n\n// ── from src/domain/ptap.ts ────────────────────────────────────────\n/**\n * Canonical PTAP v1 contract. Types live only here.\n * Runtime parse/validate/create: `src/ptap`.\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\nexport const PTAP_PROTOCOL = 'ptap' as const\nexport const PTAP_VERSION = 1 as const\n\nexport const PTAP_EVENT_TYPES = [\n 'progress.updated',\n 'artifact.produced',\n 'evidence.produced',\n 'finding.produced',\n 'delegate.requested',\n 'task.completed',\n 'task.failed',\n 'task.blocked',\n] as const\n\nexport type PtapEventType = (typeof PTAP_EVENT_TYPES)[number]\nexport type PtapMessageType = PtapEventType\n\nexport const AGENT_PROGRESS_STATUSES = [\n 'planning',\n 'working',\n 'waiting',\n 'blocked',\n 'finalizing',\n] as const\n\nexport type AgentProgressStatus = (typeof AGENT_PROGRESS_STATUSES)[number]\n\nexport const TASK_CONSTRAINT_PRIORITIES = ['low', 'normal', 'high'] as const\nexport type TaskConstraintPriority = (typeof TASK_CONSTRAINT_PRIORITIES)[number]\n\nexport type PtapMessageId = string & { readonly __brand: 'PtapMessageId' }\nexport type PtapRequestId = string & { readonly __brand: 'PtapRequestId' }\n\nexport interface PtapEnvelope<TType extends PtapMessageType, TPayload> {\n readonly protocol: typeof PTAP_PROTOCOL\n readonly version: typeof PTAP_VERSION\n readonly messageId: PtapMessageId\n readonly type: TType\n readonly engagementId: EngagementId\n readonly stageId: StageId\n readonly taskId: TaskId\n readonly agentRunId: AgentRunId\n readonly timestamp: string\n readonly payload: TPayload\n}\n\nexport interface PtapInputRefs {\n readonly assets?: readonly AssetId[]\n readonly artifacts?: readonly ArtifactId[]\n readonly evidence?: readonly EvidenceId[]\n readonly findings?: readonly FindingId[]\n}\n\nexport interface ProgressUpdatedPayload {\n readonly status: AgentProgressStatus\n readonly summary: string\n readonly currentAction?: string\n}\n\nexport interface ArtifactProducedPayload {\n readonly artifact: ArtifactSubmission\n readonly summary?: string\n readonly reportWorthy?: boolean\n}\n\nexport interface EvidenceProducedPayload {\n readonly evidence: EvidenceSubmission\n readonly summary?: string\n readonly reportWorthy?: boolean\n}\n\nexport interface FindingProducedPayload {\n readonly finding: FindingSubmission\n readonly summary?: string\n readonly reportWorthy?: boolean\n}\n\nexport interface DelegateRequestedPayload {\n readonly requestId: PtapRequestId\n readonly goal: string\n readonly reason: string\n readonly preferredAgentTemplateId?: AgentTemplateId\n readonly inputRefs?: PtapInputRefs\n}\n\nexport interface SuggestedTask {\n readonly goal: string\n readonly reason?: string\n readonly preferredAgentTemplateId?: AgentTemplateId\n}\n\nexport interface TaskCompletedPayload {\n readonly summary: string\n readonly produced?: {\n readonly artifacts?: readonly PtapMessageId[]\n readonly evidence?: readonly PtapMessageId[]\n readonly findings?: readonly PtapMessageId[]\n }\n readonly suggestedTasks?: readonly SuggestedTask[]\n /** P1-5: which exit criteria this completion satisfied (typed, not prose). */\n readonly exitCondition?: {\n /** Stable machine code (e.g. \"recon-service-inventory\"). */\n readonly code: string\n readonly satisfiedCriteria: readonly string[]\n }\n}\n\nexport interface TaskFailedPayload {\n readonly summary: string\n readonly code?: string\n readonly retryable: boolean\n readonly details?: string\n}\n\n/**\n * A Worker declares its Task blocked: it cannot make progress on its own and\n * requires Orchestrator/user intervention. `reasonCode` is a stable machine\n * code (e.g. `missing_credentials`, `user_decision_required`,\n * `target_unreachable`); `recoverable` tells the Orchestrator whether a later\n * continue/steer can resume the Task.\n */\nexport interface TaskBlockedPayload {\n readonly summary: string\n readonly reasonCode: string\n /** True when a later continue/steer may resume the Task. */\n readonly recoverable: boolean\n /** Optional machine-readable diagnostics (never secrets). */\n readonly diagnostics?: readonly string[]\n}\n\nexport type ProgressUpdatedMessage = PtapEnvelope<'progress.updated', ProgressUpdatedPayload>\nexport type ArtifactProducedMessage = PtapEnvelope<'artifact.produced', ArtifactProducedPayload>\nexport type EvidenceProducedMessage = PtapEnvelope<'evidence.produced', EvidenceProducedPayload>\nexport type FindingProducedMessage = PtapEnvelope<'finding.produced', FindingProducedPayload>\nexport type DelegateRequestedMessage = PtapEnvelope<'delegate.requested', DelegateRequestedPayload>\nexport type TaskCompletedMessage = PtapEnvelope<'task.completed', TaskCompletedPayload>\nexport type TaskFailedMessage = PtapEnvelope<'task.failed', TaskFailedPayload>\nexport type TaskBlockedMessage = PtapEnvelope<'task.blocked', TaskBlockedPayload>\n\nexport type PtapEvent =\n | ProgressUpdatedMessage\n | ArtifactProducedMessage\n | EvidenceProducedMessage\n | FindingProducedMessage\n | DelegateRequestedMessage\n | TaskCompletedMessage\n | TaskFailedMessage\n | TaskBlockedMessage\n\nexport type PtapMessage = PtapEvent\n\nexport type PtapEventHandler = (event: PtapEvent) => Promise<void>\n\nexport function assertNever(value: never, message?: string): never {\n throw new Error(message ?? `Unexpected value: ${String(value)}`)\n}\n// ── from src/ptap/errors.ts ────────────────────────────────────────\nexport const PTAP_VALIDATION_ERROR_CODES = [\n 'invalid_protocol',\n 'unsupported_version',\n 'unknown_type',\n 'invalid_envelope',\n 'invalid_timestamp',\n 'missing_field',\n 'invalid_payload',\n] as const\n\nexport type PtapValidationErrorCode = (typeof PTAP_VALIDATION_ERROR_CODES)[number]\n\nexport class PtapValidationError extends Error {\n readonly code: PtapValidationErrorCode\n readonly path?: string\n /** Expected values for enum/const mismatches (actionable model feedback). */\n readonly expected?: readonly string[]\n /** The received value that failed validation. */\n readonly received?: unknown\n\n constructor(\n code: PtapValidationErrorCode,\n message: string,\n path?: string,\n expected?: readonly string[],\n received?: unknown,\n ) {\n super(message)\n this.name = 'PtapValidationError'\n this.code = code\n if (path !== undefined) {\n this.path = path\n }\n if (expected !== undefined) {\n this.expected = expected\n }\n if (received !== undefined) {\n this.received = received\n }\n }\n}\n\nexport type PtapValidateResult =\n | { readonly ok: true; readonly value: import('./worker-events.js').PtapMessage }\n | { readonly ok: false; readonly error: PtapValidationError }\n\nexport function fail(\n code: PtapValidationErrorCode,\n message: string,\n path?: string,\n expected?: readonly string[],\n received?: unknown,\n): { readonly ok: false; readonly error: PtapValidationError } {\n return { ok: false, error: new PtapValidationError(code, message, path, expected, received) }\n}\n// ── from src/ptap/schema.ts ────────────────────────────────────────\n/**\n * Canonical PTAP event schemas — SINGLE SOURCE OF TRUTH.\n *\n * Worker → Pentester event contract. One zod schema per payload derives:\n * - the TypeScript payload type (`z.infer`)\n * - runtime validation (`safeParse`)\n * - the model-facing JSON Schema (`toJSONSchema`)\n *\n * The PTAP tool names stay (`ptap_progress`, `ptap_produce_artifact`, …) —\n * only the internal representation is unified here.\n */\n\n\n\n\n\n\nconst nonEmptyString = z.string().min(1)\nconst optionalString = z.string().optional()\nconst optionalBoolean = z.boolean().optional()\nconst nonEmptyStringArray = z.array(z.string().min(1))\nconst optionalStringArray = nonEmptyStringArray.optional()\n\nexport const inputRefsSchema = z\n .object({\n assets: optionalStringArray,\n artifacts: optionalStringArray,\n evidence: optionalStringArray,\n findings: optionalStringArray,\n })\n .passthrough()\n .optional()\n\nconst evidenceRefsSchema = optionalStringArray\n\nexport const artifactSubmissionSchema = z\n .object({\n kind: z.enum(ARTIFACT_KINDS),\n summary: nonEmptyString,\n assetValue: optionalString,\n assetId: optionalString,\n protocol: optionalString,\n port: z.number().int().min(0).max(65535).optional(),\n serviceId: optionalString,\n method: optionalString,\n path: optionalString,\n ownerRef: optionalString,\n technologyName: optionalString,\n evidenceRefs: evidenceRefsSchema,\n })\n .passthrough()\n\nexport const evidenceSubmissionSchema = z\n .object({\n kind: z.enum(EVIDENCE_KINDS),\n summary: nonEmptyString,\n content: optionalString,\n ref: optionalString,\n mediaType: z.string().min(1).optional(),\n })\n .passthrough()\n\nexport const occurrenceSubmissionSchema = z\n .object({\n assetId: nonEmptyString,\n endpoint: optionalString,\n serviceId: optionalString,\n evidenceRefs: evidenceRefsSchema,\n reproductionContext: optionalString,\n })\n .passthrough()\n\nexport const findingSubmissionSchema = z\n .object({\n title: nonEmptyString,\n severity: z.enum(FINDING_SEVERITIES),\n confidence: z.number(),\n status: z.enum(FINDING_STATUSES),\n summary: optionalString,\n category: optionalString,\n weakness: optionalString,\n cwe: optionalString,\n occurrence: occurrenceSubmissionSchema.optional(),\n })\n .passthrough()\n\nexport const progressUpdatedSchema = z\n .object({\n status: z.enum(AGENT_PROGRESS_STATUSES),\n summary: nonEmptyString,\n currentAction: optionalString,\n })\n .passthrough()\n\nexport const artifactProducedSchema = z\n .object({\n artifact: artifactSubmissionSchema,\n summary: optionalString,\n reportWorthy: optionalBoolean,\n })\n .passthrough()\n\nexport const evidenceProducedSchema = z\n .object({\n evidence: evidenceSubmissionSchema,\n summary: optionalString,\n reportWorthy: optionalBoolean,\n })\n .passthrough()\n\nexport const findingProducedSchema = z\n .object({\n finding: findingSubmissionSchema,\n summary: optionalString,\n reportWorthy: optionalBoolean,\n })\n .passthrough()\n\nexport const delegateRequestedSchema = z\n .object({\n requestId: nonEmptyString,\n goal: nonEmptyString,\n reason: nonEmptyString,\n preferredAgentTemplateId: optionalString,\n inputRefs: inputRefsSchema,\n })\n .passthrough()\n\nconst producedRefsSchema = z\n .object({\n artifacts: optionalStringArray,\n evidence: optionalStringArray,\n findings: optionalStringArray,\n })\n .passthrough()\n .optional()\n\nconst suggestedTaskSchema = z\n .object({\n goal: nonEmptyString,\n reason: optionalString,\n preferredAgentTemplateId: optionalString,\n })\n .passthrough()\n\nconst exitConditionSchema = z\n .object({\n code: nonEmptyString,\n satisfiedCriteria: z.array(z.string().min(1)),\n })\n .passthrough()\n .optional()\n\nexport const taskCompletedSchema = z\n .object({\n summary: nonEmptyString,\n produced: producedRefsSchema,\n suggestedTasks: z.array(suggestedTaskSchema).optional(),\n exitCondition: exitConditionSchema,\n })\n .passthrough()\n\nexport const taskFailedSchema = z\n .object({\n summary: nonEmptyString,\n code: optionalString,\n retryable: z.boolean(),\n details: optionalString,\n })\n .passthrough()\n\nexport const taskBlockedSchema = z\n .object({\n summary: nonEmptyString,\n reasonCode: nonEmptyString,\n recoverable: z.boolean(),\n diagnostics: z.array(z.string()).optional(),\n })\n .passthrough()\n\n/** payload schema per PTAP event type. */\nexport const PTAP_PAYLOAD_SCHEMAS = {\n 'progress.updated': progressUpdatedSchema,\n 'artifact.produced': artifactProducedSchema,\n 'evidence.produced': evidenceProducedSchema,\n 'finding.produced': findingProducedSchema,\n 'delegate.requested': delegateRequestedSchema,\n 'task.completed': taskCompletedSchema,\n 'task.failed': taskFailedSchema,\n 'task.blocked': taskBlockedSchema,\n} as const\n\nexport type PtapPayloadSchemaType = keyof typeof PTAP_PAYLOAD_SCHEMAS\n\nexport type PtapPayloadOf<Type extends PtapPayloadSchemaType> = z.infer<(typeof PTAP_PAYLOAD_SCHEMAS)[Type]>\n// ── from src/ptap/predicates.ts ────────────────────────────────────────\nconst EVENT_TYPE_SET: ReadonlySet<string> = new Set(PTAP_EVENT_TYPES)\n\nexport function isPtapEventType(type: string): type is PtapEventType {\n return EVENT_TYPE_SET.has(type)\n}\n\nexport function isPtapMessageType(type: string): type is PtapMessageType {\n return isPtapEventType(type)\n}\n\nexport function isPtapEvent(message: PtapMessage): message is PtapEvent {\n return isPtapEventType(message.type)\n}\n// ── from src/ptap/validate.ts ────────────────────────────────────────\nconst ISO_8601_UTC =\n /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})$/\n\ntype FieldResult<T> =\n | { readonly ok: true; readonly value: T }\n | { readonly ok: false; readonly error: import('./worker-events.js').PtapValidationError }\n\nfunction isNonEmptyString(value: unknown): value is string {\n return typeof value === 'string' && value.length > 0\n}\n\nfunction isIso8601Utc(value: string): boolean {\n if (!ISO_8601_UTC.test(value)) {\n return false\n }\n return !Number.isNaN(Date.parse(value))\n}\n\nfunction ok<T>(value: T): { readonly ok: true; readonly value: T } {\n return { ok: true, value }\n}\n\nfunction invalidPayload(\n message: string,\n path: string,\n expected?: readonly string[],\n received?: unknown,\n): FieldResult<never> {\n return fail('invalid_payload', message, path, expected, received)\n}\n\nfunction validatePayload(\n type: PtapMessageType,\n payload: Record<string, unknown>,\n): FieldResult<PtapMessage['payload']> {\n const schema = PTAP_PAYLOAD_SCHEMAS[type as PtapPayloadSchemaType]\n if (schema === undefined) {\n return invalidPayload(`Unknown PTAP payload type`, 'payload')\n }\n // Unknown optional fields are tolerated at runtime (dropped), matching the\n // previous \"rebuild known fields only\" behavior; the model-facing JSON\n // Schema (generated from the same schemas with .strict()) still forbids\n // extra properties at the tool layer.\n const parsed = schema.passthrough().safeParse(payload)\n if (!parsed.success) {\n const issue = parsed.error.issues[0]\n const path = issue === undefined ? 'payload' : `payload.${issue.path.join('.')}`\n // Include the field path so actionable model feedback names the failing\n // field; enum issues carry options/received for expected+received.\n const anyIssue = issue as unknown as { values?: readonly string[]; options?: readonly string[]; path?: readonly (string | number)[] } | undefined\n const expected = anyIssue?.values ?? anyIssue?.options\n // zod v4 enum issues do not carry the received value — read it from the\n // original payload at the failing path.\n let received: unknown\n if (anyIssue?.path !== undefined && anyIssue.path.length > 0) {\n let cursor: unknown = payload\n for (const segment of anyIssue.path) {\n if (cursor === null || typeof cursor !== 'object') {\n cursor = undefined\n break\n }\n cursor = (cursor as Record<string, unknown>)[String(segment)]\n }\n received = cursor\n }\n return invalidPayload(\n `${path}: ${issue?.message ?? 'invalid payload'}`,\n path,\n expected,\n received,\n )\n }\n return ok(parsed.data as PtapMessage['payload'])\n}\n\nexport function validatePtapMessage(input: unknown): PtapValidateResult {\n const compatibility = checkPtapCompatibility(input)\n if (!compatibility.ok) {\n if (compatibility.reason === 'invalid_protocol') {\n return fail('invalid_protocol', 'protocol must be \"ptap\"', 'protocol')\n }\n return fail('unsupported_version', 'version must be exactly 1', 'version')\n }\n if (!isRecord(input)) {\n return fail('invalid_envelope', 'message must be an object')\n }\n if (!isNonEmptyString(input.messageId)) {\n return fail('missing_field', 'messageId must be a non-empty string', 'messageId')\n }\n if (!isNonEmptyString(input.type) || !isPtapMessageType(input.type)) {\n return fail('unknown_type', 'unknown PTAP message type', 'type')\n }\n if (!isNonEmptyString(input.engagementId)) {\n return fail('missing_field', 'engagementId must be a non-empty string', 'engagementId')\n }\n if (!isNonEmptyString(input.stageId)) {\n return fail('missing_field', 'stageId must be a non-empty string', 'stageId')\n }\n if (!isNonEmptyString(input.taskId)) {\n return fail('missing_field', 'taskId must be a non-empty string', 'taskId')\n }\n if (!isNonEmptyString(input.agentRunId)) {\n return fail('missing_field', 'agentRunId must be a non-empty string', 'agentRunId')\n }\n if (typeof input.timestamp !== 'string' || !isIso8601Utc(input.timestamp)) {\n return fail('invalid_timestamp', 'timestamp must be an ISO-8601 UTC datetime', 'timestamp')\n }\n if (!isRecord(input.payload)) {\n return fail('invalid_payload', 'payload must be an object', 'payload')\n }\n\n const payload = validatePayload(input.type, input.payload)\n if (!payload.ok) {\n return payload\n }\n\n const message = {\n protocol: PTAP_PROTOCOL,\n version: PTAP_VERSION,\n messageId: brand<PtapMessageId>(input.messageId),\n type: input.type,\n engagementId: brand<EngagementId>(input.engagementId),\n stageId: brand<StageId>(input.stageId),\n taskId: brand<TaskId>(input.taskId),\n agentRunId: brand<AgentRunId>(input.agentRunId),\n timestamp: input.timestamp,\n payload: payload.value,\n } as PtapMessage\n\n return { ok: true, value: message }\n}\n// ── from src/ptap/create.ts ────────────────────────────────────────\nexport type PtapEventPayloadOf<T extends PtapMessageType> = Extract<PtapMessage, { type: T }>['payload']\n\nexport interface PtapCreateInput<T extends PtapMessageType> {\n readonly type: T\n readonly engagementId: PtapMessage['engagementId']\n readonly stageId: PtapMessage['stageId']\n readonly taskId: PtapMessage['taskId']\n readonly agentRunId: PtapMessage['agentRunId']\n readonly payload: PtapPayloadOf<T>\n}\n\nexport function createPtapMessageId(): PtapMessageId {\n return brand<PtapMessageId>(crypto.randomUUID())\n}\n\nexport function createPtapRequestId(): PtapRequestId {\n return brand<PtapRequestId>(crypto.randomUUID())\n}\n\nexport function createPtapMessage<T extends PtapMessageType>(\n input: PtapCreateInput<T>,\n): Extract<PtapMessage, { type: T }> {\n return {\n protocol: PTAP_PROTOCOL,\n version: PTAP_VERSION,\n messageId: createPtapMessageId(),\n type: input.type,\n engagementId: input.engagementId,\n stageId: input.stageId,\n taskId: input.taskId,\n agentRunId: input.agentRunId,\n timestamp: new Date().toISOString(),\n payload: input.payload,\n } as unknown as Extract<PtapMessage, { type: T }>\n}\n// ── from src/ptap/compatibility.ts ────────────────────────────────────────\nexport type PtapCompatibilityResult =\n | { readonly ok: true }\n | { readonly ok: false; readonly reason: 'invalid_protocol' | 'unsupported_version' }\n\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\nexport function checkPtapCompatibility(input: unknown): PtapCompatibilityResult {\n if (!isRecord(input)) {\n return { ok: false, reason: 'invalid_protocol' }\n }\n if (input.protocol !== PTAP_PROTOCOL) {\n return { ok: false, reason: 'invalid_protocol' }\n }\n if (input.version !== PTAP_VERSION) {\n return { ok: false, reason: 'unsupported_version' }\n }\n return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