@absolutejs/agent-control 0.3.0 → 0.4.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/README.md +2 -1
- package/dist/index.js +14 -5
- package/dist/manifest.js +17 -0
- package/dist/manifest.json +22 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -6,7 +6,8 @@ before cleanup, reports partial source failures, restores deliberately, and uses
|
|
|
6
6
|
leased idempotency records so operator retries cannot change the requested input.
|
|
7
7
|
|
|
8
8
|
Scopes are `agents:read`, `agents:revoke`, and `agents:restore`. Mutations require
|
|
9
|
-
an `operationId
|
|
9
|
+
an `operationId`, bounded `reason`, same-origin `Origin` header, and
|
|
10
|
+
`X-Agent-Control-Intent: mutate`; PostgreSQL operations can be safely reclaimed
|
|
10
11
|
after a crashed operator process's lease expires.
|
|
11
12
|
|
|
12
13
|
`createAgentControlConsoleHandler()` adds a dependency-free authenticated
|
package/dist/index.js
CHANGED
|
@@ -339,11 +339,20 @@ var createAgentControlHandler = ({
|
|
|
339
339
|
return Response.json(await control.inventory(agentId));
|
|
340
340
|
if (request.method !== "POST" || action !== "revoke" && action !== "restore")
|
|
341
341
|
return new Response(null, { status: 405 });
|
|
342
|
-
|
|
343
|
-
return;
|
|
344
|
-
|
|
345
|
-
if (
|
|
346
|
-
return Response.json({ error: "
|
|
342
|
+
if (request.headers.get("origin") !== url.origin || request.headers.get("x-agent-control-intent") !== "mutate")
|
|
343
|
+
return new Response("Cross-site mutation denied", { status: 403 });
|
|
344
|
+
const raw = await request.text();
|
|
345
|
+
if (new TextEncoder().encode(raw).byteLength > 4096)
|
|
346
|
+
return Response.json({ error: "Request body is too large" }, { status: 413 });
|
|
347
|
+
const body = (() => {
|
|
348
|
+
try {
|
|
349
|
+
return JSON.parse(raw);
|
|
350
|
+
} catch {
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
})();
|
|
354
|
+
if (!body?.operationId || body.operationId.length > 200 || !body.reason || body.reason.length > 1000)
|
|
355
|
+
return Response.json({ error: "A bounded operationId and reason are required" }, { status: 400 });
|
|
347
356
|
const digest2 = await hash2({ action, agentId, reason: body.reason });
|
|
348
357
|
let claim;
|
|
349
358
|
try {
|
package/dist/manifest.js
CHANGED
|
@@ -5940,6 +5940,23 @@ var manifestSchema = Type.Object({
|
|
|
5940
5940
|
import { Type as Type2 } from "@sinclair/typebox";
|
|
5941
5941
|
var manifest = defineManifest()({
|
|
5942
5942
|
contract: 2,
|
|
5943
|
+
discovery: {
|
|
5944
|
+
audiences: ["platform-operators", "security-teams"],
|
|
5945
|
+
intents: [
|
|
5946
|
+
"inspect agent activity",
|
|
5947
|
+
"revoke agent access",
|
|
5948
|
+
"operate an agent kill switch"
|
|
5949
|
+
],
|
|
5950
|
+
keywords: [
|
|
5951
|
+
"agents",
|
|
5952
|
+
"operations",
|
|
5953
|
+
"approvals",
|
|
5954
|
+
"revocation",
|
|
5955
|
+
"kill-switch",
|
|
5956
|
+
"console"
|
|
5957
|
+
],
|
|
5958
|
+
protocols: ["AbsoluteJS Agent Control"]
|
|
5959
|
+
},
|
|
5943
5960
|
identity: {
|
|
5944
5961
|
accent: "#dc2626",
|
|
5945
5962
|
category: "security",
|
package/dist/manifest.json
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"contract": 2,
|
|
3
|
+
"discovery": {
|
|
4
|
+
"audiences": [
|
|
5
|
+
"platform-operators",
|
|
6
|
+
"security-teams"
|
|
7
|
+
],
|
|
8
|
+
"intents": [
|
|
9
|
+
"inspect agent activity",
|
|
10
|
+
"revoke agent access",
|
|
11
|
+
"operate an agent kill switch"
|
|
12
|
+
],
|
|
13
|
+
"keywords": [
|
|
14
|
+
"agents",
|
|
15
|
+
"operations",
|
|
16
|
+
"approvals",
|
|
17
|
+
"revocation",
|
|
18
|
+
"kill-switch",
|
|
19
|
+
"console"
|
|
20
|
+
],
|
|
21
|
+
"protocols": [
|
|
22
|
+
"AbsoluteJS Agent Control"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
3
25
|
"identity": {
|
|
4
26
|
"accent": "#dc2626",
|
|
5
27
|
"category": "security",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@absolutejs/agent-control",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Authenticated AI agent operator API, console, and bound plan-then-execute playground.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"check:package": "bun run format && bun run typecheck && bun run test && bun run build"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@absolutejs/agency": "^0.
|
|
43
|
+
"@absolutejs/agency": "^0.5.0",
|
|
44
44
|
"@absolutejs/manifest": "^0.3.0",
|
|
45
45
|
"@sinclair/typebox": "^0.34.0"
|
|
46
46
|
},
|