@atlasauth/pca-agent 0.0.0-stage → 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/LICENSE +21 -0
- package/README.md +63 -2
- package/dist/agent.d.ts +128 -0
- package/dist/agent.js +183 -0
- package/dist/agent.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/package.json +54 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Atlas Authorization
|
|
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
CHANGED
|
@@ -1,3 +1,64 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @atlasauth/pca-agent
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Agent-side client for Proof-Carrying Authority (PCA). It commits a plan, builds and signs a PCActn (a proof-carrying action) for a plan node, posts it to a resource server, handles step-up approval, delegates attenuated authority to sub-agents, and checks ledger inclusion receipts.
|
|
4
|
+
|
|
5
|
+
The client talks to a resource server that exposes the PCA HTTP surface: `POST /v1/pca/plans`, `POST /v1/pca/actions` and `GET /v1/pca/stepups/:id` (the hosted Atlas API does, and so can your own server). `act` emits a proof; it does not authorize anything on its own. The resource server's verifier decides allow, step-up or deny.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm i @atlasauth/pca-agent
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Depends on `@atlasauth/pca` (installed transitively).
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { createAgent } from '@atlasauth/pca-agent';
|
|
19
|
+
|
|
20
|
+
const client = createAgent({
|
|
21
|
+
grant, // principal-signed Capability (see @atlasauth/pca)
|
|
22
|
+
agentSecret, // Ed25519 secret key (32 bytes) of the leaf holder
|
|
23
|
+
rsBaseUrl: 'https://api.example.com',
|
|
24
|
+
audience: 'ins_acme', // required: the id the resource server verifies against
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// 1. Commit the principal-authorised plan (once).
|
|
28
|
+
await client.commitPlan([{ id: 'refund-1', verb: 'stripe.refund', resource: 'ch_123' }]);
|
|
29
|
+
|
|
30
|
+
// 2. Act on a plan node: builds and signs a PCActn, then POSTs it.
|
|
31
|
+
const res = await client.act('refund-1', { amount: 500 });
|
|
32
|
+
|
|
33
|
+
if (res.status === 'allowed') {
|
|
34
|
+
client.verifyReceipt(res.receipt); // ledger inclusion proof -> boolean
|
|
35
|
+
} else if (res.status === 'step_up') {
|
|
36
|
+
const outcome = await client.awaitStepUp(res.stepupId); // polls for human co-sign
|
|
37
|
+
} else if (res.status === 'denied') {
|
|
38
|
+
console.log(res.verdict.reason);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// 3. Hand a narrower slice of authority to a sub-agent.
|
|
42
|
+
const sub = client.delegate({
|
|
43
|
+
toPublic: subAgentPublicKey,
|
|
44
|
+
addedCaveats: [{ type: 'ttl', secs: 60 }],
|
|
45
|
+
agentSecret: subAgentSecret,
|
|
46
|
+
});
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
`audience` is required because a PCActn only verifies at the audience it names, which stops it being replayed at another server. A fresh random nonce is stamped on each action by default, and the per-action counter only moves forward. `act` resolves to `{ status: 'error', error }` (a `PcaAgentError`) for local failures such as calling before `commitPlan` or an unknown node id. Pass `fetch` to supply your own HTTP client.
|
|
50
|
+
|
|
51
|
+
## API
|
|
52
|
+
|
|
53
|
+
- `createAgent(options)` returns an `AgentClient` with `commitPlan`, `act`, `awaitStepUp`, `delegate`, `verifyReceipt`, plus `grant`, `chain`, `counter`, `budget`, `planRoot`.
|
|
54
|
+
- Types: `ActResult`, `StepUpOutcome`, `Receipt`, `Verdict`, `ActSlots` (optional signed slots such as `caution`), `PcaAgentError`.
|
|
55
|
+
|
|
56
|
+
## Status
|
|
57
|
+
|
|
58
|
+
Experimental. The underlying cryptography in `@atlasauth/pca` has not been independently audited.
|
|
59
|
+
|
|
60
|
+
Source and issues: https://github.com/Atlas-Authorization/pca
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
MIT - see LICENSE
|
package/dist/agent.d.ts
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { type Capability, type CapabilityChain, type Caveat, type InclusionProof, type PCActn, type PlanNode } from '@atlasauth/pca';
|
|
2
|
+
export type FetchLike = (url: string, init?: {
|
|
3
|
+
method?: string;
|
|
4
|
+
headers?: Record<string, string>;
|
|
5
|
+
body?: string;
|
|
6
|
+
}) => Promise<{
|
|
7
|
+
status: number;
|
|
8
|
+
json(): Promise<unknown>;
|
|
9
|
+
}>;
|
|
10
|
+
export interface TrustBudget {
|
|
11
|
+
B: number;
|
|
12
|
+
tau: number;
|
|
13
|
+
asOf: number;
|
|
14
|
+
}
|
|
15
|
+
export interface Verdict {
|
|
16
|
+
allow: boolean;
|
|
17
|
+
checks?: Record<string, string>;
|
|
18
|
+
reason?: string;
|
|
19
|
+
budget?: TrustBudget;
|
|
20
|
+
[k: string]: unknown;
|
|
21
|
+
}
|
|
22
|
+
export interface Receipt {
|
|
23
|
+
grant_ref?: string;
|
|
24
|
+
index: number;
|
|
25
|
+
commit: string;
|
|
26
|
+
root: string;
|
|
27
|
+
size?: number;
|
|
28
|
+
inclusion_proof: InclusionProof;
|
|
29
|
+
}
|
|
30
|
+
export type StepUpOutcome = {
|
|
31
|
+
status: 'approved';
|
|
32
|
+
pcactn?: PCActn;
|
|
33
|
+
[k: string]: unknown;
|
|
34
|
+
} | {
|
|
35
|
+
status: 'denied';
|
|
36
|
+
[k: string]: unknown;
|
|
37
|
+
} | {
|
|
38
|
+
status: 'expired';
|
|
39
|
+
[k: string]: unknown;
|
|
40
|
+
} | {
|
|
41
|
+
status: 'timeout';
|
|
42
|
+
};
|
|
43
|
+
export type ActResult = {
|
|
44
|
+
status: 'allowed';
|
|
45
|
+
verdict: Verdict;
|
|
46
|
+
receipt: Receipt;
|
|
47
|
+
pcactn: PCActn;
|
|
48
|
+
} | {
|
|
49
|
+
status: 'denied';
|
|
50
|
+
verdict: Verdict;
|
|
51
|
+
httpStatus: number;
|
|
52
|
+
pcactn: PCActn;
|
|
53
|
+
} | {
|
|
54
|
+
status: 'step_up';
|
|
55
|
+
stepupId: string;
|
|
56
|
+
requiredT: number;
|
|
57
|
+
pcactn: PCActn;
|
|
58
|
+
} | {
|
|
59
|
+
status: 'error';
|
|
60
|
+
error: PcaAgentError;
|
|
61
|
+
};
|
|
62
|
+
export declare class PcaAgentError extends Error {
|
|
63
|
+
readonly code: 'no_plan' | 'unknown_node' | 'no_secret' | 'network' | 'bad_response' | 'build_failed';
|
|
64
|
+
readonly httpStatus?: number | undefined;
|
|
65
|
+
constructor(code: 'no_plan' | 'unknown_node' | 'no_secret' | 'network' | 'bad_response' | 'build_failed', message: string, httpStatus?: number | undefined);
|
|
66
|
+
}
|
|
67
|
+
export interface CreateAgentOptions {
|
|
68
|
+
grant: Capability;
|
|
69
|
+
/** Capability chain starting at the grant; defaults to `[grant]`. */
|
|
70
|
+
chain?: CapabilityChain;
|
|
71
|
+
/** Ed25519 secret key (32 bytes) of the leaf holder. Omit only for a sub-agent client you do not drive. */
|
|
72
|
+
agentSecret?: Uint8Array;
|
|
73
|
+
/** b64u public key of the agent (informational). */
|
|
74
|
+
agentPublic?: string;
|
|
75
|
+
rsBaseUrl: string;
|
|
76
|
+
/**
|
|
77
|
+
* REQUIRED. The audience the PCActns are FOR (wire v2 `aud`): for the hosted Atlas API this is the Atlas
|
|
78
|
+
* INSTANCE id (`ins_...`); for your own resource server, the id it passes to `requirePCA({ audience })`.
|
|
79
|
+
* A PCActn only verifies at the audience it names, so it cannot be replayed at another server / instance.
|
|
80
|
+
*/
|
|
81
|
+
audience: string;
|
|
82
|
+
/** Lifetime stamped into each PCActn (`exp = iat + ttlMs`), default 20 min (covers the 15-min step-up window). */
|
|
83
|
+
ttlMs?: number;
|
|
84
|
+
/** Clock (epoch ms) for `iat`; default `Date.now`. */
|
|
85
|
+
now?: () => number;
|
|
86
|
+
/** Stamp a fresh random per-action `nonce` (default true). */
|
|
87
|
+
nonce?: boolean;
|
|
88
|
+
fetch?: FetchLike;
|
|
89
|
+
/** Initial counter (last used); the first act() uses counter+1. Default 0. */
|
|
90
|
+
counter?: number;
|
|
91
|
+
budget?: TrustBudget;
|
|
92
|
+
}
|
|
93
|
+
/** Optional signed slots of wire v2 (all signed into the PCActn when present; absent = current behaviour). */
|
|
94
|
+
export interface ActSlots {
|
|
95
|
+
/** Uncertainty attestation in [0,1]; MONOTONE (the verifier takes max with its own risk). */
|
|
96
|
+
caution?: number;
|
|
97
|
+
/** b64u(32) commitment to your rationale. */
|
|
98
|
+
rationaleCommitment?: string;
|
|
99
|
+
progressStep?: Record<string, unknown>;
|
|
100
|
+
prohibitionEvidence?: Record<string, unknown> | unknown[];
|
|
101
|
+
/** The tool signature you will dispatch to (hashed with `hashCanonical`) or its b64u(32) digest. */
|
|
102
|
+
toolBinding?: string;
|
|
103
|
+
/** Override the generated nonce. */
|
|
104
|
+
nonce?: string;
|
|
105
|
+
}
|
|
106
|
+
export interface AgentClient {
|
|
107
|
+
readonly grant: Capability;
|
|
108
|
+
readonly chain: CapabilityChain;
|
|
109
|
+
readonly agentPublic?: string;
|
|
110
|
+
readonly counter: number;
|
|
111
|
+
readonly budget: TrustBudget | undefined;
|
|
112
|
+
readonly planRoot: string | undefined;
|
|
113
|
+
commitPlan(nodes: PlanNode[]): Promise<{
|
|
114
|
+
planRoot: string;
|
|
115
|
+
}>;
|
|
116
|
+
act(nodeId: string, params?: Record<string, unknown>, slots?: ActSlots): Promise<ActResult>;
|
|
117
|
+
awaitStepUp(stepupId: string, opts?: {
|
|
118
|
+
pollMs?: number;
|
|
119
|
+
timeoutMs?: number;
|
|
120
|
+
}): Promise<StepUpOutcome>;
|
|
121
|
+
delegate(opts: {
|
|
122
|
+
toPublic: string;
|
|
123
|
+
addedCaveats?: Caveat[];
|
|
124
|
+
agentSecret?: Uint8Array;
|
|
125
|
+
}): AgentClient;
|
|
126
|
+
verifyReceipt(receipt: Receipt): boolean;
|
|
127
|
+
}
|
|
128
|
+
export declare function createAgent(opts: CreateAgentOptions): AgentClient;
|
package/dist/agent.js
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PcaAgentError = void 0;
|
|
4
|
+
exports.createAgent = createAgent;
|
|
5
|
+
const pca_1 = require("@atlasauth/pca");
|
|
6
|
+
class PcaAgentError extends Error {
|
|
7
|
+
code;
|
|
8
|
+
httpStatus;
|
|
9
|
+
constructor(code, message, httpStatus) {
|
|
10
|
+
super(message);
|
|
11
|
+
this.code = code;
|
|
12
|
+
this.httpStatus = httpStatus;
|
|
13
|
+
this.name = 'PcaAgentError';
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.PcaAgentError = PcaAgentError;
|
|
17
|
+
const newNonce = () => {
|
|
18
|
+
const b = new Uint8Array(16);
|
|
19
|
+
globalThis.crypto.getRandomValues(b);
|
|
20
|
+
return Array.from(b, (x) => x.toString(16).padStart(2, '0')).join('');
|
|
21
|
+
};
|
|
22
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
23
|
+
function createAgent(opts) {
|
|
24
|
+
if (typeof opts.audience !== 'string' || opts.audience.length === 0) {
|
|
25
|
+
throw new PcaAgentError('build_failed', 'createAgent: `audience` is required (the resource-server / Atlas instance id PCActns are for)');
|
|
26
|
+
}
|
|
27
|
+
const base = opts.rsBaseUrl.replace(/\/+$/, '');
|
|
28
|
+
const doFetch = opts.fetch ?? ((u, i) => globalThis.fetch(u, i));
|
|
29
|
+
const chain = opts.chain ?? [opts.grant];
|
|
30
|
+
let counter = opts.counter ?? 0;
|
|
31
|
+
let budget = opts.budget;
|
|
32
|
+
let plan;
|
|
33
|
+
let planRoot;
|
|
34
|
+
const call = async (method, path, body) => {
|
|
35
|
+
const res = await doFetch(`${base}${path}`, {
|
|
36
|
+
method,
|
|
37
|
+
headers: { 'content-type': 'application/json', accept: 'application/json' },
|
|
38
|
+
body: body === undefined ? undefined : JSON.stringify(body),
|
|
39
|
+
});
|
|
40
|
+
let json = {};
|
|
41
|
+
try {
|
|
42
|
+
json = ((await res.json()) ?? {});
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
/* non-JSON body */
|
|
46
|
+
}
|
|
47
|
+
return { status: res.status, json };
|
|
48
|
+
};
|
|
49
|
+
const client = {
|
|
50
|
+
grant: opts.grant,
|
|
51
|
+
chain,
|
|
52
|
+
agentPublic: opts.agentPublic,
|
|
53
|
+
get counter() {
|
|
54
|
+
return counter;
|
|
55
|
+
},
|
|
56
|
+
get budget() {
|
|
57
|
+
return budget;
|
|
58
|
+
},
|
|
59
|
+
get planRoot() {
|
|
60
|
+
return planRoot;
|
|
61
|
+
},
|
|
62
|
+
async commitPlan(nodes) {
|
|
63
|
+
const local = (0, pca_1.commitPlan)(nodes).root;
|
|
64
|
+
const res = await call('POST', '/v1/pca/plans', { grant_ref: opts.grant.id, nodes });
|
|
65
|
+
if (res.status < 200 || res.status >= 300) {
|
|
66
|
+
throw new PcaAgentError('bad_response', `plan commit failed (${res.status})`, res.status);
|
|
67
|
+
}
|
|
68
|
+
const remote = res.json.plan_root;
|
|
69
|
+
if (typeof remote === 'string' && remote !== local) {
|
|
70
|
+
throw new PcaAgentError('bad_response', 'server plan_root differs from the locally computed root', res.status);
|
|
71
|
+
}
|
|
72
|
+
plan = nodes;
|
|
73
|
+
planRoot = local;
|
|
74
|
+
return { planRoot: local };
|
|
75
|
+
},
|
|
76
|
+
async act(nodeId, params, slots) {
|
|
77
|
+
if (!plan)
|
|
78
|
+
return { status: 'error', error: new PcaAgentError('no_plan', 'commitPlan() first') };
|
|
79
|
+
if (!opts.agentSecret)
|
|
80
|
+
return { status: 'error', error: new PcaAgentError('no_secret', 'no agentSecret for this client') };
|
|
81
|
+
if (!plan.some((n) => n.id === nodeId)) {
|
|
82
|
+
return { status: 'error', error: new PcaAgentError('unknown_node', `unknown plan node ${nodeId}`) };
|
|
83
|
+
}
|
|
84
|
+
const next = counter + 1;
|
|
85
|
+
let pcactn;
|
|
86
|
+
try {
|
|
87
|
+
// The leaf `sig` IS the agent's threshold share: no separate agent share is carried.
|
|
88
|
+
pcactn = (0, pca_1.buildPCActn)({
|
|
89
|
+
grant: opts.grant,
|
|
90
|
+
chain,
|
|
91
|
+
plan,
|
|
92
|
+
nodeId,
|
|
93
|
+
params,
|
|
94
|
+
counter: next,
|
|
95
|
+
signerSecret: opts.agentSecret,
|
|
96
|
+
aud: opts.audience,
|
|
97
|
+
now: (opts.now ?? Date.now)(),
|
|
98
|
+
...(opts.ttlMs !== undefined ? { ttlMs: opts.ttlMs } : {}),
|
|
99
|
+
...(slots?.nonce !== undefined ? { nonce: slots.nonce } : opts.nonce !== false ? { nonce: newNonce() } : {}),
|
|
100
|
+
...(slots?.caution !== undefined ? { caution: slots.caution } : {}),
|
|
101
|
+
...(slots?.rationaleCommitment !== undefined ? { rationaleCommitment: slots.rationaleCommitment } : {}),
|
|
102
|
+
...(slots?.progressStep !== undefined ? { progressStep: slots.progressStep } : {}),
|
|
103
|
+
...(slots?.prohibitionEvidence !== undefined ? { prohibitionEvidence: slots.prohibitionEvidence } : {}),
|
|
104
|
+
...(slots?.toolBinding !== undefined ? { toolBinding: slots.toolBinding } : {}),
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
catch (e) {
|
|
108
|
+
return { status: 'error', error: new PcaAgentError('build_failed', e.message) };
|
|
109
|
+
}
|
|
110
|
+
counter = next; // monotonic: never reuse a counter, even if the call fails
|
|
111
|
+
let res;
|
|
112
|
+
try {
|
|
113
|
+
res = await call('POST', '/v1/pca/actions', { pcactn });
|
|
114
|
+
}
|
|
115
|
+
catch (e) {
|
|
116
|
+
return { status: 'error', error: new PcaAgentError('network', e.message) };
|
|
117
|
+
}
|
|
118
|
+
const j = res.json;
|
|
119
|
+
if (res.status === 202 || j.status === 'step_up_required' || j.step_up_required === true) {
|
|
120
|
+
const id = (j.stepup_id ?? j.stepupId ?? j.id);
|
|
121
|
+
const t = (j.required_t ?? j.requiredT ?? j.t);
|
|
122
|
+
if (typeof id !== 'string') {
|
|
123
|
+
return { status: 'error', error: new PcaAgentError('bad_response', 'step-up response missing stepup_id', res.status) };
|
|
124
|
+
}
|
|
125
|
+
return { status: 'step_up', stepupId: id, requiredT: typeof t === 'number' ? t : 2, pcactn };
|
|
126
|
+
}
|
|
127
|
+
const verdict = (j.verdict ?? { allow: j.allow === true });
|
|
128
|
+
if (verdict.budget)
|
|
129
|
+
budget = verdict.budget;
|
|
130
|
+
if (res.status >= 200 && res.status < 300 && (j.allow === true || verdict.allow)) {
|
|
131
|
+
const receipt = j.receipt;
|
|
132
|
+
if (!receipt)
|
|
133
|
+
return { status: 'error', error: new PcaAgentError('bad_response', 'allow without receipt', res.status) };
|
|
134
|
+
return { status: 'allowed', verdict, receipt, pcactn };
|
|
135
|
+
}
|
|
136
|
+
return { status: 'denied', verdict, httpStatus: res.status, pcactn };
|
|
137
|
+
},
|
|
138
|
+
async awaitStepUp(stepupId, o = {}) {
|
|
139
|
+
const pollMs = o.pollMs ?? 1000;
|
|
140
|
+
const deadline = Date.now() + (o.timeoutMs ?? 5 * 60_000);
|
|
141
|
+
for (;;) {
|
|
142
|
+
const res = await call('GET', `/v1/pca/stepups/${encodeURIComponent(stepupId)}`);
|
|
143
|
+
const s = res.json.status;
|
|
144
|
+
if (s === 'approved' || s === 'denied' || s === 'expired') {
|
|
145
|
+
return { ...res.json, status: s };
|
|
146
|
+
}
|
|
147
|
+
if (Date.now() + pollMs > deadline)
|
|
148
|
+
return { status: 'timeout' };
|
|
149
|
+
await sleep(pollMs);
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
delegate({ toPublic, addedCaveats = [], agentSecret }) {
|
|
153
|
+
if (!opts.agentSecret)
|
|
154
|
+
throw new PcaAgentError('no_secret', 'cannot delegate without agentSecret');
|
|
155
|
+
const leaf = chain[chain.length - 1];
|
|
156
|
+
const child = (0, pca_1.delegate)(leaf, toPublic, addedCaveats, opts.agentSecret);
|
|
157
|
+
const sub = createAgent({
|
|
158
|
+
grant: opts.grant,
|
|
159
|
+
chain: [...chain, child],
|
|
160
|
+
agentSecret,
|
|
161
|
+
agentPublic: toPublic,
|
|
162
|
+
rsBaseUrl: base,
|
|
163
|
+
audience: opts.audience,
|
|
164
|
+
...(opts.ttlMs !== undefined ? { ttlMs: opts.ttlMs } : {}),
|
|
165
|
+
...(opts.now ? { now: opts.now } : {}),
|
|
166
|
+
...(opts.nonce !== undefined ? { nonce: opts.nonce } : {}),
|
|
167
|
+
fetch: doFetch,
|
|
168
|
+
counter: 0,
|
|
169
|
+
});
|
|
170
|
+
return sub;
|
|
171
|
+
},
|
|
172
|
+
verifyReceipt(r) {
|
|
173
|
+
try {
|
|
174
|
+
return (0, pca_1.verifyLedgerInclusion)(r.root, r.inclusion_proof, r.commit);
|
|
175
|
+
}
|
|
176
|
+
catch {
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
return client;
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":";;;AA+HA,kCA4JC;AA3RD,wCAWwB;AA0CxB,MAAa,aAAc,SAAQ,KAAK;IAEpB;IAEA;IAHlB,YACkB,IAA4F,EAC5G,OAAe,EACC,UAAmB;QAEnC,KAAK,CAAC,OAAO,CAAC,CAAC;QAJC,SAAI,GAAJ,IAAI,CAAwF;QAE5F,eAAU,GAAV,UAAU,CAAS;QAGnC,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AATD,sCASC;AAyDD,MAAM,QAAQ,GAAG,GAAW,EAAE;IAC5B,MAAM,CAAC,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IAC5B,UAAoF,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAChH,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxE,CAAC,CAAC;AAEF,MAAM,KAAK,GAAG,CAAC,EAAU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,KAAK,EAAE,OAAO;gBACd,OAAO,EAAE,CAAC;aACX,CAAC,CAAC;YACH,OAAO,GAAG,CAAC;QACb,CAAC;QAED,aAAa,CAAC,CAAC;YACb,IAAI,CAAC;gBACH,OAAO,IAAA,2BAAqB,EAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;YACpE,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;KACF,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './agent';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./agent"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,57 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlasauth/pca-agent",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Agent-side client for Proof-Carrying Authority: commit a plan, act with a PCActn + threshold share, handle step-up, delegate to sub-agents, verify receipts.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"agent client",
|
|
7
|
+
"step-up",
|
|
8
|
+
"delegation",
|
|
9
|
+
"receipts",
|
|
10
|
+
"agent authorization",
|
|
11
|
+
"proof-carrying authority",
|
|
12
|
+
"pca",
|
|
13
|
+
"ai agents"
|
|
14
|
+
],
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"homepage": "https://github.com/Atlas-Authorization/pca#readme",
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/Atlas-Authorization/pca/issues"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/Atlas-Authorization/pca.git",
|
|
23
|
+
"directory": "packages/pca-agent"
|
|
24
|
+
},
|
|
25
|
+
"main": "./dist/index.js",
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"default": "./dist/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./package.json": "./package.json"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@atlasauth/pca": "0.2.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"typescript": "^5.6.3",
|
|
39
|
+
"vitest": "^2.1.4"
|
|
40
|
+
},
|
|
41
|
+
"files": [
|
|
42
|
+
"dist",
|
|
43
|
+
"README.md",
|
|
44
|
+
"LICENSE"
|
|
45
|
+
],
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=20"
|
|
48
|
+
},
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "tsc -p tsconfig.build.json",
|
|
54
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
55
|
+
"test": "vitest run"
|
|
56
|
+
}
|
|
6
57
|
}
|