@odingard/guardian-sdk 0.1.0 → 0.2.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/README.md +252 -17
- package/dist/contracts.js +9865 -0
- package/dist/index.js +12976 -1787
- package/dist/public-catalog.v1.json +6915 -0
- package/dist-dts/catalog.d.ts +14 -0
- package/dist-dts/client.d.ts +51 -1
- package/dist-dts/contracts/action-pack.d.ts +464 -0
- package/dist-dts/contracts/action-registry.d.ts +91 -1
- package/dist-dts/contracts/action.d.ts +1408 -17
- package/dist-dts/contracts/agent-state.d.ts +386 -0
- package/dist-dts/contracts/approval.d.ts +224 -5
- package/dist-dts/contracts/assurance.d.ts +60 -0
- package/dist-dts/contracts/authority-graph.d.ts +294 -0
- package/dist-dts/contracts/authority-state.d.ts +17 -2
- package/dist-dts/contracts/authority.d.ts +31 -5
- package/dist-dts/contracts/billing.d.ts +32 -0
- package/dist-dts/contracts/calendar.d.ts +6 -6
- package/dist-dts/contracts/denial.d.ts +648 -0
- package/dist-dts/contracts/evidence.d.ts +73 -16
- package/dist-dts/contracts/execution.d.ts +449 -55
- package/dist-dts/contracts/identifiers.d.ts +16 -0
- package/dist-dts/contracts/index.d.ts +22 -0
- package/dist-dts/contracts/intent.d.ts +335 -0
- package/dist-dts/contracts/lineage.d.ts +218 -0
- package/dist-dts/contracts/local.d.ts +101 -0
- package/dist-dts/contracts/multi-principal.d.ts +292 -0
- package/dist-dts/contracts/multiparty.d.ts +169 -0
- package/dist-dts/contracts/obligation.d.ts +196 -0
- package/dist-dts/contracts/plan.d.ts +67 -0
- package/dist-dts/contracts/policy-simulation.d.ts +681 -0
- package/dist-dts/contracts/prerequisite.d.ts +147 -0
- package/dist-dts/contracts/protected-data.d.ts +67 -0
- package/dist-dts/contracts/receipt.d.ts +3126 -0
- package/dist-dts/contracts/resource-claims.d.ts +146 -0
- package/dist-dts/contracts/runtime.d.ts +111 -0
- package/dist-dts/contracts/safety-envelope.d.ts +287 -0
- package/dist-dts/contracts/sequence.d.ts +132 -0
- package/dist-dts/contracts/sources.d.ts +191 -0
- package/dist-dts/contracts/tools.d.ts +50 -5
- package/dist-dts/contracts/transaction.d.ts +360 -0
- package/dist-dts/contracts-entry.d.ts +1 -0
- package/dist-dts/embedded.d.ts +58 -0
- package/dist-dts/evidence/evidence.d.ts +25 -0
- package/dist-dts/evidence/receipt.d.ts +61 -0
- package/dist-dts/index.d.ts +5 -1
- package/dist-dts/lifecycle.d.ts +25 -0
- package/dist-dts/proposal.d.ts +16 -0
- package/dist-dts/receipts.d.ts +37 -0
- package/package.json +12 -6
- package/dist-dts/__tests__/client.test.d.ts +0 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { type TransactionDeclaration } from "./transaction.js";
|
|
1
2
|
import { type ActionAuthorityFacts } from "./commerce.js";
|
|
3
|
+
import type { ResourceClaim } from "./resource-claims.js";
|
|
2
4
|
import { type ProtectedCatalogEntry } from "./protected-data.js";
|
|
3
5
|
import { type ToolDescriptor } from "./tools.js";
|
|
4
6
|
/**
|
|
@@ -32,6 +34,23 @@ export type ActionConnectionBinding = Readonly<{
|
|
|
32
34
|
shareAllowlist?: readonly string[];
|
|
33
35
|
/** Declared protected fields for this connection (protected_data). */
|
|
34
36
|
protectedCatalog?: readonly ProtectedCatalogEntry[];
|
|
37
|
+
/**
|
|
38
|
+
* WO-016 — provider "guardian" connections bind delegation facts for the
|
|
39
|
+
* requesting agent: which sub-agents are bonded to it, and the parent's
|
|
40
|
+
* derived authority ceiling per target connection. An unbonded child id or
|
|
41
|
+
* a delegation outside the ceiling fails the binding (DENY).
|
|
42
|
+
*/
|
|
43
|
+
bondedSubAgentIds?: readonly string[];
|
|
44
|
+
delegationCeilings?: Readonly<Record<string, {
|
|
45
|
+
actionIds: readonly string[];
|
|
46
|
+
}>>;
|
|
47
|
+
/**
|
|
48
|
+
* WO-021 — the universal Resource Claim projected from this connection's
|
|
49
|
+
* binding facts (guardian.resource-claim.v1). Built-in definitions keep
|
|
50
|
+
* reading the legacy vertical fields above; pack-defined actions evaluate
|
|
51
|
+
* their declarative claim/binding rules against this claim only.
|
|
52
|
+
*/
|
|
53
|
+
claims?: ResourceClaim;
|
|
35
54
|
}>;
|
|
36
55
|
export type ActionBindingResult = Readonly<{
|
|
37
56
|
ok: true;
|
|
@@ -39,6 +58,12 @@ export type ActionBindingResult = Readonly<{
|
|
|
39
58
|
ok: false;
|
|
40
59
|
reasonCode: string;
|
|
41
60
|
}>;
|
|
61
|
+
/**
|
|
62
|
+
* WO-028 (§34) — the full canonical lifecycle declared on consequential
|
|
63
|
+
* action kinds. An intent may union its own declaration on top; the
|
|
64
|
+
* effective lifecycle binds into the canonical action digest.
|
|
65
|
+
*/
|
|
66
|
+
export declare const FULL_TRANSACTION_LIFECYCLE: TransactionDeclaration;
|
|
42
67
|
export interface ActionDefinition<P = unknown> {
|
|
43
68
|
readonly actionId: string;
|
|
44
69
|
readonly schemaVersion: 1;
|
|
@@ -62,6 +87,16 @@ export interface ActionDefinition<P = unknown> {
|
|
|
62
87
|
readonly defaultDecisionPosture: "allow" | "ask" | "deny";
|
|
63
88
|
/** Generic fields the Authority Slip renders. */
|
|
64
89
|
readonly approvalPresentationSchema: readonly string[];
|
|
90
|
+
/**
|
|
91
|
+
* WO-021 — optional labelled display fields. Signed Action Packs set these
|
|
92
|
+
* from their verified `approvalDisplay` metadata so the slip can render
|
|
93
|
+
* trusted labels against the bound material parameters; built-ins leave
|
|
94
|
+
* this unset and keep today's rendering.
|
|
95
|
+
*/
|
|
96
|
+
readonly approvalDisplayFields?: readonly Readonly<{
|
|
97
|
+
field: string;
|
|
98
|
+
label: string;
|
|
99
|
+
}>[];
|
|
65
100
|
readonly capabilityRequirements: Readonly<{
|
|
66
101
|
uses: number;
|
|
67
102
|
}>;
|
|
@@ -78,6 +113,28 @@ export interface ActionDefinition<P = unknown> {
|
|
|
78
113
|
* a human selects it explicitly (WO-015 self-serve-escalation denial).
|
|
79
114
|
*/
|
|
80
115
|
readonly requiresExplicitGrant?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* WO-019 — minimum principal class allowed to hold authority for this
|
|
118
|
+
* action. "adult" marks governance and identity-level actions that a
|
|
119
|
+
* child-classed principal can never be granted: the control plane excludes
|
|
120
|
+
* them when emitting authority for a child, so the kernel DENYs with
|
|
121
|
+
* ACTION_NOT_ALLOWED. Absent means any principal class may hold it.
|
|
122
|
+
*/
|
|
123
|
+
readonly minPrincipalClass?: "adult";
|
|
124
|
+
/**
|
|
125
|
+
* WO-028 (§34–35) — when set, every action of this kind executes under
|
|
126
|
+
* a recorded guardian.transaction.v1 lifecycle. Unioned with the
|
|
127
|
+
* governing intent's own declaration (canonical order; never shrinks);
|
|
128
|
+
* the effective declaration binds into the canonical action digest.
|
|
129
|
+
*/
|
|
130
|
+
readonly transaction?: TransactionDeclaration;
|
|
131
|
+
/**
|
|
132
|
+
* WO-028 (§36) — declared compensation mapping: this action kind
|
|
133
|
+
* compensates `compensatesAction` (e.g. commerce.refund compensates
|
|
134
|
+
* commerce.purchase). A compensating action still runs the full
|
|
135
|
+
* authority path — it never bypasses ASK or enlarges authority.
|
|
136
|
+
*/
|
|
137
|
+
readonly compensatesAction?: string;
|
|
81
138
|
/**
|
|
82
139
|
* Action-specific logic lives HERE — inside the registered definition —
|
|
83
140
|
* never inside the kernel. Hooks receive only kernel-verified inputs.
|
|
@@ -152,6 +209,11 @@ export declare const MCP_INSTALL_DEFINITION: ActionDefinition<{
|
|
|
152
209
|
method: "GET" | "HEAD" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
153
210
|
url: string;
|
|
154
211
|
description?: string | undefined;
|
|
212
|
+
transport?: "http" | undefined;
|
|
213
|
+
} | {
|
|
214
|
+
name: string;
|
|
215
|
+
transport: "record";
|
|
216
|
+
description?: string | undefined;
|
|
155
217
|
};
|
|
156
218
|
}>;
|
|
157
219
|
export declare const MCP_ENABLE_DEFINITION: ActionDefinition<{
|
|
@@ -193,5 +255,33 @@ export declare const SUBSCRIPTION_CREATE_DEFINITION: ActionDefinition<{
|
|
|
193
255
|
interval: "week" | "month" | "year";
|
|
194
256
|
idempotencyKey: string;
|
|
195
257
|
}>;
|
|
196
|
-
|
|
258
|
+
export declare const LOCAL_EXEC_DEFINITION: ActionDefinition<{
|
|
259
|
+
schema: "odingard.guardian.local.exec.v1";
|
|
260
|
+
connectionId: string & import("zod").$brand<"ConnectionId">;
|
|
261
|
+
command: string;
|
|
262
|
+
cwd?: string | undefined;
|
|
263
|
+
}>;
|
|
264
|
+
export declare const LOCAL_EXEC_PUBLISH_DEFINITION: ActionDefinition<{
|
|
265
|
+
schema: "odingard.guardian.local.exec.v1";
|
|
266
|
+
connectionId: string & import("zod").$brand<"ConnectionId">;
|
|
267
|
+
command: string;
|
|
268
|
+
cwd?: string | undefined;
|
|
269
|
+
}>;
|
|
270
|
+
export declare const LOCAL_EXEC_DESTROY_DEFINITION: ActionDefinition<{
|
|
271
|
+
schema: "odingard.guardian.local.exec.v1";
|
|
272
|
+
connectionId: string & import("zod").$brand<"ConnectionId">;
|
|
273
|
+
command: string;
|
|
274
|
+
cwd?: string | undefined;
|
|
275
|
+
}>;
|
|
276
|
+
export declare const LOCAL_EGRESS_DEFINITION: ActionDefinition<{
|
|
277
|
+
schema: "odingard.guardian.local.egress.v1";
|
|
278
|
+
connectionId: string & import("zod").$brand<"ConnectionId">;
|
|
279
|
+
url: string;
|
|
280
|
+
method: "GET" | "HEAD" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS";
|
|
281
|
+
}>;
|
|
282
|
+
export declare const LOCAL_BROWSE_DEFINITION: ActionDefinition<{
|
|
283
|
+
schema: "odingard.guardian.local.browse.v1";
|
|
284
|
+
connectionId: string & import("zod").$brand<"ConnectionId">;
|
|
285
|
+
url: string;
|
|
286
|
+
}>;
|
|
197
287
|
export declare const universalActionRegistry: ActionRegistry;
|