@veridid/poe 0.0.0-stage → 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 (183) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +39 -2
  3. package/build/PoeApi.d.mts +150 -0
  4. package/build/PoeApi.d.mts.map +1 -0
  5. package/build/PoeApi.mjs +262 -0
  6. package/build/PoeApi.mjs.map +1 -0
  7. package/build/PoeEvents.d.mts +187 -0
  8. package/build/PoeEvents.d.mts.map +1 -0
  9. package/build/PoeEvents.mjs +28 -0
  10. package/build/PoeEvents.mjs.map +1 -0
  11. package/build/PoeModule.d.mts +61 -0
  12. package/build/PoeModule.d.mts.map +1 -0
  13. package/build/PoeModule.mjs +139 -0
  14. package/build/PoeModule.mjs.map +1 -0
  15. package/build/PoeModuleConfig.d.mts +71 -0
  16. package/build/PoeModuleConfig.d.mts.map +1 -0
  17. package/build/PoeRole.d.mts +21 -0
  18. package/build/PoeRole.d.mts.map +1 -0
  19. package/build/PoeRole.mjs +23 -0
  20. package/build/PoeRole.mjs.map +1 -0
  21. package/build/PoeState.d.mts +76 -0
  22. package/build/PoeState.d.mts.map +1 -0
  23. package/build/PoeState.mjs +78 -0
  24. package/build/PoeState.mjs.map +1 -0
  25. package/build/_virtual/_@oxc-project_runtime@0.112.0/helpers/decorate.mjs +10 -0
  26. package/build/_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateMetadata.mjs +7 -0
  27. package/build/_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateParam.mjs +9 -0
  28. package/build/_virtual/_rolldown/runtime.mjs +8 -0
  29. package/build/errors/PoeError.d.mts +173 -0
  30. package/build/errors/PoeError.d.mts.map +1 -0
  31. package/build/errors/PoeError.mjs +147 -0
  32. package/build/errors/PoeError.mjs.map +1 -0
  33. package/build/errors/index.d.mts +1 -0
  34. package/build/errors/index.mjs +1 -0
  35. package/build/executor/ProgramExecutor.d.mts +148 -0
  36. package/build/executor/ProgramExecutor.d.mts.map +1 -0
  37. package/build/executor/ProgramExecutorRegistry.d.mts +111 -0
  38. package/build/executor/ProgramExecutorRegistry.d.mts.map +1 -0
  39. package/build/executor/ProgramExecutorRegistry.mjs +145 -0
  40. package/build/executor/ProgramExecutorRegistry.mjs.map +1 -0
  41. package/build/executor/__mocks__/MockProgramExecutor.d.mts +118 -0
  42. package/build/executor/__mocks__/MockProgramExecutor.d.mts.map +1 -0
  43. package/build/executor/__mocks__/MockProgramExecutor.mjs +96 -0
  44. package/build/executor/__mocks__/MockProgramExecutor.mjs.map +1 -0
  45. package/build/executor/__mocks__/MockProofVerifier.d.mts +97 -0
  46. package/build/executor/__mocks__/MockProofVerifier.d.mts.map +1 -0
  47. package/build/executor/__mocks__/MockProofVerifier.mjs +79 -0
  48. package/build/executor/__mocks__/MockProofVerifier.mjs.map +1 -0
  49. package/build/executor/__mocks__/index.d.mts +2 -0
  50. package/build/executor/index.d.mts +5 -0
  51. package/build/executor/index.mjs +3 -0
  52. package/build/handlers/AcceptPoeMessageHandler.mjs +24 -0
  53. package/build/handlers/AcceptPoeMessageHandler.mjs.map +1 -0
  54. package/build/handlers/ChallengeMessageHandler.mjs +24 -0
  55. package/build/handlers/ChallengeMessageHandler.mjs.map +1 -0
  56. package/build/handlers/CompleteMessageHandler.mjs +24 -0
  57. package/build/handlers/CompleteMessageHandler.mjs.map +1 -0
  58. package/build/handlers/DeclinePoeMessageHandler.mjs +24 -0
  59. package/build/handlers/DeclinePoeMessageHandler.mjs.map +1 -0
  60. package/build/handlers/PoeProblemReportMessageHandler.mjs +18 -0
  61. package/build/handlers/PoeProblemReportMessageHandler.mjs.map +1 -0
  62. package/build/handlers/ProposePoeMessageHandler.mjs +18 -0
  63. package/build/handlers/ProposePoeMessageHandler.mjs.map +1 -0
  64. package/build/handlers/RequestPoeMessageHandler.mjs +18 -0
  65. package/build/handlers/RequestPoeMessageHandler.mjs.map +1 -0
  66. package/build/handlers/SubmitPoeMessageHandler.mjs +18 -0
  67. package/build/handlers/SubmitPoeMessageHandler.mjs.map +1 -0
  68. package/build/handlers/index.mjs +8 -0
  69. package/build/index.d.mts +38 -0
  70. package/build/index.mjs +33 -0
  71. package/build/messages/AcceptPoeMessage.d.mts +48 -0
  72. package/build/messages/AcceptPoeMessage.d.mts.map +1 -0
  73. package/build/messages/AcceptPoeMessage.mjs +61 -0
  74. package/build/messages/AcceptPoeMessage.mjs.map +1 -0
  75. package/build/messages/ChallengeMessage.d.mts +46 -0
  76. package/build/messages/ChallengeMessage.d.mts.map +1 -0
  77. package/build/messages/ChallengeMessage.mjs +57 -0
  78. package/build/messages/ChallengeMessage.mjs.map +1 -0
  79. package/build/messages/CompleteMessage.d.mts +56 -0
  80. package/build/messages/CompleteMessage.d.mts.map +1 -0
  81. package/build/messages/CompleteMessage.mjs +69 -0
  82. package/build/messages/CompleteMessage.mjs.map +1 -0
  83. package/build/messages/DeclinePoeMessage.d.mts +36 -0
  84. package/build/messages/DeclinePoeMessage.d.mts.map +1 -0
  85. package/build/messages/DeclinePoeMessage.mjs +45 -0
  86. package/build/messages/DeclinePoeMessage.mjs.map +1 -0
  87. package/build/messages/PoeProblemReportMessage.d.mts +51 -0
  88. package/build/messages/PoeProblemReportMessage.d.mts.map +1 -0
  89. package/build/messages/PoeProblemReportMessage.mjs +64 -0
  90. package/build/messages/PoeProblemReportMessage.mjs.map +1 -0
  91. package/build/messages/ProposePoeMessage.d.mts +51 -0
  92. package/build/messages/ProposePoeMessage.d.mts.map +1 -0
  93. package/build/messages/ProposePoeMessage.mjs +69 -0
  94. package/build/messages/ProposePoeMessage.mjs.map +1 -0
  95. package/build/messages/RequestPoeMessage.d.mts +64 -0
  96. package/build/messages/RequestPoeMessage.d.mts.map +1 -0
  97. package/build/messages/RequestPoeMessage.mjs +82 -0
  98. package/build/messages/RequestPoeMessage.mjs.map +1 -0
  99. package/build/messages/SubmitPoeMessage.d.mts +58 -0
  100. package/build/messages/SubmitPoeMessage.d.mts.map +1 -0
  101. package/build/messages/SubmitPoeMessage.mjs +75 -0
  102. package/build/messages/SubmitPoeMessage.mjs.map +1 -0
  103. package/build/messages/index.d.mts +9 -0
  104. package/build/messages/index.mjs +11 -0
  105. package/build/models/BindingContext.d.mts +36 -0
  106. package/build/models/BindingContext.d.mts.map +1 -0
  107. package/build/models/BindingContext.mjs +42 -0
  108. package/build/models/BindingContext.mjs.map +1 -0
  109. package/build/models/ProgramExecution.d.mts +142 -0
  110. package/build/models/ProgramExecution.d.mts.map +1 -0
  111. package/build/models/ProofArtifact.d.mts +260 -0
  112. package/build/models/ProofArtifact.d.mts.map +1 -0
  113. package/build/programs/AppAttestationProgram.d.mts +179 -0
  114. package/build/programs/AppAttestationProgram.d.mts.map +1 -0
  115. package/build/programs/AppAttestationProgram.mjs +296 -0
  116. package/build/programs/AppAttestationProgram.mjs.map +1 -0
  117. package/build/programs/PoeProgram.d.mts +204 -0
  118. package/build/programs/PoeProgram.d.mts.map +1 -0
  119. package/build/programs/PoeProgram.mjs +155 -0
  120. package/build/programs/PoeProgram.mjs.map +1 -0
  121. package/build/programs/examples/MockProgram.d.mts +98 -0
  122. package/build/programs/examples/MockProgram.d.mts.map +1 -0
  123. package/build/programs/examples/MockProgram.mjs +117 -0
  124. package/build/programs/examples/MockProgram.mjs.map +1 -0
  125. package/build/programs/examples/index.d.mts +1 -0
  126. package/build/programs/index.d.mts +4 -0
  127. package/build/programs/index.mjs +3 -0
  128. package/build/programs/vkeys/app_attestation_vkey.mjs +136 -0
  129. package/build/programs/vkeys/app_attestation_vkey.mjs.map +1 -0
  130. package/build/registry/ProgramRegistry.d.mts +108 -0
  131. package/build/registry/ProgramRegistry.d.mts.map +1 -0
  132. package/build/registry/ProgramRegistry.mjs +87 -0
  133. package/build/registry/ProgramRegistry.mjs.map +1 -0
  134. package/build/registry/ProofSystemRegistry.d.mts +111 -0
  135. package/build/registry/ProofSystemRegistry.d.mts.map +1 -0
  136. package/build/registry/ProofSystemRegistry.mjs +87 -0
  137. package/build/registry/ProofSystemRegistry.mjs.map +1 -0
  138. package/build/registry/index.d.mts +2 -0
  139. package/build/registry/index.mjs +2 -0
  140. package/build/repository/NonceRecord.d.mts +45 -0
  141. package/build/repository/NonceRecord.d.mts.map +1 -0
  142. package/build/repository/NonceRecord.mjs +34 -0
  143. package/build/repository/NonceRecord.mjs.map +1 -0
  144. package/build/repository/NonceRepository.d.mts +41 -0
  145. package/build/repository/NonceRepository.d.mts.map +1 -0
  146. package/build/repository/NonceRepository.mjs +63 -0
  147. package/build/repository/NonceRepository.mjs.map +1 -0
  148. package/build/repository/PoeSessionRecord.d.mts +107 -0
  149. package/build/repository/PoeSessionRecord.d.mts.map +1 -0
  150. package/build/repository/PoeSessionRecord.mjs +100 -0
  151. package/build/repository/PoeSessionRecord.mjs.map +1 -0
  152. package/build/repository/PoeSessionRepository.d.mts +29 -0
  153. package/build/repository/PoeSessionRepository.d.mts.map +1 -0
  154. package/build/repository/PoeSessionRepository.mjs +46 -0
  155. package/build/repository/PoeSessionRepository.mjs.map +1 -0
  156. package/build/repository/index.d.mts +4 -0
  157. package/build/repository/index.mjs +6 -0
  158. package/build/services/AutoProofExecutionService.d.mts +2 -0
  159. package/build/services/AutoProofExecutionService.mjs +144 -0
  160. package/build/services/AutoProofExecutionService.mjs.map +1 -0
  161. package/build/services/ContextBindingService.d.mts +51 -0
  162. package/build/services/ContextBindingService.d.mts.map +1 -0
  163. package/build/services/ContextBindingService.mjs +92 -0
  164. package/build/services/ContextBindingService.mjs.map +1 -0
  165. package/build/services/NonceService.d.mts +74 -0
  166. package/build/services/NonceService.d.mts.map +1 -0
  167. package/build/services/NonceService.mjs +126 -0
  168. package/build/services/NonceService.mjs.map +1 -0
  169. package/build/services/PoeService.d.mts +163 -0
  170. package/build/services/PoeService.d.mts.map +1 -0
  171. package/build/services/PoeService.mjs +487 -0
  172. package/build/services/PoeService.mjs.map +1 -0
  173. package/build/services/ProofVerificationService.d.mts +87 -0
  174. package/build/services/ProofVerificationService.d.mts.map +1 -0
  175. package/build/services/ProofVerificationService.mjs +164 -0
  176. package/build/services/ProofVerificationService.mjs.map +1 -0
  177. package/build/services/index.d.mts +5 -0
  178. package/build/services/index.mjs +5 -0
  179. package/build/workflow/PoeV1Actions.d.mts +149 -0
  180. package/build/workflow/PoeV1Actions.d.mts.map +1 -0
  181. package/build/workflow/PoeV1Actions.mjs +190 -0
  182. package/build/workflow/PoeV1Actions.mjs.map +1 -0
  183. package/package.json +44 -3
