@nexart/ai-execution 0.10.0 → 0.11.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.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as CreateSnapshotParams, A as AiExecutionSnapshotV1, V as VerificationResult, a as CerMeta, B as BundleDeclaration, b as CerAiExecutionBundle, c as CertifyDecisionParams, R as RunBuilderOptions, S as StepParams, d as RunSummary, e as AttestOptions, f as AttestationResult, g as SanitizeStorageOptions, h as AttestationReceipt, N as NodeKeysDocument, i as NodeReceiptVerifyResult, j as SignedAttestationReceipt, k as CerVerifyCode, l as AiefVerifyResult, T as ToolEvent, m as RunSummaryVerifyResult, n as AiefProfile } from './types-C5t12OK8.cjs';
2
- export { o as AiExecutionParameters, p as AttestationReceiptResult, q as ClientDefaults, r as NexArtClient, P as ProviderCallParams, s as ProviderCallResult, t as ProviderConfig, u as RedactionEnvelope, W as WrappedExecutionParams, v as WrappedExecutionResult } from './types-C5t12OK8.cjs';
1
+ import { C as CreateSnapshotParams, A as AiExecutionSnapshotV1, V as VerificationResult, a as CerMeta, B as BundleDeclaration, b as CerContextSignal, c as CerAiExecutionBundle, d as CertifyDecisionParams, R as RunBuilderOptions, S as StepParams, e as RunSummary, f as AttestOptions, g as AttestationResult, h as SanitizeStorageOptions, i as AttestationReceipt, N as NodeKeysDocument, j as NodeReceiptVerifyResult, k as SignedAttestationReceipt, l as CerVerifyCode, m as AiefVerifyResult, T as ToolEvent, n as RunSummaryVerifyResult, o as AiefProfile } from './types-C_M2xSWK.cjs';
2
+ export { p as AiExecutionParameters, q as AttestationReceiptResult, r as CerContext, s as ClientDefaults, t as NexArtClient, P as ProviderCallParams, u as ProviderCallResult, v as ProviderConfig, w as RedactionEnvelope, W as WrappedExecutionParams, x as WrappedExecutionResult } from './types-C_M2xSWK.cjs';
3
3
  export { wrapProvider } from './providers/wrap.cjs';
4
4
  export { AttestDecisionFn, LangChainAttestedResult, LangChainCerResult, LangChainCertificationInput, certifyLangChainRun, createLangChainCer } from './langchain.cjs';
5
5
 
@@ -29,6 +29,8 @@ declare function sealCer(snapshot: AiExecutionSnapshotV1, options?: {
29
29
  createdAt?: string;
30
30
  meta?: CerMeta;
31
31
  declaration?: BundleDeclaration;
32
+ /** v0.10.0 — upstream signals to bind as evidence. Included in certificateHash. */
33
+ signals?: CerContextSignal[];
32
34
  }): CerAiExecutionBundle;
33
35
  declare function verifyCer(bundle: CerAiExecutionBundle): VerificationResult;
34
36
 
