@decionis/agent-safe-pipeline 0.4.0 → 0.5.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 +29 -0
- package/dist/Index.d.ts +9 -0
- package/dist/Index.d.ts.map +1 -1
- package/dist/Index.js +9 -0
- package/dist/Index.js.map +1 -1
- package/dist/execution/ActionRegistry.d.ts +12 -0
- package/dist/execution/ActionRegistry.d.ts.map +1 -1
- package/dist/execution/ActionRegistry.js +14 -0
- package/dist/execution/ActionRegistry.js.map +1 -1
- package/dist/execution/GovernedExecutionRunner.d.ts +14 -0
- package/dist/execution/GovernedExecutionRunner.d.ts.map +1 -1
- package/dist/execution/GovernedExecutionRunner.js +46 -1
- package/dist/execution/GovernedExecutionRunner.js.map +1 -1
- package/dist/execution/NativeExecutor.d.ts +20 -1
- package/dist/execution/NativeExecutor.d.ts.map +1 -1
- package/dist/execution/NativeExecutor.js.map +1 -1
- package/dist/intent/CanonicalIntentHasher.d.ts.map +1 -1
- package/dist/intent/CanonicalIntentHasher.js +11 -0
- package/dist/intent/CanonicalIntentHasher.js.map +1 -1
- package/dist/intent/ExecutionIntent.d.ts +55 -4
- package/dist/intent/ExecutionIntent.d.ts.map +1 -1
- package/dist/intent/ExecutionIntent.js +40 -0
- package/dist/intent/ExecutionIntent.js.map +1 -1
- package/dist/intent/ExecutionSignals.d.ts +9 -1
- package/dist/intent/ExecutionSignals.d.ts.map +1 -1
- package/dist/intent/ExecutionSignals.js +9 -0
- package/dist/intent/ExecutionSignals.js.map +1 -1
- package/dist/intent/IntentBindingSchema.d.ts +6 -0
- package/dist/intent/IntentBindingSchema.d.ts.map +1 -1
- package/dist/intent/IntentBindingSchema.js +10 -0
- package/dist/intent/IntentBindingSchema.js.map +1 -1
- package/dist/intent/IntentCapture.d.ts.map +1 -1
- package/dist/intent/IntentCapture.js +18 -4
- package/dist/intent/IntentCapture.js.map +1 -1
- package/dist/intent/TargetPrecondition.d.ts +36 -0
- package/dist/intent/TargetPrecondition.d.ts.map +1 -0
- package/dist/intent/TargetPrecondition.js +57 -0
- package/dist/intent/TargetPrecondition.js.map +1 -0
- package/dist/manifest/ActionManifest.d.ts +112 -0
- package/dist/manifest/ActionManifest.d.ts.map +1 -0
- package/dist/manifest/ActionManifest.js +182 -0
- package/dist/manifest/ActionManifest.js.map +1 -0
- package/dist/plan/GovernedPlan.d.ts +109 -0
- package/dist/plan/GovernedPlan.d.ts.map +1 -0
- package/dist/plan/GovernedPlan.js +187 -0
- package/dist/plan/GovernedPlan.js.map +1 -0
- package/dist/plan/PlanState.d.ts +94 -0
- package/dist/plan/PlanState.d.ts.map +1 -0
- package/dist/plan/PlanState.js +240 -0
- package/dist/plan/PlanState.js.map +1 -0
- package/dist/plan/PlanStepReference.d.ts +16 -0
- package/dist/plan/PlanStepReference.d.ts.map +1 -0
- package/dist/plan/PlanStepReference.js +25 -0
- package/dist/plan/PlanStepReference.js.map +1 -0
- package/dist/profile/ApiProfile.d.ts +354 -0
- package/dist/profile/ApiProfile.d.ts.map +1 -0
- package/dist/profile/ApiProfile.js +755 -0
- package/dist/profile/ApiProfile.js.map +1 -0
- package/dist/profile/ApiProfiles.d.ts +16 -0
- package/dist/profile/ApiProfiles.d.ts.map +1 -0
- package/dist/profile/ApiProfiles.js +29 -0
- package/dist/profile/ApiProfiles.js.map +1 -0
- package/dist/profile/BuiltInApiProfiles.d.ts +9 -0
- package/dist/profile/BuiltInApiProfiles.d.ts.map +1 -0
- package/dist/profile/BuiltInApiProfiles.js +494 -0
- package/dist/profile/BuiltInApiProfiles.js.map +1 -0
- package/dist/profile/McpToolProfile.d.ts +129 -0
- package/dist/profile/McpToolProfile.d.ts.map +1 -0
- package/dist/profile/McpToolProfile.js +270 -0
- package/dist/profile/McpToolProfile.js.map +1 -0
- package/dist/testing/Index.d.ts +3 -1
- package/dist/testing/Index.d.ts.map +1 -1
- package/dist/testing/Index.js +2 -0
- package/dist/testing/Index.js.map +1 -1
- package/dist/testing/LocalAssumptionBreaches.d.ts +96 -0
- package/dist/testing/LocalAssumptionBreaches.d.ts.map +1 -0
- package/dist/testing/LocalAssumptionBreaches.js +109 -0
- package/dist/testing/LocalAssumptionBreaches.js.map +1 -0
- package/dist/testing/LocalAuthority.d.ts +158 -5
- package/dist/testing/LocalAuthority.d.ts.map +1 -1
- package/dist/testing/LocalAuthority.js +302 -18
- package/dist/testing/LocalAuthority.js.map +1 -1
- package/dist/testing/LocalPlans.d.ts +43 -0
- package/dist/testing/LocalPlans.d.ts.map +1 -0
- package/dist/testing/LocalPlans.js +124 -0
- package/dist/testing/LocalPlans.js.map +1 -0
- package/package.json +5 -4
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type JsonObject } from "../intent/JsonValue.js";
|
|
3
|
+
/**
|
|
4
|
+
* `agent-safe.profile.mcp/1`: an MCP server's consequential tools described as
|
|
5
|
+
* data. Each tool names the action it becomes, the target it acts on (a
|
|
6
|
+
* template over its arguments), the argument that names its subject (the
|
|
7
|
+
* customer it is for), the arguments that decide what it does, and the
|
|
8
|
+
* arguments it accepts. A guard reads the file in place of a binding written
|
|
9
|
+
* in code, so governing a tool is a reviewable file, not code reached by name.
|
|
10
|
+
*/
|
|
11
|
+
export declare const MCP_PROFILE_CONTRACT = "agent-safe.profile.mcp/1";
|
|
12
|
+
export declare const MCP_PROFILE_SCHEMA_ID = "https://github.com/decionis/agent-safe-pipeline/blob/master/spec/profiles/mcp/v1/schema.json";
|
|
13
|
+
/** The most arguments a tool declares, and the most placeholders its target holds. */
|
|
14
|
+
export declare const MAX_TOOL_ARGUMENTS = 64;
|
|
15
|
+
export declare const MAX_TARGET_PLACEHOLDERS = 16;
|
|
16
|
+
/** The types an argument may be declared as; a scalar one may fill a target or name a subject. */
|
|
17
|
+
export declare const MCP_ARGUMENT_TYPES: readonly ["string", "number", "integer", "boolean", "array", "object"];
|
|
18
|
+
export type McpArgumentType = (typeof MCP_ARGUMENT_TYPES)[number];
|
|
19
|
+
export declare const McpArgumentSchema: z.ZodObject<{
|
|
20
|
+
type: z.ZodEnum<{
|
|
21
|
+
string: "string";
|
|
22
|
+
number: "number";
|
|
23
|
+
boolean: "boolean";
|
|
24
|
+
object: "object";
|
|
25
|
+
array: "array";
|
|
26
|
+
integer: "integer";
|
|
27
|
+
}>;
|
|
28
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
29
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
}, z.core.$strict>;
|
|
31
|
+
export declare const McpToolSchema: z.ZodObject<{
|
|
32
|
+
tool: z.ZodString;
|
|
33
|
+
action: z.ZodString;
|
|
34
|
+
operation: z.ZodString;
|
|
35
|
+
summary: z.ZodString;
|
|
36
|
+
target: z.ZodString;
|
|
37
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
38
|
+
consequential: z.ZodArray<z.ZodString>;
|
|
39
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
40
|
+
type: z.ZodEnum<{
|
|
41
|
+
string: "string";
|
|
42
|
+
number: "number";
|
|
43
|
+
boolean: "boolean";
|
|
44
|
+
object: "object";
|
|
45
|
+
array: "array";
|
|
46
|
+
integer: "integer";
|
|
47
|
+
}>;
|
|
48
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
49
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
}, z.core.$strict>>;
|
|
51
|
+
}, z.core.$strict>;
|
|
52
|
+
export declare const McpProfileDefinitionSchema: z.ZodObject<{
|
|
53
|
+
profile: z.ZodLiteral<"agent-safe.profile.mcp/1">;
|
|
54
|
+
id: z.ZodString;
|
|
55
|
+
title: z.ZodString;
|
|
56
|
+
system: z.ZodString;
|
|
57
|
+
environment: z.ZodOptional<z.ZodString>;
|
|
58
|
+
tools: z.ZodArray<z.ZodObject<{
|
|
59
|
+
tool: z.ZodString;
|
|
60
|
+
action: z.ZodString;
|
|
61
|
+
operation: z.ZodString;
|
|
62
|
+
summary: z.ZodString;
|
|
63
|
+
target: z.ZodString;
|
|
64
|
+
subject: z.ZodOptional<z.ZodString>;
|
|
65
|
+
consequential: z.ZodArray<z.ZodString>;
|
|
66
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
67
|
+
type: z.ZodEnum<{
|
|
68
|
+
string: "string";
|
|
69
|
+
number: "number";
|
|
70
|
+
boolean: "boolean";
|
|
71
|
+
object: "object";
|
|
72
|
+
array: "array";
|
|
73
|
+
integer: "integer";
|
|
74
|
+
}>;
|
|
75
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
76
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
77
|
+
}, z.core.$strict>>;
|
|
78
|
+
}, z.core.$strict>>;
|
|
79
|
+
}, z.core.$strict>;
|
|
80
|
+
export type McpArgumentDefinition = z.infer<typeof McpArgumentSchema>;
|
|
81
|
+
export type McpToolDefinition = z.infer<typeof McpToolSchema>;
|
|
82
|
+
export type McpProfileDefinition = z.infer<typeof McpProfileDefinitionSchema>;
|
|
83
|
+
/** A subject check's answer for a tool call: `MATCH`, or why it is refused. */
|
|
84
|
+
export type McpSubjectCheck = "MATCH" | "SUBJECT_ABSENT" | "SUBJECT_MISMATCH";
|
|
85
|
+
export declare class McpProfileError extends Error {
|
|
86
|
+
readonly code: "MCP_PROFILE_INVALID";
|
|
87
|
+
readonly detail: string;
|
|
88
|
+
constructor(code: "MCP_PROFILE_INVALID", detail: string);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* One MCP tool profile, validated. Every rule a schema cannot state is held
|
|
92
|
+
* here, at parse: a tool named twice, two tools on one action, a target that
|
|
93
|
+
* names an argument a call
|
|
94
|
+
* could leave out, a subject that is not a required identifier, a
|
|
95
|
+
* consequential argument the tool does not accept.
|
|
96
|
+
*/
|
|
97
|
+
export declare class McpToolProfile {
|
|
98
|
+
readonly definition: McpProfileDefinition;
|
|
99
|
+
private readonly byName;
|
|
100
|
+
private readonly schemas;
|
|
101
|
+
private constructor();
|
|
102
|
+
/** Validates a definition (closed schema, the rules above) and compiles it. */
|
|
103
|
+
static parse(value: unknown): McpToolProfile;
|
|
104
|
+
get id(): string;
|
|
105
|
+
/** Every tool the profile governs, in profile order. */
|
|
106
|
+
tools(): readonly string[];
|
|
107
|
+
tool(name: string): McpToolDefinition | null;
|
|
108
|
+
/**
|
|
109
|
+
* The arguments a tool accepts, as a closed validator: each declared one of
|
|
110
|
+
* its type, a required one present, any other refused. A number is finite;
|
|
111
|
+
* an integer is whole; an array or object holds JSON.
|
|
112
|
+
*/
|
|
113
|
+
argumentsSchema(name: string): z.ZodType<JsonObject>;
|
|
114
|
+
/**
|
|
115
|
+
* The subject a call names, when its tool names a subject argument: a
|
|
116
|
+
* string or a finite number, as a string, of 1 to 200 characters; null when
|
|
117
|
+
* the argument holds neither. Undefined when the tool names no subject.
|
|
118
|
+
*/
|
|
119
|
+
static subjectOf(tool: McpToolDefinition, args: JsonObject): string | null | undefined;
|
|
120
|
+
/** A call's subject against the session's, as `agent-safe.profile.api/1` checks a read's. */
|
|
121
|
+
static checkSubject(tool: McpToolDefinition, args: JsonObject, subject: string): McpSubjectCheck;
|
|
122
|
+
private static validator;
|
|
123
|
+
private static rules;
|
|
124
|
+
/** A target's placeholder names, by one linear scan; null when a brace is unbalanced or empty. */
|
|
125
|
+
private static placeholders;
|
|
126
|
+
}
|
|
127
|
+
/** The published JSON Schema of an MCP tool profile, generated from the validator above. */
|
|
128
|
+
export declare function mcpProfileJsonSchema(): Record<string, unknown>;
|
|
129
|
+
//# sourceMappingURL=McpToolProfile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"McpToolProfile.d.ts","sourceRoot":"","sources":["../../src/profile/McpToolProfile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAmB,KAAK,UAAU,EAAkB,MAAM,wBAAwB,CAAC;AAE1F;;;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W,EAAE,IAAI,MAAM,CAEtB;IAED,wDAAwD;IACjD,KAAK,IAAI,SAAS,MAAM,EAAE;IAI1B,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI;IAInD;;;;OAIG;IACI,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;IAe3D;;;;OAIG;WACW,SAAS,CAAC,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS;IAc7F,6FAA6F;WAC/E,YAAY,CACxB,IAAI,EAAE,iBAAiB,EACvB,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,MAAM,GACd,eAAe;IAOlB,OAAO,CAAC,MAAM,CAAC,SAAS;IAiBxB,OAAO,CAAC,MAAM,CAAC,KAAK;IAiCpB,kGAAkG;IAClG,OAAO,CAAC,MAAM,CAAC,YAAY;CAgB5B;AAED,4FAA4F;AAC5F,wBAAgB,oBAAoB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAa9D"}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { JsonValueSchema } from "../intent/JsonValue.js";
|
|
3
|
+
/**
|
|
4
|
+
* `agent-safe.profile.mcp/1`: an MCP server's consequential tools described as
|
|
5
|
+
* data. Each tool names the action it becomes, the target it acts on (a
|
|
6
|
+
* template over its arguments), the argument that names its subject (the
|
|
7
|
+
* customer it is for), the arguments that decide what it does, and the
|
|
8
|
+
* arguments it accepts. A guard reads the file in place of a binding written
|
|
9
|
+
* in code, so governing a tool is a reviewable file, not code reached by name.
|
|
10
|
+
*/
|
|
11
|
+
export const MCP_PROFILE_CONTRACT = "agent-safe.profile.mcp/1";
|
|
12
|
+
export const MCP_PROFILE_SCHEMA_ID = "https://github.com/decionis/agent-safe-pipeline/blob/master/spec/profiles/mcp/v1/schema.json";
|
|
13
|
+
/** The most arguments a tool declares, and the most placeholders its target holds. */
|
|
14
|
+
export const MAX_TOOL_ARGUMENTS = 64;
|
|
15
|
+
export const MAX_TARGET_PLACEHOLDERS = 16;
|
|
16
|
+
/** The types an argument may be declared as; a scalar one may fill a target or name a subject. */
|
|
17
|
+
export const MCP_ARGUMENT_TYPES = [
|
|
18
|
+
"string",
|
|
19
|
+
"number",
|
|
20
|
+
"integer",
|
|
21
|
+
"boolean",
|
|
22
|
+
"array",
|
|
23
|
+
"object",
|
|
24
|
+
];
|
|
25
|
+
/** An argument's name starts with a letter, so no declared name can be `__proto__`. */
|
|
26
|
+
const argumentName = z.string().regex(/^[a-z]\w{0,63}$/i);
|
|
27
|
+
const text = (max) => z.string().trim().min(1).max(max);
|
|
28
|
+
export const McpArgumentSchema = z.strictObject({
|
|
29
|
+
type: z.enum(MCP_ARGUMENT_TYPES),
|
|
30
|
+
/** Absent means optional: a call may leave the argument out. */
|
|
31
|
+
required: z.boolean().optional(),
|
|
32
|
+
/** The longest a string argument may be; a string only. */
|
|
33
|
+
maxLength: z.number().int().min(1).max(100_000).optional(),
|
|
34
|
+
});
|
|
35
|
+
export const McpToolSchema = z.strictObject({
|
|
36
|
+
/** The tool as the server publishes it. */
|
|
37
|
+
tool: z
|
|
38
|
+
.string()
|
|
39
|
+
.min(1)
|
|
40
|
+
.max(200)
|
|
41
|
+
.regex(/^[a-z0-9][\w.:/-]*$/i),
|
|
42
|
+
/** The intent's action type. */
|
|
43
|
+
action: z
|
|
44
|
+
.string()
|
|
45
|
+
.max(120)
|
|
46
|
+
.regex(/^[a-z][a-z0-9._:-]*$/),
|
|
47
|
+
/** The operation in the downstream system, for the intent's downstream target. */
|
|
48
|
+
operation: text(200),
|
|
49
|
+
summary: text(300),
|
|
50
|
+
/** `crm:customer:{customerId}`: every placeholder a required scalar argument. */
|
|
51
|
+
target: z.string().min(1).max(500),
|
|
52
|
+
/** The argument naming the tool's subject, when the tool acts for one party. */
|
|
53
|
+
subject: argumentName.optional(),
|
|
54
|
+
/** The arguments that decide what the tool does, for evidence and an approval screen. */
|
|
55
|
+
consequential: z.array(argumentName).max(MAX_TOOL_ARGUMENTS),
|
|
56
|
+
/** Every argument the tool accepts; any other is refused, never dropped. */
|
|
57
|
+
arguments: z.record(argumentName, McpArgumentSchema),
|
|
58
|
+
});
|
|
59
|
+
export const McpProfileDefinitionSchema = z.strictObject({
|
|
60
|
+
profile: z.literal(MCP_PROFILE_CONTRACT),
|
|
61
|
+
/** `<system>/<server>/<version>`, for example `crm/mcp/v1`. */
|
|
62
|
+
id: z
|
|
63
|
+
.string()
|
|
64
|
+
.regex(/^[a-z][a-z0-9]*\/[a-z][a-z0-9]*\/v\d+(\.\d+)?$/)
|
|
65
|
+
.max(120),
|
|
66
|
+
title: text(200),
|
|
67
|
+
/** The system the tools' effects land in: the intent's downstream system. */
|
|
68
|
+
system: text(200),
|
|
69
|
+
environment: text(200).optional(),
|
|
70
|
+
tools: z.array(McpToolSchema).min(1).max(200),
|
|
71
|
+
});
|
|
72
|
+
export class McpProfileError extends Error {
|
|
73
|
+
code;
|
|
74
|
+
detail;
|
|
75
|
+
constructor(code, detail) {
|
|
76
|
+
super(code);
|
|
77
|
+
this.code = code;
|
|
78
|
+
this.detail = detail;
|
|
79
|
+
this.name = "McpProfileError";
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const SCALAR = new Set(["string", "number", "integer", "boolean"]);
|
|
83
|
+
const SUBJECT_TYPES = new Set(["string", "number", "integer"]);
|
|
84
|
+
/** The longest subject: an identifier, never a payload. */
|
|
85
|
+
const MAX_SUBJECT_LENGTH = 200;
|
|
86
|
+
/**
|
|
87
|
+
* One MCP tool profile, validated. Every rule a schema cannot state is held
|
|
88
|
+
* here, at parse: a tool named twice, two tools on one action, a target that
|
|
89
|
+
* names an argument a call
|
|
90
|
+
* could leave out, a subject that is not a required identifier, a
|
|
91
|
+
* consequential argument the tool does not accept.
|
|
92
|
+
*/
|
|
93
|
+
export class McpToolProfile {
|
|
94
|
+
definition;
|
|
95
|
+
byName;
|
|
96
|
+
schemas = new Map();
|
|
97
|
+
constructor(definition) {
|
|
98
|
+
this.definition = definition;
|
|
99
|
+
const byName = new Map();
|
|
100
|
+
const actions = new Set();
|
|
101
|
+
for (const tool of definition.tools) {
|
|
102
|
+
if (byName.has(tool.tool))
|
|
103
|
+
throw new McpProfileError("MCP_PROFILE_INVALID", `duplicate tool ${tool.tool}`);
|
|
104
|
+
// A grant authorizes an action, and the guard dispatches the one tool
|
|
105
|
+
// registered under it: two tools on one action would be ambiguous.
|
|
106
|
+
if (actions.has(tool.action))
|
|
107
|
+
throw new McpProfileError("MCP_PROFILE_INVALID", `tool ${tool.tool} repeats an action`);
|
|
108
|
+
actions.add(tool.action);
|
|
109
|
+
McpToolProfile.rules(tool);
|
|
110
|
+
byName.set(tool.tool, tool);
|
|
111
|
+
}
|
|
112
|
+
this.byName = byName;
|
|
113
|
+
}
|
|
114
|
+
/** Validates a definition (closed schema, the rules above) and compiles it. */
|
|
115
|
+
static parse(value) {
|
|
116
|
+
const parsed = McpProfileDefinitionSchema.safeParse(value);
|
|
117
|
+
if (!parsed.success)
|
|
118
|
+
throw new McpProfileError("MCP_PROFILE_INVALID", parsed.error.issues
|
|
119
|
+
.slice(0, 3)
|
|
120
|
+
.map((issue) => `${issue.path.join(".") || "(root)"}: ${issue.message}`)
|
|
121
|
+
.join("; "));
|
|
122
|
+
return new McpToolProfile(parsed.data);
|
|
123
|
+
}
|
|
124
|
+
get id() {
|
|
125
|
+
return this.definition.id;
|
|
126
|
+
}
|
|
127
|
+
/** Every tool the profile governs, in profile order. */
|
|
128
|
+
tools() {
|
|
129
|
+
return this.definition.tools.map((tool) => tool.tool);
|
|
130
|
+
}
|
|
131
|
+
tool(name) {
|
|
132
|
+
return this.byName.get(name) ?? null;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* The arguments a tool accepts, as a closed validator: each declared one of
|
|
136
|
+
* its type, a required one present, any other refused. A number is finite;
|
|
137
|
+
* an integer is whole; an array or object holds JSON.
|
|
138
|
+
*/
|
|
139
|
+
argumentsSchema(name) {
|
|
140
|
+
const cached = this.schemas.get(name);
|
|
141
|
+
if (cached !== undefined)
|
|
142
|
+
return cached;
|
|
143
|
+
const tool = this.byName.get(name);
|
|
144
|
+
if (tool === undefined)
|
|
145
|
+
throw new McpProfileError("MCP_PROFILE_INVALID", `no tool ${name}`);
|
|
146
|
+
const shape = {};
|
|
147
|
+
for (const [argument, declared] of Object.entries(tool.arguments)) {
|
|
148
|
+
const base = McpToolProfile.validator(declared);
|
|
149
|
+
shape[argument] = declared.required === true ? base : base.optional();
|
|
150
|
+
}
|
|
151
|
+
const schema = z.strictObject(shape);
|
|
152
|
+
this.schemas.set(name, schema);
|
|
153
|
+
return schema;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* The subject a call names, when its tool names a subject argument: a
|
|
157
|
+
* string or a finite number, as a string, of 1 to 200 characters; null when
|
|
158
|
+
* the argument holds neither. Undefined when the tool names no subject.
|
|
159
|
+
*/
|
|
160
|
+
static subjectOf(tool, args) {
|
|
161
|
+
if (tool.subject === undefined)
|
|
162
|
+
return undefined;
|
|
163
|
+
const value = Object.hasOwn(args, tool.subject)
|
|
164
|
+
? args[tool.subject]
|
|
165
|
+
: undefined;
|
|
166
|
+
const named = typeof value === "string"
|
|
167
|
+
? value
|
|
168
|
+
: typeof value === "number" && Number.isFinite(value)
|
|
169
|
+
? String(value)
|
|
170
|
+
: null;
|
|
171
|
+
return named === null || named.length === 0 || named.length > MAX_SUBJECT_LENGTH ? null : named;
|
|
172
|
+
}
|
|
173
|
+
/** A call's subject against the session's, as `agent-safe.profile.api/1` checks a read's. */
|
|
174
|
+
static checkSubject(tool, args, subject) {
|
|
175
|
+
const named = McpToolProfile.subjectOf(tool, args);
|
|
176
|
+
if (named === undefined)
|
|
177
|
+
return "MATCH";
|
|
178
|
+
if (named === null)
|
|
179
|
+
return "SUBJECT_ABSENT";
|
|
180
|
+
return named === subject ? "MATCH" : "SUBJECT_MISMATCH";
|
|
181
|
+
}
|
|
182
|
+
static validator(declared) {
|
|
183
|
+
switch (declared.type) {
|
|
184
|
+
case "string":
|
|
185
|
+
return declared.maxLength === undefined ? z.string() : z.string().max(declared.maxLength);
|
|
186
|
+
case "number":
|
|
187
|
+
return z.number().finite();
|
|
188
|
+
case "integer":
|
|
189
|
+
return z.number().int();
|
|
190
|
+
case "boolean":
|
|
191
|
+
return z.boolean();
|
|
192
|
+
case "array":
|
|
193
|
+
return z.array(JsonValueSchema);
|
|
194
|
+
case "object":
|
|
195
|
+
return z.record(z.string(), JsonValueSchema);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
static rules(tool) {
|
|
199
|
+
const refuse = (detail) => {
|
|
200
|
+
throw new McpProfileError("MCP_PROFILE_INVALID", `tool ${tool.tool} ${detail}`);
|
|
201
|
+
};
|
|
202
|
+
const declared = Object.entries(tool.arguments);
|
|
203
|
+
if (declared.length > MAX_TOOL_ARGUMENTS)
|
|
204
|
+
refuse("declares too many arguments");
|
|
205
|
+
for (const [name, argument] of declared) {
|
|
206
|
+
if (argument.maxLength !== undefined && argument.type !== "string")
|
|
207
|
+
refuse(`bounds the length of ${name}, which is not a string`);
|
|
208
|
+
}
|
|
209
|
+
const required = (name, types) => {
|
|
210
|
+
const argument = tool.arguments[name];
|
|
211
|
+
return (Object.hasOwn(tool.arguments, name) &&
|
|
212
|
+
argument !== undefined &&
|
|
213
|
+
argument.required === true &&
|
|
214
|
+
types.has(argument.type));
|
|
215
|
+
};
|
|
216
|
+
const placeholders = McpToolProfile.placeholders(tool.target);
|
|
217
|
+
if (placeholders === null)
|
|
218
|
+
refuse("has a malformed target");
|
|
219
|
+
for (const name of placeholders ?? []) {
|
|
220
|
+
if (!required(name, SCALAR))
|
|
221
|
+
refuse(`fills its target from ${name}, not a required scalar`);
|
|
222
|
+
}
|
|
223
|
+
if (tool.subject !== undefined && !required(tool.subject, SUBJECT_TYPES))
|
|
224
|
+
refuse(`names ${tool.subject} as its subject, not a required string or number`);
|
|
225
|
+
if (new Set(tool.consequential).size !== tool.consequential.length)
|
|
226
|
+
refuse("names a consequential argument twice");
|
|
227
|
+
for (const name of tool.consequential) {
|
|
228
|
+
if (!Object.hasOwn(tool.arguments, name))
|
|
229
|
+
refuse(`names ${name} consequential, not accepted`);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
/** A target's placeholder names, by one linear scan; null when a brace is unbalanced or empty. */
|
|
233
|
+
static placeholders(target) {
|
|
234
|
+
const names = [];
|
|
235
|
+
for (let at = 0; at < target.length; at += 1) {
|
|
236
|
+
const character = target[at];
|
|
237
|
+
if (character === "}")
|
|
238
|
+
return null;
|
|
239
|
+
if (character !== "{")
|
|
240
|
+
continue;
|
|
241
|
+
const close = target.indexOf("}", at + 1);
|
|
242
|
+
if (close === -1)
|
|
243
|
+
return null;
|
|
244
|
+
const name = target.slice(at + 1, close);
|
|
245
|
+
if (name.length === 0 || name.includes("{"))
|
|
246
|
+
return null;
|
|
247
|
+
names.push(name);
|
|
248
|
+
if (names.length > MAX_TARGET_PLACEHOLDERS)
|
|
249
|
+
return null;
|
|
250
|
+
at = close;
|
|
251
|
+
}
|
|
252
|
+
return names;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
/** The published JSON Schema of an MCP tool profile, generated from the validator above. */
|
|
256
|
+
export function mcpProfileJsonSchema() {
|
|
257
|
+
const generated = z.toJSONSchema(McpProfileDefinitionSchema, {
|
|
258
|
+
target: "draft-2020-12",
|
|
259
|
+
io: "input",
|
|
260
|
+
});
|
|
261
|
+
const schema = { ...generated };
|
|
262
|
+
delete schema["$schema"];
|
|
263
|
+
return {
|
|
264
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
265
|
+
$id: MCP_PROFILE_SCHEMA_ID,
|
|
266
|
+
title: MCP_PROFILE_CONTRACT,
|
|
267
|
+
...schema,
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
//# source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I,CAAC;YAC9B,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;YACzC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;gBAAE,OAAO,IAAI,CAAC;YACzD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACjB,IAAI,KAAK,CAAC,MAAM,GAAG,uBAAuB;gBAAE,OAAO,IAAI,CAAC;YACxD,EAAE,GAAG,KAAK,CAAC;QACb,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAED,4FAA4F;AAC5F,MAAM,UAAU,oBAAoB;IAClC,MAAM,SAAS,GAAG,CAAC,CAAC,YAAY,CAAC,0BAA0B,EAAE;QAC3D,MAAM,EAAE,eAAe;QACvB,EAAE,EAAE,OAAO;KACZ,CAAC,CAAC;IACH,MAAM,MAAM,GAA4B,EAAE,GAAG,SAAS,EAAE,CAAC;IACzD,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;IACzB,OAAO;QACL,OAAO,EAAE,8CAA8C;QACvD,GAAG,EAAE,qBAAqB;QAC1B,KAAK,EAAE,oBAAoB;QAC3B,GAAG,MAAM;KACV,CAAC;AACJ,CAAC"}
|
package/dist/testing/Index.d.ts
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
export { FixtureAuthorizationVerifier, FixtureDecisionAuthority, createFixtureAuthorityPair, type FixtureAuthorityPair, type FixtureCommitRecord, type FixtureVerdictResolver, type UnsafeFixtureAuthorityOptions, } from "../decision/FixtureDecisionAuthority.js";
|
|
9
9
|
export { InMemoryReplayStore } from "../execution/ReplayStore.js";
|
|
10
10
|
export { LocalPresence, LOCAL_PRESENCE_API_KEY, readBody, type LocalAuthenticator, type LocalCeremonyResponse, type LocalPresenceOptions, type LocalPresenceRequestRecord, type LocalReceipt, type LocalReceiptBinding, type LocalReceiptVerification, type LocalVerificationRecord, type LocalVerificationStatus, } from "./LocalPresence.js";
|
|
11
|
-
export { AUTONOMOUS_LIMIT_MINOR, CLAIM_ATTESTATION_TYPE, EFFECT_RECEIPT_TYPE, HUMAN_LIMIT_MINOR, LocalAuthority, LOCAL_AUTHORITY_API_KEY, LOCAL_AUTHORITY_ISSUER, LOCAL_AUTHORITY_JWKS_PATH, hashBinding, stableStringify, type LocalAuthorityOptions, type LocalClaimAttestationClaims, type LocalEffectReceiptCode, type LocalEffectReceiptRecord, type LocalProviderKey, PROVIDER_KEY_PURPOSES, type LocalAuthorityPolicy, type LocalAuthorityPolicyInput, type LocalProviderKeyPurpose, type LocalAuthorityRequestRecord, type LocalGrantRecord, type LocalManagedEscalationRecord, type LocalRouteOverride, } from "./LocalAuthority.js";
|
|
11
|
+
export { AUTONOMOUS_LIMIT_MINOR, CLAIM_ATTESTATION_TYPE, EFFECT_RECEIPT_TYPE, HUMAN_LIMIT_MINOR, LocalAuthority, LOCAL_AUTHORITY_API_KEY, LOCAL_AUTHORITY_ISSUER, LOCAL_AUTHORITY_JWKS_PATH, hashBinding, stableStringify, type LocalAllowanceDraw, type LocalAllowanceUsage, type LocalAuthorityOptions, type LocalClaimAttestationClaims, type LocalEffectReceiptCode, type LocalEffectReceiptRecord, type LocalProviderKey, PROVIDER_KEY_PURPOSES, type LocalAuthorityPolicy, type LocalAuthorityPolicyInput, type LocalProviderKeyPurpose, type LocalAuthorityRequestRecord, type LocalGrantRecord, type LocalManagedEscalationRecord, type LocalMaterialSignal, type LocalRouteOverride, } from "./LocalAuthority.js";
|
|
12
|
+
export { LocalPlans } from "./LocalPlans.js";
|
|
13
|
+
export { LocalAssumptionBreaches, type LocalAssumptionBreach, type LocalAssumptionBreachCitation, type LocalAssumptionBreachScope, type LocalAssumptionBreachTrigger, } from "./LocalAssumptionBreaches.js";
|
|
12
14
|
export { SIGNED_SIGNAL_MAX_LIFETIME_SECONDS, SIGNED_SIGNAL_REFUSAL_CODES, SIGNED_SIGNAL_TYPE, mintSignedSignal, signedSignalFacts, verifySignedSignal, verifySignedSignals, type SignedSignalClaims, type SignedSignalCoverage, type SignedSignalFacts, type SignedSignalIntentView, type SignedSignalKey, type SignedSignalRefusalCode, type SignedSignalVerification, type VerifiedSignedSignal, } from "./SignedSignals.js";
|
|
13
15
|
//# sourceMappingURL=Index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Index.d.ts","sourceRoot":"","sources":["../../src/testing/Index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,0BAA0B,EAC1B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,GACnC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,QAAQ,EACR,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,GAC7B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,EACzB,WAAW,EACX,eAAe,EACf,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,gBAAgB,EACrB,KAAK,4BAA4B,EACjC,KAAK,kBAAkB,GACxB,MA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EACzB,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,gBAAgB,EACrB,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,uBAAuB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,EAC/B,KAAK,4BAA4B,GAClC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,kCAAkC,EAClC,2BAA2B,EAC3B,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAC"}
|
package/dist/testing/Index.js
CHANGED
|
@@ -9,5 +9,7 @@ export { FixtureAuthorizationVerifier, FixtureDecisionAuthority, createFixtureAu
|
|
|
9
9
|
export { InMemoryReplayStore } from "../execution/ReplayStore.js";
|
|
10
10
|
export { LocalPresence, LOCAL_PRESENCE_API_KEY, readBody, } from "./LocalPresence.js";
|
|
11
11
|
export { AUTONOMOUS_LIMIT_MINOR, CLAIM_ATTESTATION_TYPE, EFFECT_RECEIPT_TYPE, HUMAN_LIMIT_MINOR, LocalAuthority, LOCAL_AUTHORITY_API_KEY, LOCAL_AUTHORITY_ISSUER, LOCAL_AUTHORITY_JWKS_PATH, hashBinding, stableStringify, PROVIDER_KEY_PURPOSES, } from "./LocalAuthority.js";
|
|
12
|
+
export { LocalPlans } from "./LocalPlans.js";
|
|
13
|
+
export { LocalAssumptionBreaches, } from "./LocalAssumptionBreaches.js";
|
|
12
14
|
export { SIGNED_SIGNAL_MAX_LIFETIME_SECONDS, SIGNED_SIGNAL_REFUSAL_CODES, SIGNED_SIGNAL_TYPE, mintSignedSignal, signedSignalFacts, verifySignedSignal, verifySignedSignals, } from "./SignedSignals.js";
|
|
13
15
|
//# sourceMappingURL=Index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Index.js","sourceRoot":"","sources":["../../src/testing/Index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,0BAA0B,GAK3B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,QAAQ,GAUT,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,EACzB,WAAW,EACX,eAAe,
|
|
1
|
+
{"version":3,"file":"Index.js","sourceRoot":"","sources":["../../src/testing/Index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,0BAA0B,GAK3B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,QAAQ,GAUT,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,EACzB,WAAW,EACX,eAAe,EAQf,qBAAqB,GAStB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,uBAAuB,GAKxB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,kCAAkC,EAClC,2BAA2B,EAC3B,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,GASpB,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The hosted authority's assumption breaches, as `LocalAuthority` models them
|
|
3
|
+
* (Decionis `docs/architecture/assumption-breaches.md`): an observed outcome
|
|
4
|
+
* that contradicts what a grant was bound to holds that grant's scope, the
|
|
5
|
+
* action type at its target, until a governed release or recovery review
|
|
6
|
+
* cites it and every piece of its evidence.
|
|
7
|
+
*
|
|
8
|
+
* Hosted, the breach is a fact policy reads (`history.assumption_breach`) and
|
|
9
|
+
* the starter policy's rule ESCALATEs on it; this double has a policy hook
|
|
10
|
+
* instead of rules, so it applies that rule's effect itself: an autonomous
|
|
11
|
+
* ALLOW in a held scope becomes ESCALATE, and a grant issued autonomously
|
|
12
|
+
* fails at claim with `POLICY_STATE_CHANGED`, the code the hosted claim's
|
|
13
|
+
* policy re-run answers. An ALLOW a person approved is that person's
|
|
14
|
+
* decision and goes through, as it would under a policy whose approval rule
|
|
15
|
+
* sits above the hold.
|
|
16
|
+
*/
|
|
17
|
+
/** Why a breach opened. The double opens the two a finalization can. */
|
|
18
|
+
export type LocalAssumptionBreachTrigger = "EFFECT_MISMATCH" | "EFFECT_RECEIPT_CONTRADICTION";
|
|
19
|
+
/** Where a breach holds: the action type at one target, as the hosted scope names it. */
|
|
20
|
+
export interface LocalAssumptionBreachScope {
|
|
21
|
+
readonly tenantId: string;
|
|
22
|
+
readonly actionType: string;
|
|
23
|
+
readonly system: string;
|
|
24
|
+
readonly environment: string;
|
|
25
|
+
readonly resource: string;
|
|
26
|
+
}
|
|
27
|
+
export interface LocalAssumptionBreach {
|
|
28
|
+
readonly breachId: string;
|
|
29
|
+
readonly trigger: LocalAssumptionBreachTrigger;
|
|
30
|
+
readonly scope: LocalAssumptionBreachScope;
|
|
31
|
+
readonly grantJti: string;
|
|
32
|
+
readonly dossierId: string;
|
|
33
|
+
/** What a clearance must cite, exactly. */
|
|
34
|
+
readonly evidenceIds: readonly string[];
|
|
35
|
+
status: "OPEN" | "CLEARED";
|
|
36
|
+
}
|
|
37
|
+
/** What a governed release or recovery review cites to clear a breach. */
|
|
38
|
+
export interface LocalAssumptionBreachCitation {
|
|
39
|
+
readonly breachId: string;
|
|
40
|
+
readonly evidenceIds: readonly string[];
|
|
41
|
+
}
|
|
42
|
+
export declare class LocalAssumptionBreaches {
|
|
43
|
+
/** Every breach opened, oldest first. */
|
|
44
|
+
readonly all: LocalAssumptionBreach[];
|
|
45
|
+
private readonly subjects;
|
|
46
|
+
/** The scope of an intent: the hosted binding's target, environment defaulting to production. */
|
|
47
|
+
static scopeOf(request: {
|
|
48
|
+
readonly tenant_id: string;
|
|
49
|
+
readonly action: {
|
|
50
|
+
readonly type: string;
|
|
51
|
+
readonly resource: string;
|
|
52
|
+
};
|
|
53
|
+
readonly downstream_target: {
|
|
54
|
+
readonly system: string;
|
|
55
|
+
readonly environment?: string | undefined;
|
|
56
|
+
};
|
|
57
|
+
}): LocalAssumptionBreachScope;
|
|
58
|
+
/** The breaches still holding a scope. */
|
|
59
|
+
openIn(scope: LocalAssumptionBreachScope): readonly LocalAssumptionBreach[];
|
|
60
|
+
/** Remembers what a grant was issued for, so its finalization and its claim are scoped. */
|
|
61
|
+
granted(token: string, scope: LocalAssumptionBreachScope, autonomous: boolean): void;
|
|
62
|
+
/** Whether a claim of this grant is refused: an autonomous grant in a held scope. */
|
|
63
|
+
holdsClaim(token: string): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Opens a breach when a finalization contradicts its binding: a verified
|
|
66
|
+
* receipt that effected another effect, effected what the executor reports
|
|
67
|
+
* FAILED, or refused what it reports COMMITTED; or the executor's own
|
|
68
|
+
* observation of another effect. One per grant, whatever it is retried as.
|
|
69
|
+
*/
|
|
70
|
+
finalized(input: {
|
|
71
|
+
readonly token: string;
|
|
72
|
+
readonly grantJti: string;
|
|
73
|
+
readonly dossierId: string;
|
|
74
|
+
readonly outcome: "COMMITTED" | "FAILED" | "INDETERMINATE";
|
|
75
|
+
readonly expectedEffectDigest: string | null;
|
|
76
|
+
readonly observedEffectDigest: string | null;
|
|
77
|
+
readonly evidenceDigest: string | null;
|
|
78
|
+
readonly receipt: {
|
|
79
|
+
readonly verified: boolean;
|
|
80
|
+
readonly token: string;
|
|
81
|
+
readonly effect_status: "EFFECTED" | "REFUSED" | "INDETERMINATE" | null;
|
|
82
|
+
readonly effect_digest: string | null;
|
|
83
|
+
} | null;
|
|
84
|
+
}): {
|
|
85
|
+
readonly breach_id: string;
|
|
86
|
+
readonly trigger: LocalAssumptionBreachTrigger;
|
|
87
|
+
readonly created: boolean;
|
|
88
|
+
} | null;
|
|
89
|
+
/**
|
|
90
|
+
* What a governed release or recovery review that cites the breaches does
|
|
91
|
+
* hosted: each must be open and cited with every evidence id it was opened
|
|
92
|
+
* on, or none clears.
|
|
93
|
+
*/
|
|
94
|
+
clear(citations: readonly LocalAssumptionBreachCitation[]): void;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=LocalAssumptionBreaches.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocalAssumptionBreaches.d.ts","sourceRoot":"","sources":["../../src/testing/LocalAssumptionBreaches.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AAEH,wEAAwE;AACxE,MAAM,MAAM,4BAA4B,GAAG,iBAAiB,GAAG,8BAA8B,CAAC;AAE9F,yFAAyF;AACzF,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,C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