@@ -0,0 +1,164 @@
1
+ import { __require } from "../_virtual/_rolldown/runtime.mjs";
2
+ import { ExpiryError, ProgramParametersError, ProofVerificationError, VerifyingKeyError } from "../errors/PoeError.mjs";
3
+ import "../errors/index.mjs";
4
+ import { __decorateMetadata } from "../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateMetadata.mjs";
5
+ import { __decorateParam } from "../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateParam.mjs";
6
+ import { __decorate } from "../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorate.mjs";
7
+ import { NonceService } from "./NonceService.mjs";
8
+ import { ContextBindingService } from "./ContextBindingService.mjs";
9
+ import { ProgramRegistry } from "../registry/ProgramRegistry.mjs";
10
+ import { ProofSystemRegistry } from "../registry/ProofSystemRegistry.mjs";
11
+ import "../registry/index.mjs";
12
+ import { ProgramExecutorRegistry } from "../executor/ProgramExecutorRegistry.mjs";
13
+ import { InjectionSymbols } from "@credo-ts/core";
14
+ import { inject as inject$1, injectable as injectable$1 } from "tsyringe";
15
+
16
+ //#region src/services/ProofVerificationService.ts
17
+ var _ref, _ref2, _ref3, _ref4, _ref5;
18
+ let ProofVerificationService = class ProofVerificationService {
19
+ constructor(logger, programRegistry, proofSystemRegistry, executorRegistry, contextBindingService, nonceService) {
20
+ this.programRegistry = programRegistry;
21
+ this.proofSystemRegistry = proofSystemRegistry;
22
+ this.executorRegistry = executorRegistry;
23
+ this.contextBindingService = contextBindingService;
24
+ this.nonceService = nonceService;
25
+ this.logger = logger;
26
+ }
27
+ /**
28
+ * Verify a proof artifact through the complete verification pipeline
29
+ *
30
+ * Pipeline steps:
31
+ * 1. Check expiry
32
+ * 2. Check for custom verifier (if registered, use it instead of generic verification)
33
+ * 3. If no custom verifier:
34
+ * a. Registry checks (program, VK, params)
35
+ * b. ZK proof verification
36
+ * c. Binding context validation
37
+ * 4. Nonce validation
38
+ */
39
+ async verifyProof(agentContext, options) {
40
+ const { proofArtifact, expectedBindingContext, proverDid, expiry, skipNonceCheck } = options;
41
+ const errors = [];
42
+ const warnings = [];
43
+ this.logger.info("Starting proof verification", {
44
+ programId: proofArtifact.program_id,
45
+ result: proofArtifact.result
46
+ });
47
+ try {
48
+ if (expiry) this.checkExpiry(expiry);
49
+ const customVerifier = this.executorRegistry.getVerifier(proofArtifact.program_id);
50
+ if (customVerifier) {
51
+ this.logger.debug("Using custom verifier for program", { programId: proofArtifact.program_id });
52
+ const customResult = await customVerifier.verify(agentContext, proofArtifact, expectedBindingContext);
53
+ if (!customResult.verified) {
54
+ if (customResult.errors) errors.push(...customResult.errors);
55
+ throw new ProofVerificationError(customResult.errors?.join("; ") || "Custom verification failed");
56
+ }
57
+ if (customResult.warnings) warnings.push(...customResult.warnings);
58
+ } else {
59
+ this.logger.debug("Using generic verification (no custom verifier)");
60
+ const program = this.checkRegistry(proofArtifact);
61
+ if (!await this.verifyZKProof(agentContext, proofArtifact, program)) throw new ProofVerificationError("ZK proof verification failed");
62
+ this.contextBindingService.assertBindingMatch(expectedBindingContext, {
63
+ nonce: proofArtifact.public.nonce,
64
+ context_hash: proofArtifact.public.context_hash,
65
+ session_id: proofArtifact.public.session_id
66
+ });
67
+ }
68
+ if (!skipNonceCheck) await this.nonceService.validateAndMarkNonce(agentContext, proverDid, proofArtifact.public.nonce);
69
+ this.logger.info("Proof verification successful");
70
+ return {
71
+ verified: true,
72
+ timestamp: /* @__PURE__ */ new Date(),
73
+ metadata: warnings.length > 0 ? { warnings } : void 0
74
+ };
75
+ } catch (error) {
76
+ this.logger.error("Proof verification failed", { error });
77
+ const errorMessage = error instanceof Error ? error.message : String(error);
78
+ errors.push(errorMessage);
79
+ return {
80
+ verified: false,
81
+ timestamp: /* @__PURE__ */ new Date(),
82
+ errors
83
+ };
84
+ }
85
+ }
86
+ /**
87
+ * Check if the proof has expired
88
+ */
89
+ checkExpiry(expiry) {
90
+ const expiryDate = new Date(expiry);
91
+ if (/* @__PURE__ */ new Date() > expiryDate) throw new ExpiryError(`Proof expired at ${expiry}`);
92
+ }
93
+ /**
94
+ * Perform registry checks
95
+ */
96
+ checkRegistry(proofArtifact) {
97
+ const { program_id, zk, public: publicOutputs } = proofArtifact;
98
+ const program = this.programRegistry.getById(program_id);
99
+ if (!this.programRegistry.isVkAllowed(program_id, zk.vk_hash)) throw new VerifyingKeyError(zk.vk_hash);
100
+ if (publicOutputs.vk_hash !== zk.vk_hash) throw new VerifyingKeyError(`VK hash mismatch: public=${publicOutputs.vk_hash}, zk=${zk.vk_hash}`);
101
+ if (program.allowed_params_hashes && publicOutputs["params_hash"]) {
102
+ const paramsHash = publicOutputs["params_hash"];
103
+ if (!this.programRegistry.isParamsAllowed(program_id, paramsHash)) throw new ProgramParametersError(paramsHash);
104
+ }
105
+ return program;
106
+ }
107
+ /**
108
+ * Verify the zero-knowledge proof
109
+ */
110
+ async verifyZKProof(agentContext, proofArtifact, program) {
111
+ const { zk, public: publicOutputs } = proofArtifact;
112
+ const proofSystem = this.proofSystemRegistry.getByScheme(zk.scheme);
113
+ if (!proofSystem) throw new ProofVerificationError(`Proof system for scheme '${zk.scheme}' not found`);
114
+ const verifyingKey = {
115
+ vk_hash: zk.vk_hash,
116
+ vk_data: zk.vk_hash,
117
+ metadata: {
118
+ program_id: proofArtifact.program_id,
119
+ circuit_id: zk.circuit_id
120
+ }
121
+ };
122
+ return proofSystem.verify(agentContext, zk, publicOutputs, verifyingKey);
123
+ }
124
+ /**
125
+ * Create a verification receipt
126
+ */
127
+ createReceipt(proofArtifact, verifierDid, sessionId) {
128
+ const proofHash = this.computeProofHash(proofArtifact);
129
+ return {
130
+ receipt_id: `receipt-${Date.now()}-${Math.random().toString(36).substring(7)}`,
131
+ proof_hash: proofHash,
132
+ issued_at: (/* @__PURE__ */ new Date()).toISOString(),
133
+ issuer_did: verifierDid,
134
+ session_id: sessionId,
135
+ program_id: proofArtifact.program_id,
136
+ result: proofArtifact.result,
137
+ expires_at: new Date(Date.now() + 1800 * 1e3).toISOString()
138
+ };
139
+ }
140
+ /**
141
+ * Compute hash of proof artifact for receipt
142
+ */
143
+ computeProofHash(proofArtifact) {
144
+ const Hasher = __require("@credo-ts/core").Hasher;
145
+ const canonical = JSON.stringify(proofArtifact);
146
+ return "0x" + Hasher.hash(canonical, "sha-256").toString("hex");
147
+ }
148
+ };
149
+ ProofVerificationService = __decorate([
150
+ injectable$1(),
151
+ __decorateParam(0, inject$1(InjectionSymbols.Logger)),
152
+ __decorateMetadata("design:paramtypes", [
153
+ Object,
154
+ ProgramRegistry,
155
+ ProofSystemRegistry,
156
+ ProgramExecutorRegistry,
157
+ ContextBindingService,
158
+ NonceService
159
+ ])
160
+ ], ProofVerificationService);
161
+
162
+ //#endregion
163
+ export { ProofVerificationService };
164
+ //# sourceMappingURL=ProofVerificationService.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProofVerificationService.mjs","names":["injectable","inject"],"sources":["../../src/services/ProofVerificationService.ts"],"sourcesContent":["import type { AgentContext } from '@credo-ts/core'\nimport type { ProofArtifact, VerificationResult } from '../models'\nimport type { ProgramMetadata } from '../registry/ProgramRegistry'\n\nimport { injectable, inject } from 'tsyringe'\nimport type { Logger } from '@credo-ts/core'\nimport { InjectionSymbols } from '@credo-ts/core'\nimport type { VerifyingKey } from '../registry'\nimport { ProgramRegistry, ProofSystemRegistry } from '../registry'\nimport { ProgramExecutorRegistry } from '../executor/ProgramExecutorRegistry'\nimport { ContextBindingService } from './ContextBindingService'\nimport { NonceService } from './NonceService'\nimport {\n ProofVerificationError,\n VerifyingKeyError,\n ProgramParametersError,\n ExpiryError,\n} from '../errors'\n\n/**\n * Options for proof verification\n */\nexport interface VerifyProofOptions {\n /**\n * Proof artifact to verify\n */\n proofArtifact: ProofArtifact\n\n /**\n * Expected binding context (from original request)\n */\n expectedBindingContext: {\n nonce: string\n context_hash: string\n session_id: string\n }\n\n /**\n * Prover DID (for nonce tracking)\n */\n proverDid: string\n\n /**\n * Expiry time (ISO 8601 string)\n */\n expiry?: string\n\n /**\n * Whether to skip nonce validation (for testing)\n */\n skipNonceCheck?: boolean\n}\n\n/**\n * Service for verifying zero-knowledge proofs\n */\n@injectable()\nexport class ProofVerificationService {\n private logger: Logger\n\n public constructor(\n @inject(InjectionSymbols.Logger) logger: Logger,\n private programRegistry: ProgramRegistry,\n private proofSystemRegistry: ProofSystemRegistry,\n private executorRegistry: ProgramExecutorRegistry,\n private contextBindingService: ContextBindingService,\n private nonceService: NonceService\n ) {\n this.logger = logger\n }\n\n /**\n * Verify a proof artifact through the complete verification pipeline\n *\n * Pipeline steps:\n * 1. Check expiry\n * 2. Check for custom verifier (if registered, use it instead of generic verification)\n * 3. If no custom verifier:\n * a. Registry checks (program, VK, params)\n * b. ZK proof verification\n * c. Binding context validation\n * 4. Nonce validation\n */\n public async verifyProof(\n agentContext: AgentContext,\n options: VerifyProofOptions\n ): Promise<VerificationResult> {\n const { proofArtifact, expectedBindingContext, proverDid, expiry, skipNonceCheck } = options\n const errors: string[] = []\n const warnings: string[] = []\n\n this.logger.info('Starting proof verification', {\n programId: proofArtifact.program_id,\n result: proofArtifact.result,\n })\n\n try {\n // Step 1: Check expiry\n if (expiry) {\n this.checkExpiry(expiry)\n }\n\n // Step 2: Check if custom verifier exists\n const customVerifier = this.executorRegistry.getVerifier(proofArtifact.program_id)\n\n if (customVerifier) {\n this.logger.debug('Using custom verifier for program', {\n programId: proofArtifact.program_id,\n })\n\n // Use custom verification\n const customResult = await customVerifier.verify(\n agentContext,\n proofArtifact,\n expectedBindingContext\n )\n\n if (!customResult.verified) {\n // Custom verification failed\n if (customResult.errors) {\n errors.push(...customResult.errors)\n }\n throw new ProofVerificationError(\n customResult.errors?.join('; ') || 'Custom verification failed'\n )\n }\n\n // Add warnings from custom verifier\n if (customResult.warnings) {\n warnings.push(...customResult.warnings)\n }\n } else {\n this.logger.debug('Using generic verification (no custom verifier)')\n\n // Step 3: Generic verification\n // a. Registry checks\n const program = this.checkRegistry(proofArtifact)\n\n // b. ZK proof verification\n const zkVerified = await this.verifyZKProof(agentContext, proofArtifact, program)\n\n if (!zkVerified) {\n throw new ProofVerificationError('ZK proof verification failed')\n }\n\n // c. Binding context validation\n this.contextBindingService.assertBindingMatch(\n expectedBindingContext,\n {\n nonce: proofArtifact.public.nonce,\n context_hash: proofArtifact.public.context_hash,\n session_id: proofArtifact.public.session_id,\n }\n )\n }\n\n // Step 4: Nonce validation (prevent replay) - always performed\n if (!skipNonceCheck) {\n await this.nonceService.validateAndMarkNonce(agentContext, proverDid, proofArtifact.public.nonce)\n }\n\n this.logger.info('Proof verification successful')\n\n return {\n verified: true,\n timestamp: new Date(),\n metadata: warnings.length > 0 ? { warnings } : undefined,\n }\n } catch (error) {\n this.logger.error('Proof verification failed', { error })\n\n const errorMessage = error instanceof Error ? error.message : String(error)\n errors.push(errorMessage)\n\n return {\n verified: false,\n timestamp: new Date(),\n errors,\n }\n }\n }\n\n /**\n * Check if the proof has expired\n */\n private checkExpiry(expiry: string): void {\n const expiryDate = new Date(expiry)\n const now = new Date()\n\n if (now > expiryDate) {\n throw new ExpiryError(`Proof expired at ${expiry}`)\n }\n }\n\n /**\n * Perform registry checks\n */\n private checkRegistry(proofArtifact: ProofArtifact): ProgramMetadata {\n const { program_id, zk, public: publicOutputs } = proofArtifact\n\n // Check program is registered\n const program = this.programRegistry.getById(program_id)\n\n // Check VK is allowed\n if (!this.programRegistry.isVkAllowed(program_id, zk.vk_hash)) {\n throw new VerifyingKeyError(zk.vk_hash)\n }\n\n // Verify VK hash in public outputs matches ZK proof VK hash\n if (publicOutputs.vk_hash !== zk.vk_hash) {\n throw new VerifyingKeyError(\n `VK hash mismatch: public=${publicOutputs.vk_hash}, zk=${zk.vk_hash}`\n )\n }\n\n // Check params if specified in public constraints\n if (program.allowed_params_hashes && publicOutputs['params_hash']) {\n const paramsHash = publicOutputs['params_hash'] as string\n if (!this.programRegistry.isParamsAllowed(program_id, paramsHash)) {\n throw new ProgramParametersError(paramsHash)\n }\n }\n\n return program\n }\n\n /**\n * Verify the zero-knowledge proof\n */\n private async verifyZKProof(\n agentContext: AgentContext,\n proofArtifact: ProofArtifact,\n program: ProgramMetadata\n ): Promise<boolean> {\n const { zk, public: publicOutputs } = proofArtifact\n\n // Get proof system for this scheme\n const proofSystem = this.proofSystemRegistry.getByScheme(zk.scheme)\n if (!proofSystem) {\n throw new ProofVerificationError(`Proof system for scheme '${zk.scheme}' not found`)\n }\n\n // Create verifying key object\n const verifyingKey: VerifyingKey = {\n vk_hash: zk.vk_hash,\n vk_data: zk.vk_hash, // In real implementation, fetch actual VK data\n metadata: {\n program_id: proofArtifact.program_id,\n circuit_id: zk.circuit_id,\n },\n }\n\n // Verify the proof\n return proofSystem.verify(agentContext, zk, publicOutputs, verifyingKey)\n }\n\n /**\n * Create a verification receipt\n */\n public createReceipt(\n proofArtifact: ProofArtifact,\n verifierDid: string,\n sessionId: string\n ): VerificationResult['receipt'] {\n // Compute proof hash\n const proofHash = this.computeProofHash(proofArtifact)\n\n return {\n receipt_id: `receipt-${Date.now()}-${Math.random().toString(36).substring(7)}`,\n proof_hash: proofHash,\n issued_at: new Date().toISOString(),\n issuer_did: verifierDid,\n session_id: sessionId,\n program_id: proofArtifact.program_id,\n result: proofArtifact.result,\n expires_at: new Date(Date.now() + 30 * 60 * 1000).toISOString(), // 30 minutes\n }\n }\n\n /**\n * Compute hash of proof artifact for receipt\n */\n private computeProofHash(proofArtifact: ProofArtifact): string {\n const Hasher = require('@credo-ts/core').Hasher\n const canonical = JSON.stringify(proofArtifact)\n const hash = Hasher.hash(canonical, 'sha-256')\n return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Z,SAAS,GAAG;GACZ,UAAU;IACR,YAAY,cAAc;IAC1B,YAAY,GAAG;IAChB;GACF;AAGD,SAAO,YAAY,OAAO,cAAc,IAAI,eAAe,aAAa;;;;;CAM1E,AAAO,cACL,eACA,aACA,WAC+B;EAE/B,MAAM,YAAY,KAAK,iBAAiB,cAAc;AAEtD,SAAO;GACL,YAAY,WAAW,KAAK,KAAK,CAAC,GAAG,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC,UAAU,EAAE;GAC5E,YAAY;GACZ,4BAAW,IAAI,MAAM,EAAC,aAAa;GACnC,YAAY;GACZ,YAAY;GACZ,YAAY,cAAc;GAC1B,QAAQ,cAAc;GACtB,YAAY,IAAI,KAAK,KAAK,KAAK,GAAG,OAAU,IAAK,CAAC,aAAa;GAChE;;;;;CAMH,AAAQ,iBAAiB,eAAsC;EAC7D,MAAM,mBAAiB,iBAAiB,CAAC;EACzC,MAAM,YAAY,KAAK,UAAU,cAAc;AAE/C,SAAO,OADM,OAAO,KAAK,WAAW,UAAU,CAC3B,SAAS,MAAM;;;;CAtOrCA,cAAY;oBAKRC,SAAO,iBAAiB,OAAO"}
@@ -0,0 +1,5 @@
1
+ import { NonceService } from "./NonceService.mjs";
2
+ import { ContextBindingService } from "./ContextBindingService.mjs";
3
+ import { ProofVerificationService, VerifyProofOptions } from "./ProofVerificationService.mjs";
4
+ import { CreateProposalOptions, CreateRequestOptions, CreateSubmitOptions, PoeService } from "./PoeService.mjs";
5
+ import "./AutoProofExecutionService.mjs";
@@ -0,0 +1,5 @@
1
+ import { NonceService } from "./NonceService.mjs";
2
+ import { ContextBindingService } from "./ContextBindingService.mjs";
3
+ import { ProofVerificationService } from "./ProofVerificationService.mjs";
4
+ import { PoeService } from "./PoeService.mjs";
5
+ import { AutoProofExecutionService } from "./AutoProofExecutionService.mjs";
@@ -0,0 +1,149 @@
1
+ import { AgentContext } from "@credo-ts/core";
2
+
3
+ //#region src/workflow/PoeV1Actions.d.ts
4
+ interface WorkflowActionHandlerLike {
5
+ readonly typeUri: string;
6
+ execute(ctx: {
7
+ agentContext: AgentContext;
8
+ template: unknown;
9
+ instance?: {
10
+ connection_id?: string;
11
+ instance_id?: string;
12
+ instanceId?: string;
13
+ id?: string;
14
+ context?: {
15
+ session_id?: string;
16
+ poe_record_id?: string;
17
+ };
18
+ };
19
+ action?: {
20
+ staticInput?: Record<string, unknown>;
21
+ };
22
+ input?: Record<string, unknown>;
23
+ }): Promise<{
24
+ artifacts?: Record<string, unknown>;
25
+ contextMerge?: Record<string, unknown>;
26
+ messageId?: string;
27
+ }>;
28
+ }
29
+ /**
30
+ * Request Proof of Execution from a prover
31
+ * Requester → Prover
32
+ */
33
+ declare class PoeRequestAction implements WorkflowActionHandlerLike {
34
+ readonly typeUri = "https://didcomm.org/poe/1.0/actions/request-poe";
35
+ execute(ctx: Parameters<WorkflowActionHandlerLike['execute']>[0]): Promise<{
36
+ artifacts: {
37
+ poe: {
38
+ record_id: string;
39
+ session_id: string;
40
+ nonce: string;
41
+ context_hash: string;
42
+ };
43
+ };
44
+ contextMerge: {
45
+ poe_record_id: string;
46
+ poe_session_id: string;
47
+ };
48
+ }>;
49
+ }
50
+ /**
51
+ * Submit proof of execution (for prover-side workflows)
52
+ * Prover → Requester
53
+ */
54
+ declare class PoeSubmitAction implements WorkflowActionHandlerLike {
55
+ readonly typeUri = "https://didcomm.org/poe/1.0/actions/submit-poe";
56
+ execute(ctx: Parameters<WorkflowActionHandlerLike['execute']>[0]): Promise<{
57
+ artifacts: {
58
+ poe: {
59
+ submitted: boolean;
60
+ record_id: string;
61
+ };
62
+ };
63
+ }>;
64
+ }
65
+ /**
66
+ * Complete the POE protocol
67
+ * Requester → Prover
68
+ */
69
+ declare class PoeCompleteAction implements WorkflowActionHandlerLike {
70
+ readonly typeUri = "https://didcomm.org/poe/1.0/actions/complete";
71
+ execute(ctx: Parameters<WorkflowActionHandlerLike['execute']>[0]): Promise<{
72
+ artifacts: {
73
+ poe: {
74
+ completed: boolean;
75
+ record_id: string;
76
+ verified: boolean | undefined;
77
+ };
78
+ };
79
+ }>;
80
+ }
81
+ /**
82
+ * Propose alternative execution (for prover-side negotiation)
83
+ * Prover → Requester
84
+ */
85
+ declare class PoeProposalAction implements WorkflowActionHandlerLike {
86
+ readonly typeUri = "https://didcomm.org/poe/1.0/actions/propose-alternative";
87
+ execute(ctx: Parameters<WorkflowActionHandlerLike['execute']>[0]): Promise<{
88
+ artifacts: {
89
+ poe: {
90
+ proposed: boolean;
91
+ record_id: string;
92
+ };
93
+ };
94
+ }>;
95
+ }
96
+ /**
97
+ * Accept a proposal from prover
98
+ * Requester → Prover
99
+ */
100
+ declare class PoeAcceptProposalAction implements WorkflowActionHandlerLike {
101
+ readonly typeUri = "https://didcomm.org/poe/1.0/actions/accept-proposal";
102
+ execute(ctx: Parameters<WorkflowActionHandlerLike['execute']>[0]): Promise<{
103
+ artifacts: {
104
+ poe: {
105
+ accepted: boolean;
106
+ record_id: string;
107
+ };
108
+ };
109
+ }>;
110
+ }
111
+ /**
112
+ * Decline a proposal from prover
113
+ * Requester → Prover
114
+ */
115
+ declare class PoeDeclineProposalAction implements WorkflowActionHandlerLike {
116
+ readonly typeUri = "https://didcomm.org/poe/1.0/actions/decline-proposal";
117
+ execute(ctx: Parameters<WorkflowActionHandlerLike['execute']>[0]): Promise<{
118
+ artifacts: {
119
+ poe: {
120
+ declined: boolean;
121
+ record_id: string;
122
+ reason: string | undefined;
123
+ };
124
+ };
125
+ }>;
126
+ }
127
+ /**
128
+ * Send problem report
129
+ * Either party
130
+ */
131
+ declare class PoeProblemReportAction implements WorkflowActionHandlerLike {
132
+ readonly typeUri = "https://didcomm.org/poe/1.0/actions/problem-report";
133
+ execute(ctx: Parameters<WorkflowActionHandlerLike['execute']>[0]): Promise<{
134
+ artifacts: {
135
+ poe: {
136
+ problem_reported: boolean;
137
+ record_id: string;
138
+ code: string;
139
+ };
140
+ };
141
+ }>;
142
+ }
143
+ /**
144
+ * Factory function to create all POE workflow actions
145
+ */
146
+ declare function createPoeV1Actions(): WorkflowActionHandlerLike[];
147
+ //#endregion
148
+ export { PoeAcceptProposalAction, PoeCompleteAction, PoeDeclineProposalAction, PoeProblemReportAction, PoeProposalAction, PoeRequestAction, PoeSubmitAction, WorkflowActionHandlerLike, createPoeV1Actions };
149
+ //# sourceMappingURL=PoeV1Actions.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PoeV1Actions.d.mts","names":[],"sources":["../../src/workflow/PoeV1Actions.ts"],"mappings":";;;UAQiB,yBAAA;EAAA,SACN,OAAA;EACT,OAAA,CAAQ,GAAA;IACN,YAAA,EAAc,YAAA;IACd,QAAA;IACA,QAAA;MACE,aAAA;MACA,WAAA;MACA,UAAA;MACA,EAAA;MACA,OAAA;QAAY,UAAA;QAAqB,aAAA;MAAA;IAAA;IAEnC,MAAA;MAAW,WAAA,GAAc,MAAA;IAAA;IACzB,KAAA,GAAQ,MAAA;EAAA,IACN,OAAA;IAAU,SAAA,GAAY,MAAA;IAAyB,YAAA,GAAe,MAAA;IAAyB,SAAA;EAAA;AAAA;;;;;cA0BhF,gBAAA,YAA4B,yBAAA;EAAA,SACvB,OAAA;EAEH,OAAA,CAAQ,GAAA,EAAK,UAAA,CAAW,yBAAA,kBAAwC,OAAA;;;;;;;;;;;;;;;;;;;cAgElE,eAAA,YAA2B,yBAAA;EAAA,SACtB,OAAA;EAEH,OAAA,CAAQ,GAAA,EAAK,UAAA,CAAW,yBAAA,kBAAwC,OAAA;;;;;;;;;;;;;cAqClE,iBAAA,YAA6B,yBAAA;EAAA,SACxB,OAAA;EAEH,OAAA,CAAQ,GAAA,EAAK,UAAA,CAAW,yBAAA,kBAAwC,OAAA;;;;;;;;;;;;;;cAgClE,iBAAA,YAA6B,yBAAA;EAAA,SACxB,OAAA;EAEH,OAAA,CAAQ,GAAA,EAAK,UAAA,CAAW,yBAAA,kBAAwC,OAAA;;;;;;;;;;;;;cAmClE,uBAAA,YAAmC,yBAAA;EAAA,SAC9B,OAAA;EAEH,OAAA,CAAQ,GAAA,EAAK,UAAA,CAAW,yBAAA,kBAAwC,OAAA;;;;;;;;;;;;;cA2BlE,wBAAA,YAAoC,yBAAA;EAAA,SAC/B,OAAA;EAEH,OAAA,CAAQ,GAAA,EAAK,UAAA,CAAW,yBAAA,kBAAwC,OAAA;;;;;;;;;;;;;;cAgClE,sBAAA,YAAkC,yBAAA;EAAA,SAC7B,OAAA;EAEH,OAAA,CAAQ,GAAA,EAAK,UAAA,CAAW,yBAAA,kBAAwC,OAAA;;;;;;;;;;;;;iBAgC/D,kBAAA,CAAA,GAAsB,yBAAA"}
@@ -0,0 +1,190 @@
1
+ import { __decorate } from "../_virtual/_@oxc-project_runtime@0.112.0/helpers/decorate.mjs";
2
+ import { PoeApi } from "../PoeApi.mjs";
3
+ import { injectable } from "@credo-ts/core";
4
+
5
+ //#region src/workflow/PoeV1Actions.ts
6
+ function requireConnectionId(ctx) {
7
+ const id = ctx.instance?.connection_id;
8
+ if (!id) throw Object.assign(/* @__PURE__ */ new Error("connection_id required in workflow instance"), { code: "action_error" });
9
+ return id;
10
+ }
11
+ function getPoeRecordId(ctx) {
12
+ return ctx.input?.record_id ?? ctx.action?.staticInput?.record_id ?? ctx.instance?.context?.poe_record_id;
13
+ }
14
+ let PoeRequestAction = class PoeRequestAction {
15
+ constructor() {
16
+ this.typeUri = "https://didcomm.org/poe/1.0/actions/request-poe";
17
+ }
18
+ async execute(ctx) {
19
+ const connectionId = requireConnectionId(ctx);
20
+ const api = ctx.agentContext.dependencyManager.resolve(PoeApi);
21
+ const input = ctx.input ?? {};
22
+ const staticIn = ctx.action?.staticInput ?? {};
23
+ const programId = input.program_id ?? staticIn.program_id;
24
+ if (!programId) throw Object.assign(/* @__PURE__ */ new Error("program_id required"), { code: "action_error" });
25
+ const disclosure = (input.disclosure ?? staticIn.disclosure) || "proof-only";
26
+ const expirySeconds = input.expiry_seconds ?? staticIn.expiry_seconds ?? 300;
27
+ const contextData = input.context_data ?? staticIn.context_data ?? {
28
+ workflow_instance_id: ctx.instance?.instance_id,
29
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
30
+ };
31
+ const bindingContext = await api.createBindingContext(contextData, { sessionId: ctx.instance?.instance_id });
32
+ const expiry = new Date(Date.now() + expirySeconds * 1e3).toISOString();
33
+ const record = await api.requestProofOfExecution(connectionId, {
34
+ programs: [{
35
+ program_id: programId,
36
+ disclosure
37
+ }],
38
+ bindingContext,
39
+ expiry,
40
+ parentThreadId: ctx.instance?.instance_id
41
+ });
42
+ return {
43
+ artifacts: { poe: {
44
+ record_id: record.id,
45
+ session_id: record.sessionId,
46
+ nonce: bindingContext.nonce,
47
+ context_hash: bindingContext.context_hash
48
+ } },
49
+ contextMerge: {
50
+ poe_record_id: record.id,
51
+ poe_session_id: record.sessionId
52
+ }
53
+ };
54
+ }
55
+ };
56
+ PoeRequestAction = __decorate([injectable()], PoeRequestAction);
57
+ let PoeSubmitAction = class PoeSubmitAction {
58
+ constructor() {
59
+ this.typeUri = "https://didcomm.org/poe/1.0/actions/submit-poe";
60
+ }
61
+ async execute(ctx) {
62
+ const api = ctx.agentContext.dependencyManager.resolve(PoeApi);
63
+ const input = ctx.input ?? {};
64
+ const staticIn = ctx.action?.staticInput ?? {};
65
+ const recordId = getPoeRecordId(ctx);
66
+ if (!recordId) throw Object.assign(/* @__PURE__ */ new Error("record_id or poe_record_id required"), { code: "action_error" });
67
+ const proofArtifact = input.proof_artifact ?? staticIn.proof_artifact;
68
+ if (!proofArtifact) throw Object.assign(/* @__PURE__ */ new Error("proof_artifact required"), { code: "action_error" });
69
+ return { artifacts: { poe: {
70
+ submitted: true,
71
+ record_id: (await api.submitProof(recordId, proofArtifact)).id
72
+ } } };
73
+ }
74
+ };
75
+ PoeSubmitAction = __decorate([injectable()], PoeSubmitAction);
76
+ let PoeCompleteAction = class PoeCompleteAction {
77
+ constructor() {
78
+ this.typeUri = "https://didcomm.org/poe/1.0/actions/complete";
79
+ }
80
+ async execute(ctx) {
81
+ const api = ctx.agentContext.dependencyManager.resolve(PoeApi);
82
+ const input = ctx.input ?? {};
83
+ const staticIn = ctx.action?.staticInput ?? {};
84
+ const recordId = getPoeRecordId(ctx);
85
+ if (!recordId) throw Object.assign(/* @__PURE__ */ new Error("record_id or poe_record_id required"), { code: "action_error" });
86
+ const issueReceipt = input.issue_receipt ?? staticIn.issue_receipt ?? false;
87
+ const record = await api.complete(recordId, issueReceipt);
88
+ return { artifacts: { poe: {
89
+ completed: true,
90
+ record_id: record.id,
91
+ verified: record.verificationResult?.verified
92
+ } } };
93
+ }
94
+ };
95
+ PoeCompleteAction = __decorate([injectable()], PoeCompleteAction);
96
+ let PoeProposalAction = class PoeProposalAction {
97
+ constructor() {
98
+ this.typeUri = "https://didcomm.org/poe/1.0/actions/propose-alternative";
99
+ }
100
+ async execute(ctx) {
101
+ const api = ctx.agentContext.dependencyManager.resolve(PoeApi);
102
+ const input = ctx.input ?? {};
103
+ const staticIn = ctx.action?.staticInput ?? {};
104
+ const recordId = getPoeRecordId(ctx);
105
+ if (!recordId) throw Object.assign(/* @__PURE__ */ new Error("record_id or poe_record_id required"), { code: "action_error" });
106
+ const programId = input.program_id ?? staticIn.program_id;
107
+ const disclosure = input.disclosure ?? staticIn.disclosure;
108
+ return { artifacts: { poe: {
109
+ proposed: true,
110
+ record_id: (await api.proposeAlternative(recordId, {
111
+ programId,
112
+ disclosure
113
+ })).id
114
+ } } };
115
+ }
116
+ };
117
+ PoeProposalAction = __decorate([injectable()], PoeProposalAction);
118
+ let PoeAcceptProposalAction = class PoeAcceptProposalAction {
119
+ constructor() {
120
+ this.typeUri = "https://didcomm.org/poe/1.0/actions/accept-proposal";
121
+ }
122
+ async execute(ctx) {
123
+ const api = ctx.agentContext.dependencyManager.resolve(PoeApi);
124
+ const recordId = getPoeRecordId(ctx);
125
+ if (!recordId) throw Object.assign(/* @__PURE__ */ new Error("record_id or poe_record_id required"), { code: "action_error" });
126
+ return { artifacts: { poe: {
127
+ accepted: true,
128
+ record_id: (await api.acceptProposal(recordId)).id
129
+ } } };
130
+ }
131
+ };
132
+ PoeAcceptProposalAction = __decorate([injectable()], PoeAcceptProposalAction);
133
+ let PoeDeclineProposalAction = class PoeDeclineProposalAction {
134
+ constructor() {
135
+ this.typeUri = "https://didcomm.org/poe/1.0/actions/decline-proposal";
136
+ }
137
+ async execute(ctx) {
138
+ const api = ctx.agentContext.dependencyManager.resolve(PoeApi);
139
+ const input = ctx.input ?? {};
140
+ const staticIn = ctx.action?.staticInput ?? {};
141
+ const recordId = getPoeRecordId(ctx);
142
+ if (!recordId) throw Object.assign(/* @__PURE__ */ new Error("record_id or poe_record_id required"), { code: "action_error" });
143
+ const reason = input.reason ?? staticIn.reason;
144
+ return { artifacts: { poe: {
145
+ declined: true,
146
+ record_id: (await api.declineProposal(recordId, reason)).id,
147
+ reason
148
+ } } };
149
+ }
150
+ };
151
+ PoeDeclineProposalAction = __decorate([injectable()], PoeDeclineProposalAction);
152
+ let PoeProblemReportAction = class PoeProblemReportAction {
153
+ constructor() {
154
+ this.typeUri = "https://didcomm.org/poe/1.0/actions/problem-report";
155
+ }
156
+ async execute(ctx) {
157
+ const api = ctx.agentContext.dependencyManager.resolve(PoeApi);
158
+ const input = ctx.input ?? {};
159
+ const staticIn = ctx.action?.staticInput ?? {};
160
+ const recordId = getPoeRecordId(ctx);
161
+ if (!recordId) throw Object.assign(/* @__PURE__ */ new Error("record_id or poe_record_id required"), { code: "action_error" });
162
+ const code = input.code ?? staticIn.code ?? "e.p.poe.generic";
163
+ const explain = input.explain ?? staticIn.explain;
164
+ const details = input.details ?? staticIn.details;
165
+ return { artifacts: { poe: {
166
+ problem_reported: true,
167
+ record_id: (await api.sendProblemReport(recordId, code, explain, details)).id,
168
+ code
169
+ } } };
170
+ }
171
+ };
172
+ PoeProblemReportAction = __decorate([injectable()], PoeProblemReportAction);
173
+ /**
174
+ * Factory function to create all POE workflow actions
175
+ */
176
+ function createPoeV1Actions() {
177
+ return [
178
+ new PoeRequestAction(),
179
+ new PoeSubmitAction(),
180
+ new PoeCompleteAction(),
181
+ new PoeProposalAction(),
182
+ new PoeAcceptProposalAction(),
183
+ new PoeDeclineProposalAction(),
184
+ new PoeProblemReportAction()
185
+ ];
186
+ }
187
+
188
+ //#endregion
189
+ export { PoeAcceptProposalAction, PoeCompleteAction, PoeDeclineProposalAction, PoeProblemReportAction, PoeProposalAction, PoeRequestAction, PoeSubmitAction, createPoeV1Actions };
190
+ //# sourceMappingURL=PoeV1Actions.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PoeV1Actions.mjs","names":[],"sources":["../../src/workflow/PoeV1Actions.ts"],"sourcesContent":["import type { AgentContext } from '@credo-ts/core'\nimport type { ProofArtifact, DisclosureLevel } from '../models'\n\nimport { injectable } from '@credo-ts/core'\n\nimport { PoeApi } from '../PoeApi'\n\n// Lightweight shape compatible with WorkflowActionHandler without importing workflow types\nexport interface WorkflowActionHandlerLike {\n readonly typeUri: string\n execute(ctx: {\n agentContext: AgentContext\n template: unknown\n instance?: {\n connection_id?: string\n instance_id?: string\n instanceId?: string\n id?: string\n context?: { session_id?: string; poe_record_id?: string }\n }\n action?: { staticInput?: Record<string, unknown> }\n input?: Record<string, unknown>\n }): Promise<{ artifacts?: Record<string, unknown>; contextMerge?: Record<string, unknown>; messageId?: string }>\n}\n\nfunction requireConnectionId(ctx: { instance?: { connection_id?: string } }): string {\n const id = ctx.instance?.connection_id\n if (!id) throw Object.assign(new Error('connection_id required in workflow instance'), { code: 'action_error' })\n return id\n}\n\nfunction getPoeRecordId(ctx: {\n instance?: { context?: { poe_record_id?: string } }\n input?: Record<string, unknown>\n action?: { staticInput?: Record<string, unknown> }\n}): string | undefined {\n return (\n (ctx.input?.record_id as string | undefined) ??\n (ctx.action?.staticInput?.record_id as string | undefined) ??\n ctx.instance?.context?.poe_record_id\n )\n}\n\n/**\n * Request Proof of Execution from a prover\n * Requester → Prover\n */\n@injectable()\nexport class PoeRequestAction implements WorkflowActionHandlerLike {\n public readonly typeUri = 'https://didcomm.org/poe/1.0/actions/request-poe'\n\n public async execute(ctx: Parameters<WorkflowActionHandlerLike['execute']>[0]) {\n const connectionId = requireConnectionId(ctx)\n const dm = ctx.agentContext.dependencyManager\n const api = dm.resolve(PoeApi)\n const input = (ctx.input ?? {}) as Record<string, unknown>\n const staticIn = (ctx.action?.staticInput ?? {}) as Record<string, unknown>\n\n // Build program execution request\n const programId = (input.program_id as string | undefined) ?? (staticIn.program_id as string | undefined)\n if (!programId) {\n throw Object.assign(new Error('program_id required'), { code: 'action_error' })\n }\n\n const disclosureStr = (input.disclosure as string | undefined) ?? (staticIn.disclosure as string | undefined)\n const disclosure: DisclosureLevel = (disclosureStr as DisclosureLevel) || 'proof-only'\n const expirySeconds = (input.expiry_seconds as number | undefined) ?? (staticIn.expiry_seconds as number | undefined) ?? 300\n\n // Build binding context from workflow instance context or inputs\n const contextData = (input.context_data as unknown) ?? (staticIn.context_data as unknown) ?? {\n workflow_instance_id: ctx.instance?.instance_id,\n timestamp: new Date().toISOString(),\n }\n\n const bindingContext = await api.createBindingContext(contextData, {\n sessionId: ctx.instance?.instance_id,\n })\n\n // Calculate expiry timestamp\n const expiry = new Date(Date.now() + expirySeconds * 1000).toISOString()\n\n const record = await api.requestProofOfExecution(connectionId, {\n programs: [\n {\n program_id: programId,\n disclosure,\n },\n ],\n bindingContext,\n expiry,\n parentThreadId: ctx.instance?.instance_id,\n })\n\n return {\n artifacts: {\n poe: {\n record_id: record.id,\n session_id: record.sessionId,\n nonce: bindingContext.nonce,\n context_hash: bindingContext.context_hash,\n },\n },\n contextMerge: {\n poe_record_id: record.id,\n poe_session_id: record.sessionId,\n },\n }\n }\n}\n\n/**\n * Submit proof of execution (for prover-side workflows)\n * Prover → Requester\n */\n@injectable()\nexport class PoeSubmitAction implements WorkflowActionHandlerLike {\n public readonly typeUri = 'https://didcomm.org/poe/1.0/actions/submit-poe'\n\n public async execute(ctx: Parameters<WorkflowActionHandlerLike['execute']>[0]) {\n const dm = ctx.agentContext.dependencyManager\n const api = dm.resolve(PoeApi)\n const input = (ctx.input ?? {}) as Record<string, unknown>\n const staticIn = (ctx.action?.staticInput ?? {}) as Record<string, unknown>\n\n const recordId = getPoeRecordId(ctx)\n if (!recordId) {\n throw Object.assign(new Error('record_id or poe_record_id required'), { code: 'action_error' })\n }\n\n // Get the proof artifact from inputs (could be auto-generated or provided)\n const proofArtifact = (input.proof_artifact as ProofArtifact | undefined) ??\n (staticIn.proof_artifact as ProofArtifact | undefined)\n\n if (!proofArtifact) {\n throw Object.assign(new Error('proof_artifact required'), { code: 'action_error' })\n }\n\n const record = await api.submitProof(recordId, proofArtifact)\n\n return {\n artifacts: {\n poe: {\n submitted: true,\n record_id: record.id,\n },\n },\n }\n }\n}\n\n/**\n * Complete the POE protocol\n * Requester → Prover\n */\n@injectable()\nexport class PoeCompleteAction implements WorkflowActionHandlerLike {\n public readonly typeUri = 'https://didcomm.org/poe/1.0/actions/complete'\n\n public async execute(ctx: Parameters<WorkflowActionHandlerLike['execute']>[0]) {\n const dm = ctx.agentContext.dependencyManager\n const api = dm.resolve(PoeApi)\n const input = (ctx.input ?? {}) as Record<string, unknown>\n const staticIn = (ctx.action?.staticInput ?? {}) as Record<string, unknown>\n\n const recordId = getPoeRecordId(ctx)\n if (!recordId) {\n throw Object.assign(new Error('record_id or poe_record_id required'), { code: 'action_error' })\n }\n\n const issueReceipt = (input.issue_receipt as boolean | undefined) ?? (staticIn.issue_receipt as boolean | undefined) ?? false\n\n const record = await api.complete(recordId, issueReceipt)\n\n return {\n artifacts: {\n poe: {\n completed: true,\n record_id: record.id,\n verified: record.verificationResult?.verified,\n },\n },\n }\n }\n}\n\n/**\n * Propose alternative execution (for prover-side negotiation)\n * Prover → Requester\n */\n@injectable()\nexport class PoeProposalAction implements WorkflowActionHandlerLike {\n public readonly typeUri = 'https://didcomm.org/poe/1.0/actions/propose-alternative'\n\n public async execute(ctx: Parameters<WorkflowActionHandlerLike['execute']>[0]) {\n const dm = ctx.agentContext.dependencyManager\n const api = dm.resolve(PoeApi)\n const input = (ctx.input ?? {}) as Record<string, unknown>\n const staticIn = (ctx.action?.staticInput ?? {}) as Record<string, unknown>\n\n const recordId = getPoeRecordId(ctx)\n if (!recordId) {\n throw Object.assign(new Error('record_id or poe_record_id required'), { code: 'action_error' })\n }\n\n const programId = (input.program_id as string | undefined) ?? (staticIn.program_id as string | undefined)\n const disclosure = (input.disclosure as string | undefined) ?? (staticIn.disclosure as string | undefined)\n\n const record = await api.proposeAlternative(recordId, {\n programId,\n disclosure,\n })\n\n return {\n artifacts: {\n poe: {\n proposed: true,\n record_id: record.id,\n },\n },\n }\n }\n}\n\n/**\n * Accept a proposal from prover\n * Requester → Prover\n */\n@injectable()\nexport class PoeAcceptProposalAction implements WorkflowActionHandlerLike {\n public readonly typeUri = 'https://didcomm.org/poe/1.0/actions/accept-proposal'\n\n public async execute(ctx: Parameters<WorkflowActionHandlerLike['execute']>[0]) {\n const dm = ctx.agentContext.dependencyManager\n const api = dm.resolve(PoeApi)\n\n const recordId = getPoeRecordId(ctx)\n if (!recordId) {\n throw Object.assign(new Error('record_id or poe_record_id required'), { code: 'action_error' })\n }\n\n const record = await api.acceptProposal(recordId)\n\n return {\n artifacts: {\n poe: {\n accepted: true,\n record_id: record.id,\n },\n },\n }\n }\n}\n\n/**\n * Decline a proposal from prover\n * Requester → Prover\n */\n@injectable()\nexport class PoeDeclineProposalAction implements WorkflowActionHandlerLike {\n public readonly typeUri = 'https://didcomm.org/poe/1.0/actions/decline-proposal'\n\n public async execute(ctx: Parameters<WorkflowActionHandlerLike['execute']>[0]) {\n const dm = ctx.agentContext.dependencyManager\n const api = dm.resolve(PoeApi)\n const input = (ctx.input ?? {}) as Record<string, unknown>\n const staticIn = (ctx.action?.staticInput ?? {}) as Record<string, unknown>\n\n const recordId = getPoeRecordId(ctx)\n if (!recordId) {\n throw Object.assign(new Error('record_id or poe_record_id required'), { code: 'action_error' })\n }\n\n const reason = (input.reason as string | undefined) ?? (staticIn.reason as string | undefined)\n\n const record = await api.declineProposal(recordId, reason)\n\n return {\n artifacts: {\n poe: {\n declined: true,\n record_id: record.id,\n reason,\n },\n },\n }\n }\n}\n\n/**\n * Send problem report\n * Either party\n */\n@injectable()\nexport class PoeProblemReportAction implements WorkflowActionHandlerLike {\n public readonly typeUri = 'https://didcomm.org/poe/1.0/actions/problem-report'\n\n public async execute(ctx: Parameters<WorkflowActionHandlerLike['execute']>[0]) {\n const dm = ctx.agentContext.dependencyManager\n const api = dm.resolve(PoeApi)\n const input = (ctx.input ?? {}) as Record<string, unknown>\n const staticIn = (ctx.action?.staticInput ?? {}) as Record<string, unknown>\n\n const recordId = getPoeRecordId(ctx)\n if (!recordId) {\n throw Object.assign(new Error('record_id or poe_record_id required'), { code: 'action_error' })\n }\n\n const code = (input.code as string | undefined) ?? (staticIn.code as string | undefined) ?? 'e.p.poe.generic'\n const explain = (input.explain as string | undefined) ?? (staticIn.explain as string | undefined)\n const details = (input.details as Record<string, unknown> | undefined) ?? (staticIn.details as Record<string, unknown> | undefined)\n\n const record = await api.sendProblemReport(recordId, code, explain, details)\n\n return {\n artifacts: {\n poe: {\n problem_reported: true,\n record_id: record.id,\n code,\n },\n },\n }\n }\n}\n\n/**\n * Factory function to create all POE workflow actions\n */\nexport function createPoeV1Actions(): WorkflowActionHandlerLike[] {\n return [\n new PoeRequestAction(),\n new PoeSubmitAction(),\n new PoeCompleteAction(),\n new PoeProposalAction(),\n new PoeAcceptProposalAction(),\n new PoeDeclineProposalAction(),\n new PoeProblemReportAction(),\n ]\n}\n"],"mappings":";;;;;AAyBA,SAAS,oBAAoB,KAAwD;CACnF,MAAM,KAAK,IAAI,UAAU;AACzB,KAAI,CAAC,GAAI,OAAM,OAAO,uBAAO,IAAI,MAAM,8CAA8C,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAChH,QAAO;;AAGT,SAAS,eAAe,KAID;AACrB,QACG,IAAI,OAAO,aACX,IAAI,QAAQ,aAAa,aAC1B,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AAI,aAAa,kBACb,QAAQ,OAAO;EAC9B,MAAM,QAAS,IAAI,SAAS,EAAE;EAC9B,MAAM,WAAY,IAAI,QAAQ,eAAe,EAAE;EAE/C,MAAM,WAAW,eAAe,IAAI;AACpC,MAAI,CAAC,SACH,OAAM,OAAO,uBAAO,IAAI,MAAM,sCAAsC,EAAE,EAAE,MAAM,gBAAgB,CAAC;EAGjG,MAAM,OAAQ,MAAM,QAAgC,SAAS,QAA+B;EAC5F,MAAM,UAAW,MAAM,WAAmC,SAAS;EACnE,MAAM,UAAW,MAAM,WAAoD,SAAS;AAIpF,SAAO,EACL,WAAW,EACT,KAAK;GACH,kBAAkB;GAClB,YANS,MAAM,IAAI,kBAAkB,UAAU,MAAM,SAAS,QAAQ,EAMpD;GAClB;GACD,EACF,EACF;;;qCA7BJ,YAAY;;;;AAoCb,SAAgB,qBAAkD;AAChE,QAAO;EACL,IAAI,kBAAkB;EACtB,IAAI,iBAAiB;EACrB,IAAI,mBAAmB;EACvB,IAAI,mBAAmB;EACvB,IAAI,yBAAyB;EAC7B,IAAI,0BAA0B;EAC9B,IAAI,wBAAwB;EAC7B"}
package/package.json CHANGED
@@ -1,6 +1,47 @@
1
1
  {
2
2
  "name": "@veridid/poe",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.0.0",
4
+ "description": "Proof of Execution (PoE) protocol for Credo: request and verify zero-knowledge proofs that a program executed correctly.",
5
+ "exports": {
6
+ ".": "./build/index.mjs",
7
+ "./package.json": "./package.json"
8
+ },
9
+ "files": [
10
+ "build"
11
+ ],
12
+ "license": "Apache-2.0",
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "homepage": "https://github.com/VeriDID/credo-ts-internal/tree/release/packages/poe",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/VeriDID/credo-ts-internal",
20
+ "directory": "packages/poe"
21
+ },
22
+ "dependencies": {
23
+ "class-transformer": "0.5.1",
24
+ "class-validator": "^0.14.3",
25
+ "snarkjs": "^0.7.5"
26
+ },
27
+ "peerDependencies": {
28
+ "@credo-ts/core": ">=0.7.0 <0.8",
29
+ "@credo-ts/didcomm": ">=0.7.0 <0.8"
30
+ },
31
+ "peerDependenciesMeta": {
32
+ "snarkjs": {
33
+ "optional": true
34
+ }
35
+ },
36
+ "devDependencies": {
37
+ "reflect-metadata": "0.2.2",
38
+ "typescript": "~5.9.3",
39
+ "@credo-ts/didcomm": "0.7.0",
40
+ "@credo-ts/core": "0.7.0"
41
+ },
42
+ "scripts": {
43
+ "build": "tsdown --config-loader unconfig"
44
+ },
45
+ "types": "./build/index.d.mts",
46
+ "module": "./build/index.mjs"
6
47
  }