@@ -566,4 +568,4 @@ interface CerVerificationResult {
566
568
  */
567
569
  declare function verifyAiCerBundleDetailed(bundle: unknown): CerVerificationResult;
568
570
 
569
- export { AiExecutionSnapshotV1, AiefProfile, AiefVerifyResult, AttestOptions, AttestationReceipt, AttestationResult, BundleDeclaration, CerAiExecutionBundle, CerAttestationError, CerMeta, CerVerificationError, type CerVerificationResult, CerVerifyCode, CerVerifyCode as CerVerifyCodeType, type CertifyAndAttestRunOptions, type CertifyAndAttestRunResult, CertifyDecisionParams, type CheckStatus, CreateSnapshotParams, type ExportVerifiableRedactedOptions, type ExportVerifiableRedactedProvenance, type ExportVerifiableRedactedResult, type MakeToolEventParams, NodeKeysDocument, NodeReceiptVerifyResult, type ProfileValidationResult, ReasonCode, ReasonCode as ReasonCodeType, type RedactBeforeSealPolicy, RunBuilder, RunBuilderOptions, RunSummary, RunSummaryVerifyResult, SanitizeStorageOptions, SignedAttestationReceipt, StepParams, ToolEvent, VerificationResult, type VerificationStatus, type VerifyRunSummaryOptions, attest, attestIfNeeded, certifyAndAttestDecision, certifyAndAttestRun, certifyDecision, certifyDecisionFromProviderCall, computeInputHash, computeOutputHash, createClient, createSnapshot, exportCer, exportVerifiableRedacted, fetchNodeKeys, getAttestationReceipt, hasAttestation, hashCanonicalJson, hashToolOutput, hashUtf8, importCer, makeToolEvent, mapToAiefReason, redactBeforeSeal, sanitizeForAttestation, sanitizeForStamp, sanitizeForStorage, sealCer, selectNodeKey, sha256Hex, toCanonicalJson, validateProfile, verifyCer as verify, verifyAiCerBundleDetailed, verifyAief, verifyBundleAttestation, verifyCer, verifyNodeReceiptSignature, verifyRunSummary, verifySnapshot };
571
+ export { AiExecutionSnapshotV1, AiefProfile, AiefVerifyResult, AttestOptions, AttestationReceipt, AttestationResult, BundleDeclaration, CerAiExecutionBundle, CerAttestationError, CerContextSignal, CerMeta, CerVerificationError, type CerVerificationResult, CerVerifyCode, CerVerifyCode as CerVerifyCodeType, type CertifyAndAttestRunOptions, type CertifyAndAttestRunResult, CertifyDecisionParams, type CheckStatus, CreateSnapshotParams, type ExportVerifiableRedactedOptions, type ExportVerifiableRedactedProvenance, type ExportVerifiableRedactedResult, type MakeToolEventParams, NodeKeysDocument, NodeReceiptVerifyResult, type ProfileValidationResult, ReasonCode, ReasonCode as ReasonCodeType, type RedactBeforeSealPolicy, RunBuilder, RunBuilderOptions, RunSummary, RunSummaryVerifyResult, SanitizeStorageOptions, SignedAttestationReceipt, StepParams, ToolEvent, VerificationResult, type VerificationStatus, type VerifyRunSummaryOptions, attest, attestIfNeeded, certifyAndAttestDecision, certifyAndAttestRun, certifyDecision, certifyDecisionFromProviderCall, computeInputHash, computeOutputHash, createClient, createSnapshot, exportCer, exportVerifiableRedacted, fetchNodeKeys, getAttestationReceipt, hasAttestation, hashCanonicalJson, hashToolOutput, hashUtf8, importCer, makeToolEvent, mapToAiefReason, redactBeforeSeal, sanitizeForAttestation, sanitizeForStamp, sanitizeForStorage, sealCer, selectNodeKey, sha256Hex, toCanonicalJson, validateProfile, verifyCer as verify, verifyAiCerBundleDetailed, verifyAief, verifyBundleAttestation, verifyCer, verifyNodeReceiptSignature, verifyRunSummary, verifySnapshot };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as CreateSnapshotParams, A as AiExecutionSnapshotV1, V as VerificationResult, a as CerMeta, B as BundleDeclaration, b as CerAiExecutionBundle, c as CertifyDecisionParams, R as RunBuilderOptions, S as StepParams, d as RunSummary, e as AttestOptions, f as AttestationResult, g as SanitizeStorageOptions, h as AttestationReceipt, N as NodeKeysDocument, i as NodeReceiptVerifyResult, j as SignedAttestationReceipt, k as CerVerifyCode, l as AiefVerifyResult, T as ToolEvent, m as RunSummaryVerifyResult, n as AiefProfile } from './types-C5t12OK8.js';
2
- export { o as AiExecutionParameters, p as AttestationReceiptResult, q as ClientDefaults, r as NexArtClient, P as ProviderCallParams, s as ProviderCallResult, t as ProviderConfig, u as RedactionEnvelope, W as WrappedExecutionParams, v as WrappedExecutionResult } from './types-C5t12OK8.js';
1
+ import { C as CreateSnapshotParams, A as AiExecutionSnapshotV1, V as VerificationResult, a as CerMeta, B as BundleDeclaration, b as CerContextSignal, c as CerAiExecutionBundle, d as CertifyDecisionParams, R as RunBuilderOptions, S as StepParams, e as RunSummary, f as AttestOptions, g as AttestationResult, h as SanitizeStorageOptions, i as AttestationReceipt, N as NodeKeysDocument, j as NodeReceiptVerifyResult, k as SignedAttestationReceipt, l as CerVerifyCode, m as AiefVerifyResult, T as ToolEvent, n as RunSummaryVerifyResult, o as AiefProfile } from './types-C_M2xSWK.js';
2
+ export { p as AiExecutionParameters, q as AttestationReceiptResult, r as CerContext, s as ClientDefaults, t as NexArtClient, P as ProviderCallParams, u as ProviderCallResult, v as ProviderConfig, w as RedactionEnvelope, W as WrappedExecutionParams, x as WrappedExecutionResult } from './types-C_M2xSWK.js';
3
3
  export { wrapProvider } from './providers/wrap.js';
