@responsibleai/agent-hooks 0.1.0-alpha.5 → 0.1.0-beta.2
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 +74 -5
- package/binding.d.ts +34 -0
- package/binding.js +164 -82
- package/dist/ctk/index.d.ts +53 -5
- package/dist/ctk/index.js +5 -1
- package/dist/ctk/reference.d.ts +15 -1
- package/dist/ctk/reference.declaration.json +33 -0
- package/dist/ctk/reference.js +84 -31
- package/dist/ctk/runner.d.ts +34 -4
- package/dist/ctk/runner.js +569 -36
- package/dist/declaration.d.ts +393 -0
- package/dist/declaration.js +752 -0
- package/dist/emitter.d.ts +111 -15
- package/dist/emitter.js +329 -41
- package/dist/index.d.ts +15 -3
- package/dist/index.js +26 -1
- package/dist/native.d.ts +8 -1
- package/dist/native.js +9 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* `policy-engine/sdk/node/src/index.ts`.
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.InterceptionBlocked = exports.InterceptionEmitter = exports.AgentContextBuilder = exports.ApprovalOutcome = exports.Composition = exports.CompositionProfile = exports.ALLOW = exports.Verdict = exports.HostError = exports.EnforcementMode = exports.Decision = exports.InterceptionPoint = exports.JCS_SHA256 = exports.SPEC_VERSION = exports.AgentHooksCoreError = void 0;
|
|
10
|
+
exports.InterceptionBlocked = exports.validReference = exports.validKind = exports.fullKnobSupport = exports.declarationVersions = exports.canonicalDeclaration = exports.SUPPORTED_DECLARATION_VERSIONS = exports.MAX_TIMEOUT_MS = exports.MAX_KIND_LEN = exports.MAX_ID_LEN = exports.MAX_DOCUMENT_BYTES = exports.MAX_DETAIL_LEN = exports.MAX_DEPTH = exports.MAX_BINDINGS = exports.HostSurface = exports.HostRegistryError = exports.HostRegistry = exports.HostDeclaration = exports.DeclarationErrorClass = exports.DeclarationError = exports.DeclarationBuilder = exports.DECLARATION_VERSION = exports.CAPABILITIES = exports.EmitterSealed = exports.InterceptionEmitter = exports.AgentContextBuilder = exports.ApprovalOutcome = exports.Composition = exports.CompositionProfile = exports.ALLOW = exports.Verdict = exports.HostError = exports.EnforcementMode = exports.Decision = exports.InterceptionPoint = exports.JCS_SHA256 = exports.SPEC_VERSION = exports.AgentHooksCoreError = void 0;
|
|
11
11
|
exports.transformPermitted = transformPermitted;
|
|
12
12
|
exports.permits = permits;
|
|
13
13
|
exports.hostErrorVerdict = hostErrorVerdict;
|
|
@@ -251,6 +251,7 @@ function finalize(ctx, verdict, mode, meta) {
|
|
|
251
251
|
enforced_identity: meta.enforced_identity ?? null,
|
|
252
252
|
decided_by: meta.decided_by ?? null,
|
|
253
253
|
composition: meta.composition,
|
|
254
|
+
declaration: meta.declaration ?? null,
|
|
254
255
|
verdicts: meta.verdicts ?? null,
|
|
255
256
|
fold_truncated: meta.fold_truncated ?? null,
|
|
256
257
|
resolved_by: meta.resolved_by ?? null,
|
|
@@ -267,6 +268,30 @@ var builder_1 = require("./builder");
|
|
|
267
268
|
Object.defineProperty(exports, "AgentContextBuilder", { enumerable: true, get: function () { return builder_1.AgentContextBuilder; } });
|
|
268
269
|
var emitter_1 = require("./emitter");
|
|
269
270
|
Object.defineProperty(exports, "InterceptionEmitter", { enumerable: true, get: function () { return emitter_1.InterceptionEmitter; } });
|
|
271
|
+
Object.defineProperty(exports, "EmitterSealed", { enumerable: true, get: function () { return emitter_1.EmitterSealed; } });
|
|
272
|
+
var declaration_1 = require("./declaration");
|
|
273
|
+
Object.defineProperty(exports, "CAPABILITIES", { enumerable: true, get: function () { return declaration_1.CAPABILITIES; } });
|
|
274
|
+
Object.defineProperty(exports, "DECLARATION_VERSION", { enumerable: true, get: function () { return declaration_1.DECLARATION_VERSION; } });
|
|
275
|
+
Object.defineProperty(exports, "DeclarationBuilder", { enumerable: true, get: function () { return declaration_1.DeclarationBuilder; } });
|
|
276
|
+
Object.defineProperty(exports, "DeclarationError", { enumerable: true, get: function () { return declaration_1.DeclarationError; } });
|
|
277
|
+
Object.defineProperty(exports, "DeclarationErrorClass", { enumerable: true, get: function () { return declaration_1.DeclarationErrorClass; } });
|
|
278
|
+
Object.defineProperty(exports, "HostDeclaration", { enumerable: true, get: function () { return declaration_1.HostDeclaration; } });
|
|
279
|
+
Object.defineProperty(exports, "HostRegistry", { enumerable: true, get: function () { return declaration_1.HostRegistry; } });
|
|
280
|
+
Object.defineProperty(exports, "HostRegistryError", { enumerable: true, get: function () { return declaration_1.HostRegistryError; } });
|
|
281
|
+
Object.defineProperty(exports, "HostSurface", { enumerable: true, get: function () { return declaration_1.HostSurface; } });
|
|
282
|
+
Object.defineProperty(exports, "MAX_BINDINGS", { enumerable: true, get: function () { return declaration_1.MAX_BINDINGS; } });
|
|
283
|
+
Object.defineProperty(exports, "MAX_DEPTH", { enumerable: true, get: function () { return declaration_1.MAX_DEPTH; } });
|
|
284
|
+
Object.defineProperty(exports, "MAX_DETAIL_LEN", { enumerable: true, get: function () { return declaration_1.MAX_DETAIL_LEN; } });
|
|
285
|
+
Object.defineProperty(exports, "MAX_DOCUMENT_BYTES", { enumerable: true, get: function () { return declaration_1.MAX_DOCUMENT_BYTES; } });
|
|
286
|
+
Object.defineProperty(exports, "MAX_ID_LEN", { enumerable: true, get: function () { return declaration_1.MAX_ID_LEN; } });
|
|
287
|
+
Object.defineProperty(exports, "MAX_KIND_LEN", { enumerable: true, get: function () { return declaration_1.MAX_KIND_LEN; } });
|
|
288
|
+
Object.defineProperty(exports, "MAX_TIMEOUT_MS", { enumerable: true, get: function () { return declaration_1.MAX_TIMEOUT_MS; } });
|
|
289
|
+
Object.defineProperty(exports, "SUPPORTED_DECLARATION_VERSIONS", { enumerable: true, get: function () { return declaration_1.SUPPORTED_DECLARATION_VERSIONS; } });
|
|
290
|
+
Object.defineProperty(exports, "canonicalDeclaration", { enumerable: true, get: function () { return declaration_1.canonicalDeclaration; } });
|
|
291
|
+
Object.defineProperty(exports, "declarationVersions", { enumerable: true, get: function () { return declaration_1.declarationVersions; } });
|
|
292
|
+
Object.defineProperty(exports, "fullKnobSupport", { enumerable: true, get: function () { return declaration_1.fullKnobSupport; } });
|
|
293
|
+
Object.defineProperty(exports, "validKind", { enumerable: true, get: function () { return declaration_1.validKind; } });
|
|
294
|
+
Object.defineProperty(exports, "validReference", { enumerable: true, get: function () { return declaration_1.validReference; } });
|
|
270
295
|
class InterceptionBlocked extends Error {
|
|
271
296
|
result;
|
|
272
297
|
constructor(result) {
|
package/dist/native.d.ts
CHANGED
|
@@ -6,9 +6,12 @@
|
|
|
6
6
|
* the `AgentHooksCoreError` unwrapping so callers get `.code`.
|
|
7
7
|
*/
|
|
8
8
|
/** Thrown by every native function on failure. `.code` is the §11
|
|
9
|
-
* `host_error:*` wire string.
|
|
9
|
+
* `host_error:*` wire string, or a §7.7.6 `declaration_error:*`
|
|
10
|
+
* string from the declaration functions (the detail is then JSON
|
|
11
|
+
* findings, which `declaration.ts` retypes as `DeclarationError`). */
|
|
10
12
|
export declare class AgentHooksCoreError extends Error {
|
|
11
13
|
readonly code: string;
|
|
14
|
+
readonly detail: string;
|
|
12
15
|
constructor(code: string, detail: string);
|
|
13
16
|
}
|
|
14
17
|
export declare const native: {
|
|
@@ -26,4 +29,8 @@ export declare const native: {
|
|
|
26
29
|
ctkScriptedResolve: (rulesJson: string, ctxJson: string, identity: string) => string;
|
|
27
30
|
ctkShouldSkip: (vectorJson: string, capsJson: string) => string;
|
|
28
31
|
ctkAssert: (vectorJson: string, recordedJson: string, runRecordJson: string) => string;
|
|
32
|
+
declarationVersions: () => string;
|
|
33
|
+
declarationValidate: (documentJson: string) => string;
|
|
34
|
+
declarationResolve: (documentJson: string, hostJson: string) => string;
|
|
35
|
+
declarationResolveSurface: (documentJson: string, surfaceJson: string) => string;
|
|
29
36
|
};
|
package/dist/native.js
CHANGED
|
@@ -15,12 +15,16 @@ exports.native = exports.AgentHooksCoreError = void 0;
|
|
|
15
15
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
16
16
|
const binding = require("../binding.js");
|
|
17
17
|
/** Thrown by every native function on failure. `.code` is the §11
|
|
18
|
-
* `host_error:*` wire string.
|
|
18
|
+
* `host_error:*` wire string, or a §7.7.6 `declaration_error:*`
|
|
19
|
+
* string from the declaration functions (the detail is then JSON
|
|
20
|
+
* findings, which `declaration.ts` retypes as `DeclarationError`). */
|
|
19
21
|
class AgentHooksCoreError extends Error {
|
|
20
22
|
code;
|
|
23
|
+
detail;
|
|
21
24
|
constructor(code, detail) {
|
|
22
25
|
super(`${code}: ${detail}`);
|
|
23
26
|
this.code = code;
|
|
27
|
+
this.detail = detail;
|
|
24
28
|
this.name = "AgentHooksCoreError";
|
|
25
29
|
}
|
|
26
30
|
}
|
|
@@ -54,4 +58,8 @@ exports.native = {
|
|
|
54
58
|
ctkScriptedResolve: wrap(binding.ctkScriptedResolve),
|
|
55
59
|
ctkShouldSkip: wrap(binding.ctkShouldSkip),
|
|
56
60
|
ctkAssert: wrap(binding.ctkAssert),
|
|
61
|
+
declarationVersions: binding.declarationVersions,
|
|
62
|
+
declarationValidate: wrap(binding.declarationValidate),
|
|
63
|
+
declarationResolve: wrap(binding.declarationResolve),
|
|
64
|
+
declarationResolveSurface: wrap(binding.declarationResolveSurface),
|
|
57
65
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@responsibleai/agent-hooks",
|
|
3
|
-
"version": "0.1.0-
|
|
3
|
+
"version": "0.1.0-beta.2",
|
|
4
4
|
"description": "Framework-neutral agent control contract (AGENT-HOOKS-0.1). TypeScript wrapper over the canonical Rust core. Cooperative contract, not a security boundary: the host is fully trusted (see SECURITY.md).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"node": ">=20"
|
|
45
45
|
},
|
|
46
46
|
"optionalDependencies": {
|
|
47
|
-
"@responsibleai/agent-hooks-linux-x64-gnu": "0.1.0-
|
|
48
|
-
"@responsibleai/agent-hooks-linux-arm64-gnu": "0.1.0-
|
|
49
|
-
"@responsibleai/agent-hooks-darwin-x64": "0.1.0-
|
|
50
|
-
"@responsibleai/agent-hooks-darwin-arm64": "0.1.0-
|
|
51
|
-
"@responsibleai/agent-hooks-win32-x64-msvc": "0.1.0-
|
|
47
|
+
"@responsibleai/agent-hooks-linux-x64-gnu": "0.1.0-beta.2",
|
|
48
|
+
"@responsibleai/agent-hooks-linux-arm64-gnu": "0.1.0-beta.2",
|
|
49
|
+
"@responsibleai/agent-hooks-darwin-x64": "0.1.0-beta.2",
|
|
50
|
+
"@responsibleai/agent-hooks-darwin-arm64": "0.1.0-beta.2",
|
|
51
|
+
"@responsibleai/agent-hooks-win32-x64-msvc": "0.1.0-beta.2"
|
|
52
52
|
}
|
|
53
53
|
}
|