@atlasauth/pca-llamaindex 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/LICENSE +21 -0
- package/README.md +33 -11
- package/package.json +25 -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,30 +1,52 @@
|
|
|
1
1
|
# @atlasauth/pca-llamaindex
|
|
2
2
|
|
|
3
|
-
LlamaIndex.TS adapter for Proof-Carrying Authority
|
|
4
|
-
PCActn (and hands you the proof) before the tool runs.
|
|
3
|
+
LlamaIndex.TS adapter for Proof-Carrying Authority (PCA). `withPCA` wraps a `FunctionTool` so every call first builds a signed PCActn (failing fast if the agent's own grant does not permit it), hands you the proof to forward to the resource server, and then runs the original tool.
|
|
5
4
|
|
|
6
5
|
## Install
|
|
7
6
|
|
|
8
7
|
```sh
|
|
9
|
-
npm i @atlasauth/pca-llamaindex
|
|
10
|
-
# peer dependency
|
|
11
|
-
npm i llamaindex
|
|
8
|
+
npm i @atlasauth/pca-llamaindex @atlasauth/pca
|
|
9
|
+
npm i llamaindex # optional peer dependency (^0.8 || ^0.9 || ^0.10)
|
|
12
10
|
```
|
|
13
11
|
|
|
14
12
|
## Usage
|
|
15
13
|
|
|
16
14
|
```ts
|
|
15
|
+
import { agent, generateKeyPair } from '@atlasauth/pca';
|
|
17
16
|
import { withPCA } from '@atlasauth/pca-llamaindex';
|
|
18
17
|
|
|
18
|
+
const pcaAgent = agent({
|
|
19
|
+
principal: generateKeyPair(),
|
|
20
|
+
goal: 'process refunds',
|
|
21
|
+
permissions: { stripe: ['refund'] },
|
|
22
|
+
limits: { refund: '$500/day' },
|
|
23
|
+
aud: 'ins_acme',
|
|
24
|
+
});
|
|
25
|
+
|
|
19
26
|
const guardedRefund = withPCA(
|
|
20
|
-
|
|
21
|
-
{
|
|
27
|
+
pcaAgent,
|
|
28
|
+
{
|
|
29
|
+
verb: 'stripe.refund',
|
|
30
|
+
resource: (args) => `charge:${args.charge}`,
|
|
31
|
+
onProof: (pca, args) => {
|
|
32
|
+
// forward pca.headers (PCA-Action) to the resource server with your request
|
|
33
|
+
},
|
|
34
|
+
},
|
|
22
35
|
refundTool, // your LlamaIndex FunctionTool
|
|
23
36
|
);
|
|
24
37
|
```
|
|
25
38
|
|
|
26
|
-
The wrapped tool has the same shape, so it drops into your agent's
|
|
27
|
-
|
|
28
|
-
|
|
39
|
+
The wrapped tool has the same shape (`metadata` and other fields preserved; only `call` is wrapped), so it drops into your agent's `tools` array. If the agent's local dry-run denies the action, the call throws `PcaDenied` before the tool runs (disable with `failFast: false`).
|
|
40
|
+
|
|
41
|
+
## API
|
|
42
|
+
|
|
43
|
+
- `withPCA(agent, spec, tool)` - spec is `{ verb, resource, aud?, failFast?, onProof? }`.
|
|
44
|
+
- Re-exports `bridgeToolCall`, `pcaHeaders`, and the `PcaCall` type from `@atlasauth/pca`.
|
|
45
|
+
|
|
46
|
+
## Status
|
|
47
|
+
|
|
48
|
+
This package does not authorize anything. It attaches a proof-carrying action; the resource server's verifier (see `@atlasauth/pca`) decides. The `llamaindex` package is matched structurally and never imported. PCA cryptography has not been independently audited.
|
|
49
|
+
|
|
50
|
+
## License
|
|
29
51
|
|
|
30
|
-
|
|
52
|
+
MIT - see LICENSE
|
package/package.json
CHANGED
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlasauth/pca-llamaindex",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "LlamaIndex.TS adapter for Proof-Carrying Authority: wrap a FunctionTool so each call emits a PCActn before it runs.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"llamaindex",
|
|
7
|
+
"tool calling",
|
|
8
|
+
"agent authorization",
|
|
9
|
+
"proof-carrying authority",
|
|
10
|
+
"pca",
|
|
11
|
+
"ai agents"
|
|
12
|
+
],
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"homepage": "https://github.com/Atlas-Authorization/pca#readme",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/Atlas-Authorization/pca/issues"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/Atlas-Authorization/pca.git",
|
|
21
|
+
"directory": "packages/pca-llamaindex"
|
|
22
|
+
},
|
|
5
23
|
"main": "./dist/index.js",
|
|
6
24
|
"types": "./dist/index.d.ts",
|
|
7
25
|
"exports": {
|
|
@@ -12,7 +30,7 @@
|
|
|
12
30
|
"./package.json": "./package.json"
|
|
13
31
|
},
|
|
14
32
|
"dependencies": {
|
|
15
|
-
"@atlasauth/pca": "0.
|
|
33
|
+
"@atlasauth/pca": "0.2.0"
|
|
16
34
|
},
|
|
17
35
|
"peerDependencies": {
|
|
18
36
|
"llamaindex": "^0.8 || ^0.9 || ^0.10"
|
|
@@ -28,8 +46,12 @@
|
|
|
28
46
|
},
|
|
29
47
|
"files": [
|
|
30
48
|
"dist",
|
|
31
|
-
"README.md"
|
|
49
|
+
"README.md",
|
|
50
|
+
"LICENSE"
|
|
32
51
|
],
|
|
52
|
+
"engines": {
|
|
53
|
+
"node": ">=20"
|
|
54
|
+
},
|
|
33
55
|
"publishConfig": {
|
|
34
56
|
"access": "public"
|
|
35
57
|
},
|