@agenticprimitives/home 0.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Agentic Trust Labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,62 @@
1
+ # @agenticprimitives/home
2
+
3
+ Portable **Agentic Trust Home** contracts ([spec 310](../../specs/310-agentic-trust-home-control-plane-and-inbox.md)):
4
+ the schemas, fail-closed validators, and deterministic projections behind a personal/org
5
+ trust control plane — the place an agent's owner reviews everything acting in their name.
6
+
7
+ A Home serves five surfaces: **identity entry**, **connected apps**, **managed agents**,
8
+ **authority review**, and the **agentic inbox**. This package defines what a Home *publishes
9
+ and renders*; it contains no routes, UI, branding, or deployment specifics (ADR-0021). The
10
+ reference Home app is `demo-sso-next` (spec 234).
11
+
12
+ Two doctrine points shape everything here:
13
+
14
+ - **A Home is a facet, not the identity** (ADR-0010/0011). The Smart Agent address never
15
+ changes when a Home is added, rotated, or deprecated.
16
+ - **A Home renders authority, never mints it.** Approve/deny/issue/revoke route through
17
+ `delegation`/`entitlements`/custody packages; this package only carries `AuthorityRef`
18
+ pointers at their artifacts.
19
+
20
+ ## Surface
21
+
22
+ | Export | What it is |
23
+ | --- | --- |
24
+ | `HomeManifestV1` | Signed, portable discovery document: endpoints, surfaces, capabilities, inbox binding, validity window |
25
+ | `validateHomeManifest` / `isManifestCurrent` | Fail-closed structural + currency gates; unsigned/expired/suspended ⇒ not trusted |
26
+ | `ManifestVerificationPort` | Port for cryptographic proof verification (SA / operator-under-delegation) — wired by the consumer |
27
+ | `HomeInboxBindingV1` | ActivityPub-shaped inbox/outbox declaration: supported message/interaction kinds, crypto + delivery profiles |
28
+ | `HomeActionCardV1` + `validateHomeActionCard` / `resolveCardAction` | Declarative approval card (render half); only declared `allowedActions` resolve — unknown action ⇒ `null` ⇒ reject |
29
+ | `ManagedAgentEntryV1` | "Agents you manage" console row: type, relationship, control grade, status, actions |
30
+ | `ConnectedAppGrantV1` | Connected relying app row; `grantRef` REFERENCES a delegation token |
31
+ | `HomeControlEventV1` | Durable-audit-backed control-plane timeline row |
32
+ | `projectHomeInboxSummary` | Pure deterministic dashboard counts over `messaging` + `interactions` projections |
33
+
34
+ ## Usage
35
+
36
+ ```ts
37
+ import {
38
+ isManifestCurrent,
39
+ resolveCardAction,
40
+ projectHomeInboxSummary,
41
+ } from '@agenticprimitives/home';
42
+
43
+ // Trust gate before using any Home endpoint (reachable ≠ trusted):
44
+ if (!isManifestCurrent(manifest, new Date().toISOString())) throw new Error('untrusted home');
45
+ const ok = await verificationPort.verifyManifestProof(manifest); // consumer-wired crypto
46
+
47
+ // Card response handling — unknown actions are rejections, never defaults:
48
+ const action = resolveCardAction(card, submittedActionId);
49
+ if (!action) return reject('action_not_allowed');
50
+ // action.transition feeds the interactions state machine; it grants nothing.
51
+
52
+ // Dashboard badge:
53
+ const summary = projectHomeInboxSummary({ items, cases, runs });
54
+ // summary.attentionCount = pending approvals + paused runs
55
+ ```
56
+
57
+ ## Boundary
58
+
59
+ Imports `types`, `vault`, `messaging`, `interactions` (types/refs only). Must not import
60
+ `a2a`, `mcp-runtime`, `agent-account`, Next.js, React, or anything host-specific. Status:
61
+ `w1-contracts` — manifest publication and the inbox/console pages land in the reference app
62
+ (spec 310 W2–W5).
@@ -0,0 +1,7 @@
1
+ export declare const PACKAGE_NAME = "@agenticprimitives/home";
2
+ export declare const PACKAGE_STATUS: "w1-contracts";
3
+ export declare const SPEC_REF = "specs/310-agentic-trust-home-control-plane-and-inbox.md";
4
+ export { type ProofRefV1, type PolicyRefV1, type AuditRefV1, type EndpointRefV1, type StoreRefV1, type AppRefV1, type HomeSurfaceKind, type HomeSurfaceDescriptorV1, type HomeEndpointSetV1, type HomeCapabilityCardV1, type HomeCryptoProfileDescriptorV1, type HomeInboxBindingV1, type HomeManifestV1, type HomeContextV1, type ManagedAgentEntryV1, type ConnectedAppGrantV1, type HomeCardUiProfile, type HomeActionCardKind, type HomeActionDescriptorV1, type HomeActionCardV1, type HomeControlEventV1, } from './types.js';
5
+ export { type ManifestValidationError, validateHomeManifest, isManifestCurrent, type ManifestVerificationPort, type CardValidationError, validateHomeActionCard, resolveCardAction, } from './validate.js';
6
+ export { type HomeInboxSummaryV1, projectHomeInboxSummary } from './projection.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,YAAY,4BAA4B,CAAC;AACtD,eAAO,MAAM,cAAc,EAAG,cAAuB,CAAC;AACtD,eAAO,MAAM,QAAQ,4DAA4D,CAAC;AAElF,OAAO,EACL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,6BAA6B,EAClC,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,GACxB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,KAAK,uBAAuB,EAC5B,oBAAoB,EACpB,iBAAiB,EACjB,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,KAAK,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,15 @@
1
+ // @agenticprimitives/home — portable Agentic Trust Home contracts (spec 310).
2
+ // W1 slice: schemas + fail-closed validators for the manifest, surfaces, inbox
3
+ // binding, action cards (render half), managed-agent/connected-app
4
+ // projections, control-plane events — plus the deterministic inbox summary.
5
+ //
6
+ // Doctrine: a Home is a facet, not the identity (ADR-0010); it renders
7
+ // authority, never mints it; this package contains no routes, UI, branding, or
8
+ // deployment specifics (ADR-0021). Apps (e.g. the reference Home in
9
+ // demo-sso-next, spec 234) own rendering, publication, and storage.
10
+ export const PACKAGE_NAME = '@agenticprimitives/home';
11
+ export const PACKAGE_STATUS = 'w1-contracts';
12
+ export const SPEC_REF = 'specs/310-agentic-trust-home-control-plane-and-inbox.md';
13
+ export { validateHomeManifest, isManifestCurrent, validateHomeActionCard, resolveCardAction, } from './validate.js';
14
+ export { projectHomeInboxSummary } from './projection.js';
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,+EAA+E;AAC/E,mEAAmE;AACnE,4EAA4E;AAC5E,EAAE;AACF,uEAAuE;AACvE,+EAA+E;AAC/E,oEAAoE;AACpE,oEAAoE;AAEpE,MAAM,CAAC,MAAM,YAAY,GAAG,yBAAyB,CAAC;AACtD,MAAM,CAAC,MAAM,cAAc,GAAG,cAAuB,CAAC;AACtD,MAAM,CAAC,MAAM,QAAQ,GAAG,yDAAyD,CAAC;AA0BlF,OAAO,EAEL,oBAAoB,EACpB,iBAAiB,EAGjB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAA2B,uBAAuB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,26 @@
1
+ import type { FolderKind, InboxItemV1 } from '@agenticprimitives/fabric/messaging';
2
+ import type { InteractionCaseV1, InteractionRunV1 } from '@agenticprimitives/fabric/interactions';
3
+ export interface HomeInboxSummaryV1 {
4
+ type: 'ap.home.inbox-summary.v1';
5
+ /** Unread message count per folder, folders sorted alphabetically. */
6
+ folders: Array<{
7
+ folder: FolderKind;
8
+ total: number;
9
+ unread: number;
10
+ }>;
11
+ unreadTotal: number;
12
+ /** Cases awaiting this Home's decision (submitted/triaged). */
13
+ pendingApprovals: number;
14
+ /** Cases waiting on the REQUESTER to answer (needs-info). */
15
+ needsInfo: number;
16
+ /** Runs paused on a human/agent interrupt. */
17
+ pausedRuns: number;
18
+ /** Highest-signal single number for a badge: approvals + paused runs. */
19
+ attentionCount: number;
20
+ }
21
+ export declare function projectHomeInboxSummary(input: {
22
+ items: readonly InboxItemV1[];
23
+ cases?: readonly InteractionCaseV1[];
24
+ runs?: readonly InteractionRunV1[];
25
+ }): HomeInboxSummaryV1;
26
+ //# sourceMappingURL=projection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../src/projection.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AACnF,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAOlG,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,0BAA0B,CAAC;IACjC,sEAAsE;IACtE,OAAO,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,UAAU,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtE,WAAW,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,gBAAgB,EAAE,MAAM,CAAC;IACzB,6DAA6D;IAC7D,SAAS,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE;IAC7C,KAAK,EAAE,SAAS,WAAW,EAAE,CAAC;IAC9B,KAAK,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACrC,IAAI,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;CACpC,GAAG,kBAAkB,CA6BrB"}
@@ -0,0 +1,37 @@
1
+ // Deterministic Home inbox summary (spec 310 §4): the counts the Home's
2
+ // dashboard renders — unread messages, pending approvals, needs-info, paused
3
+ // runs — computed as a pure function over the `messaging` + `interactions`
4
+ // projections. Same inputs ⇒ same summary, always.
5
+ /** Interaction states awaiting a RESPONDER decision (the Home's review queue). 13→11 reconciliation:
6
+ * `delivered`/`seen` are no longer case states (they are inbox `unread` facts) — a case the Home has
7
+ * received-but-not-decided is `submitted`; a case it is actively working is `triaged`. */
8
+ const AWAITING_DECISION = ['submitted', 'triaged'];
9
+ export function projectHomeInboxSummary(input) {
10
+ const byFolder = new Map();
11
+ let unreadTotal = 0;
12
+ for (const item of input.items) {
13
+ const f = byFolder.get(item.folder) ?? { total: 0, unread: 0 };
14
+ f.total += 1;
15
+ if (item.unread) {
16
+ f.unread += 1;
17
+ unreadTotal += 1;
18
+ }
19
+ byFolder.set(item.folder, f);
20
+ }
21
+ const cases = input.cases ?? [];
22
+ const pendingApprovals = cases.filter((c) => AWAITING_DECISION.includes(c.state)).length;
23
+ const needsInfo = cases.filter((c) => c.state === 'needs-info').length;
24
+ const pausedRuns = (input.runs ?? []).filter((r) => r.state === 'paused').length;
25
+ return {
26
+ type: 'ap.home.inbox-summary.v1',
27
+ folders: [...byFolder.entries()]
28
+ .map(([folder, counts]) => ({ folder, ...counts }))
29
+ .sort((a, b) => a.folder.localeCompare(b.folder)),
30
+ unreadTotal,
31
+ pendingApprovals,
32
+ needsInfo,
33
+ pausedRuns,
34
+ attentionCount: pendingApprovals + pausedRuns,
35
+ };
36
+ }
37
+ //# sourceMappingURL=projection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projection.js","sourceRoot":"","sources":["../src/projection.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,6EAA6E;AAC7E,2EAA2E;AAC3E,mDAAmD;AAKnD;;2FAE2F;AAC3F,MAAM,iBAAiB,GAA0C,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AAiB1F,MAAM,UAAU,uBAAuB,CAAC,KAIvC;IACC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAiD,CAAC;IAC1E,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QAC/B,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;QAC/D,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC;QACb,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC;YACd,WAAW,IAAI,CAAC,CAAC;QACnB,CAAC;QACD,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC/B,CAAC;IAED,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;IAChC,MAAM,gBAAgB,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;IACzF,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,YAAY,CAAC,CAAC,MAAM,CAAC;IACvE,MAAM,UAAU,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,MAAM,CAAC;IAEjF,OAAO;QACL,IAAI,EAAE,0BAA0B;QAChC,OAAO,EAAE,CAAC,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC;aAC7B,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;aAClD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QACnD,WAAW;QACX,gBAAgB;QAChB,SAAS;QACT,UAAU;QACV,cAAc,EAAE,gBAAgB,GAAG,UAAU;KAC9C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,145 @@
1
+ import type { CanonicalAgentId } from '@agenticprimitives/types';
2
+ import type { VaultRef } from '@agenticprimitives/vault';
3
+ import type { SignatureProof } from '@agenticprimitives/fabric/messaging';
4
+ import type { AuthorityRef, InteractionTransitionType } from '@agenticprimitives/fabric/interactions';
5
+ /** Signature over the canonical form of a Home artifact. Verification (SA /
6
+ * ERC-1271 / operator-under-delegation) is the consumer runtime's job. */
7
+ export type ProofRefV1 = SignatureProof;
8
+ /** Opaque pointer at a policy document (by id/URI) — never embedded. */
9
+ export type PolicyRefV1 = string;
10
+ /** Opaque pointer at an audit row/chain entry backing a control-plane event. */
11
+ export type AuditRefV1 = string;
12
+ /** A reachable surface endpoint (URL or URI template). A surface, not identity. */
13
+ export type EndpointRefV1 = string;
14
+ /** Opaque pointer at a store (vault namespace, projection stream id, …). */
15
+ export type StoreRefV1 = string;
16
+ /** A relying app, by its canonical agent id or registered client id. */
17
+ export type AppRefV1 = string;
18
+ /** The five Home surfaces (spec 310 §2). */
19
+ export type HomeSurfaceKind = 'identity-entry' | 'connected-apps' | 'managed-agents' | 'authority-review' | 'inbox';
20
+ export interface HomeSurfaceDescriptorV1 {
21
+ surface: HomeSurfaceKind;
22
+ /** How capable this Home's implementation of the surface is. */
23
+ level: 'view' | 'act' | 'full';
24
+ endpoint?: EndpointRefV1;
25
+ }
26
+ export interface HomeEndpointSetV1 {
27
+ sso?: EndpointRefV1;
28
+ a2a?: EndpointRefV1;
29
+ inbox?: EndpointRefV1;
30
+ outbox?: EndpointRefV1;
31
+ wellKnown?: EndpointRefV1;
32
+ }
33
+ export interface HomeCapabilityCardV1 {
34
+ supportedMessageKinds: string[];
35
+ supportedInteractionKinds: string[];
36
+ supportedCardProfiles: HomeCardUiProfile[];
37
+ supportedCredentialFormats?: string[];
38
+ }
39
+ export interface HomeCryptoProfileDescriptorV1 {
40
+ profile: string;
41
+ keyRef?: string;
42
+ }
43
+ export interface HomeInboxBindingV1 {
44
+ owner: CanonicalAgentId;
45
+ inboxEndpoint?: EndpointRefV1;
46
+ outboxEndpoint?: EndpointRefV1;
47
+ messageStoreRef?: StoreRefV1;
48
+ interactionStoreRef?: StoreRefV1;
49
+ projectionStoreRef?: StoreRefV1;
50
+ supportedMessageKinds: string[];
51
+ supportedInteractionKinds: string[];
52
+ supportedCryptoProfiles: string[];
53
+ supportedDeliveryProfiles: string[];
54
+ }
55
+ /**
56
+ * The signed, portable Home manifest — how any counterparty discovers what
57
+ * this agent's Home serves. Publication route (well-known / profile / A2A
58
+ * AgentCard) is the app's choice; the primitive owns only the schema.
59
+ */
60
+ export interface HomeManifestV1 {
61
+ type: 'ap.home.manifest.v1';
62
+ homeId: string;
63
+ /** The identity this Home is a facet of (ADR-0010). */
64
+ owner: CanonicalAgentId;
65
+ /** Who runs the Home, when it differs from the owner. */
66
+ operator?: CanonicalAgentId;
67
+ status: 'active' | 'rotating' | 'deprecated' | 'suspended';
68
+ endpoints: HomeEndpointSetV1;
69
+ surfaces: HomeSurfaceDescriptorV1[];
70
+ capabilities: HomeCapabilityCardV1;
71
+ inbox?: HomeInboxBindingV1;
72
+ cryptoProfiles?: HomeCryptoProfileDescriptorV1[];
73
+ policyRefs?: PolicyRefV1[];
74
+ validFrom: string;
75
+ validUntil?: string;
76
+ proof: ProofRefV1;
77
+ }
78
+ /** Which agent context a Home session is operating as (owner may steward many). */
79
+ export interface HomeContextV1 {
80
+ homeId: string;
81
+ subject: CanonicalAgentId;
82
+ activeAgent: CanonicalAgentId;
83
+ surfaces: HomeSurfaceKind[];
84
+ }
85
+ export interface ManagedAgentEntryV1 {
86
+ agent: CanonicalAgentId;
87
+ agentType: 'person' | 'organization' | 'service' | 'treasury' | 'vault' | 'device';
88
+ relationship: 'self' | 'owned_by_subject' | 'administered_by_subject' | 'delegated_to_subject' | 'represented_by_subject' | 'service_for_subject';
89
+ controlGrade: 'view' | 'operate' | 'admin' | 'custody' | 'root';
90
+ status: 'active' | 'pending' | 'disabled' | 'revoked';
91
+ supportedActions: HomeActionDescriptorV1[];
92
+ }
93
+ /** A connected relying app and the delegation backing it — the grant is a
94
+ * REFERENCE to a `delegation` token, never a new authority object. */
95
+ export interface ConnectedAppGrantV1 {
96
+ app: AppRefV1;
97
+ grantRef: AuthorityRef;
98
+ scope: string[];
99
+ grantedAt: string;
100
+ expiresAt?: string;
101
+ status: 'active' | 'expired' | 'revoked';
102
+ }
103
+ export type HomeCardUiProfile = 'agenticprimitives-card-v1' | 'a2ui' | 'open-json-ui' | 'mcp-ui-resource';
104
+ /** Same vocabulary as `interactions`' ActionCardKind (transport half) so a
105
+ * received card maps 1:1 onto its render descriptor. */
106
+ export type HomeActionCardKind = 'access-request' | 'entitlement-request' | 'credential-review' | 'tool-approval' | 'delegation-review' | 'policy-exception' | 'revocation-notice' | 'needs-information';
107
+ /** An action a card/agent-entry offers. Pressing it can only PROPOSE a signed
108
+ * lifecycle transition — it grants nothing (spec 310 §6.3). */
109
+ export interface HomeActionDescriptorV1 {
110
+ actionId: string;
111
+ label: string;
112
+ transition: InteractionTransitionType;
113
+ style?: 'primary' | 'secondary' | 'destructive';
114
+ inputSchemaRef?: string;
115
+ }
116
+ /** The RENDER half of the declarative card (transport half is `interactions`'
117
+ * ActionCardV1): the Home chooses trusted native components per `uiProfile` —
118
+ * arbitrary remote UI never executes by default (spec 310 §4.1). */
119
+ export interface HomeActionCardV1 {
120
+ type: 'ap.home.action-card.v1';
121
+ cardId: string;
122
+ interactionId: string;
123
+ messageId?: string;
124
+ cardKind: HomeActionCardKind;
125
+ title: string;
126
+ summary?: string;
127
+ dataRefs: VaultRef[];
128
+ /** Ref to a signed ActionRiskMetadataV1 (spec 309) backing the risk display. */
129
+ risk?: string;
130
+ allowedActions: HomeActionDescriptorV1[];
131
+ uiProfile: HomeCardUiProfile;
132
+ schemaRef?: string;
133
+ proof: ProofRefV1;
134
+ }
135
+ /** Control-plane audit projection — a durable-audit-backed timeline row. */
136
+ export interface HomeControlEventV1 {
137
+ type: 'ap.home.control-event.v1';
138
+ homeId: string;
139
+ actor: CanonicalAgentId;
140
+ eventType: 'grant-issued' | 'grant-revoked' | 'agent-added' | 'agent-disabled' | 'credential-issued' | 'credential-received' | 'inbox-decision' | 'home-rotated';
141
+ at: string;
142
+ refs: (AuthorityRef | VaultRef)[];
143
+ auditRef: AuditRefV1;
144
+ }
145
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAgB,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAEtG;2EAC2E;AAC3E,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC;AAExC,wEAAwE;AACxE,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC,gFAAgF;AAChF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC,mFAAmF;AACnF,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC,4EAA4E;AAC5E,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC,wEAAwE;AACxE,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B,4CAA4C;AAC5C,MAAM,MAAM,eAAe,GACvB,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,OAAO,CAAC;AAEZ,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,eAAe,CAAC;IACzB,gEAAgE;IAChE,KAAK,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;IAC/B,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B;AAED,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,S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ctrine: a Home is a FACET of a Smart Agent, never the identity (ADR-0010);
4
+ // it RENDERS authority, never mints it; endpoints are surfaces subject to edge
5
+ // admission (ADR-0043), not authorization. This package is schema + validation
6
+ // + deterministic projection — no routes, no UI, no branding (ADR-0021).
7
+ export {};
8
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,EAAE;AACF,+EAA+E;AAC/E,+EAA+E;AAC/E,+EAA+E;AAC/E,yEAAyE"}
@@ -0,0 +1,23 @@
1
+ import type { HomeActionCardV1, HomeManifestV1, HomeActionDescriptorV1 } from './types.js';
2
+ export type ManifestValidationError = 'bad_type' | 'missing_home_id' | 'missing_owner' | 'bad_status' | 'no_surfaces' | 'bad_surface' | 'duplicate_surface' | 'bad_valid_from' | 'bad_valid_until' | 'expires_before_valid_from' | 'missing_proof' | 'proof_signer_not_owner_or_operator';
3
+ /** Structural gate. Empty array ⇔ structurally admissible. */
4
+ export declare function validateHomeManifest(m: HomeManifestV1): ManifestValidationError[];
5
+ /**
6
+ * Currency gate (spec 310 §6.2): an unsigned, structurally invalid, expired,
7
+ * not-yet-valid, or suspended manifest is NOT trusted. Fail-closed.
8
+ */
9
+ export declare function isManifestCurrent(m: HomeManifestV1, atIso: string): boolean;
10
+ /** Port for the check this package must not implement: verify `proof` against
11
+ * the owner SA (ERC-1271) or the operator's delegation. Consumers wire it. */
12
+ export interface ManifestVerificationPort {
13
+ verifyManifestProof(manifest: HomeManifestV1): Promise<boolean>;
14
+ }
15
+ export type CardValidationError = 'bad_type' | 'empty_title' | 'no_actions' | 'duplicate_action_id' | 'missing_proof';
16
+ export declare function validateHomeActionCard(card: HomeActionCardV1): CardValidationError[];
17
+ /**
18
+ * Allowed-actions enforcement (spec 310 §6.4): a user/agent response to a card
19
+ * may only invoke an action the card declared. Returns the descriptor or null
20
+ * — a null MUST be treated as a rejection, never a default action.
21
+ */
22
+ export declare function resolveCardAction(card: HomeActionCardV1, actionId: string): HomeActionDescriptorV1 | null;
23
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EACvB,MAAM,YAAY,CAAC;AAepB,MAAM,MAAM,uBAAuB,GAC/B,UAAU,GACV,iBAAiB,GACjB,eAAe,GACf,YAAY,GACZ,aAAa,GACb,aAAa,GACb,mBAAmB,GACnB,gBAAgB,GAChB,iBAAiB,GACjB,2BAA2B,GAC3B,eAAe,GACf,oCAAoC,CAAC;AAEzC,8DAA8D;AAC9D,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,cAAc,GAAG,uBAAuB,EAAE,CAgCjF;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAO3E;AAED;+EAC+E;AAC/E,MAAM,WAAW,wBAAwB;IACvC,mBAAmB,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACjE;AAED,MAAM,MAAM,mBAAmB,GAC3B,UAAU,GACV,aAAa,GACb,YAAY,GACZ,qBAAqB,GACrB,eAAe,CAAC;AAEpB,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,gBAAgB,GAAG,mBAAmB,EAAE,CAapF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,gBAAgB,EACtB,QAAQ,EAAE,MAAM,GACf,sBAAsB,GAAG,IAAI,CAE/B"}
@@ -0,0 +1,94 @@
1
+ // Fail-closed structural validation for Home artifacts (spec 310 §6).
2
+ // Structural only — cryptographic verification of `proof` (owner SA / operator
3
+ // under delegation) is the consumer runtime's job, behind the port below.
4
+ const MANIFEST_STATUSES = ['active', 'rotating', 'deprecated', 'suspended'];
5
+ const SURFACE_KINDS = [
6
+ 'identity-entry',
7
+ 'connected-apps',
8
+ 'managed-agents',
9
+ 'authority-review',
10
+ 'inbox',
11
+ ];
12
+ function isIsoDate(s) {
13
+ return typeof s === 'string' && !Number.isNaN(Date.parse(s));
14
+ }
15
+ /** Structural gate. Empty array ⇔ structurally admissible. */
16
+ export function validateHomeManifest(m) {
17
+ const errors = [];
18
+ if (m.type !== 'ap.home.manifest.v1')
19
+ errors.push('bad_type');
20
+ if (!m.homeId?.trim())
21
+ errors.push('missing_home_id');
22
+ if (!m.owner)
23
+ errors.push('missing_owner');
24
+ if (!MANIFEST_STATUSES.includes(m.status))
25
+ errors.push('bad_status');
26
+ if (!Array.isArray(m.surfaces) || m.surfaces.length === 0) {
27
+ errors.push('no_surfaces');
28
+ }
29
+ else {
30
+ if (m.surfaces.some((s) => !SURFACE_KINDS.includes(s.surface)))
31
+ errors.push('bad_surface');
32
+ if (new Set(m.surfaces.map((s) => s.surface)).size !== m.surfaces.length) {
33
+ errors.push('duplicate_surface');
34
+ }
35
+ }
36
+ if (!isIsoDate(m.validFrom))
37
+ errors.push('bad_valid_from');
38
+ if (m.validUntil !== undefined) {
39
+ if (!isIsoDate(m.validUntil))
40
+ errors.push('bad_valid_until');
41
+ else if (isIsoDate(m.validFrom) && Date.parse(m.validUntil) <= Date.parse(m.validFrom)) {
42
+ errors.push('expires_before_valid_from');
43
+ }
44
+ }
45
+ if (!m.proof?.signature) {
46
+ errors.push('missing_proof');
47
+ }
48
+ else if (m.proof.signer !== m.owner && (m.operator === undefined || m.proof.signer !== m.operator)) {
49
+ // Spec 310 §6.2: signed by the owner SA, or the operator under delegation.
50
+ errors.push('proof_signer_not_owner_or_operator');
51
+ }
52
+ return errors;
53
+ }
54
+ /**
55
+ * Currency gate (spec 310 §6.2): an unsigned, structurally invalid, expired,
56
+ * not-yet-valid, or suspended manifest is NOT trusted. Fail-closed.
57
+ */
58
+ export function isManifestCurrent(m, atIso) {
59
+ if (validateHomeManifest(m).length > 0)
60
+ return false;
61
+ if (m.status === 'suspended' || m.status === 'deprecated')
62
+ return false;
63
+ const at = Date.parse(atIso);
64
+ if (at < Date.parse(m.validFrom))
65
+ return false;
66
+ if (m.validUntil !== undefined && at >= Date.parse(m.validUntil))
67
+ return false;
68
+ return true;
69
+ }
70
+ export function validateHomeActionCard(card) {
71
+ const errors = [];
72
+ if (card.type !== 'ap.home.action-card.v1')
73
+ errors.push('bad_type');
74
+ if (!card.title?.trim())
75
+ errors.push('empty_title');
76
+ if (!Array.isArray(card.allowedActions) || card.allowedActions.length === 0) {
77
+ errors.push('no_actions');
78
+ }
79
+ else if (new Set(card.allowedActions.map((a) => a.actionId)).size !== card.allowedActions.length) {
80
+ errors.push('duplicate_action_id');
81
+ }
82
+ if (!card.proof?.signature)
83
+ errors.push('missing_proof');
84
+ return errors;
85
+ }
86
+ /**
87
+ * Allowed-actions enforcement (spec 310 §6.4): a user/agent response to a card
88
+ * may only invoke an action the card declared. Returns the descriptor or null
89
+ * — a null MUST be treated as a rejection, never a default action.
90
+ */
91
+ export function resolveCardAction(card, actionId) {
92
+ return card.allowedActions.find((a) => a.actionId === actionId) ?? null;
93
+ }
94
+ //# sourceMappingURL=validate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.js","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,+EAA+E;AAC/E,0EAA0E;AAQ1E,MAAM,iBAAiB,GAAG,CAAC,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,CAAU,CAAC;AACrF,MAAM,aAAa,GAAG;IACpB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,kBAAkB;IAClB,OAAO;CACC,CAAC;AAEX,SAAS,SAAS,CAAC,CAAS;IAC1B,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;A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Q,CAAC,IAAI,IAAI,CAAC;AAC1E,CAAC"}
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@agenticprimitives/home",
3
+ "version": "0.0.0-alpha.1",
4
+ "description": "Portable Agentic Trust Home contracts (spec 310): signed Home manifests, surface descriptors, inbox bindings, action cards, managed-agent/connected-app projections, control-plane events. Schema + validation + deterministic projection only — no routes, UI, or branding.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/agentictrustlabs/agenticprimitives.git",
9
+ "directory": "packages/home"
10
+ },
11
+ "homepage": "https://github.com/agentictrustlabs/agenticprimitives/tree/master/packages/home",
12
+ "bugs": {
13
+ "url": "https://github.com/agentictrustlabs/agenticprimitives/issues"
14
+ },
15
+ "type": "module",
16
+ "main": "./dist/index.js",
17
+ "types": "./dist/index.d.ts",
18
+ "exports": {
19
+ ".": {
20
+ "types": "./dist/index.d.ts",
21
+ "import": "./dist/index.js"
22
+ }
23
+ },
24
+ "files": [
25
+ "LICENSE",
26
+ "dist",
27
+ "spec.md",
28
+ "README.md"
29
+ ],
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
33
+ "dependencies": {
34
+ "@agenticprimitives/fabric": "0.0.0-alpha.1",
35
+ "@agenticprimitives/types": "1.0.0-alpha.17",
36
+ "@agenticprimitives/vault": "0.0.0-alpha.2"
37
+ },
38
+ "devDependencies": {
39
+ "vitest": "^4.1.8",
40
+ "@types/node": "^22.7.0"
41
+ },
42
+ "keywords": [
43
+ "agentic",
44
+ "primitives",
45
+ "home",
46
+ "control-plane",
47
+ "inbox",
48
+ "smart-agent"
49
+ ],
50
+ "scripts": {
51
+ "build": "tsc -p tsconfig.build.json",
52
+ "typecheck": "tsc -p tsconfig.json --noEmit",
53
+ "test": "vitest run",
54
+ "test:unit": "vitest run test/unit --passWithNoTests",
55
+ "test:watch": "vitest",
56
+ "clean": "rm -rf dist"
57
+ }
58
+ }
package/spec.md ADDED
@@ -0,0 +1,20 @@
1
+ # @agenticprimitives/home — spec
2
+
3
+ Full design: [`../../specs/310-agentic-trust-home-control-plane-and-inbox.md`](../../specs/310-agentic-trust-home-control-plane-and-inbox.md).
4
+
5
+ This release (W1) implements the **portable contracts**: `HomeManifestV1` + fail-closed
6
+ validation/currency gates, `HomeInboxBindingV1`, `HomeActionCardV1` (render half) with
7
+ allowed-actions enforcement, `ManagedAgentEntryV1`/`ConnectedAppGrantV1` projections,
8
+ `HomeControlEventV1`, and the deterministic `projectHomeInboxSummary`. Remaining: manifest
9
+ publication + inbox/console pages in `demo-sso-next` (W2–W5, app layer).
10
+
11
+ Architecture decisions:
12
+ - [ADR-0010](../../docs/architecture/decisions/0010-smart-agent-canonical-identifier.md) /
13
+ [ADR-0011](../../docs/architecture/decisions/0011-credential-recovery-and-re-association.md) —
14
+ a Home is a facet; the SA address never changes when a Home rotates.
15
+ - [ADR-0013](../../docs/architecture/decisions/0013-no-silent-fallbacks.md) — unknown card
16
+ action ⇒ reject; manifest proof verification has one mechanism, behind a port.
17
+ - [ADR-0021](../../docs/architecture/decisions/0021-generic-packages-vs-white-label-apps.md) —
18
+ no branding/routes/deployment content; `demo-sso-next` owns the product surface.
19
+
20
+ Do not edit a divergent copy here — edit the canonical spec.