@intutic/shared-types 2.9.0 → 3.0.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/dist/decide.d.ts +269 -0
- package/dist/decide.d.ts.map +1 -0
- package/dist/decide.js +781 -0
- package/dist/decide.js.map +1 -0
- package/dist/decideEngine.d.ts +195 -0
- package/dist/decideEngine.d.ts.map +1 -0
- package/dist/decideEngine.js +720 -0
- package/dist/decideEngine.js.map +1 -0
- package/dist/decideEvaluate.d.ts +250 -0
- package/dist/decideEvaluate.d.ts.map +1 -0
- package/dist/decideEvaluate.js +518 -0
- package/dist/decideEvaluate.js.map +1 -0
- package/dist/decideHostGuard.d.ts +56 -0
- package/dist/decideHostGuard.d.ts.map +1 -0
- package/dist/decideHostGuard.js +200 -0
- package/dist/decideHostGuard.js.map +1 -0
- package/dist/decideLog.d.ts +287 -0
- package/dist/decideLog.d.ts.map +1 -0
- package/dist/decideLog.js +543 -0
- package/dist/decideLog.js.map +1 -0
- package/dist/decideLogRedaction.d.ts +12 -0
- package/dist/decideLogRedaction.d.ts.map +1 -0
- package/dist/decideLogRedaction.js +19 -0
- package/dist/decideLogRedaction.js.map +1 -0
- package/dist/decideRecord.d.ts +128 -0
- package/dist/decideRecord.d.ts.map +1 -0
- package/dist/decideRecord.js +266 -0
- package/dist/decideRecord.js.map +1 -0
- package/dist/decideSdk.d.ts +86 -0
- package/dist/decideSdk.d.ts.map +1 -0
- package/dist/decideSdk.js +151 -0
- package/dist/decideSdk.js.map +1 -0
- package/dist/errors.d.ts +11 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +12 -1
- package/dist/errors.js.map +1 -1
- package/dist/gateLimits.d.ts +27 -0
- package/dist/gateLimits.d.ts.map +1 -1
- package/dist/gateLimits.js +29 -1
- package/dist/gateLimits.js.map +1 -1
- package/dist/gateRuleRecord.d.ts +244 -0
- package/dist/gateRuleRecord.d.ts.map +1 -0
- package/dist/gateRuleRecord.js +474 -0
- package/dist/gateRuleRecord.js.map +1 -0
- package/dist/guardrailIr.d.ts +301 -10
- package/dist/guardrailIr.d.ts.map +1 -1
- package/dist/guardrailIr.js +86 -7
- package/dist/guardrailIr.js.map +1 -1
- package/dist/guardrailRender.d.ts +38 -4
- package/dist/guardrailRender.d.ts.map +1 -1
- package/dist/guardrailRender.js +155 -14
- package/dist/guardrailRender.js.map +1 -1
- package/dist/index.d.ts +28 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +162 -8
- package/dist/index.js.map +1 -1
- package/dist/lanes.d.ts +94 -0
- package/dist/lanes.d.ts.map +1 -0
- package/dist/lanes.js +160 -0
- package/dist/lanes.js.map +1 -0
- package/dist/loopVerify.d.ts +49 -0
- package/dist/loopVerify.d.ts.map +1 -0
- package/dist/loopVerify.js +77 -0
- package/dist/loopVerify.js.map +1 -0
- package/dist/mcpBudgets.d.ts +8 -8
- package/dist/notifications.d.ts +1 -1
- package/dist/notifications.d.ts.map +1 -1
- package/dist/notifications.js +14 -0
- package/dist/notifications.js.map +1 -1
- package/dist/providers.d.ts +13 -0
- package/dist/providers.d.ts.map +1 -1
- package/dist/providers.js +31 -0
- package/dist/providers.js.map +1 -1
- package/dist/refusalDetail.d.ts +58 -0
- package/dist/refusalDetail.d.ts.map +1 -0
- package/dist/refusalDetail.js +128 -0
- package/dist/refusalDetail.js.map +1 -0
- package/dist/responses/decide.d.ts +1858 -0
- package/dist/responses/decide.d.ts.map +1 -0
- package/dist/responses/decide.js +166 -0
- package/dist/responses/decide.js.map +1 -0
- package/dist/responses/gateways.d.ts +745 -101
- package/dist/responses/gateways.d.ts.map +1 -1
- package/dist/responses/gateways.js +34 -2
- package/dist/responses/gateways.js.map +1 -1
- package/dist/responses/guardrails.d.ts +1434 -144
- package/dist/responses/guardrails.d.ts.map +1 -1
- package/dist/responses/identity.d.ts +6 -6
- package/dist/responses/index.d.ts +1 -0
- package/dist/responses/index.d.ts.map +1 -1
- package/dist/responses/index.js +1 -0
- package/dist/responses/index.js.map +1 -1
- package/dist/responses/integrations.d.ts +84 -84
- package/dist/responses/observability.d.ts +272 -92
- package/dist/responses/observability.d.ts.map +1 -1
- package/dist/responses/observability.js +31 -1
- package/dist/responses/observability.js.map +1 -1
- package/dist/responses/rules.d.ts +1026 -187
- package/dist/responses/rules.d.ts.map +1 -1
- package/dist/responses/rules.js +47 -1
- package/dist/responses/rules.js.map +1 -1
- package/dist/scopeMatch.d.ts +156 -0
- package/dist/scopeMatch.d.ts.map +1 -0
- package/dist/scopeMatch.js +451 -0
- package/dist/scopeMatch.js.map +1 -0
- package/dist/sopKeySince.d.ts +41 -0
- package/dist/sopKeySince.d.ts.map +1 -0
- package/dist/sopKeySince.js +81 -0
- package/dist/sopKeySince.js.map +1 -0
- package/dist/testOutcome.d.ts +164 -0
- package/dist/testOutcome.d.ts.map +1 -0
- package/dist/testOutcome.js +454 -0
- package/dist/testOutcome.js.map +1 -0
- package/dist/upstreamRetry.d.ts +2 -2
- package/dist/workspaceSettings.d.ts +91 -0
- package/dist/workspaceSettings.d.ts.map +1 -1
- package/dist/workspaceSettings.js +48 -2
- package/dist/workspaceSettings.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,518 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Evaluating one tool call's decide rules against the engine, inside the
|
|
4
|
+
* engine protections:
|
|
5
|
+
*
|
|
6
|
+
* 1. Decisions only add friction: nothing is asked unless the deterministic
|
|
7
|
+
* tiers allowed the call, and a decide outcome can refuse or escalate,
|
|
8
|
+
* never lower another rule's verdict. Shadow rules never change the call.
|
|
9
|
+
* 2. The state is built from the call's own fields and the rule's text only
|
|
10
|
+
* (`buildDecideToolCallState`); a context field goes in quoted and marked
|
|
11
|
+
* untrusted.
|
|
12
|
+
* 3. Choice questions are asked in every order and averaged; orders that
|
|
13
|
+
* disagree make the answer unknown (`decide.ts`).
|
|
14
|
+
* 4. A rule enforces only under a pin for the model digest the engine
|
|
15
|
+
* reports on this call; any other digest runs it as shadow.
|
|
16
|
+
* 5. Pins belong to a rule hash: pins earned by another wording are not this
|
|
17
|
+
* rule's.
|
|
18
|
+
* 6. A known-answer canary, cached per engine URL and model digest for
|
|
19
|
+
* {@link DECIDE_CANARY_TTL_MS}, runs beside the rule's questions when the
|
|
20
|
+
* cache is missing, failed or stale. A failed canary discards every
|
|
21
|
+
* answer: the engine is unavailable, which refuses an enforcing rule.
|
|
22
|
+
*
|
|
23
|
+
* And the latency budget: with the engine's per-call p95 (`q95Ms`, which
|
|
24
|
+
* `intutic doctor` measures and stores in engine.json), a rule whose
|
|
25
|
+
* estimate does not fit the time left is not asked. An enforcing one
|
|
26
|
+
* escalates, as an unknown answer does; a shadow one is logged and allowed.
|
|
27
|
+
*
|
|
28
|
+
* Self-contained but for the decide modules beside it, so `@intutic/gate`
|
|
29
|
+
* carries a byte-identical copy. The canary cache's file is reached through
|
|
30
|
+
* the `fs` its caller passes ({@link createDecideCanaryFileStore}). The Python
|
|
31
|
+
* (`intutic_clawde/gate/decide_evaluate.py`) and Rust
|
|
32
|
+
* (`proxy/src/decide/evaluate.rs`) ports run the same `rollout` and
|
|
33
|
+
* `evaluate` cases of `fixtures/decide-engine-vectors.json`.
|
|
34
|
+
*
|
|
35
|
+
* @module
|
|
36
|
+
*/
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.DECIDE_GATE_JS_SOURCE = exports.DECIDE_EVALUATE_JS_SOURCE = exports.DECIDE_CANARY_FILE = exports.DECIDE_CANARY_TTL_MS = void 0;
|
|
39
|
+
exports.decideEffectiveRollout = decideEffectiveRollout;
|
|
40
|
+
exports.decideCanaryFresh = decideCanaryFresh;
|
|
41
|
+
exports.createDecideCanaryFileStore = createDecideCanaryFileStore;
|
|
42
|
+
exports.decideVerdictInOrder = decideVerdictInOrder;
|
|
43
|
+
exports.decideRuleCalls = decideRuleCalls;
|
|
44
|
+
exports.decideRuleEstimateMs = decideRuleEstimateMs;
|
|
45
|
+
exports.decideStoredQ95Ms = decideStoredQ95Ms;
|
|
46
|
+
exports.evaluateDecideCall = evaluateDecideCall;
|
|
47
|
+
exports.decideDecision = decideDecision;
|
|
48
|
+
exports.decideShadowFindings = decideShadowFindings;
|
|
49
|
+
exports.decideUnavailableDecision = decideUnavailableDecision;
|
|
50
|
+
const decide_js_1 = require("./decide.js");
|
|
51
|
+
const decideRecord_js_1 = require("./decideRecord.js");
|
|
52
|
+
const decideEngine_js_1 = require("./decideEngine.js");
|
|
53
|
+
const decideHostGuard_js_1 = require("./decideHostGuard.js");
|
|
54
|
+
const decideLog_js_1 = require("./decideLog.js");
|
|
55
|
+
/**
|
|
56
|
+
* Whether a rule enforces on this call. Only when its author wrote `enforce`,
|
|
57
|
+
* the snapshot stamped it `enforce`, and one of its pins is for `modelDigest`;
|
|
58
|
+
* otherwise it runs as shadow and `why` says which condition failed. A null
|
|
59
|
+
* digest (the engine could not say) leaves a stamped rule enforcing, so the
|
|
60
|
+
* engine's unavailability refuses rather than opening the call.
|
|
61
|
+
*/
|
|
62
|
+
function decideEffectiveRollout(entry, modelDigest) {
|
|
63
|
+
if (entry.ir.rollout !== 'enforce')
|
|
64
|
+
return { effective: 'shadow', why: 'rollout', pin: null };
|
|
65
|
+
if (entry.rollout !== 'enforce')
|
|
66
|
+
return { effective: 'shadow', why: entry.stampedBy === 'rule' ? 'rollout' : entry.stampedBy, pin: null };
|
|
67
|
+
if (entry.pins.length === 0)
|
|
68
|
+
return { effective: 'shadow', why: 'no-pins', pin: null };
|
|
69
|
+
if (modelDigest === null)
|
|
70
|
+
return { effective: 'enforce', why: null, pin: null };
|
|
71
|
+
const pin = entry.pins.find((p) => p.modelDigest === modelDigest);
|
|
72
|
+
return pin ? { effective: 'enforce', why: null, pin } : { effective: 'shadow', why: 'not_evaluated', pin: null };
|
|
73
|
+
}
|
|
74
|
+
// ---------------------------------------------------------------------------
|
|
75
|
+
// The canary cache (protection 6)
|
|
76
|
+
// ---------------------------------------------------------------------------
|
|
77
|
+
/** A canary result older than this is run again. */
|
|
78
|
+
exports.DECIDE_CANARY_TTL_MS = 600_000;
|
|
79
|
+
/** The cache's file name in `~/.intutic/decide/`. */
|
|
80
|
+
exports.DECIDE_CANARY_FILE = 'canary.json';
|
|
81
|
+
/** The most engine and digest pairs the file keeps, newest last. */
|
|
82
|
+
const CANARY_ENTRIES_MAX = 16;
|
|
83
|
+
/** A passed result younger than {@link DECIDE_CANARY_TTL_MS}. A failed one is never fresh: it runs again. */
|
|
84
|
+
function decideCanaryFresh(entry, nowMs) {
|
|
85
|
+
return entry !== null && entry.ok && entry.atMs <= nowMs && nowMs - entry.atMs < exports.DECIDE_CANARY_TTL_MS;
|
|
86
|
+
}
|
|
87
|
+
function canaryEntry(v) {
|
|
88
|
+
if (typeof v !== 'object' || v === null)
|
|
89
|
+
return null;
|
|
90
|
+
const e = v;
|
|
91
|
+
const num = (x) => typeof x === 'number' && Number.isFinite(x);
|
|
92
|
+
if (typeof e.url !== 'string' || typeof e.modelDigest !== 'string' || typeof e.ok !== 'boolean')
|
|
93
|
+
return null;
|
|
94
|
+
if (!num(e.atMs) || !num(e.pViolation) || !num(e.pClean) || typeof e.choiceTop !== 'string')
|
|
95
|
+
return null;
|
|
96
|
+
return { url: e.url, modelDigest: e.modelDigest, ok: e.ok, atMs: e.atMs, pViolation: e.pViolation, pClean: e.pClean, choiceTop: e.choiceTop };
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The canary cache as one JSON file, `{"v":1,"entries":[…]}`, mode 0600 in a
|
|
100
|
+
* 0700 directory, replaced whole by a rename so a reader never sees half of
|
|
101
|
+
* it. A file that does not read is an empty cache, and the canary runs.
|
|
102
|
+
*/
|
|
103
|
+
function createDecideCanaryFileStore(file, fs) {
|
|
104
|
+
const readAll = () => {
|
|
105
|
+
try {
|
|
106
|
+
const doc = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
107
|
+
if (doc.v !== 1 || !Array.isArray(doc.entries))
|
|
108
|
+
return [];
|
|
109
|
+
return doc.entries.map(canaryEntry).filter((e) => e !== null);
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
return [];
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
return {
|
|
116
|
+
read(url, modelDigest) {
|
|
117
|
+
return readAll().find((e) => e.url === url && e.modelDigest === modelDigest) ?? null;
|
|
118
|
+
},
|
|
119
|
+
write(entry) {
|
|
120
|
+
const entries = [...readAll().filter((e) => e.url !== entry.url || e.modelDigest !== entry.modelDigest), entry].slice(-CANARY_ENTRIES_MAX);
|
|
121
|
+
const dir = file.replace(/[\\/][^\\/]*$/, '');
|
|
122
|
+
if (dir && dir !== file)
|
|
123
|
+
fs.mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
124
|
+
const tmp = `${file}.${Date.now()}.${Math.random().toString(36).slice(2)}.tmp`;
|
|
125
|
+
fs.writeFileSync(tmp, JSON.stringify({ v: 1, entries }) + '\n', { mode: 0o600 });
|
|
126
|
+
fs.renameSync(tmp, file);
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
const ALLOW = { outcome: 'allow', code: null, ruleRef: null, via: null, reason: null };
|
|
131
|
+
function errorCode(err) {
|
|
132
|
+
return err instanceof decideEngine_js_1.DecideEngineError ? err.code : 'bad_response';
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* A call's verdict in the order of evidence: deterministic
|
|
136
|
+
* refusals, then consequence (holds), then trajectory, then model judgement
|
|
137
|
+
* last. `before` is the verdict of everything before decide; `decide` is
|
|
138
|
+
* what the decide rules answered, or null when none was asked. A hold or a
|
|
139
|
+
* refusal before decide stands whatever decide says; inside an open lane a
|
|
140
|
+
* decide refusal or escalation still applies.
|
|
141
|
+
*/
|
|
142
|
+
function decideVerdictInOrder(before, decide) {
|
|
143
|
+
if (before !== 'allow')
|
|
144
|
+
return before;
|
|
145
|
+
return decide === null ? 'allow' : decide.outcome;
|
|
146
|
+
}
|
|
147
|
+
// ---------------------------------------------------------------------------
|
|
148
|
+
// The latency budget
|
|
149
|
+
// ---------------------------------------------------------------------------
|
|
150
|
+
/** The engine calls one evaluation of `rule` makes: a yes/no question one, a choice two, or three past three options (none_of_these counted). */
|
|
151
|
+
function decideRuleCalls(rule) {
|
|
152
|
+
let n = 0;
|
|
153
|
+
for (const q of Object.values(rule.questions))
|
|
154
|
+
n += q.type === 'yes_no' ? 1 : (0, decide_js_1.decideOptions)(q).length > 3 ? 3 : 2;
|
|
155
|
+
return n;
|
|
156
|
+
}
|
|
157
|
+
/** The estimated time to evaluate `rule`: the per-call p95 times its calls over `parallel`. */
|
|
158
|
+
function decideRuleEstimateMs(rule, q95Ms, parallel) {
|
|
159
|
+
return Math.round(q95Ms * Math.ceil(decideRuleCalls(rule) / Math.max(1, parallel)));
|
|
160
|
+
}
|
|
161
|
+
/** The per-call p95 `intutic doctor` stored in engine.json (`q95Ms`, parsed), or null when there is none. */
|
|
162
|
+
function decideStoredQ95Ms(file) {
|
|
163
|
+
const v = file !== null && typeof file === 'object' && !Array.isArray(file) ? file.q95Ms : undefined;
|
|
164
|
+
return typeof v === 'number' && Number.isFinite(v) && v > 0 ? v : null;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Evaluates the decide rules a tool call matches. Never throws: an engine
|
|
168
|
+
* error is an unavailable rule (or, for `too_large`, an unknown one), which
|
|
169
|
+
* refuses with GOVERNANCE_UNAVAILABLE when the rule enforces.
|
|
170
|
+
*
|
|
171
|
+
* With the engine's p95 (`deps.q95Ms`), a rule whose estimate does not fit
|
|
172
|
+
* the time left before `deadlineMs` is not asked: its report carries
|
|
173
|
+
* `budget_skip`, and it is unknown. An enforcing one escalates (or refuses,
|
|
174
|
+
* with `escalate: refuse`); a shadow one is allowed. The rest are asked.
|
|
175
|
+
*/
|
|
176
|
+
async function evaluateDecideCall(input, deps) {
|
|
177
|
+
const q95 = deps.q95Ms ?? null;
|
|
178
|
+
if (q95 === null || input.deterministic !== 'allow')
|
|
179
|
+
return evaluateDecideRules(input, deps);
|
|
180
|
+
const leftMs = input.deadlineMs - (deps.now ?? Date.now)();
|
|
181
|
+
const inBudget = [];
|
|
182
|
+
const overBudget = [];
|
|
183
|
+
for (const r of input.rules) {
|
|
184
|
+
const v = (0, decide_js_1.validateDecideRule)(r.ir);
|
|
185
|
+
const named = r.ir.on === 'tool_call' && (r.ir.tools ?? []).includes(input.tool);
|
|
186
|
+
if (named && v.ok && decideRuleEstimateMs(v.rule, q95, deps.parallel ?? 1) > leftMs)
|
|
187
|
+
overBudget.push(r);
|
|
188
|
+
else
|
|
189
|
+
inBudget.push(r);
|
|
190
|
+
}
|
|
191
|
+
const ev = await evaluateDecideRules({ ...input, rules: inBudget }, deps);
|
|
192
|
+
if (overBudget.length === 0)
|
|
193
|
+
return ev;
|
|
194
|
+
const digest = ev.engine?.modelDigest ?? null;
|
|
195
|
+
const skipped = overBudget.map((r) => {
|
|
196
|
+
const v = (0, decide_js_1.validateDecideRule)(r.ir);
|
|
197
|
+
const pins = v.ok && (0, decide_js_1.decideRuleHash)(v.rule, deps.sha256Hex) === r.ruleHash ? r.pins : [];
|
|
198
|
+
const eff = decideEffectiveRollout({ ...r, pins }, digest);
|
|
199
|
+
const escalate = v.ok ? v.rule.escalate ?? 'ask' : 'ask';
|
|
200
|
+
const report = { ref: r.ref, ruleHash: r.ruleHash, effective: eff.effective, why: eff.why, error: 'budget_skip', modelDigest: digest, answers: null };
|
|
201
|
+
if (eff.effective === 'shadow')
|
|
202
|
+
return { ...report, outcome: 'allow', code: null, via: null };
|
|
203
|
+
if (escalate === 'refuse')
|
|
204
|
+
return { ...report, outcome: 'refuse', code: 'DECIDE_ESCALATED', via: null };
|
|
205
|
+
return { ...report, outcome: 'escalate', code: 'DECIDE_ESCALATED', via: escalate };
|
|
206
|
+
});
|
|
207
|
+
const rules = [...ev.rules, ...skipped];
|
|
208
|
+
// A refusal for too many rules on the tool comes before any rule is asked, and stands.
|
|
209
|
+
const call = ev.rules.length === 0 && ev.call.outcome !== 'allow' ? ev.call : (0, decide_js_1.decideCallOutcome)({ unavailable: null }, rules);
|
|
210
|
+
return { ...ev, call, rules };
|
|
211
|
+
}
|
|
212
|
+
/** {@link evaluateDecideCall} on every rule it is given, with no budget estimate. */
|
|
213
|
+
async function evaluateDecideRules(input, deps) {
|
|
214
|
+
const now = deps.now ?? Date.now;
|
|
215
|
+
if (input.deterministic !== 'allow') {
|
|
216
|
+
const reason = input.deterministic === 'hold' ? 'the call is held for a person; a decide answer never releases a hold' : 'a deterministic rule refused the call';
|
|
217
|
+
return {
|
|
218
|
+
call: { outcome: 'refuse', code: null, ruleRef: null, via: null, reason },
|
|
219
|
+
rules: [],
|
|
220
|
+
skipped: [],
|
|
221
|
+
engine: null,
|
|
222
|
+
canary: null,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
const matched = input.rules.filter((r) => r.ir.on === 'tool_call' && (r.ir.tools ?? []).includes(input.tool));
|
|
226
|
+
if (matched.length === 0)
|
|
227
|
+
return { call: ALLOW, rules: [], skipped: [], engine: null, canary: null };
|
|
228
|
+
const engine = deps.engine instanceof decideEngine_js_1.DecideEngineError ? null : deps.engine;
|
|
229
|
+
let engineError = deps.engine instanceof decideEngine_js_1.DecideEngineError ? deps.engine.code : null;
|
|
230
|
+
let identity = null;
|
|
231
|
+
if (engine) {
|
|
232
|
+
try {
|
|
233
|
+
identity = await engine.describe(input.deadlineMs);
|
|
234
|
+
}
|
|
235
|
+
catch (err) {
|
|
236
|
+
engineError = errorCode(err);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
const entries = matched.map((r) => {
|
|
240
|
+
const v = (0, decide_js_1.validateDecideRule)(r.ir);
|
|
241
|
+
// Pins are earned by one rule hash: a rule whose hash is not the one its
|
|
242
|
+
// pins were stored under has none.
|
|
243
|
+
const pins = v.ok && (0, decide_js_1.decideRuleHash)(v.rule, deps.sha256Hex) === r.ruleHash ? r.pins : [];
|
|
244
|
+
const entry = { ...r, pins };
|
|
245
|
+
return { entry, v, pre: decideEffectiveRollout(entry, identity?.modelDigest ?? null) };
|
|
246
|
+
});
|
|
247
|
+
const selection = (0, decide_js_1.selectDecideRules)(entries.map((e) => ({ ref: e.entry.ref, on: e.entry.ir.on, tools: e.entry.ir.tools, effective: e.pre.effective, e })), input.tool);
|
|
248
|
+
const skipped = selection.skipped.map((c) => c.ref);
|
|
249
|
+
if (selection.unavailable) {
|
|
250
|
+
return { call: (0, decide_js_1.decideCallOutcome)(selection, []), rules: [], skipped, engine: identity, canary: null };
|
|
251
|
+
}
|
|
252
|
+
const askRule = async (e) => {
|
|
253
|
+
if (!engine || engineError)
|
|
254
|
+
return { answers: null, error: engineError ?? 'not_configured', modelDigest: null };
|
|
255
|
+
if (!e.v.ok)
|
|
256
|
+
return { answers: null, error: 'bad_response', modelDigest: null };
|
|
257
|
+
const rule = e.v.rule;
|
|
258
|
+
const questions = Object.keys(rule.questions).map((name) => {
|
|
259
|
+
const q = rule.questions[name];
|
|
260
|
+
return q.type === 'choice' ? { name, type: 'choice', ask: q.ask, options: (0, decide_js_1.decideOptions)(q) } : { name, type: 'yes_no', ask: q.ask };
|
|
261
|
+
});
|
|
262
|
+
try {
|
|
263
|
+
const state = (0, decideEngine_js_1.buildDecideToolCallState)({
|
|
264
|
+
ruleId: rule.id,
|
|
265
|
+
sopTitle: e.entry.sopTitle,
|
|
266
|
+
ruleText: e.entry.ruleText,
|
|
267
|
+
tool: input.tool,
|
|
268
|
+
cwd: input.cwd,
|
|
269
|
+
toolInput: input.toolInput,
|
|
270
|
+
...((rule.context ?? []).includes('last_user_turn') ? { lastUserTurn: input.lastUserTurn ?? null } : {}),
|
|
271
|
+
});
|
|
272
|
+
const res = await engine.ask(state, questions, input.deadlineMs);
|
|
273
|
+
return { answers: res.answers, error: null, modelDigest: res.modelDigest };
|
|
274
|
+
}
|
|
275
|
+
catch (err) {
|
|
276
|
+
return { answers: null, error: errorCode(err), modelDigest: null };
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
let canary = null;
|
|
280
|
+
// `canary_failed` only when the canary was answered and the answer was
|
|
281
|
+
// wrong; an engine that did not answer it at all carries its own error
|
|
282
|
+
// (`upstream`, `timeout`, …).
|
|
283
|
+
let canaryRun = Promise.resolve(null);
|
|
284
|
+
if (engine && !engineError && identity) {
|
|
285
|
+
const key = identity.modelDigest;
|
|
286
|
+
if (decideCanaryFresh(deps.canary.read(deps.engineUrl, key), now())) {
|
|
287
|
+
canary = 'cached';
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
canaryRun = (0, decideEngine_js_1.runDecideCanary)(engine.ask, input.deadlineMs).then((r) => {
|
|
291
|
+
try {
|
|
292
|
+
deps.canary.write({ url: deps.engineUrl, modelDigest: key, ok: r.ok, atMs: now(), pViolation: r.pViolation, pClean: r.pClean, choiceTop: r.choiceTop });
|
|
293
|
+
}
|
|
294
|
+
catch {
|
|
295
|
+
// An unwritable cache only means the canary runs again next call.
|
|
296
|
+
}
|
|
297
|
+
return r.ok ? null : 'canary_failed';
|
|
298
|
+
}, (err) => errorCode(err));
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
const [canaryError, asked] = await Promise.all([canaryRun, Promise.all(selection.evaluate.map((c) => askRule(c.e)))]);
|
|
302
|
+
if (canary === null && engine && !engineError && identity)
|
|
303
|
+
canary = canaryError === null ? 'ok' : canaryError === 'canary_failed' ? 'failed' : null;
|
|
304
|
+
const reports = selection.evaluate.map((c, i) => {
|
|
305
|
+
const e = c.e;
|
|
306
|
+
const a = asked[i];
|
|
307
|
+
const digest = a.modelDigest ?? identity?.modelDigest ?? null;
|
|
308
|
+
const eff = decideEffectiveRollout(e.entry, digest);
|
|
309
|
+
const base = { ref: e.entry.ref, ruleHash: e.entry.ruleHash, effective: eff.effective, why: eff.why, modelDigest: digest };
|
|
310
|
+
if (canaryError !== null) {
|
|
311
|
+
// A canary that got no answer: the rule's own engine error when it has
|
|
312
|
+
// one (it asked the same engine), else the canary's.
|
|
313
|
+
const error = canaryError !== 'canary_failed' && a.error && (0, decideEngine_js_1.decideEngineErrorOutcome)(a.error) === 'unavailable' ? a.error : canaryError;
|
|
314
|
+
return { ...base, outcome: 'unavailable', code: null, via: null, error, answers: null };
|
|
315
|
+
}
|
|
316
|
+
if (a.error && (0, decideEngine_js_1.decideEngineErrorOutcome)(a.error) === 'unavailable') {
|
|
317
|
+
return { ...base, outcome: 'unavailable', code: null, via: null, error: a.error, answers: null };
|
|
318
|
+
}
|
|
319
|
+
if (!e.v.ok)
|
|
320
|
+
return { ...base, outcome: 'unavailable', code: null, via: null, error: 'bad_response', answers: null };
|
|
321
|
+
const inputs = {};
|
|
322
|
+
for (const [name, ans] of Object.entries(a.answers ?? {}))
|
|
323
|
+
inputs[name] = { p: ans.p, perOrder: ans.perOrder };
|
|
324
|
+
// A pin's fitted combiner replaces `when`. Its per-question temperatures
|
|
325
|
+
// are not applied here.
|
|
326
|
+
const pin = eff.pin;
|
|
327
|
+
const combiner = pin?.combiner
|
|
328
|
+
? { bias: pin.combiner.bias, weights: pin.combiner.weights, band: pin.band ?? e.v.rule.band ?? decide_js_1.DECIDE_DEFAULT_BAND }
|
|
329
|
+
: null;
|
|
330
|
+
const o = (0, decide_js_1.decideRuleOutcome)(e.v.rule, e.v.expr, inputs, combiner);
|
|
331
|
+
return { ...base, outcome: o.outcome, code: o.code, via: o.via, error: a.error, answers: a.answers };
|
|
332
|
+
});
|
|
333
|
+
const results = reports.map((r) => ({ ref: r.ref, effective: r.effective, outcome: r.outcome, code: r.code, via: r.via }));
|
|
334
|
+
return { call: (0, decide_js_1.decideCallOutcome)(selection, results), rules: reports, skipped, engine: identity, canary };
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* The questions a rule could not answer: a yes/no question between its bands,
|
|
338
|
+
* a choice none of whose options cleared `yes_at` while one stayed unknown.
|
|
339
|
+
* Every question when none can be named (no answers came back).
|
|
340
|
+
*/
|
|
341
|
+
function unknownQuestions(entry, answers) {
|
|
342
|
+
const v = (0, decide_js_1.validateDecideRule)(entry.ir);
|
|
343
|
+
if (!v.ok)
|
|
344
|
+
return [];
|
|
345
|
+
const names = Object.keys(v.rule.questions);
|
|
346
|
+
if (answers) {
|
|
347
|
+
const inputs = {};
|
|
348
|
+
for (const [name, ans] of Object.entries(answers))
|
|
349
|
+
inputs[name] = { p: ans.p, perOrder: ans.perOrder };
|
|
350
|
+
const atoms = (0, decide_js_1.decideAtoms)(v.rule, inputs);
|
|
351
|
+
const unknown = names.filter((name) => {
|
|
352
|
+
if (atoms.yes[name] !== undefined)
|
|
353
|
+
return atoms.yes[name] === 'U';
|
|
354
|
+
const values = Object.values(atoms.eq[name] ?? {});
|
|
355
|
+
return !values.includes('T') && values.includes('U');
|
|
356
|
+
});
|
|
357
|
+
if (unknown.length > 0)
|
|
358
|
+
return unknown.map((name) => v.rule.questions[name].ask);
|
|
359
|
+
}
|
|
360
|
+
return names.map((name) => v.rule.questions[name].ask);
|
|
361
|
+
}
|
|
362
|
+
/** What one evaluated rule says, for a refusal, a question or a shadow record. */
|
|
363
|
+
function decideRuleReason(report, entry) {
|
|
364
|
+
const title = entry.ir.title ?? entry.sopTitle;
|
|
365
|
+
if (report.error === 'budget_skip' && report.outcome !== 'allow') {
|
|
366
|
+
return `Needs a person: ${title} — the decide engine cannot answer rule ${entry.ir.id} within this call's time budget`;
|
|
367
|
+
}
|
|
368
|
+
if (report.outcome === 'unavailable') {
|
|
369
|
+
return `GOVERNANCE_UNAVAILABLE — the decide engine could not evaluate rule ${entry.ir.id} (${title}): ${report.error ?? 'unavailable'}`;
|
|
370
|
+
}
|
|
371
|
+
if (report.code === 'DECIDE_REFUSED')
|
|
372
|
+
return `Decide rule ${entry.ir.id} (${title}) refused this call`;
|
|
373
|
+
return `Needs a person: ${title} — ${unknownQuestions(entry, report.answers).join(' ')}`;
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* The decision a gate acts on for a call's evaluation of `rules` (the records
|
|
377
|
+
* it passed in), with the reason it refuses or asks with.
|
|
378
|
+
*/
|
|
379
|
+
function decideDecision(ev, rules) {
|
|
380
|
+
const call = ev.call;
|
|
381
|
+
if (call.outcome === 'allow')
|
|
382
|
+
return { outcome: 'allow', code: null, ruleId: null, via: null, reason: '' };
|
|
383
|
+
const ruleId = call.ruleRef === null ? null : `decide.${call.ruleRef}`;
|
|
384
|
+
const entry = rules.find((r) => r.ref === call.ruleRef);
|
|
385
|
+
const report = ev.rules.find((r) => r.ref === call.ruleRef);
|
|
386
|
+
const reason = entry && report
|
|
387
|
+
? decideRuleReason(report, entry)
|
|
388
|
+
: `GOVERNANCE_UNAVAILABLE — ${call.reason ?? 'the decide rules for this call could not be evaluated'}`;
|
|
389
|
+
return { outcome: call.outcome, code: call.code, ruleId, via: call.outcome === 'escalate' ? call.via ?? 'ask' : null, reason };
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* The evaluated shadow rules that would have refused, escalated or found the
|
|
393
|
+
* engine unavailable: what a gate records, while the call goes on.
|
|
394
|
+
*/
|
|
395
|
+
function decideShadowFindings(ev, rules) {
|
|
396
|
+
const out = [];
|
|
397
|
+
for (const report of ev.rules) {
|
|
398
|
+
if (report.effective !== 'shadow' || report.outcome === 'allow')
|
|
399
|
+
continue;
|
|
400
|
+
const entry = rules.find((r) => r.ref === report.ref);
|
|
401
|
+
if (entry)
|
|
402
|
+
out.push({ ruleId: `decide.${report.ref}`, reason: decideRuleReason(report, entry) });
|
|
403
|
+
}
|
|
404
|
+
return out;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* The decision when the evaluation itself could not run or finish (the CLI
|
|
408
|
+
* failed, the budget ran out): refuse with GOVERNANCE_UNAVAILABLE, under the
|
|
409
|
+
* first matched rule its snapshot record stamped `enforce`, unless every rule
|
|
410
|
+
* on the tool is stamped `shadow`, which allows.
|
|
411
|
+
*/
|
|
412
|
+
function decideUnavailableDecision(rules, tool, why) {
|
|
413
|
+
const matched = rules.filter((r) => r.ir.on === 'tool_call' && (r.ir.tools ?? []).includes(tool));
|
|
414
|
+
const enforcing = matched.find((r) => r.rollout === 'enforce');
|
|
415
|
+
if (!enforcing)
|
|
416
|
+
return { outcome: 'allow', code: null, ruleId: null, via: null, reason: '' };
|
|
417
|
+
return { outcome: 'refuse', code: 'GOVERNANCE_UNAVAILABLE', ruleId: `decide.${enforcing.ref}`, via: null, reason: `GOVERNANCE_UNAVAILABLE — ${why}` };
|
|
418
|
+
}
|
|
419
|
+
// ---------------------------------------------------------------------------
|
|
420
|
+
// As source
|
|
421
|
+
// ---------------------------------------------------------------------------
|
|
422
|
+
/**
|
|
423
|
+
* This module as JavaScript source, for the hook gates to embed. The
|
|
424
|
+
* embedding scope supplies what it imports from `decide.ts`
|
|
425
|
+
* (`DECIDE_DEFAULT_BAND`, `decideAtoms`, `decideCallOutcome`,
|
|
426
|
+
* `decideOptions`, `decideRuleHash`, `decideRuleOutcome`, `selectDecideRules`,
|
|
427
|
+
* `validateDecideRule`) and `decideEngine.ts` (`buildDecideToolCallState`,
|
|
428
|
+
* `DecideEngineError`, `decideEngineErrorOutcome`, `runDecideCanary`). A
|
|
429
|
+
* test holds the list to the functions this file declares.
|
|
430
|
+
*/
|
|
431
|
+
exports.DECIDE_EVALUATE_JS_SOURCE = (0, decideEngine_js_1.decideModuleSource)([
|
|
432
|
+
`const DECIDE_CANARY_TTL_MS = ${exports.DECIDE_CANARY_TTL_MS};`,
|
|
433
|
+
`const DECIDE_CANARY_FILE = ${JSON.stringify(exports.DECIDE_CANARY_FILE)};`,
|
|
434
|
+
`const CANARY_ENTRIES_MAX = ${CANARY_ENTRIES_MAX};`,
|
|
435
|
+
`const ALLOW = ${JSON.stringify(ALLOW)};`,
|
|
436
|
+
decideEffectiveRollout,
|
|
437
|
+
decideCanaryFresh,
|
|
438
|
+
canaryEntry,
|
|
439
|
+
createDecideCanaryFileStore,
|
|
440
|
+
errorCode,
|
|
441
|
+
decideRuleCalls,
|
|
442
|
+
decideRuleEstimateMs,
|
|
443
|
+
decideStoredQ95Ms,
|
|
444
|
+
decideVerdictInOrder,
|
|
445
|
+
evaluateDecideCall,
|
|
446
|
+
evaluateDecideRules,
|
|
447
|
+
unknownQuestions,
|
|
448
|
+
decideRuleReason,
|
|
449
|
+
decideDecision,
|
|
450
|
+
decideShadowFindings,
|
|
451
|
+
decideUnavailableDecision,
|
|
452
|
+
]);
|
|
453
|
+
/**
|
|
454
|
+
* Every decide module a hook gate needs, as one JavaScript function
|
|
455
|
+
* expression: called with the gate's `sha256(text)` (hex), it returns the
|
|
456
|
+
* snapshot decoders (`format`, `record`), the engine (`resolveConfig`,
|
|
457
|
+
* `createEngine`, `EngineError`), the canary cache (`canaryStore(file, fs)`),
|
|
458
|
+
* the tier (`evaluate`, `decision`, `shadowFindings`, `unavailable`,
|
|
459
|
+
* `storedQ95`, the p95 an engine.json holds, and `verdictInOrder`, the order
|
|
460
|
+
* of evidence of the loops, graphs and gates release), and the decide log
|
|
461
|
+
* (`writeLog`, `logEngine`, `logDeps`).
|
|
462
|
+
* Each module has a scope of its own, since their private helpers share
|
|
463
|
+
* names, and receives what it imports as parameters.
|
|
464
|
+
*/
|
|
465
|
+
exports.DECIDE_GATE_JS_SOURCE = `(function (sha256) {
|
|
466
|
+
const decide = (function () {
|
|
467
|
+
${decide_js_1.DECIDE_JS_SOURCE}
|
|
468
|
+
${decideRecord_js_1.DECIDE_RECORD_JS_SOURCE}
|
|
469
|
+
return { choiceOrders, DECIDE_DEFAULT_BAND, decideAtoms, decideCallOutcome, decideOptions, decideRuleHash, decideRuleOutcome,
|
|
470
|
+
selectDecideRules, validateDecideRule, decodeSnapshotFormatRecord, decodeDecideRecord, bandValue, choiceAtoms,
|
|
471
|
+
decideQuestionBand, parseWhen };
|
|
472
|
+
})();
|
|
473
|
+
const guard = (function () {
|
|
474
|
+
${decideHostGuard_js_1.DECIDE_HOST_GUARD_JS_SOURCE}
|
|
475
|
+
return { checkSelfHostedDecisionHost };
|
|
476
|
+
})();
|
|
477
|
+
const engine = (function (choiceOrders, checkSelfHostedDecisionHost) {
|
|
478
|
+
${decideEngine_js_1.DECIDE_ENGINE_JS_SOURCE}
|
|
479
|
+
return { DecideEngineError, resolveDecideEngineConfig, createDecideEngine, buildDecideToolCallState, decideEngineErrorOutcome, runDecideCanary,
|
|
480
|
+
decideCanonicalJson };
|
|
481
|
+
})(decide.choiceOrders, guard.checkSelfHostedDecisionHost);
|
|
482
|
+
const evaluate = (function (DECIDE_DEFAULT_BAND, decideAtoms, decideCallOutcome, decideOptions, decideRuleHash, decideRuleOutcome,
|
|
483
|
+
selectDecideRules, validateDecideRule, buildDecideToolCallState, DecideEngineError, decideEngineErrorOutcome, runDecideCanary) {
|
|
484
|
+
${exports.DECIDE_EVALUATE_JS_SOURCE}
|
|
485
|
+
return { createDecideCanaryFileStore, evaluateDecideCall, decideDecision, decideShadowFindings, decideUnavailableDecision, decideStoredQ95Ms,
|
|
486
|
+
decideVerdictInOrder };
|
|
487
|
+
})(decide.DECIDE_DEFAULT_BAND, decide.decideAtoms, decide.decideCallOutcome, decide.decideOptions, decide.decideRuleHash,
|
|
488
|
+
decide.decideRuleOutcome, decide.selectDecideRules, decide.validateDecideRule, engine.buildDecideToolCallState,
|
|
489
|
+
engine.DecideEngineError, engine.decideEngineErrorOutcome, engine.runDecideCanary);
|
|
490
|
+
const log = (function (bandValue, choiceAtoms, decideOptions, decideQuestionBand, parseWhen, validateDecideRule, buildDecideToolCallState,
|
|
491
|
+
decideCanonicalJson) {
|
|
492
|
+
${decideLog_js_1.DECIDE_LOG_JS_SOURCE}
|
|
493
|
+
return { writeDecideCallLog, decideLogEngine, decideLogDeps };
|
|
494
|
+
})(decide.bandValue, decide.choiceAtoms, decide.decideOptions, decide.decideQuestionBand, decide.parseWhen, decide.validateDecideRule,
|
|
495
|
+
engine.buildDecideToolCallState, engine.decideCanonicalJson);
|
|
496
|
+
const check = function (ir) {
|
|
497
|
+
const v = decide.validateDecideRule(ir);
|
|
498
|
+
return v.ok ? decide.decideRuleHash(v.rule, sha256) : null;
|
|
499
|
+
};
|
|
500
|
+
return {
|
|
501
|
+
format: decide.decodeSnapshotFormatRecord,
|
|
502
|
+
record: function (line) { return decide.decodeDecideRecord(line, check); },
|
|
503
|
+
EngineError: engine.DecideEngineError,
|
|
504
|
+
resolveConfig: engine.resolveDecideEngineConfig,
|
|
505
|
+
createEngine: engine.createDecideEngine,
|
|
506
|
+
canaryStore: evaluate.createDecideCanaryFileStore,
|
|
507
|
+
evaluate: evaluate.evaluateDecideCall,
|
|
508
|
+
decision: evaluate.decideDecision,
|
|
509
|
+
shadowFindings: evaluate.decideShadowFindings,
|
|
510
|
+
unavailable: evaluate.decideUnavailableDecision,
|
|
511
|
+
storedQ95: evaluate.decideStoredQ95Ms,
|
|
512
|
+
verdictInOrder: evaluate.decideVerdictInOrder,
|
|
513
|
+
writeLog: log.writeDecideCallLog,
|
|
514
|
+
logEngine: log.decideLogEngine,
|
|
515
|
+
logDeps: log.decideLogDeps,
|
|
516
|
+
};
|
|
517
|
+
})`;
|
|
518
|
+
//# sourceMappingURL=decideEvaluate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decideEvaluate.js","sourceRoot":"","sources":["../src/decideEvaluate.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;;;AAwDH,wDAUC;AA8BD,8CAEC;AAwBD,kEAuBC;AA+FD,oDAGC;AAOD,0CAIC;AAGD,oDAEC;AAGD,8CAGC;AAYD,gDA8BC;AAyLD,wCAWC;AAMD,oDAQC;AAQD,8DAKC;AAhhBD,2CAeoB;AACpB,uDAAgH;AAChH,uDAY0B;AAC1B,6DAAkE;AAClE,iDAAqD;AAgBrD;;;;;;GAMG;AACH,SAAgB,sBAAsB,CACpC,KAAoI,EACpI,WAA0B;IAE1B,IAAI,KAAK,CAAC,EAAE,CAAC,OAAO,KAAK,SAAS;QAAE,OAAO,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,gDAA2B;;;;EAI3B,yCAAuB;;;;;;EAMvB,iCAAyB;;;;;;;;EAQzB,mCAAoB;;;;;;;;;;;;;;;;;;;;;;;;;GAyBnB,CAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The self-hosted guard on a decide engine's URL.
|
|
3
|
+
*
|
|
4
|
+
* A decide engine sees every tool call a rule asks about, so it must run on
|
|
5
|
+
* hardware the user controls. The guard judges the literal URL, with no DNS
|
|
6
|
+
* lookup: loopback and private addresses pass, a name passes only when it is
|
|
7
|
+
* `localhost`, ends in `.local`, or is listed in
|
|
8
|
+
* `INTUTIC_SELF_HOSTED_DECISION_HOSTS`, and the hosted decision APIs are
|
|
9
|
+
* refused even when listed.
|
|
10
|
+
*
|
|
11
|
+
* The parser is deliberately narrower than WHATWG's: a URL with anything but
|
|
12
|
+
* printable ASCII, a backslash, a percent sign, a query or a fragment is
|
|
13
|
+
* refused rather than normalised, so every HTTP client reaches the host the
|
|
14
|
+
* guard judged.
|
|
15
|
+
*
|
|
16
|
+
* Byte-identical copy in `packages/gate-js/src/`; the Python
|
|
17
|
+
* (`intutic_clawde/gate/decide_engine.py`) and Rust (`proxy/src/decide/guard.rs`)
|
|
18
|
+
* guards run the same `fixtures/decide-engine-vectors.json` host cases.
|
|
19
|
+
*
|
|
20
|
+
* @module
|
|
21
|
+
*/
|
|
22
|
+
/** Hosted decision APIs, matched on the host or any subdomain of it. */
|
|
23
|
+
export declare const DECIDE_HOSTED_DENYLIST: readonly ["typesafe.ai", "fastino.ai", "api.openai.com", "openai.azure.com", "services.ai.azure.com", "gateway.ai.cloudflare.com", "ai-gateway.vercel.sh", "api.fireworks.ai", "api.perplexity.ai", "cloud.databricks.com", "azuredatabricks.net"];
|
|
24
|
+
export type DecideHostVerdict = {
|
|
25
|
+
ok: true;
|
|
26
|
+
host: string;
|
|
27
|
+
reason: 'loopback' | 'private' | 'listed';
|
|
28
|
+
} | {
|
|
29
|
+
ok: false;
|
|
30
|
+
host: string;
|
|
31
|
+
reason: 'scheme' | 'bad_url' | 'credentials' | 'denylist' | 'decision_path' | 'not_listed';
|
|
32
|
+
};
|
|
33
|
+
export declare class DecideHostRefusedError extends Error {
|
|
34
|
+
readonly verdict: Extract<DecideHostVerdict, {
|
|
35
|
+
ok: false;
|
|
36
|
+
}>;
|
|
37
|
+
readonly code: "host_refused";
|
|
38
|
+
constructor(verdict: Extract<DecideHostVerdict, {
|
|
39
|
+
ok: false;
|
|
40
|
+
}>);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Judges a decide engine's base URL. `listed` is the value of
|
|
44
|
+
* `INTUTIC_SELF_HOSTED_DECISION_HOSTS` (a comma list).
|
|
45
|
+
*/
|
|
46
|
+
export declare function checkSelfHostedDecisionHost(url: string, listed?: string): DecideHostVerdict;
|
|
47
|
+
/** As {@link checkSelfHostedDecisionHost}, throwing {@link DecideHostRefusedError}; returns the host. */
|
|
48
|
+
export declare function assertSelfHostedDecisionHost(url: string, listed?: string): string;
|
|
49
|
+
/**
|
|
50
|
+
* {@link checkSelfHostedDecisionHost} as JavaScript source, with the
|
|
51
|
+
* constants and helpers it reads, for the hook gates to embed. A CommonJS
|
|
52
|
+
* build names an exported constant `exports.X` inside a function; the source
|
|
53
|
+
* defines each as a plain `X`, so that prefix is dropped.
|
|
54
|
+
*/
|
|
55
|
+
export declare const DECIDE_HOST_GUARD_JS_SOURCE: string;
|
|
56
|
+
//# sourceMappingURL=decideHostGuard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decideHostGuard.d.ts","sourceRoot":"","sources":["../src/decideHostGuard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,wEAAwE;AACxE,eAAO,MAAM,sBAAsB,oPAYzB,CAAA;AAKV,MAAM,MAAM,iBAAiB,GACzB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAA;CAAE,GACrE;IACE,EAAE,EAAE,KAAK,CAAA;IACT,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,aAAa,GAAG,UAAU,GAAG,eAAe,GAAG,YAAY,CAAA;CAC3F,CAAA;AAEL,qBAAa,sBAAuB,SAAQ,KAAK;IAEnC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,iBAAiB,EAAE;QAAE,EAAE,EAAE,KAAK,CAAA;KAAE,CAAC;IADvE,QAAQ,CAAC,IAAI,EAAG,cAAc,CAAS;gBAClB,OAAO,EAAE,OAAO,CAAC,iBAAiB,EAAE;QAAE,EAAE,EAAE,KAAK,CAAA;KAAE,CAAC;CAIxE;AAiED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,iBAAiB,CA2C3F;AAED,yGAAyG;AACzG,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAIjF;AAED;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,QAM5B,CAAA"}
|