@agenticprimitives/intent-engagement 0.0.0-alpha.2 → 0.0.0-alpha.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @agenticprimitives/intent-engagement
2
2
 
3
+ > Part of **[Agentic Primitives](https://agenticprimitives.dev)** — the open-source trust substrate for agentic applications: identity that can sign, authority checked at act time, evidence the owner carries. [Developer kit](https://github.com/agentictrustlabs/agentic-primitives) · [All packages](https://agenticprimitives.dev/developers)
4
+
3
5
  The layer between *candidate found* and *authorized provider is working* (spec 336): a **probe** carrying a minimized
4
6
  projection of an intent, the provider's **response** (offer · decline · needs-clarification · referral ·
5
7
  temporarily-unavailable · human-ux-required — business facts, never errors), a **firm offer** signed over RFC 8785
@@ -0,0 +1,74 @@
1
+ import type { Hex } from 'viem';
2
+ export declare const EXTERNAL_OPERATION_INTENT_TYPE: "ap.external-operation.v1";
3
+ export interface ExternalOperationRefV1 {
4
+ /** The company agent's CAIP-10 when it has one, else its issuer URL as an https: ORIGIN (no path). */
5
+ authority: string;
6
+ /** The company's id for the operation / session. */
7
+ operationId: string;
8
+ /** Integer ≥ 0. A new revision is a new ref — and a new intent. */
9
+ revision: number;
10
+ /** keccak256 over the RFC 8785 canonical JSON of the terms the company sent. */
11
+ termsDigest: Hex;
12
+ /** Unix seconds. After it the company will not perform the operation; neither will a mandate cover it. */
13
+ expiresAt: number;
14
+ }
15
+ /** The intent the mandate binds: the ref under one type tag, nothing else — so the digest is the ref's. */
16
+ export interface ExternalOperationIntentV1 extends ExternalOperationRefV1 {
17
+ type: typeof EXTERNAL_OPERATION_INTENT_TYPE;
18
+ }
19
+ /** Validate a candidate ref. `[]` when well-formed. */
20
+ export declare function validateExternalOperationRef(r: unknown): string[];
21
+ /** keccak256(JCS(terms)) — the terms exactly as the company sent them; a changed byte is a changed digest. */
22
+ export declare const externalOperationTermsDigest: (terms: unknown) => Hex;
23
+ /** Build a ref from what the company sent. Throws on a malformed input — a ref is never half-built. */
24
+ export declare function externalOperationRef(input: {
25
+ authority: string;
26
+ operationId: string;
27
+ revision: number;
28
+ terms: unknown;
29
+ expiresAt: number;
30
+ }): ExternalOperationRefV1;
31
+ /** The intent as the harness runs it and the mandate caveat binds it (`step.intent`). */
32
+ export declare function externalOperationIntent(ref: ExternalOperationRefV1): ExternalOperationIntentV1;
33
+ /** What the mandate caveat binds — `delegation.intentDigest(externalOperationIntent(ref))`, byte for byte. */
34
+ export declare const externalOperationIntentDigest: (ref: ExternalOperationRefV1) => Hex;
35
+ /** The `Idempotency-Key` a client sends with this operation — derived from the intent digest, so one intent is one key. */
36
+ export declare const externalOperationIdempotencyKey: (ref: ExternalOperationRefV1) => string;
37
+ /** Same operation (authority + operationId), any revision. */
38
+ export declare const isSameExternalOperation: (a: ExternalOperationRefV1, b: ExternalOperationRefV1) => boolean;
39
+ /**
40
+ * Does `next` supersede `prior`? Only a HIGHER revision of the SAME operation does; the parked act for `prior` is
41
+ * replaced and `prior`'s mandate covers nothing of `next` (a different digest). Equal revisions with different
42
+ * terms are a protocol error, not a supersession.
43
+ */
44
+ export declare function supersedesExternalOperation(next: ExternalOperationRefV1, prior: ExternalOperationRefV1): boolean;
45
+ /** PAP's `approved_by` vocabulary, as a projection of OUR facts. */
46
+ export type ExternalApprovedBy = 'user' | 'standing_permission';
47
+ /**
48
+ * The verified facts a caller holds about an operation's authority. Each field is the OUTCOME of a verification the
49
+ * authority layer already made (`delegation`'s mandate verifier; the spec 397 §11 covering-wire check) — this module
50
+ * verifies nothing and takes no signatures, so a `true` here is a claim the caller is responsible for.
51
+ */
52
+ export interface ExternalOperationAuthorityFacts {
53
+ /** A mandate whose intent-digest caveat equals `externalOperationIntentDigest(ref)` verified for this step. */
54
+ mandateVerifiedForIntentDigest?: Hex;
55
+ /** A standing wire (spec 397 §11) whose caveats — payee, cap, action, company, window — cover these terms. */
56
+ coveringStandingWire?: {
57
+ wireRef: string;
58
+ coversIntentDigest: Hex;
59
+ };
60
+ }
61
+ /**
62
+ * The ONLY producer of PAP's `approved_by`. `user` iff a mandate was verified over THIS ref's digest;
63
+ * `standing_permission` iff a covering wire names THIS digest; else null — the act parks. A chat "yes", a
64
+ * company's own assertion, a conversation transcript: none of them is an input here.
65
+ */
66
+ export declare function externalApprovedBy(ref: ExternalOperationRefV1, facts: ExternalOperationAuthorityFacts): ExternalApprovedBy | null;
67
+ /** The company's lifecycle word → the harness run state (spec 398 one state vocabulary; spec 442 §5). */
68
+ export declare const EXTERNAL_OPERATION_STATE: Readonly<Record<'proposed' | 'in_progress' | 'succeeded' | 'failed' | 'cancelled', string>>;
69
+ /**
70
+ * Confirming the same ref twice spends the same intent nonce: the chain refuses the second as reused. Stated here as
71
+ * the rule a client enforces BEFORE the chain does — a confirm is attempted once per `(authority, operationId, revision)`.
72
+ */
73
+ export declare const externalOperationConfirmKey: (ref: ExternalOperationRefV1) => string;
74
+ //# sourceMappingURL=external-operation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"external-operation.d.ts","sourceRoot":"","sources":["../src/external-operation.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhC,eAAO,MAAM,8BAA8B,EAAG,0BAAmC,CAAC;AAMlF,MAAM,WAAW,sBAAsB;IACrC,sGAAsG;IACtG,SAAS,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,QAAQ,EAAE,MAAM,CAAC;IACjB,gFAAgF;IAChF,WAAW,EAAE,GAAG,CAAC;IACjB,0GAA0G;IAC1G,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,2GAA2G;AAC3G,MAAM,WAAW,yBAA0B,SAAQ,sBAAsB;IACvE,IAAI,EAAE,OAAO,8BAA8B,CAAC;CAC7C;AAED,uDAAuD;AACvD,wBAAgB,4BAA4B,CAAC,CAAC,EAAE,OAAO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AAQ,CAAC,MAAM,CAAC,UAAU,GAAG,aAAa,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,EAAE,MAAM,CAAC,CAMhI,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,2BAA2B,QAAS,sBAAsB,KAAG,MAA+D,CAAC"}
@@ -0,0 +1,115 @@
1
+ // AN EXTERNAL OPERATION IS AN INTENT — spec 442 §5 (ontology `ap:ExternalOperation`).
2
+ //
3
+ // PAP's Operations extension, ACP's checkout session and UCP's checkout are the same object seen from the
4
+ // company's side: a pinned set of terms the company proposes and will perform at most once when the user
5
+ // approves. On our side that object already has a name — an INTENT whose digest a mandate binds (spec 336
6
+ // §8.3, spec 350 §3.6). This module is the reference type and the digest rule; nothing here is authority.
7
+ //
8
+ // ExternalOperationRefV1 authority · operationId · revision · termsDigest · expiresAt
9
+ // intent { type: 'ap.external-operation.v1', ...ref } — what the mandate caveat binds
10
+ // intentDigest keccak256(JCS(intent)) — `delegation.intentDigest`, byte for byte
11
+ //
12
+ // The company's words, ours (spec 442 §5):
13
+ // proposed → a PARKED act at the approval door; the person sees the company's name and the terms
14
+ // approved_by: user → the mandate signature over intentDigest — the ONLY producer of `user`
15
+ // standing_permission → a spec 397 §11 standing wire whose caveats cover the terms — the ONLY producer
16
+ // confirm → ExecuteAcceptedOffer with the mandate; one operationId‖revision = one intent nonce on chain,
17
+ // so a second confirm is refused as reuse (PAP's at-most-once stated as a chain fact)
18
+ // in_progress → `effect-uncertain`; we never report failed while the company says unknown
19
+ // new revision → a NEW intent: the parked act is replaced, never silently re-approved
20
+ // cancel → decline (proposed) / revoke the mandate (in progress)
21
+ // result.summary → the receipt's counterpart statement — evidence, never our record of what we did
22
+ //
23
+ // A chat "yes" produces neither word. The company's own `approved_by` is its claim, recorded as such.
24
+ import { digestOf } from './digests.js';
25
+ export const EXTERNAL_OPERATION_INTENT_TYPE = 'ap.external-operation.v1';
26
+ const CAIP10_EVM = /^eip155:\d+:0x[0-9a-fA-F]{40}$/;
27
+ const HTTPS_ORIGIN = /^https:\/\/[^\s/?#]+$/;
28
+ const HEX32 = /^0x[0-9a-f]{64}$/;
29
+ /** Validate a candidate ref. `[]` when well-formed. */
30
+ export function validateExternalOperationRef(r) {
31
+ const issues = [];
32
+ if (typeof r !== 'object' || r === null || Array.isArray(r))
33
+ return ['ref: must be an object'];
34
+ const x = r;
35
+ for (const k of Object.keys(x))
36
+ if (!['authority', 'operationId', 'revision', 'termsDigest', 'expiresAt'].includes(k))
37
+ issues.push(`ref.${k}: unknown property`);
38
+ if (typeof x.authority !== 'string' || !(CAIP10_EVM.test(x.authority) || HTTPS_ORIGIN.test(x.authority))) {
39
+ issues.push('ref.authority: must be a CAIP-10 (eip155:<chainId>:<address>) or an https origin');
40
+ }
41
+ if (typeof x.operationId !== 'string' || !x.operationId.trim())
42
+ issues.push('ref.operationId: required');
43
+ if (!Number.isInteger(x.revision) || x.revision < 0)
44
+ issues.push('ref.revision: must be a non-negative integer');
45
+ if (typeof x.termsDigest !== 'string' || !HEX32.test(x.termsDigest))
46
+ issues.push('ref.termsDigest: must be 0x + 64 lowercase hex (keccak256 of the JCS terms)');
47
+ if (!Number.isInteger(x.expiresAt) || x.expiresAt <= 0)
48
+ issues.push('ref.expiresAt: must be a positive integer (unix seconds)');
49
+ return issues;
50
+ }
51
+ /** keccak256(JCS(terms)) — the terms exactly as the company sent them; a changed byte is a changed digest. */
52
+ export const externalOperationTermsDigest = (terms) => digestOf(terms);
53
+ /** Build a ref from what the company sent. Throws on a malformed input — a ref is never half-built. */
54
+ export function externalOperationRef(input) {
55
+ const ref = {
56
+ authority: input.authority,
57
+ operationId: input.operationId,
58
+ revision: input.revision,
59
+ termsDigest: externalOperationTermsDigest(input.terms),
60
+ expiresAt: input.expiresAt,
61
+ };
62
+ const issues = validateExternalOperationRef(ref);
63
+ if (issues.length)
64
+ throw new Error(`ExternalOperationRefV1: ${issues.join('; ')}`);
65
+ return ref;
66
+ }
67
+ /** The intent as the harness runs it and the mandate caveat binds it (`step.intent`). */
68
+ export function externalOperationIntent(ref) {
69
+ const issues = validateExternalOperationRef(ref);
70
+ if (issues.length)
71
+ throw new Error(`ExternalOperationRefV1: ${issues.join('; ')}`);
72
+ return { type: EXTERNAL_OPERATION_INTENT_TYPE, authority: ref.authority, operationId: ref.operationId, revision: ref.revision, termsDigest: ref.termsDigest, expiresAt: ref.expiresAt };
73
+ }
74
+ /** What the mandate caveat binds — `delegation.intentDigest(externalOperationIntent(ref))`, byte for byte. */
75
+ export const externalOperationIntentDigest = (ref) => digestOf(externalOperationIntent(ref));
76
+ /** The `Idempotency-Key` a client sends with this operation — derived from the intent digest, so one intent is one key. */
77
+ export const externalOperationIdempotencyKey = (ref) => externalOperationIntentDigest(ref);
78
+ /** Same operation (authority + operationId), any revision. */
79
+ export const isSameExternalOperation = (a, b) => a.authority === b.authority && a.operationId === b.operationId;
80
+ /**
81
+ * Does `next` supersede `prior`? Only a HIGHER revision of the SAME operation does; the parked act for `prior` is
82
+ * replaced and `prior`'s mandate covers nothing of `next` (a different digest). Equal revisions with different
83
+ * terms are a protocol error, not a supersession.
84
+ */
85
+ export function supersedesExternalOperation(next, prior) {
86
+ return isSameExternalOperation(next, prior) && next.revision > prior.revision;
87
+ }
88
+ /**
89
+ * The ONLY producer of PAP's `approved_by`. `user` iff a mandate was verified over THIS ref's digest;
90
+ * `standing_permission` iff a covering wire names THIS digest; else null — the act parks. A chat "yes", a
91
+ * company's own assertion, a conversation transcript: none of them is an input here.
92
+ */
93
+ export function externalApprovedBy(ref, facts) {
94
+ const digest = externalOperationIntentDigest(ref);
95
+ if (facts.mandateVerifiedForIntentDigest && facts.mandateVerifiedForIntentDigest.toLowerCase() === digest)
96
+ return 'user';
97
+ if (facts.coveringStandingWire && facts.coveringStandingWire.coversIntentDigest.toLowerCase() === digest)
98
+ return 'standing_permission';
99
+ return null;
100
+ }
101
+ // ─── lifecycle words ──────────────────────────────────────────────────────────────────────────────
102
+ /** The company's lifecycle word → the harness run state (spec 398 one state vocabulary; spec 442 §5). */
103
+ export const EXTERNAL_OPERATION_STATE = {
104
+ proposed: 'awaiting-approval',
105
+ in_progress: 'effect-uncertain',
106
+ succeeded: 'completed',
107
+ failed: 'failed',
108
+ cancelled: 'cancelled',
109
+ };
110
+ /**
111
+ * Confirming the same ref twice spends the same intent nonce: the chain refuses the second as reused. Stated here as
112
+ * the rule a client enforces BEFORE the chain does — a confirm is attempted once per `(authority, operationId, revision)`.
113
+ */
114
+ export const externalOperationConfirmKey = (ref) => `${ref.authority}|${ref.operationId}|${ref.revision}`;
115
+ //# sourceMappingURL=external-operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"external-operation.js","sourceRoot":"","sources":["../src/external-operation.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,EAAE;AACF,0GAA0G;AAC1G,yGAAyG;AACzG,0GAA0G;AAC1G,0GAA0G;AAC1G,EAAE;AACF,yFAAyF;AACzF,6GAA6G;AAC7G,yHAAyH;AACzH,EAAE;AACF,2CAA2C;AAC3C,gHAAgH;AAChH,kGAAkG;AAClG,2GAA2G;AAC3G,yHAAyH;AACzH,gHAAgH;AAChH,sGAAsG;AACtG,iGAAiG;AACjG,kFAAkF;AAClF,4GAA4G;AAC5G,EAAE;AACF,sGAAsG;AAEtG,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC,MAAM,CAAC,MAAM,8BAA8B,GAAG,0BAAmC,CAAC;AAElF,MAAM,UAAU,GAAG,gCAAgC,CAAC;AACpD,MAAM,YAAY,GAAG,uBAAuB,CAAC;AAC7C,MAAM,KAAK,GAAG,kBAAkB,CAAC;AAoBjC,uDAAuD;AACvD,MAAM,UAAU,4BAA4B,CAAC,CAAU;IACrD,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAAE,OAAO,CAAC,wBAAwB,C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,CAAC,QAAQ,EAAE,CAAC"}
package/dist/index.d.ts CHANGED
@@ -10,4 +10,6 @@ export type { CandidateSource, CandidateV1, ReceiptSigner } from './ports.js';
10
10
  export type { CampaignBudgetV1, OfferEvaluationV1 } from './campaign.js';
11
11
  export { openCampaign, selectOffer } from './campaign.js';
12
12
  export { fulfillmentReceipt } from './fulfillment.js';
13
+ export { EXTERNAL_OPERATION_INTENT_TYPE, EXTERNAL_OPERATION_STATE, validateExternalOperationRef, externalOperationTermsDigest, externalOperationRef, externalOperationIntent, externalOperationIntentDigest, externalOperationIdempotencyKey, externalOperationConfirmKey, isSameExternalOperation, supersedesExternalOperation, externalApprovedBy, } from './external-operation.js';
14
+ export type { ExternalOperationRefV1, ExternalOperationIntentV1, ExternalApprovedBy, ExternalOperationAuthorityFacts } from './external-operation.js';
13
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,yCAAyC,CAAC;AACnE,eAAO,MAAM,cAAc,EAAG,kBAA2B,CAAC;AAC1D,eAAO,MAAM,QAAQ,2CAA2C,CAAC;AAEjE,YAAY,EACV,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,YAAY,EAAE,oBAAoB,EAChI,mBAAmB,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,sBAAsB,EAAE,UAAU,EAAE,aAAa,EACtH,yBAAyB,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,YAAY,EAChH,+BAA+B,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,sBAAsB,EAChH,oBAAoB,EAAE,kBAAkB,EAAE,eAAe,EAAE,UAAU,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,kBAAkB,GACvI,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB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EAAE,kBAAkB,GACvI,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACrI,YAAY,EAAE,qBAAqB,EAAE,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACrH,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACvH,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC9E,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAGtD,OAAO,EACL,8BAA8B,EAC9B,wBAAwB,EACxB,4BAA4B,EAC5B,4BAA4B,EAC5B,oBAAoB,EACpB,uBAAuB,EACvB,6BAA6B,EAC7B,+BAA+B,EAC/B,2BAA2B,EAC3B,uBAAuB,EACvB,2BAA2B,EAC3B,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC"}
package/dist/index.js CHANGED
@@ -6,4 +6,7 @@ export { digestOf, wireProjection, projectionDigest, probeDigest, offerDigest, a
6
6
  export { initialEngagement, decideEngagement, evolveEngagement, replayEngagement, stepEngagement } from './reducer.js';
7
7
  export { openCampaign, selectOffer } from './campaign.js';
8
8
  export { fulfillmentReceipt } from './fulfillment.js';
9
+ // Spec 442 §5 — an external operation (PAP operation / ACP session / UCP checkout) is an INTENT whose digest a
10
+ // mandate binds; `approved_by` is produced only from a verified mandate or a covering standing wire.
11
+ export { EXTERNAL_OPERATION_INTENT_TYPE, EXTERNAL_OPERATION_STATE, validateExternalOperationRef, externalOperationTermsDigest, externalOperationRef, externalOperationIntent, externalOperationIntentDigest, externalOperationIdempotencyKey, externalOperationConfirmKey, isSameExternalOperation, supersedesExternalOperation, externalApprovedBy, } from './external-operation.js';
9
12
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,sCAAsC,CAAC;AACnE,MAAM,CAAC,MAAM,cAAc,GAAG,kBAA2B,CAAC;AAC1D,MAAM,CAAC,MAAM,QAAQ,GAAG,wCAAwC,CAAC;AASjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAErI,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAGvH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,sCAAsC,CAAC;AACnE,MAAM,CAAC,MAAM,cAAc,GAAG,kBAA2B,CAAC;AAC1D,MAAM,CAAC,MAAM,QAAQ,GAAG,wCAAwC,CAAC;AASjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAErI,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAGvH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,+GAA+G;AAC/G,qGAAqG;AACrG,OAAO,EACL,8BAA8B,EAC9B,wBAAwB,EACxB,4BAA4B,EAC5B,4BAA4B,EAC5B,oBAAoB,EACpB,uBAAuB,EACvB,6BAA6B,EAC7B,+BAA+B,EAC/B,2BAA2B,EAC3B,uBAAuB,EACvB,2BAA2B,EAC3B,kBAAkB,GACnB,MAAM,yBAAyB,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,15 @@
1
1
  {
2
2
  "name": "@agenticprimitives/intent-engagement",
3
- "version": "0.0.0-alpha.2",
3
+ "version": "0.0.0-alpha.20",
4
4
  "description": "Intent engagement protocol core (spec 336 §8): probe → response → offer → acceptance → mandate requirement → execute → receipt as pure documents, JCS digests, and two deterministic reducers. Transport-free; grants nothing.",
5
+ "homepage": "https://agenticprimitives.dev",
6
+ "bugs": {
7
+ "url": "https://github.com/agentictrustlabs/agenticprimitives/issues"
8
+ },
9
+ "author": {
10
+ "name": "Agentic Trust Labs",
11
+ "url": "https://agenticprimitives.dev"
12
+ },
5
13
  "type": "module",
6
14
  "exports": {
7
15
  ".": {
@@ -16,7 +24,7 @@
16
24
  "README.md"
17
25
  ],
18
26
  "devDependencies": {
19
- "vitest": "^4.1.8"
27
+ "vitest": "^4.1.11"
20
28
  },
21
29
  "publishConfig": {
22
30
  "access": "public"
@@ -33,11 +41,16 @@
33
41
  "intent",
34
42
  "engagement",
35
43
  "offer",
36
- "mandate"
44
+ "mandate",
45
+ "agentic-primitives",
46
+ "agenticprimitives",
47
+ "ai-agents",
48
+ "agent-authority",
49
+ "agentic-trust"
37
50
  ],
38
51
  "dependencies": {
39
52
  "viem": "^2.52.2",
40
- "@agenticprimitives/types": "1.0.0-alpha.23"
53
+ "@agenticprimitives/types": "1.0.0-alpha.41"
41
54
  },
42
55
  "scripts": {
43
56
  "build": "tsc -p tsconfig.build.json",