@intutic/shared-types 2.3.0 → 2.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 +1 -1
- package/dist/anomaly.d.ts +0 -19
- package/dist/anomaly.d.ts.map +1 -1
- package/dist/attenuation.d.ts +4 -3
- package/dist/attenuation.d.ts.map +1 -1
- package/dist/attenuation.js +4 -3
- package/dist/attenuation.js.map +1 -1
- package/dist/auth.d.ts +106 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +17 -1
- package/dist/auth.js.map +1 -1
- package/dist/chaos.d.ts +2225 -0
- package/dist/chaos.d.ts.map +1 -0
- package/dist/chaos.js +358 -0
- package/dist/chaos.js.map +1 -0
- package/dist/chaosGate.d.ts +166 -0
- package/dist/chaosGate.d.ts.map +1 -0
- package/dist/chaosGate.js +383 -0
- package/dist/chaosGate.js.map +1 -0
- package/dist/cloudProbe.d.ts +54 -0
- package/dist/cloudProbe.d.ts.map +1 -0
- package/dist/cloudProbe.js +254 -0
- package/dist/cloudProbe.js.map +1 -0
- package/dist/enums.d.ts +48 -0
- package/dist/enums.d.ts.map +1 -1
- package/dist/enums.js +31 -3
- package/dist/enums.js.map +1 -1
- package/dist/finops.d.ts +38 -18
- package/dist/finops.d.ts.map +1 -1
- package/dist/guardrailIr.d.ts +4 -4
- package/dist/index.d.ts +18 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +68 -9
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +3 -100
- package/dist/intelligence.d.ts.map +1 -1
- package/dist/intelligence.js +3 -3
- package/dist/intelligence.js.map +1 -1
- package/dist/mcpBudgets.d.ts +32 -32
- package/dist/notifications.d.ts +17 -2
- package/dist/notifications.d.ts.map +1 -1
- package/dist/notifications.js +35 -5
- package/dist/notifications.js.map +1 -1
- package/dist/observability.d.ts +0 -31
- package/dist/observability.d.ts.map +1 -1
- package/dist/observability.js +0 -7
- package/dist/observability.js.map +1 -1
- package/dist/opaqueRefusal.d.ts +40 -0
- package/dist/opaqueRefusal.d.ts.map +1 -0
- package/dist/opaqueRefusal.js +53 -0
- package/dist/opaqueRefusal.js.map +1 -0
- package/dist/policyGuardrails.d.ts +5 -5
- package/dist/providerVerification.d.ts +35 -9
- package/dist/providerVerification.d.ts.map +1 -1
- package/dist/providerVerification.js +79 -19
- package/dist/providerVerification.js.map +1 -1
- package/dist/providers.d.ts +50 -13
- package/dist/providers.d.ts.map +1 -1
- package/dist/providers.js +131 -27
- package/dist/providers.js.map +1 -1
- package/dist/spendBudgets.d.ts +122 -0
- package/dist/spendBudgets.d.ts.map +1 -0
- package/dist/spendBudgets.js +92 -0
- package/dist/spendBudgets.js.map +1 -0
- package/dist/taskManagement.d.ts +34 -82
- package/dist/taskManagement.d.ts.map +1 -1
- package/dist/taskManagement.js +4 -4
- package/dist/toolPoison.d.ts +15 -2
- package/dist/toolPoison.d.ts.map +1 -1
- package/dist/toolPoison.js +14 -4
- package/dist/toolPoison.js.map +1 -1
- package/dist/upstreamRetry.d.ts +121 -0
- package/dist/upstreamRetry.d.ts.map +1 -0
- package/dist/upstreamRetry.js +90 -0
- package/dist/upstreamRetry.js.map +1 -0
- package/dist/wasmRuleDescriptor.d.ts +43 -0
- package/dist/wasmRuleDescriptor.d.ts.map +1 -0
- package/dist/wasmRuleDescriptor.js +65 -0
- package/dist/wasmRuleDescriptor.js.map +1 -0
- package/dist/workspaceSettings.d.ts +42 -4
- package/dist/workspaceSettings.d.ts.map +1 -1
- package/dist/workspaceSettings.js.map +1 -1
- package/package.json +2 -2
package/dist/mcpBudgets.d.ts
CHANGED
|
@@ -70,80 +70,80 @@ export declare const McpBudgetSettingsSchema: z.ZodEffects<z.ZodObject<{
|
|
|
70
70
|
period: z.ZodEnum<["hour", "day"]>;
|
|
71
71
|
limit: z.ZodNumber;
|
|
72
72
|
}, "strict", z.ZodTypeAny, {
|
|
73
|
-
|
|
74
|
-
scope: "server" | "tool" | "member" | "member_server";
|
|
73
|
+
period: "day" | "hour";
|
|
75
74
|
id: string;
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
limit: number;
|
|
76
|
+
scope: "member" | "tool" | "server" | "member_server";
|
|
78
77
|
tool?: string | undefined;
|
|
78
|
+
server?: string | undefined;
|
|
79
79
|
memberId?: string | undefined;
|
|
80
80
|
}, {
|
|
81
|
-
|
|
82
|
-
scope: "server" | "tool" | "member" | "member_server";
|
|
81
|
+
period: "day" | "hour";
|
|
83
82
|
id: string;
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
limit: number;
|
|
84
|
+
scope: "member" | "tool" | "server" | "member_server";
|
|
86
85
|
tool?: string | undefined;
|
|
86
|
+
server?: string | undefined;
|
|
87
87
|
memberId?: string | undefined;
|
|
88
88
|
}>, {
|
|
89
|
-
|
|
90
|
-
scope: "server" | "tool" | "member" | "member_server";
|
|
89
|
+
period: "day" | "hour";
|
|
91
90
|
id: string;
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
limit: number;
|
|
92
|
+
scope: "member" | "tool" | "server" | "member_server";
|
|
94
93
|
tool?: string | undefined;
|
|
94
|
+
server?: string | undefined;
|
|
95
95
|
memberId?: string | undefined;
|
|
96
96
|
}, {
|
|
97
|
-
|
|
98
|
-
scope: "server" | "tool" | "member" | "member_server";
|
|
97
|
+
period: "day" | "hour";
|
|
99
98
|
id: string;
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
limit: number;
|
|
100
|
+
scope: "member" | "tool" | "server" | "member_server";
|
|
102
101
|
tool?: string | undefined;
|
|
102
|
+
server?: string | undefined;
|
|
103
103
|
memberId?: string | undefined;
|
|
104
104
|
}>, "many">;
|
|
105
105
|
warnAtPct: z.ZodOptional<z.ZodNumber>;
|
|
106
106
|
}, "strict", z.ZodTypeAny, {
|
|
107
107
|
budgets: {
|
|
108
|
-
|
|
109
|
-
scope: "server" | "tool" | "member" | "member_server";
|
|
108
|
+
period: "day" | "hour";
|
|
110
109
|
id: string;
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
limit: number;
|
|
111
|
+
scope: "member" | "tool" | "server" | "member_server";
|
|
113
112
|
tool?: string | undefined;
|
|
113
|
+
server?: string | undefined;
|
|
114
114
|
memberId?: string | undefined;
|
|
115
115
|
}[];
|
|
116
116
|
warnAtPct?: number | undefined;
|
|
117
117
|
}, {
|
|
118
118
|
budgets: {
|
|
119
|
-
|
|
120
|
-
scope: "server" | "tool" | "member" | "member_server";
|
|
119
|
+
period: "day" | "hour";
|
|
121
120
|
id: string;
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
limit: number;
|
|
122
|
+
scope: "member" | "tool" | "server" | "member_server";
|
|
124
123
|
tool?: string | undefined;
|
|
124
|
+
server?: string | undefined;
|
|
125
125
|
memberId?: string | undefined;
|
|
126
126
|
}[];
|
|
127
127
|
warnAtPct?: number | undefined;
|
|
128
128
|
}>, {
|
|
129
129
|
budgets: {
|
|
130
|
-
|
|
131
|
-
scope: "server" | "tool" | "member" | "member_server";
|
|
130
|
+
period: "day" | "hour";
|
|
132
131
|
id: string;
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
limit: number;
|
|
133
|
+
scope: "member" | "tool" | "server" | "member_server";
|
|
135
134
|
tool?: string | undefined;
|
|
135
|
+
server?: string | undefined;
|
|
136
136
|
memberId?: string | undefined;
|
|
137
137
|
}[];
|
|
138
138
|
warnAtPct?: number | undefined;
|
|
139
139
|
}, {
|
|
140
140
|
budgets: {
|
|
141
|
-
|
|
142
|
-
scope: "server" | "tool" | "member" | "member_server";
|
|
141
|
+
period: "day" | "hour";
|
|
143
142
|
id: string;
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
limit: number;
|
|
144
|
+
scope: "member" | "tool" | "server" | "member_server";
|
|
146
145
|
tool?: string | undefined;
|
|
146
|
+
server?: string | undefined;
|
|
147
147
|
memberId?: string | undefined;
|
|
148
148
|
}[];
|
|
149
149
|
warnAtPct?: number | undefined;
|
package/dist/notifications.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type NotificationChannel = 'slack' | 'email' | 'webhook' | 'pagerduty';
|
|
|
4
4
|
* naming anything else, and the CLI and the Terraform provider check
|
|
5
5
|
* against this list before they send one.
|
|
6
6
|
*/
|
|
7
|
-
export declare const NOTIFICATION_EVENT_TYPES: readonly ["anomaly.detected", "anomaly.finding", "incident.created", "incident.escalated", "sop.status_changed", "session.ended", "
|
|
7
|
+
export declare const NOTIFICATION_EVENT_TYPES: readonly ["anomaly.detected", "anomaly.finding", "incident.created", "incident.escalated", "sop.status_changed", "session.ended", "decision.pending", "decision.approved", "decision.rejected", "trajectory.alert", "calibration.threshold_breach", "anomaly.drift.detected", "anomaly.capability_miss", "anomaly.trust.updated", "sop.stale.detected", "sop.cascade.alert", "sop.cascade.invalidated", "sop.integrity.drift", "sop.lifecycle.transitioned", "sop.upstream.changed", "guardrail.ready", "guardrail.stale", "mcp.server.candidate", "mcp.server.tool_change_risk", "mcp.server.decided", "mcp.server.tool_toggled", "mcp.budget.threshold", "mcp.budget.exceeded", "judge.review.queued", "finops.budget.exceeded", "finops.budget.threshold", "finops.tokens.classified", "trial.started", "trial.expired_downgraded", "trial.day7_report_sent", "trial.day13_report_sent", "plan.captured", "plan.approved", "plan.deviation.detected", "identity.offboarding.completed", "auth.login.failed", "scim.user.changed", "scim.group.changed", "webhook.secret.rotated", "evidence.exported", "credential.changed", "workspace.context.updated", "gateway.stale.detected", "gateway.cell.stuck_pending", "region.sync.stale", "org.cells.deprovision_scheduled", "org.cells.deprovision_canceled", "org.cells.deprovisioned", "device.enforcement.stale", "device.enforcement.disabled", "governance.gate.silent", "governance.gate.recovered", "governance.integrity.failed", "inventory.ungoverned.detected", "provider.outage.detected", "billing.subscription.past_due", "skill.malware.detected", "skill.semantic.flagged"];
|
|
8
8
|
export type NotificationEventType = (typeof NOTIFICATION_EVENT_TYPES)[number];
|
|
9
9
|
export type NotificationStatus = 'sent' | 'failed' | 'deduplicated' | 'filtered';
|
|
10
10
|
export interface NotificationRule {
|
|
@@ -75,15 +75,30 @@ export interface NotificationLogEntry {
|
|
|
75
75
|
latencyMs: number | null;
|
|
76
76
|
createdAt: string;
|
|
77
77
|
}
|
|
78
|
+
/** The severity a notification is sent at, which a rule's severity filter matches on. */
|
|
79
|
+
export type NotificationSeverity = 'CRITICAL' | 'HIGH' | 'MEDIUM' | 'LOW' | 'INFO';
|
|
78
80
|
export interface GovernanceEvent {
|
|
79
81
|
type: NotificationEventType;
|
|
80
82
|
workspaceId: string;
|
|
81
83
|
sessionId?: string;
|
|
82
|
-
severity:
|
|
84
|
+
severity: NotificationSeverity;
|
|
83
85
|
summary: string;
|
|
84
86
|
description: string;
|
|
85
87
|
metadata: Record<string, unknown>;
|
|
86
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* The severity `incident.created` is sent at, from the incident's own
|
|
91
|
+
* (`governance_incidents.severity`). Until 2.4.0 every incident was sent at
|
|
92
|
+
* CRITICAL whatever its severity, so a rule filtered on CRITICAL received a
|
|
93
|
+
* MEDIUM incident and a rule filtered on HIGH received none.
|
|
94
|
+
*/
|
|
95
|
+
export declare const INCIDENT_NOTIFICATION_SEVERITY: Readonly<Record<'CRITICAL' | 'HIGH' | 'MEDIUM' | 'LOW', NotificationSeverity>>;
|
|
96
|
+
/**
|
|
97
|
+
* {@link INCIDENT_NOTIFICATION_SEVERITY} for an incident event's `severity`.
|
|
98
|
+
* One the map does not name (absent, or from an emitter that sent something
|
|
99
|
+
* else) is sent at CRITICAL: a malformed event must not quieten an alert.
|
|
100
|
+
*/
|
|
101
|
+
export declare function incidentNotificationSeverity(severity: unknown): NotificationSeverity;
|
|
87
102
|
export interface DispatchResult {
|
|
88
103
|
ruleId: string;
|
|
89
104
|
channel: NotificationChannel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../src/notifications.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,GAA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,WAAW,aAAa;IAC5B,EAAE,EAAE,OAAO,CAAA;IACX,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAMD,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B"}
|
package/dist/notifications.js
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
// Notification Hub + Slack Adapter
|
|
4
4
|
// ============================================
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.NOTIFICATION_EVENT_TYPES = void 0;
|
|
6
|
+
exports.INCIDENT_NOTIFICATION_SEVERITY = exports.NOTIFICATION_EVENT_TYPES = void 0;
|
|
7
|
+
exports.incidentNotificationSeverity = incidentNotificationSeverity;
|
|
7
8
|
/**
|
|
8
9
|
* Every event a notification rule can subscribe to. The API refuses a rule
|
|
9
10
|
* naming anything else, and the CLI and the Terraform provider check
|
|
@@ -29,17 +30,22 @@ exports.NOTIFICATION_EVENT_TYPES = [
|
|
|
29
30
|
'incident.escalated',
|
|
30
31
|
'sop.status_changed',
|
|
31
32
|
'session.ended',
|
|
32
|
-
'adapter.write_back.failed',
|
|
33
33
|
'decision.pending',
|
|
34
34
|
/** An OWNER, ADMIN or EM approved a held decision, in Slack or through the API and CLI. Carries `entryId`, `reviewerId` and `via`. */
|
|
35
35
|
'decision.approved',
|
|
36
36
|
/** An OWNER, ADMIN or EM rejected a held decision, in Slack or through the API and CLI. */
|
|
37
37
|
'decision.rejected',
|
|
38
|
-
'ssl.enforcement.violation',
|
|
39
|
-
'context_gap.auto_injected',
|
|
40
38
|
'trajectory.alert',
|
|
41
39
|
// ── Calibration & drift (Q10 orphan audit) ──
|
|
42
40
|
'calibration.threshold_breach',
|
|
41
|
+
/**
|
|
42
|
+
* An enforced SOP's rolling compliance moved 0.15 or more from its stored
|
|
43
|
+
* baseline (`behavioralDriftService.ts`, the hourly SOP health sweep). Once per
|
|
44
|
+
* drift: the baseline is recaptured when it fires. Carries `sopId`,
|
|
45
|
+
* `driftScore`, `driftDirection` (`DEGRADING` or `IMPROVING`),
|
|
46
|
+
* `baselineCompliance` and `currentCompliance`. HIGH when degrading, INFO when
|
|
47
|
+
* improving.
|
|
48
|
+
*/
|
|
43
49
|
'anomaly.drift.detected',
|
|
44
50
|
'anomaly.capability_miss',
|
|
45
51
|
'anomaly.trust.updated',
|
|
@@ -97,6 +103,8 @@ exports.NOTIFICATION_EVENT_TYPES = [
|
|
|
97
103
|
'webhook.secret.rotated',
|
|
98
104
|
/** A member downloaded compliance evidence: a SOC 2 archive, a framework coverage report file or the human-oversight export. The `evidence_exports` row. */
|
|
99
105
|
'evidence.exported',
|
|
106
|
+
/** An API key, gateway token or SCIM token was created, rotated or revoked, or a provider credential was provisioned, replaced or removed. The `credential_changes` row: `credential_type`, `credential_id`, `action` and who; never the value. */
|
|
107
|
+
'credential.changed',
|
|
100
108
|
// ── Workspace context ──
|
|
101
109
|
'workspace.context.updated',
|
|
102
110
|
// ── Self-hosted gateway ──
|
|
@@ -185,7 +193,7 @@ exports.NOTIFICATION_EVENT_TYPES = [
|
|
|
185
193
|
/**
|
|
186
194
|
* The hourly audit-log integrity check found a failure of one kind
|
|
187
195
|
* (`kind`: `chain_break`, `mirror_copy_mismatch`, `signature_invalid`,
|
|
188
|
-
* `root_mismatch` or `
|
|
196
|
+
* `root_mismatch`, `guard_tampered` or `foreign_key_unenforced`). Fired once per kind while it keeps
|
|
189
197
|
* failing; a recurrence after it clears fires again.
|
|
190
198
|
*/
|
|
191
199
|
'governance.integrity.failed',
|
|
@@ -243,4 +251,26 @@ exports.NOTIFICATION_EVENT_TYPES = [
|
|
|
243
251
|
*/
|
|
244
252
|
'skill.semantic.flagged',
|
|
245
253
|
];
|
|
254
|
+
/**
|
|
255
|
+
* The severity `incident.created` is sent at, from the incident's own
|
|
256
|
+
* (`governance_incidents.severity`). Until 2.4.0 every incident was sent at
|
|
257
|
+
* CRITICAL whatever its severity, so a rule filtered on CRITICAL received a
|
|
258
|
+
* MEDIUM incident and a rule filtered on HIGH received none.
|
|
259
|
+
*/
|
|
260
|
+
exports.INCIDENT_NOTIFICATION_SEVERITY = {
|
|
261
|
+
CRITICAL: 'CRITICAL',
|
|
262
|
+
HIGH: 'HIGH',
|
|
263
|
+
MEDIUM: 'MEDIUM',
|
|
264
|
+
LOW: 'LOW',
|
|
265
|
+
};
|
|
266
|
+
/**
|
|
267
|
+
* {@link INCIDENT_NOTIFICATION_SEVERITY} for an incident event's `severity`.
|
|
268
|
+
* One the map does not name (absent, or from an emitter that sent something
|
|
269
|
+
* else) is sent at CRITICAL: a malformed event must not quieten an alert.
|
|
270
|
+
*/
|
|
271
|
+
function incidentNotificationSeverity(severity) {
|
|
272
|
+
return typeof severity === 'string' && Object.hasOwn(exports.INCIDENT_NOTIFICATION_SEVERITY, severity)
|
|
273
|
+
? exports.INCIDENT_NOTIFICATION_SEVERITY[severity]
|
|
274
|
+
: 'CRITICAL';
|
|
275
|
+
}
|
|
246
276
|
//# sourceMappingURL=notifications.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.js","sourceRoot":"","sources":["../src/notifications.ts"],"names":[],"mappings":";AAAA,+CAA+C;AAC/C,mCAAmC;AACnC,+CAA+C;;;
|
|
1
|
+
{"version":3,"file":"notifications.js","sourceRoot":"","sources":["../src/notifications.ts"],"names":[],"mappings":";AAAA,+CAA+C;AAC/C,mCAAmC;AACnC,+CAA+C;;;AA0W/C,oEAIC;AAxWD;;;;GAIG;AACU,QAAA,wBAAwB,GAAG;IACtC,+CAA+C;IAC/C,kBAAkB;IAClB;;;;;;;;;;;OAWG;IACH,iBAAiB;IACjB,kBAAkB;IAClB,oBAAoB;IACpB,oBAAoB;IACpB,eAAe;IACf,kBAAkB;IAClB,sIAAsI;IACtI,mBAAmB;IACnB,2FAA2F;IAC3F,mBAAmB;IACnB,kBAAkB;IAClB,+CAA+C;IAC/C,8BAA8B;IAC9B;;;;;;;OAOG;IACH,wBAAwB;IACxB,yBAAyB;IACzB,uBAAuB;IACvB,kCAAkC;IAClC,oBAAoB;IACpB,mBAAmB;IACnB,yBAAyB;IACzB,qBAAqB;IACrB,4BAA4B;IAC5B,+HAA+H;IAC/H,sBAAsB;IACtB,0BAA0B;IAC1B,mFAAmF;IACnF,iBAAiB;IACjB,+FAA+F;IAC/F,iBAAiB;IACjB,4BAA4B;IAC5B,kJAAkJ;IAClJ,sBAAsB;IACtB,oHAAoH;IACpH,6BAA6B;IAC7B,qJAAqJ;IACrJ,oBAAoB;IACpB,mHAAmH;IACnH,yBAAyB;IACzB,yGAAyG;IACzG,sBAAsB;IACtB,iGAAiG;IACjG,qBAAqB;IACrB,yBAAyB;IACzB,gJAAgJ;IAChJ,qBAAqB;IACrB,wBAAwB;IACxB,wBAAwB;IACxB,yBAAyB;IACzB,0BAA0B;IAC1B,2BAA2B;IAC3B,eAAe;IACf,0BAA0B;IAC1B,wBAAwB;IACxB,yBAAyB;IACzB,cAAc;IACd,eAAe;IACf,eAAe;IACf,yBAAyB;IACzB,8BAA8B;IAC9B,gCAAgC;IAChC,8LAA8L;IAC9L,mBAAmB;IACnB,8HAA8H;IAC9H,mBAAmB;IACnB,2GAA2G;IAC3G,oBAAoB;IACpB,iMAAiM;IACjM,wBAAwB;IACx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
|
2
|
-
export declare const PromptEstimateInputSchema: z.ZodObject<{
|
|
3
|
-
prompt: z.ZodString;
|
|
4
|
-
modelName: z.ZodString;
|
|
5
|
-
}, "strip", z.ZodTypeAny, {
|
|
6
|
-
prompt: string;
|
|
7
|
-
modelName: string;
|
|
8
|
-
}, {
|
|
9
|
-
prompt: string;
|
|
10
|
-
modelName: string;
|
|
11
|
-
}>;
|
|
12
|
-
export type PromptEstimateInput = z.infer<typeof PromptEstimateInputSchema>;
|
|
13
|
-
export interface PromptEstimateResult {
|
|
14
|
-
estimatedInputTokens: number;
|
|
15
|
-
estimatedOutputTokens: number;
|
|
16
|
-
estimatedCostUsd: number;
|
|
17
|
-
recommendations: string[];
|
|
18
|
-
}
|
|
19
|
-
export interface CostHistoryEntry {
|
|
20
|
-
date: string;
|
|
21
|
-
estimatedCostUsd: number;
|
|
22
|
-
actualCostUsd: number;
|
|
23
|
-
}
|
|
24
|
-
export interface CostHistoryResult {
|
|
25
|
-
history: CostHistoryEntry[];
|
|
26
|
-
}
|
|
27
|
-
export interface DriftReportResult {
|
|
28
|
-
driftPct: number;
|
|
29
|
-
totalEstimates: number;
|
|
30
|
-
totalActuals: number;
|
|
31
|
-
}
|
|
32
1
|
export interface TraceDagNode {
|
|
33
2
|
sessionId: string;
|
|
34
3
|
harnessType: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observability.d.ts","sourceRoot":"","sources":["../src/observability.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"observability.d.ts","sourceRoot":"","sources":["../src/observability.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,uFAAuF;IACvF,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,MAAM,CAAA;IACrB,4EAA4E;IAC5E,gBAAgB,EAAE,MAAM,CAAA;IACxB,KAAK,EAAE,YAAY,EAAE,CAAA;CACtB"}
|
package/dist/observability.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PromptEstimateInputSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
// ─── Zod Schemas ─────────────────────────────────────────────────────
|
|
6
|
-
exports.PromptEstimateInputSchema = zod_1.z.object({
|
|
7
|
-
prompt: zod_1.z.string().min(1),
|
|
8
|
-
modelName: zod_1.z.string().min(1),
|
|
9
|
-
});
|
|
10
3
|
//# sourceMappingURL=observability.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observability.js","sourceRoot":"","sources":["../src/observability.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"observability.js","sourceRoot":"","sources":["../src/observability.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The OPAQUE intervention mode: an agent is refused without being told which
|
|
3
|
+
* rule refused it.
|
|
4
|
+
*
|
|
5
|
+
* A refusal that names its rule, quotes the rule's text, or says which pattern
|
|
6
|
+
* matched teaches an agent the policy, and an agent that knows the policy can
|
|
7
|
+
* route around it. In an OPAQUE workspace every gate that refuses on workspace
|
|
8
|
+
* policy shows the agent {@link OPAQUE_REFUSAL_MESSAGE} instead, through the
|
|
9
|
+
* same refusal contract: the same exit code, HTTP status and refusal code, so
|
|
10
|
+
* harnesses and clients behave exactly as they would in a TRANSPARENT one.
|
|
11
|
+
* Only the text the agent reads changes. Audit records, trace records,
|
|
12
|
+
* `enforcement_log`, detector findings and the dashboard keep the full reason.
|
|
13
|
+
*
|
|
14
|
+
* Refusals that say nothing about the policy are not changed: a call too large
|
|
15
|
+
* to evaluate, a gate past its deadline, an unreadable payload, a crashed gate,
|
|
16
|
+
* a snapshot that failed its integrity check, and a chaos run's injected fault.
|
|
17
|
+
*
|
|
18
|
+
* `@intutic/gate` carries a byte-identical copy of this module
|
|
19
|
+
* (`packages/gate-js/src/opaqueRefusal.ts`); the Rust proxy (`refusal.rs`)
|
|
20
|
+
* and the Python SDK (`intutic_clawde/gate/opaque.py`) mirror the sentence.
|
|
21
|
+
* `refusal-codes.json` carries it as `opaqueMessage`, and
|
|
22
|
+
* `opaqueRefusalParity.test.ts` holds every copy to it. It carries no quote,
|
|
23
|
+
* dollar sign or backtick, so the hook gates can embed it in generated shell
|
|
24
|
+
* inside single quotes.
|
|
25
|
+
*/
|
|
26
|
+
export declare const OPAQUE_REFUSAL_MESSAGE = "Blocked by workspace policy. Ask a workspace admin if you need this action.";
|
|
27
|
+
/**
|
|
28
|
+
* The policy snapshot's record of an OPAQUE workspace: a data line inside the
|
|
29
|
+
* digest, `@intervention_mode<TAB>OPAQUE`, written only when the mode is
|
|
30
|
+
* OPAQUE, so the snapshot of a TRANSPARENT or SILENT_LOG workspace is
|
|
31
|
+
* unchanged. Two columns, so every rule parser skips it.
|
|
32
|
+
*/
|
|
33
|
+
export declare const INTERVENTION_MODE_RECORD_TAG = "@intervention_mode";
|
|
34
|
+
/** Whether a workspace's resolved intervention mode is OPAQUE. Any case. */
|
|
35
|
+
export declare function isOpaqueInterventionMode(mode: unknown): boolean;
|
|
36
|
+
/** The `.rules` line of an OPAQUE workspace. */
|
|
37
|
+
export declare function encodeInterventionModeRecord(): string;
|
|
38
|
+
/** Whether a `.rules` line is the record of an OPAQUE workspace. */
|
|
39
|
+
export declare function isOpaqueInterventionModeRecord(line: string): boolean;
|
|
40
|
+
//# sourceMappingURL=opaqueRefusal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opaqueRefusal.d.ts","sourceRoot":"","sources":["../src/opaqueRefusal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,sBAAsB,gFAC4C,CAAA;AAE/E;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,uBAAuB,CAAA;AAEhE,4EAA4E;AAC5E,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAE/D;AAED,gDAAgD;AAChD,wBAAgB,4BAA4B,IAAI,MAAM,CAErD;AAED,oEAAoE;AACpE,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGpE"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.INTERVENTION_MODE_RECORD_TAG = exports.OPAQUE_REFUSAL_MESSAGE = void 0;
|
|
4
|
+
exports.isOpaqueInterventionMode = isOpaqueInterventionMode;
|
|
5
|
+
exports.encodeInterventionModeRecord = encodeInterventionModeRecord;
|
|
6
|
+
exports.isOpaqueInterventionModeRecord = isOpaqueInterventionModeRecord;
|
|
7
|
+
/**
|
|
8
|
+
* The OPAQUE intervention mode: an agent is refused without being told which
|
|
9
|
+
* rule refused it.
|
|
10
|
+
*
|
|
11
|
+
* A refusal that names its rule, quotes the rule's text, or says which pattern
|
|
12
|
+
* matched teaches an agent the policy, and an agent that knows the policy can
|
|
13
|
+
* route around it. In an OPAQUE workspace every gate that refuses on workspace
|
|
14
|
+
* policy shows the agent {@link OPAQUE_REFUSAL_MESSAGE} instead, through the
|
|
15
|
+
* same refusal contract: the same exit code, HTTP status and refusal code, so
|
|
16
|
+
* harnesses and clients behave exactly as they would in a TRANSPARENT one.
|
|
17
|
+
* Only the text the agent reads changes. Audit records, trace records,
|
|
18
|
+
* `enforcement_log`, detector findings and the dashboard keep the full reason.
|
|
19
|
+
*
|
|
20
|
+
* Refusals that say nothing about the policy are not changed: a call too large
|
|
21
|
+
* to evaluate, a gate past its deadline, an unreadable payload, a crashed gate,
|
|
22
|
+
* a snapshot that failed its integrity check, and a chaos run's injected fault.
|
|
23
|
+
*
|
|
24
|
+
* `@intutic/gate` carries a byte-identical copy of this module
|
|
25
|
+
* (`packages/gate-js/src/opaqueRefusal.ts`); the Rust proxy (`refusal.rs`)
|
|
26
|
+
* and the Python SDK (`intutic_clawde/gate/opaque.py`) mirror the sentence.
|
|
27
|
+
* `refusal-codes.json` carries it as `opaqueMessage`, and
|
|
28
|
+
* `opaqueRefusalParity.test.ts` holds every copy to it. It carries no quote,
|
|
29
|
+
* dollar sign or backtick, so the hook gates can embed it in generated shell
|
|
30
|
+
* inside single quotes.
|
|
31
|
+
*/
|
|
32
|
+
exports.OPAQUE_REFUSAL_MESSAGE = 'Blocked by workspace policy. Ask a workspace admin if you need this action.';
|
|
33
|
+
/**
|
|
34
|
+
* The policy snapshot's record of an OPAQUE workspace: a data line inside the
|
|
35
|
+
* digest, `@intervention_mode<TAB>OPAQUE`, written only when the mode is
|
|
36
|
+
* OPAQUE, so the snapshot of a TRANSPARENT or SILENT_LOG workspace is
|
|
37
|
+
* unchanged. Two columns, so every rule parser skips it.
|
|
38
|
+
*/
|
|
39
|
+
exports.INTERVENTION_MODE_RECORD_TAG = '@intervention_mode';
|
|
40
|
+
/** Whether a workspace's resolved intervention mode is OPAQUE. Any case. */
|
|
41
|
+
function isOpaqueInterventionMode(mode) {
|
|
42
|
+
return typeof mode === 'string' && mode.trim().toUpperCase() === 'OPAQUE';
|
|
43
|
+
}
|
|
44
|
+
/** The `.rules` line of an OPAQUE workspace. */
|
|
45
|
+
function encodeInterventionModeRecord() {
|
|
46
|
+
return `${exports.INTERVENTION_MODE_RECORD_TAG}\tOPAQUE`;
|
|
47
|
+
}
|
|
48
|
+
/** Whether a `.rules` line is the record of an OPAQUE workspace. */
|
|
49
|
+
function isOpaqueInterventionModeRecord(line) {
|
|
50
|
+
const [tag, mode, ...rest] = line.split('\t');
|
|
51
|
+
return tag === exports.INTERVENTION_MODE_RECORD_TAG && rest.length === 0 && isOpaqueInterventionMode(mode);
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=opaqueRefusal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opaqueRefusal.js","sourceRoot":"","sources":["../src/opaqueRefusal.ts"],"names":[],"mappings":";;;AAqCA,4DAEC;AAGD,oEAEC;AAGD,wEAGC;AAlDD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACU,QAAA,sBAAsB,GACjC,6EAA6E,CAAA;AAE/E;;;;;GAKG;AACU,QAAA,4BAA4B,GAAG,oBAAoB,CAAA;AAEhE,4EAA4E;AAC5E,SAAgB,wBAAwB,CAAC,IAAa;IACpD,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,QAAQ,CAAA;AAC3E,CAAC;AAED,gDAAgD;AAChD,SAAgB,4BAA4B;IAC1C,OAAO,GAAG,oCAA4B,UAAU,CAAA;AAClD,CAAC;AAED,oEAAoE;AACpE,SAAgB,8BAA8B,CAAC,IAAY;IACzD,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC7C,OAAO,GAAG,KAAK,oCAA4B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,wBAAwB,CAAC,IAAI,CAAC,CAAA;AACpG,CAAC"}
|
|
@@ -78,8 +78,8 @@ export declare const AuthoredGuardrailCreateSchema: z.ZodObject<{
|
|
|
78
78
|
description?: string | null | undefined;
|
|
79
79
|
}, {
|
|
80
80
|
name: string;
|
|
81
|
-
ir?: unknown;
|
|
82
81
|
description?: string | null | undefined;
|
|
82
|
+
ir?: unknown;
|
|
83
83
|
}>;
|
|
84
84
|
/**
|
|
85
85
|
* `PUT /api/v1/policy-guardrails/guardrails/:guardrailId`: any of the three.
|
|
@@ -91,20 +91,20 @@ export declare const AuthoredGuardrailUpdateSchema: z.ZodEffects<z.ZodObject<{
|
|
|
91
91
|
ir: z.ZodOptional<z.ZodUnknown>;
|
|
92
92
|
}, "strict", z.ZodTypeAny, {
|
|
93
93
|
name?: string | undefined;
|
|
94
|
-
ir?: unknown;
|
|
95
94
|
description?: string | null | undefined;
|
|
95
|
+
ir?: unknown;
|
|
96
96
|
}, {
|
|
97
97
|
name?: string | undefined;
|
|
98
|
-
ir?: unknown;
|
|
99
98
|
description?: string | null | undefined;
|
|
99
|
+
ir?: unknown;
|
|
100
100
|
}>, {
|
|
101
101
|
name?: string | undefined;
|
|
102
|
-
ir?: unknown;
|
|
103
102
|
description?: string | null | undefined;
|
|
103
|
+
ir?: unknown;
|
|
104
104
|
}, {
|
|
105
105
|
name?: string | undefined;
|
|
106
|
-
ir?: unknown;
|
|
107
106
|
description?: string | null | undefined;
|
|
107
|
+
ir?: unknown;
|
|
108
108
|
}>;
|
|
109
109
|
export type AuthoredGuardrailCreate = z.infer<typeof AuthoredGuardrailCreateSchema>;
|
|
110
110
|
export type AuthoredGuardrailUpdate = z.infer<typeof AuthoredGuardrailUpdateSchema>;
|
|
@@ -29,8 +29,16 @@ export interface ProviderProbeRequest {
|
|
|
29
29
|
url: string;
|
|
30
30
|
method: 'GET' | 'POST';
|
|
31
31
|
headers: Record<string, string>;
|
|
32
|
-
/** Present only for POST probes (
|
|
32
|
+
/** Present only for POST probes (the cloud token and STS calls). */
|
|
33
33
|
body?: string;
|
|
34
|
+
/** A provider-specific reading of the answer; `classifyProbeResponse` otherwise. */
|
|
35
|
+
classify?: (status: number, headers: {
|
|
36
|
+
get(name: string): string | null;
|
|
37
|
+
}) => ProbeVerdict;
|
|
38
|
+
/** What a `valid` answer proves, when it is narrower than "the credential works". */
|
|
39
|
+
validDetail?: string;
|
|
40
|
+
/** Decided without a request (a key that cannot be used at all); nothing is sent. */
|
|
41
|
+
localVerdict?: ProbeVerdict;
|
|
34
42
|
}
|
|
35
43
|
/**
|
|
36
44
|
* Build the cheapest authenticated request that proves a credential works,
|
|
@@ -38,18 +46,36 @@ export interface ProviderProbeRequest {
|
|
|
38
46
|
*
|
|
39
47
|
* `fields` is the provider's credential field map exactly as stored — the
|
|
40
48
|
* same shape `PROVIDER_REGISTRY`'s `ProviderCredentialField.key`s describe
|
|
41
|
-
* (`providers.ts`), e.g. `{ apiKey: '...' }` for Anthropic, `{ apiKey, endpoint
|
|
42
|
-
*
|
|
49
|
+
* (`providers.ts`), e.g. `{ apiKey: '...' }` for Anthropic, `{ apiKey, endpoint }`
|
|
50
|
+
* for Azure OpenAI.
|
|
43
51
|
*
|
|
44
|
-
* Bedrock and Vertex AI return `null
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* the credential.
|
|
52
|
+
* Bedrock and Vertex AI return `null` here: their probe is signed per
|
|
53
|
+
* request, which takes WebCrypto and is asynchronous — see
|
|
54
|
+
* `buildVerificationProbeAsync`, which every executor calls. A caller seeing
|
|
55
|
+
* `null` from that should say "cannot verify automatically," not fail the
|
|
56
|
+
* credential.
|
|
50
57
|
*/
|
|
51
58
|
export declare function buildVerificationProbe(provider: string, fields: Record<string, string>): ProviderProbeRequest | null;
|
|
52
59
|
export type ProbeVerdict = 'valid' | 'invalid' | 'unknown';
|
|
60
|
+
/**
|
|
61
|
+
* The model ids in a provider's list-models answer (the body a `valid`
|
|
62
|
+
* verification probe got back), deduplicated and sorted; `null` when this
|
|
63
|
+
* provider's probe does not list the models a request can name, or the body
|
|
64
|
+
* is not the expected shape.
|
|
65
|
+
*
|
|
66
|
+
* Azure OpenAI's probe lists base models, while a request names a deployment,
|
|
67
|
+
* so its list would mislead; Bedrock and Vertex AI probe identity, not models.
|
|
68
|
+
*/
|
|
69
|
+
export declare function parseProviderModels(provider: string, body: unknown): string[] | null;
|
|
70
|
+
/**
|
|
71
|
+
* The probe for any provider: a signed cloud probe for Bedrock and Vertex AI
|
|
72
|
+
* (`cloudProbe.ts`), the plain request description otherwise.
|
|
73
|
+
*/
|
|
74
|
+
export declare function buildVerificationProbeAsync(provider: string, fields: Record<string, string>, now?: Date): Promise<ProviderProbeRequest | null>;
|
|
75
|
+
/** The verdict for a probe's answer: the probe's own reading when it has one. */
|
|
76
|
+
export declare function classifyProbe(probe: ProviderProbeRequest, status: number, headers?: {
|
|
77
|
+
get(name: string): string | null;
|
|
78
|
+
}): ProbeVerdict;
|
|
53
79
|
/**
|
|
54
80
|
* Classify a probe's HTTP response. Deliberately narrow about what counts as
|
|
55
81
|
* "invalid": only 401/403 mean the credential itself is wrong. A 429
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providerVerification.d.ts","sourceRoot":"","sources":["../src/providerVerification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;
|
|
1
|
+
{"version":3,"file":"providerVerification.d.ts","sourceRoot":"","sources":["../src/providerVerification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAmBH,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,KAAK,GAAG,MAAM,CAAA;IACtB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,oFAAoF;IACpF,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;KAAE,KAAK,YAAY,CAAA;IAC1F,qFAAqF;IACrF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qFAAqF;IACrF,YAAY,CAAC,EAAE,YAAY,CAAA;CAC5B;AAED;;;;;;;;;;;;;;GAcG;AACH,wB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