4
4
  export { AttestDecisionFn, LangChainAttestedResult, LangChainCerResult, LangChainCertificationInput, certifyLangChainRun, createLangChainCer } from './langchain.js';
5
5
 
@@ -29,6 +29,8 @@ declare function sealCer(snapshot: AiExecutionSnapshotV1, options?: {
29
29
  createdAt?: string;
30
30
  meta?: CerMeta;
31
31
  declaration?: BundleDeclaration;
32
+ /** v0.10.0 — upstream signals to bind as evidence. Included in certificateHash. */
33
+ signals?: CerContextSignal[];
32
34
  }): CerAiExecutionBundle;
33
35
  declare function verifyCer(bundle: CerAiExecutionBundle): VerificationResult;
34
36
 
@@ -566,4 +568,4 @@ interface CerVerificationResult {
566
568
  */
567
569
  declare function verifyAiCerBundleDetailed(bundle: unknown): CerVerificationResult;
568
570
 
569
- export { AiExecutionSnapshotV1, AiefProfile, AiefVerifyResult, AttestOptions, AttestationReceipt, AttestationResult, BundleDeclaration, CerAiExecutionBundle, CerAttestationError, CerMeta, CerVerificationError, type CerVerificationResult, CerVerifyCode, CerVerifyCode as CerVerifyCodeType, type CertifyAndAttestRunOptions, type CertifyAndAttestRunResult, CertifyDecisionParams, type CheckStatus, CreateSnapshotParams, type ExportVerifiableRedactedOptions, type ExportVerifiableRedactedProvenance, type ExportVerifiableRedactedResult, type MakeToolEventParams, NodeKeysDocument, NodeReceiptVerifyResult, type ProfileValidationResult, ReasonCode, ReasonCode as ReasonCodeType, type RedactBeforeSealPolicy, RunBuilder, RunBuilderOptions, RunSummary, RunSummaryVerifyResult, SanitizeStorageOptions, SignedAttestationReceipt, StepParams, ToolEvent, VerificationResult, type VerificationStatus, type VerifyRunSummaryOptions, attest, attestIfNeeded, certifyAndAttestDecision, certifyAndAttestRun, certifyDecision, certifyDecisionFromProviderCall, computeInputHash, computeOutputHash, createClient, createSnapshot, exportCer, exportVerifiableRedacted, fetchNodeKeys, getAttestationReceipt, hasAttestation, hashCanonicalJson, hashToolOutput, hashUtf8, importCer, makeToolEvent, mapToAiefReason, redactBeforeSeal, sanitizeForAttestation, sanitizeForStamp, sanitizeForStorage, sealCer, selectNodeKey, sha256Hex, toCanonicalJson, validateProfile, verifyCer as verify, verifyAiCerBundleDetailed, verifyAief, verifyBundleAttestation, verifyCer, verifyNodeReceiptSignature, verifyRunSummary, verifySnapshot };
571
+ export { AiExecutionSnapshotV1, AiefProfile, AiefVerifyResult, AttestOptions, AttestationReceipt, AttestationResult, BundleDeclaration, CerAiExecutionBundle, CerAttestationError, CerContextSignal, CerMeta, CerVerificationError, type CerVerificationResult, CerVerifyCode, CerVerifyCode as CerVerifyCodeType, type CertifyAndAttestRunOptions, type CertifyAndAttestRunResult, CertifyDecisionParams, type CheckStatus, CreateSnapshotParams, type ExportVerifiableRedactedOptions, type ExportVerifiableRedactedProvenance, type ExportVerifiableRedactedResult, type MakeToolEventParams, NodeKeysDocument, NodeReceiptVerifyResult, type ProfileValidationResult, ReasonCode, ReasonCode as ReasonCodeType, type RedactBeforeSealPolicy, RunBuilder, RunBuilderOptions, RunSummary, RunSummaryVerifyResult, SanitizeStorageOptions, SignedAttestationReceipt, StepParams, ToolEvent, VerificationResult, type VerificationStatus, type VerifyRunSummaryOptions, attest, attestIfNeeded, certifyAndAttestDecision, certifyAndAttestRun, certifyDecision, certifyDecisionFromProviderCall, computeInputHash, computeOutputHash, createClient, createSnapshot, exportCer, exportVerifiableRedacted, fetchNodeKeys, getAttestationReceipt, hasAttestation, hashCanonicalJson, hashToolOutput, hashUtf8, importCer, makeToolEvent, mapToAiefReason, redactBeforeSeal, sanitizeForAttestation, sanitizeForStamp, sanitizeForStorage, sealCer, selectNodeKey, sha256Hex, toCanonicalJson, validateProfile, verifyCer as verify, verifyAiCerBundleDetailed, verifyAief, verifyBundleAttestation, verifyCer, verifyNodeReceiptSignature, verifyRunSummary, verifySnapshot };
package/dist/index.mjs CHANGED
@@ -258,14 +258,22 @@ function computeCertificateHash(payload) {
258
258
  const canonical = toCanonicalJson(payload);
259
259
  return `sha256:${sha256Hex(canonical)}`;
260
260
  }
261
+ function buildContext(signals) {
262
+ if (!signals || signals.length === 0) return void 0;
263
+ return { signals };
264
+ }
261
265
  function sealCer(snapshot, options) {
262
266
  const createdAt = options?.createdAt ?? (/* @__PURE__ */ new Date()).toISOString();
267
+ const context = buildContext(options?.signals);
263
268
  const payload = {
264
269
  bundleType: "cer.ai.execution.v1",
265
270
  createdAt,
266
271
  snapshot,
267
272
  version: "0.1"
268
273
  };
274
+ if (context) {
275
+ payload.context = context;
276
+ }
269
277
  const certificateHash = computeCertificateHash(payload);
270
278
  const bundle = {
271
279
  bundleType: "cer.ai.execution.v1",
@@ -274,6 +282,9 @@ function sealCer(snapshot, options) {
274
282
  version: "0.1",
275
283
  snapshot
276
284
  };
285
+ if (context) {
286
+ bundle.context = context;
287
+ }
277
288
  if (options?.meta) {
278
289
  bundle.meta = options.meta;
279
290
  }
@@ -322,6 +333,10 @@ function verifyCer(bundle) {
322
333
  snapshot: bundle.snapshot,
323
334
  version: "0.1"
324
335
  };
336
+ const verifyContext = buildContext(bundle.context?.signals);
337
+ if (verifyContext) {
338
+ payload.context = verifyContext;
339
+ }
325
340
  const expectedHash = computeCertificateHash(payload);
326
341
  if (bundle.certificateHash !== expectedHash) {
327
342
  certHashErrors.push(`certificateHash mismatch: expected ${expectedHash}, got ${bundle.certificateHash}`);
@@ -382,7 +397,11 @@ function certifyDecision(params) {
382
397
  conversationId: params.conversationId,
383
398
  prevStepHash: params.prevStepHash
384
399
  });
385
- return sealCer(snapshot, { createdAt: params.createdAt, meta: params.meta });
400
+ return sealCer(snapshot, {
401
+ createdAt: params.createdAt,
402
+ meta: params.meta,
403
+ signals: params.signals
404
+ });
386
405
  }
387
406
 
388
407
  // src/run.ts
@@ -2607,7 +2626,8 @@ function buildCertifyParams(input, executionId) {
2607
2626
  runId: typeof input.metadata?.runId === "string" ? input.metadata.runId : void 0,
2608
2627
  workflowId: typeof input.metadata?.workflowId === "string" ? input.metadata.workflowId : void 0,
2609
2628
  conversationId: typeof input.metadata?.conversationId === "string" ? input.metadata.conversationId : void 0,
2610
- meta: buildMeta(input.metadata)
2629
+ meta: buildMeta(input.metadata),
2630
+ signals: input.signals
2611
2631
  };
2612
2632
  }
2613
2633
  function createLangChainCer(input) {