@intutic/clawde 2.2.0 → 2.4.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 +5 -3
- package/dist/client.d.ts +26 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +104 -15
- package/dist/client.js.map +1 -1
- package/dist/control-plane.d.ts +314 -13
- package/dist/control-plane.d.ts.map +1 -1
- package/dist/control-plane.js +665 -20
- package/dist/control-plane.js.map +1 -1
- package/dist/errors.d.ts +13 -3
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +15 -3
- package/dist/errors.js.map +1 -1
- package/dist/evidence.d.ts +22 -0
- package/dist/evidence.d.ts.map +1 -0
- package/dist/evidence.js +114 -0
- package/dist/evidence.js.map +1 -0
- package/dist/git-context.d.ts +27 -0
- package/dist/git-context.d.ts.map +1 -0
- package/dist/git-context.js +114 -0
- package/dist/git-context.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/dist/integrity.d.ts +23 -0
- package/dist/integrity.d.ts.map +1 -0
- package/dist/integrity.js +89 -0
- package/dist/integrity.js.map +1 -0
- package/dist/refusals.d.ts +39 -15
- package/dist/refusals.d.ts.map +1 -1
- package/dist/refusals.js +69 -16
- package/dist/refusals.js.map +1 -1
- package/dist/toon.d.ts +22 -0
- package/dist/toon.d.ts.map +1 -0
- package/dist/toon.js +115 -0
- package/dist/toon.js.map +1 -0
- package/dist/types.d.ts +1182 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/upstream.d.ts +8 -0
- package/dist/upstream.d.ts.map +1 -0
- package/dist/upstream.js +17 -0
- package/dist/upstream.js.map +1 -0
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -37,6 +37,11 @@ export interface ChatParams {
|
|
|
37
37
|
response_format?: any;
|
|
38
38
|
[key: string]: any;
|
|
39
39
|
}
|
|
40
|
+
/** The proxy's `x-intutic-upstream-attempts` / `x-intutic-upstream-fallback-from` headers, read. */
|
|
41
|
+
export interface UpstreamCalls {
|
|
42
|
+
attempts: number;
|
|
43
|
+
fallbackFrom?: string;
|
|
44
|
+
}
|
|
40
45
|
export interface ChatResponse {
|
|
41
46
|
id: string;
|
|
42
47
|
object: string;
|
|
@@ -54,6 +59,13 @@ export interface ChatResponse {
|
|
|
54
59
|
};
|
|
55
60
|
/** Always `allow`: a response only comes back when the proxy let the request through. */
|
|
56
61
|
verdict?: Verdict | LegacyVerdict;
|
|
62
|
+
/**
|
|
63
|
+
* What the proxy's retry layer did, when it did anything: how many upstream
|
|
64
|
+
* calls this answer took, and — when a fallback answered after the model's
|
|
65
|
+
* retries ran out — which model failed (`model` names the one that
|
|
66
|
+
* answered). Absent for the ordinary single-call request.
|
|
67
|
+
*/
|
|
68
|
+
upstream?: UpstreamCalls;
|
|
57
69
|
/** @deprecated Never set: the proxy does not report budget on responses. Use `checkBudget()`. */
|
|
58
70
|
budgetRemainingUsd?: number;
|
|
59
71
|
/** @deprecated Never set: the proxy does not report budget on responses. Use `checkBudget()`. */
|
|
@@ -110,10 +122,12 @@ export interface BudgetCheckResult {
|
|
|
110
122
|
export type EventCallback = (data: {
|
|
111
123
|
/** One of the `RefusalVerdict` values; typed wider so listeners written against 2.0 compile. */
|
|
112
124
|
verdict: Verdict | LegacyVerdict;
|
|
113
|
-
/** The proxy's
|
|
125
|
+
/** The proxy's refusal code, e.g. `policy_denied`, `OVERAGE_HARD_CAP_EXCEEDED` or `TOOL_DENIED`. */
|
|
114
126
|
code: string;
|
|
115
127
|
status: number;
|
|
116
128
|
message: string;
|
|
129
|
+
/** The rule that decided, when the proxy names one. */
|
|
130
|
+
ruleId?: string;
|
|
117
131
|
/** @deprecated Never set. */
|
|
118
132
|
budgetRemainingUsd?: number;
|
|
119
133
|
/** @deprecated Never set. */
|
|
@@ -242,15 +256,28 @@ export interface GatewayStatus {
|
|
|
242
256
|
litellmReachable: boolean | null;
|
|
243
257
|
lastError: string | null;
|
|
244
258
|
reportedAt: string | null;
|
|
259
|
+
/** The config version the gateway reported running in its last heartbeat; null when unreachable or not reported. */
|
|
260
|
+
appliedConfigVersion: number | null;
|
|
261
|
+
/** The version the latest config change produced; 0 before any. The gateway pulls it on its next heartbeat. */
|
|
262
|
+
desiredConfigVersion: number;
|
|
245
263
|
}
|
|
246
264
|
export interface GatewayConfigUpdate {
|
|
247
265
|
requireVk?: boolean;
|
|
248
266
|
requireProvisionedKey?: boolean;
|
|
249
267
|
}
|
|
250
268
|
export interface GatewayConfigResult {
|
|
269
|
+
/** The flags set on the gateway (`requireVk`, `requireProvisionedKey`). One never set is absent: the gateway runs its deployment's own value. */
|
|
251
270
|
config: Record<string, unknown>;
|
|
252
271
|
configVersion: number;
|
|
253
272
|
}
|
|
273
|
+
export interface WorkspaceSettings {
|
|
274
|
+
workspaceId: string;
|
|
275
|
+
/** Every setting, resolved with its default. */
|
|
276
|
+
settings: Record<string, unknown>;
|
|
277
|
+
}
|
|
278
|
+
export interface WorkspaceSettingsUpdateResult extends WorkspaceSettings {
|
|
279
|
+
updated: true;
|
|
280
|
+
}
|
|
254
281
|
export interface GatewayResolution {
|
|
255
282
|
source: 'workspace' | 'org' | 'default';
|
|
256
283
|
gateway: {
|
|
@@ -268,4 +295,1158 @@ export interface ProviderCredentialStatus {
|
|
|
268
295
|
lastFour: string | null;
|
|
269
296
|
updatedAt: string | null;
|
|
270
297
|
}
|
|
298
|
+
/**
|
|
299
|
+
* The models a provider credential can reach, as the provider listed them
|
|
300
|
+
* when the stored key was last checked. `models` and `checkedAt` are `null`
|
|
301
|
+
* until a check has recorded a list (and stay so for providers that have no
|
|
302
|
+
* list, such as Azure OpenAI, whose list names base models, not deployments).
|
|
303
|
+
*/
|
|
304
|
+
export interface ProviderModelList {
|
|
305
|
+
provider: string;
|
|
306
|
+
models: string[] | null;
|
|
307
|
+
checkedAt: string | null;
|
|
308
|
+
}
|
|
309
|
+
/** `listProperty` and `rowCase`, which every control-plane list response carries beside its rows. */
|
|
310
|
+
export interface ListEnvelope {
|
|
311
|
+
listProperty?: string;
|
|
312
|
+
rowCase?: 'snake' | 'camel' | 'mixed';
|
|
313
|
+
}
|
|
314
|
+
export interface McpServer {
|
|
315
|
+
serverId: string;
|
|
316
|
+
serverName: string;
|
|
317
|
+
status: 'candidate' | 'approved' | 'blocked';
|
|
318
|
+
tools: string[];
|
|
319
|
+
disabledTools: string[];
|
|
320
|
+
lastSeenAt: string;
|
|
321
|
+
/** A high-risk tool change is waiting for a decision. */
|
|
322
|
+
heldForReview: boolean;
|
|
323
|
+
}
|
|
324
|
+
export interface McpServerList extends ListEnvelope {
|
|
325
|
+
servers: McpServer[];
|
|
326
|
+
defaultPolicy: 'allow' | 'deny';
|
|
327
|
+
highRiskToolChange: 'notify' | 'hold';
|
|
328
|
+
pendingCount: number;
|
|
329
|
+
}
|
|
330
|
+
export interface McpServerDecision {
|
|
331
|
+
ok: boolean;
|
|
332
|
+
server: McpServer;
|
|
333
|
+
}
|
|
334
|
+
export type NotificationChannel = 'slack' | 'email' | 'webhook' | 'pagerduty';
|
|
335
|
+
export interface NotificationChannelConfig {
|
|
336
|
+
slackChannelId?: string;
|
|
337
|
+
slackChannelName?: string;
|
|
338
|
+
emailRecipients?: string[];
|
|
339
|
+
webhookUrl?: string;
|
|
340
|
+
pagerdutyRoutingKey?: string;
|
|
341
|
+
}
|
|
342
|
+
export interface NotificationFilters {
|
|
343
|
+
severity?: string[];
|
|
344
|
+
harnessType?: string[];
|
|
345
|
+
userId?: string[];
|
|
346
|
+
}
|
|
347
|
+
export interface NotificationRule {
|
|
348
|
+
ruleId: string;
|
|
349
|
+
eventType: string;
|
|
350
|
+
channel: NotificationChannel;
|
|
351
|
+
channelConfig: NotificationChannelConfig;
|
|
352
|
+
filters: NotificationFilters;
|
|
353
|
+
cooldownMinutes: number;
|
|
354
|
+
enabled: boolean;
|
|
355
|
+
/** A webhook rule's signing secret, only in the response that made it. Not retrievable again. */
|
|
356
|
+
signingSecret?: string;
|
|
357
|
+
}
|
|
358
|
+
/** The body of a create. Channel config and filters are each stored whole. */
|
|
359
|
+
export interface NotificationRuleInput {
|
|
360
|
+
eventType: string;
|
|
361
|
+
channel: NotificationChannel;
|
|
362
|
+
channelConfig: NotificationChannelConfig;
|
|
363
|
+
filters?: NotificationFilters;
|
|
364
|
+
cooldownMinutes?: number;
|
|
365
|
+
enabled?: boolean;
|
|
366
|
+
}
|
|
367
|
+
/** An update sends only the fields that change; `channelConfig` and `filters` replace the stored ones whole. */
|
|
368
|
+
export type NotificationRuleUpdate = Partial<NotificationRuleInput>;
|
|
369
|
+
export interface SigningSecretRotation {
|
|
370
|
+
/** Shown once: not retrievable again after this response. */
|
|
371
|
+
signingSecret: string;
|
|
372
|
+
}
|
|
373
|
+
export interface NotificationSecretRotation extends SigningSecretRotation {
|
|
374
|
+
ruleId: string;
|
|
375
|
+
}
|
|
376
|
+
export type SiemAdapterType = 'syslog_cef' | 'webhook_https' | 'gcs' | 's3' | 'splunk_hec' | 'datadog_logs';
|
|
377
|
+
export interface SiemDestination {
|
|
378
|
+
destinationId: string;
|
|
379
|
+
name: string;
|
|
380
|
+
adapterType: SiemAdapterType;
|
|
381
|
+
isActive: boolean;
|
|
382
|
+
/** Empty means the default set: every source except the opt-in ones. */
|
|
383
|
+
sourceTables: string[];
|
|
384
|
+
batchSize: number;
|
|
385
|
+
flushIntervalMs: number;
|
|
386
|
+
lastHeartbeatAt: string | null;
|
|
387
|
+
lastError: string | null;
|
|
388
|
+
/** The adapter settings, with credentials masked. */
|
|
389
|
+
config?: Record<string, unknown>;
|
|
390
|
+
/** A webhook destination's signing secret, only in the response that made it. */
|
|
391
|
+
signingSecret?: string;
|
|
392
|
+
}
|
|
393
|
+
export interface SiemSources {
|
|
394
|
+
all: string[];
|
|
395
|
+
defaults: string[];
|
|
396
|
+
}
|
|
397
|
+
export interface SiemDestinationList {
|
|
398
|
+
items: SiemDestination[];
|
|
399
|
+
sources: SiemSources;
|
|
400
|
+
}
|
|
401
|
+
export interface SiemDestinationInput {
|
|
402
|
+
name: string;
|
|
403
|
+
adapterType: SiemAdapterType;
|
|
404
|
+
/** Adapter settings, credentials included; the control plane encrypts them and masks them on every read. */
|
|
405
|
+
config: Record<string, unknown>;
|
|
406
|
+
sourceTables?: string[];
|
|
407
|
+
batchSize?: number;
|
|
408
|
+
flushIntervalMs?: number;
|
|
409
|
+
}
|
|
410
|
+
export interface SiemDestinationUpdate {
|
|
411
|
+
name?: string;
|
|
412
|
+
config?: Record<string, unknown>;
|
|
413
|
+
sourceTables?: string[];
|
|
414
|
+
batchSize?: number;
|
|
415
|
+
flushIntervalMs?: number;
|
|
416
|
+
/** `true` turns a deleted (deactivated) destination back on. */
|
|
417
|
+
isActive?: boolean;
|
|
418
|
+
}
|
|
419
|
+
export interface SiemSecretRotation extends SigningSecretRotation {
|
|
420
|
+
destinationId: string;
|
|
421
|
+
}
|
|
422
|
+
export type UsagePeriod = 'daily' | 'monthly';
|
|
423
|
+
export interface UsageOptions {
|
|
424
|
+
/** Default `monthly`. */
|
|
425
|
+
period?: UsagePeriod;
|
|
426
|
+
}
|
|
427
|
+
export interface UsageTotals {
|
|
428
|
+
totalCostUsd: number;
|
|
429
|
+
totalRawCostUsd: number;
|
|
430
|
+
totalInputTokens: number;
|
|
431
|
+
totalOutputTokens: number;
|
|
432
|
+
traceCount: number;
|
|
433
|
+
}
|
|
434
|
+
/** `self` when the caller may see only their own calls (below OWNER, ADMIN and EM). */
|
|
435
|
+
export type UsageScope = 'workspace' | 'self';
|
|
436
|
+
export interface MemberUsage extends UsageTotals {
|
|
437
|
+
/** Null for calls no single member owns. */
|
|
438
|
+
memberId: string | null;
|
|
439
|
+
displayName: string | null;
|
|
440
|
+
email: string | null;
|
|
441
|
+
models: string[];
|
|
442
|
+
activeDays: number;
|
|
443
|
+
}
|
|
444
|
+
export interface MemberUsageResponse {
|
|
445
|
+
scope: UsageScope;
|
|
446
|
+
members: MemberUsage[];
|
|
447
|
+
}
|
|
448
|
+
export interface TeamUsage extends UsageTotals {
|
|
449
|
+
groupId: string;
|
|
450
|
+
displayName: string;
|
|
451
|
+
memberCount: number;
|
|
452
|
+
activeMembers: number;
|
|
453
|
+
}
|
|
454
|
+
export interface TeamUsageResponse {
|
|
455
|
+
/** False when the workspace has no SCIM groups, so there are no teams. */
|
|
456
|
+
scimGroups: boolean;
|
|
457
|
+
teams: TeamUsage[];
|
|
458
|
+
}
|
|
459
|
+
export interface BranchUsage extends UsageTotals {
|
|
460
|
+
/** Null on the row for calls made with no git context. */
|
|
461
|
+
repo: string | null;
|
|
462
|
+
branch: string | null;
|
|
463
|
+
commitCount: number;
|
|
464
|
+
lastCallAt: string;
|
|
465
|
+
}
|
|
466
|
+
export interface BranchUsageResponse {
|
|
467
|
+
scope: UsageScope;
|
|
468
|
+
branches: BranchUsage[];
|
|
469
|
+
}
|
|
470
|
+
export interface CommitUsage extends UsageTotals {
|
|
471
|
+
repo: string | null;
|
|
472
|
+
branch: string | null;
|
|
473
|
+
commit: string | null;
|
|
474
|
+
firstCallAt: string;
|
|
475
|
+
lastCallAt: string;
|
|
476
|
+
}
|
|
477
|
+
export interface CommitUsageResponse {
|
|
478
|
+
scope: UsageScope;
|
|
479
|
+
commits: CommitUsage[];
|
|
480
|
+
}
|
|
481
|
+
export interface PullRequestUsage extends UsageTotals {
|
|
482
|
+
repo: string;
|
|
483
|
+
number: number;
|
|
484
|
+
title: string;
|
|
485
|
+
author: string | null;
|
|
486
|
+
state: 'open' | 'closed' | 'merged';
|
|
487
|
+
headBranch: string;
|
|
488
|
+
baseBranch: string | null;
|
|
489
|
+
url: string;
|
|
490
|
+
openedAt: string;
|
|
491
|
+
mergedAt: string | null;
|
|
492
|
+
closedAt: string | null;
|
|
493
|
+
memberCount: number;
|
|
494
|
+
firstCallAt: string;
|
|
495
|
+
lastCallAt: string;
|
|
496
|
+
}
|
|
497
|
+
export interface PullRequestSources {
|
|
498
|
+
connector: boolean;
|
|
499
|
+
webhook: boolean;
|
|
500
|
+
apiHost: string;
|
|
501
|
+
noAccessRepos: string[];
|
|
502
|
+
mappedPullRequests: number;
|
|
503
|
+
lastCheckedAt: string | null;
|
|
504
|
+
}
|
|
505
|
+
export interface PullRequestUsageResponse {
|
|
506
|
+
scope: UsageScope;
|
|
507
|
+
github: PullRequestSources;
|
|
508
|
+
pullRequests: PullRequestUsage[];
|
|
509
|
+
}
|
|
510
|
+
export interface PullRequestRefreshResult {
|
|
511
|
+
checked: number;
|
|
512
|
+
notModified: number;
|
|
513
|
+
pullRequests: number;
|
|
514
|
+
noAccess: number;
|
|
515
|
+
rateLimited: boolean;
|
|
516
|
+
}
|
|
517
|
+
export interface InventorySummary {
|
|
518
|
+
devices: number;
|
|
519
|
+
staleDevices: number;
|
|
520
|
+
harnesses: number;
|
|
521
|
+
governedHarnesses: number;
|
|
522
|
+
governedPercent: number | null;
|
|
523
|
+
ungovernedHarnesses: number;
|
|
524
|
+
staleGates: number;
|
|
525
|
+
unverifiedHarnesses: number;
|
|
526
|
+
mcpServers: number;
|
|
527
|
+
ungovernedMcpServers: number;
|
|
528
|
+
skills: number;
|
|
529
|
+
}
|
|
530
|
+
export interface InventoryDevice {
|
|
531
|
+
deviceId: string;
|
|
532
|
+
hostname: string;
|
|
533
|
+
platform: string;
|
|
534
|
+
cliVersion: string | null;
|
|
535
|
+
reportedBy: string | null;
|
|
536
|
+
workspace: string | null;
|
|
537
|
+
guardProbes: {
|
|
538
|
+
total: number;
|
|
539
|
+
failed: number;
|
|
540
|
+
ranAt: number;
|
|
541
|
+
} | null;
|
|
542
|
+
firstSeenAt: string;
|
|
543
|
+
lastSeenAt: string;
|
|
544
|
+
stale: boolean;
|
|
545
|
+
disconnectedAt: string | null;
|
|
546
|
+
harnesses: number;
|
|
547
|
+
ungovernedHarnesses: number;
|
|
548
|
+
staleGates: number;
|
|
549
|
+
mcpServers: number;
|
|
550
|
+
ungovernedMcpServers: number;
|
|
551
|
+
skills: number;
|
|
552
|
+
}
|
|
553
|
+
interface InventoryItem {
|
|
554
|
+
itemId: string;
|
|
555
|
+
deviceId: string;
|
|
556
|
+
hostname: string;
|
|
557
|
+
deviceStale: boolean;
|
|
558
|
+
firstSeenAt: string;
|
|
559
|
+
lastSeenAt: string;
|
|
560
|
+
}
|
|
561
|
+
export interface InventoryHarness extends InventoryItem {
|
|
562
|
+
harness: string;
|
|
563
|
+
version: string | null;
|
|
564
|
+
configured: boolean;
|
|
565
|
+
gateKind: string;
|
|
566
|
+
gateInstalled: boolean | null;
|
|
567
|
+
gateFile: string | null;
|
|
568
|
+
lastHookEventAt: string | null;
|
|
569
|
+
status: string;
|
|
570
|
+
reason: string | null;
|
|
571
|
+
reasonText: string | null;
|
|
572
|
+
}
|
|
573
|
+
export interface InventoryMcpServer extends InventoryItem {
|
|
574
|
+
server: string;
|
|
575
|
+
harness: string;
|
|
576
|
+
transport: string;
|
|
577
|
+
endpoint: string | null;
|
|
578
|
+
status: string;
|
|
579
|
+
reason: string | null;
|
|
580
|
+
}
|
|
581
|
+
export interface InventorySkill extends InventoryItem {
|
|
582
|
+
name: string;
|
|
583
|
+
source: string;
|
|
584
|
+
sha256: string | null;
|
|
585
|
+
scanned: boolean;
|
|
586
|
+
clean: boolean;
|
|
587
|
+
findingsCount: number;
|
|
588
|
+
scriptCount: number;
|
|
589
|
+
}
|
|
590
|
+
export interface DeviceDisconnect {
|
|
591
|
+
disconnectId: string;
|
|
592
|
+
hostname: string;
|
|
593
|
+
fingerprint: string;
|
|
594
|
+
scope: 'machine' | 'harness';
|
|
595
|
+
harnesses: string[];
|
|
596
|
+
memberId: string | null;
|
|
597
|
+
reportedBy: string | null;
|
|
598
|
+
createdAt: string;
|
|
599
|
+
}
|
|
600
|
+
export interface InventoryFilters {
|
|
601
|
+
status?: string;
|
|
602
|
+
harness?: string;
|
|
603
|
+
/** A device id. */
|
|
604
|
+
device?: string;
|
|
605
|
+
/** Text matched against the item's name and the machine's hostname. */
|
|
606
|
+
search?: string;
|
|
607
|
+
}
|
|
608
|
+
export interface InventorySkillFilters {
|
|
609
|
+
device?: string;
|
|
610
|
+
search?: string;
|
|
611
|
+
}
|
|
612
|
+
/** The coverage report formats: `md` is markdown. */
|
|
613
|
+
export type CoverageFormat = 'json' | 'md' | 'csv' | 'pdf';
|
|
614
|
+
export interface FrameworkCoverage {
|
|
615
|
+
frameworkId: string;
|
|
616
|
+
name: string;
|
|
617
|
+
mappingVersion: string;
|
|
618
|
+
generatedAt: string;
|
|
619
|
+
summary: {
|
|
620
|
+
controls: number;
|
|
621
|
+
mapped: number;
|
|
622
|
+
full: number;
|
|
623
|
+
partial: number;
|
|
624
|
+
states: Record<string, number>;
|
|
625
|
+
};
|
|
626
|
+
[key: string]: unknown;
|
|
627
|
+
}
|
|
628
|
+
export interface EvidenceCollectOptions {
|
|
629
|
+
/** ISO 8601. */
|
|
630
|
+
periodStart?: string;
|
|
631
|
+
periodEnd?: string;
|
|
632
|
+
}
|
|
633
|
+
export interface EvidenceDetachedSignature {
|
|
634
|
+
algorithm: string;
|
|
635
|
+
keyId: string;
|
|
636
|
+
preimageDomain: string;
|
|
637
|
+
value: string;
|
|
638
|
+
}
|
|
639
|
+
/** An evidence archive: the parts verification reads. Everything else is covered by the archive hash. */
|
|
640
|
+
export interface EvidenceArchive {
|
|
641
|
+
formatVersion?: number;
|
|
642
|
+
runId?: string;
|
|
643
|
+
collectedAt?: string;
|
|
644
|
+
periodStart?: string;
|
|
645
|
+
periodEnd?: string;
|
|
646
|
+
overallScore?: number | null;
|
|
647
|
+
categories?: Array<{
|
|
648
|
+
category: string;
|
|
649
|
+
[key: string]: unknown;
|
|
650
|
+
}>;
|
|
651
|
+
frameworks?: Array<{
|
|
652
|
+
coverage: {
|
|
653
|
+
frameworkId: string;
|
|
654
|
+
[key: string]: unknown;
|
|
655
|
+
};
|
|
656
|
+
csv?: string;
|
|
657
|
+
pdf?: string;
|
|
658
|
+
[key: string]: unknown;
|
|
659
|
+
}>;
|
|
660
|
+
manifest?: {
|
|
661
|
+
algorithm?: string;
|
|
662
|
+
sections?: Record<string, string>;
|
|
663
|
+
archiveSha256?: string;
|
|
664
|
+
unsignedReason?: string;
|
|
665
|
+
[key: string]: unknown;
|
|
666
|
+
};
|
|
667
|
+
signature?: EvidenceDetachedSignature | null;
|
|
668
|
+
[key: string]: unknown;
|
|
669
|
+
}
|
|
670
|
+
export interface EvidenceCollectResult {
|
|
671
|
+
runId: string;
|
|
672
|
+
archive: EvidenceArchive;
|
|
673
|
+
artifactUrl: string | null;
|
|
674
|
+
signed: boolean;
|
|
675
|
+
signingKeyId?: string;
|
|
676
|
+
unsignedReason?: string;
|
|
677
|
+
}
|
|
678
|
+
/** The control plane's published signing keys, one per `kid`. */
|
|
679
|
+
export interface SigningJwks {
|
|
680
|
+
keys: Array<Record<string, unknown>>;
|
|
681
|
+
}
|
|
682
|
+
export type EvidenceSignatureState = 'valid' | 'invalid' | 'unsigned' | 'unverifiable' | 'keys_unavailable';
|
|
683
|
+
export interface EvidenceVerification {
|
|
684
|
+
/** The recomputed whole-archive hash, and whether it equals `manifest.archiveSha256`. */
|
|
685
|
+
archiveSha256: string;
|
|
686
|
+
archiveHashMatches: boolean;
|
|
687
|
+
/** Manifest entries whose content does not hash to the recorded value, or that name nothing in the archive. */
|
|
688
|
+
sectionMismatches: string[];
|
|
689
|
+
sectionsChecked: number;
|
|
690
|
+
signature: EvidenceSignatureState;
|
|
691
|
+
signingKeyId: string | null;
|
|
692
|
+
unsignedReason: string | null;
|
|
693
|
+
/** True only when the hashes match and a published key accepts the signature. */
|
|
694
|
+
verified: boolean;
|
|
695
|
+
}
|
|
696
|
+
export interface GateLiveness {
|
|
697
|
+
windowHours: number;
|
|
698
|
+
gates: Array<{
|
|
699
|
+
harnessType: string;
|
|
700
|
+
status: 'reporting' | 'silent' | 'new';
|
|
701
|
+
lastSeen: string | null;
|
|
702
|
+
agentLastSeen: string | null;
|
|
703
|
+
alertOpen: boolean;
|
|
704
|
+
}>;
|
|
705
|
+
}
|
|
706
|
+
export interface GitHubWebhookInfo {
|
|
707
|
+
configured: boolean;
|
|
708
|
+
url: string | null;
|
|
709
|
+
createdAt: string | null;
|
|
710
|
+
secretRotatedAt: string | null;
|
|
711
|
+
lastDeliveryAt: string | null;
|
|
712
|
+
}
|
|
713
|
+
export interface GitHubWebhookSecret {
|
|
714
|
+
url: string;
|
|
715
|
+
/** Shown once: not retrievable again after this response. */
|
|
716
|
+
secret: string;
|
|
717
|
+
}
|
|
718
|
+
/** The connector providers that are policy sources. */
|
|
719
|
+
export type PolicySourceProvider = 'notion' | 'confluence' | 'github' | 'gdrive';
|
|
720
|
+
export interface PolicySource {
|
|
721
|
+
connector_id: string;
|
|
722
|
+
provider: PolicySourceProvider;
|
|
723
|
+
name: string;
|
|
724
|
+
config: Record<string, unknown> | null;
|
|
725
|
+
last_synced_at: string | null;
|
|
726
|
+
last_sync_error?: string | null;
|
|
727
|
+
last_attempt_at?: string | null;
|
|
728
|
+
created_at?: string;
|
|
729
|
+
}
|
|
730
|
+
export interface PolicySourceInput {
|
|
731
|
+
provider: PolicySourceProvider;
|
|
732
|
+
name: string;
|
|
733
|
+
/** The provider credential (a Google service-account key is the key file's JSON). */
|
|
734
|
+
token: string;
|
|
735
|
+
config?: Record<string, unknown>;
|
|
736
|
+
}
|
|
737
|
+
export interface PolicySourceSyncResult {
|
|
738
|
+
success: boolean;
|
|
739
|
+
processed_docs: number;
|
|
740
|
+
updated_sops: string[];
|
|
741
|
+
successor_sops: string[];
|
|
742
|
+
}
|
|
743
|
+
export type GuardrailStatus = 'PROPOSED' | 'SHADOW' | 'ENFORCING' | 'REJECTED' | 'RETIRED';
|
|
744
|
+
export type GuardrailTarget = 'hook_rule' | 'sop_front_matter' | 'wasm_rule' | 'workspace_setting';
|
|
745
|
+
export type GuardrailProvenance = 'extracted' | 'authored';
|
|
746
|
+
export interface PolicyDocumentSummary {
|
|
747
|
+
docId: string;
|
|
748
|
+
title: string;
|
|
749
|
+
provider: string;
|
|
750
|
+
sourceUrl: string | null;
|
|
751
|
+
status: string;
|
|
752
|
+
injectionFlagged: boolean;
|
|
753
|
+
sopId: string | null;
|
|
754
|
+
fetchedAt: string;
|
|
755
|
+
passageCount: number;
|
|
756
|
+
clauseCount: number;
|
|
757
|
+
guardrailCount: number;
|
|
758
|
+
lastRun: {
|
|
759
|
+
runId: string;
|
|
760
|
+
extractor: string;
|
|
761
|
+
startedAt: string;
|
|
762
|
+
finishedAt: string | null;
|
|
763
|
+
error: string | null;
|
|
764
|
+
} | null;
|
|
765
|
+
}
|
|
766
|
+
export interface PolicyDocumentDetail extends PolicyDocumentSummary {
|
|
767
|
+
contentHash: string;
|
|
768
|
+
upstreamVersion: string | null;
|
|
769
|
+
passages: Array<Record<string, unknown>>;
|
|
770
|
+
clauses: Array<Record<string, unknown>>;
|
|
771
|
+
runs: Array<Record<string, unknown>>;
|
|
772
|
+
}
|
|
773
|
+
export interface ExtractDocumentResult {
|
|
774
|
+
docId: string;
|
|
775
|
+
runId: string | null;
|
|
776
|
+
extractor: string;
|
|
777
|
+
skipped: 'no_passages' | 'daily_cap' | 'cap_unavailable' | 'llm_disabled' | null;
|
|
778
|
+
cap: {
|
|
779
|
+
count: number;
|
|
780
|
+
cap: number;
|
|
781
|
+
} | null;
|
|
782
|
+
llmUnavailable: boolean;
|
|
783
|
+
chunks: number;
|
|
784
|
+
proposals: number;
|
|
785
|
+
verbatimQuotes: number;
|
|
786
|
+
valid: number;
|
|
787
|
+
rejected: number;
|
|
788
|
+
malformed: number;
|
|
789
|
+
guardrails: {
|
|
790
|
+
proposed: number;
|
|
791
|
+
rejectedForInjection: number;
|
|
792
|
+
existing: number;
|
|
793
|
+
};
|
|
794
|
+
lifted: {
|
|
795
|
+
clauses: number;
|
|
796
|
+
valid: number;
|
|
797
|
+
errors: string[];
|
|
798
|
+
};
|
|
799
|
+
error: string | null;
|
|
800
|
+
}
|
|
801
|
+
export interface ExtractOptions {
|
|
802
|
+
/** Default true. False runs only the front-matter lift, with no model call. */
|
|
803
|
+
llm?: boolean;
|
|
804
|
+
}
|
|
805
|
+
export interface TokenCoverage {
|
|
806
|
+
token: string;
|
|
807
|
+
passages: Array<{
|
|
808
|
+
passageId: string;
|
|
809
|
+
docId: string;
|
|
810
|
+
title: string;
|
|
811
|
+
sourceUrl: string | null;
|
|
812
|
+
headingPath: string[];
|
|
813
|
+
excerpt: string;
|
|
814
|
+
}>;
|
|
815
|
+
guardrails: Array<{
|
|
816
|
+
guardrailId: string;
|
|
817
|
+
clauseId: string;
|
|
818
|
+
passageId: string | null;
|
|
819
|
+
status: string;
|
|
820
|
+
target: string;
|
|
821
|
+
quote: string;
|
|
822
|
+
}>;
|
|
823
|
+
}
|
|
824
|
+
export interface PassageSearchResult {
|
|
825
|
+
query: string;
|
|
826
|
+
passages: Array<{
|
|
827
|
+
passageId: string;
|
|
828
|
+
docId: string;
|
|
829
|
+
title: string;
|
|
830
|
+
sourceUrl: string | null;
|
|
831
|
+
headingPath: string[];
|
|
832
|
+
excerpt: string;
|
|
833
|
+
rank: number;
|
|
834
|
+
}>;
|
|
835
|
+
}
|
|
836
|
+
/** Name exactly one: the document or the passage whose change to follow. */
|
|
837
|
+
export interface GuardrailImpactSeed {
|
|
838
|
+
docId?: string;
|
|
839
|
+
passageId?: string;
|
|
840
|
+
}
|
|
841
|
+
export interface LedgerImpact {
|
|
842
|
+
seed: {
|
|
843
|
+
docId: string | null;
|
|
844
|
+
passageId: string | null;
|
|
845
|
+
};
|
|
846
|
+
maxDepth: number;
|
|
847
|
+
passages: Array<Record<string, unknown>>;
|
|
848
|
+
clauses: Array<Record<string, unknown>>;
|
|
849
|
+
guardrails: Array<{
|
|
850
|
+
guardrailId: string;
|
|
851
|
+
clauseId: string;
|
|
852
|
+
status: string;
|
|
853
|
+
target: string;
|
|
854
|
+
sourceStale: boolean;
|
|
855
|
+
ruleCandidateId: string | null;
|
|
856
|
+
depth: number;
|
|
857
|
+
}>;
|
|
858
|
+
truncated: boolean;
|
|
859
|
+
}
|
|
860
|
+
export interface DuplicatesOptions {
|
|
861
|
+
/** 0 to 1. */
|
|
862
|
+
minJaccard?: number;
|
|
863
|
+
}
|
|
864
|
+
export interface LedgerDuplicates {
|
|
865
|
+
minJaccard: number;
|
|
866
|
+
passagePairs: Array<Record<string, unknown>>;
|
|
867
|
+
sameRule: Array<Record<string, unknown>>;
|
|
868
|
+
}
|
|
869
|
+
export interface GuardrailFilters {
|
|
870
|
+
status?: GuardrailStatus;
|
|
871
|
+
target?: GuardrailTarget;
|
|
872
|
+
provenance?: GuardrailProvenance;
|
|
873
|
+
docId?: string;
|
|
874
|
+
limit?: number;
|
|
875
|
+
}
|
|
876
|
+
export interface GuardrailSummary {
|
|
877
|
+
guardrailId: string;
|
|
878
|
+
provenance: GuardrailProvenance;
|
|
879
|
+
name: string | null;
|
|
880
|
+
description: string | null;
|
|
881
|
+
version: number;
|
|
882
|
+
supersedes: string | null;
|
|
883
|
+
target: GuardrailTarget;
|
|
884
|
+
status: GuardrailStatus;
|
|
885
|
+
/** The guardrail IR: `kind` and the keys that kind takes. */
|
|
886
|
+
ir: Record<string, unknown>;
|
|
887
|
+
rendered: unknown;
|
|
888
|
+
roles: string[];
|
|
889
|
+
scope: string;
|
|
890
|
+
shadowEvaluations: number;
|
|
891
|
+
shadowWouldAct: number;
|
|
892
|
+
enforcingFires: number;
|
|
893
|
+
sourceStale: boolean;
|
|
894
|
+
ruleCandidateId: string | null;
|
|
895
|
+
proposedAt: string;
|
|
896
|
+
shadowAt: string | null;
|
|
897
|
+
promotedAt: string | null;
|
|
898
|
+
rejectedReason: string | null;
|
|
899
|
+
clause: Record<string, unknown> | null;
|
|
900
|
+
document: {
|
|
901
|
+
docId: string;
|
|
902
|
+
title: string;
|
|
903
|
+
provider: string;
|
|
904
|
+
sourceUrl: string | null;
|
|
905
|
+
} | null;
|
|
906
|
+
}
|
|
907
|
+
export interface GuardrailDetail extends GuardrailSummary {
|
|
908
|
+
validation: unknown;
|
|
909
|
+
passage: Record<string, unknown> | null;
|
|
910
|
+
events: Array<{
|
|
911
|
+
eventId: string;
|
|
912
|
+
event: string;
|
|
913
|
+
actorId: string | null;
|
|
914
|
+
detail: unknown;
|
|
915
|
+
createdAt: string;
|
|
916
|
+
}>;
|
|
917
|
+
supersededBy: string | null;
|
|
918
|
+
}
|
|
919
|
+
export interface GuardrailReadiness {
|
|
920
|
+
ready: boolean;
|
|
921
|
+
reasons: string[];
|
|
922
|
+
neverFired: boolean;
|
|
923
|
+
evaluations: number;
|
|
924
|
+
wouldAct: number;
|
|
925
|
+
wouldActRate: number | null;
|
|
926
|
+
adjudicated: number;
|
|
927
|
+
adjudicatedRequired: number;
|
|
928
|
+
falsePositives: number;
|
|
929
|
+
falsePositiveRate: number | null;
|
|
930
|
+
thresholds: {
|
|
931
|
+
minShadowEvaluations: number;
|
|
932
|
+
maxWouldActRate: number;
|
|
933
|
+
minAdjudicatedFires: number;
|
|
934
|
+
maxAdjudicatedFalsePositiveRate: number;
|
|
935
|
+
};
|
|
936
|
+
}
|
|
937
|
+
export interface GuardrailTransitionResult {
|
|
938
|
+
ok: boolean;
|
|
939
|
+
guardrail: GuardrailDetail;
|
|
940
|
+
readiness?: GuardrailReadiness;
|
|
941
|
+
}
|
|
942
|
+
export interface PromoteOptions {
|
|
943
|
+
/** Promote a guardrail that never fired in shadow. Default false. */
|
|
944
|
+
acknowledgeNoTraffic?: boolean;
|
|
945
|
+
}
|
|
946
|
+
export interface AuthoredGuardrailInput {
|
|
947
|
+
/** One line. */
|
|
948
|
+
name: string;
|
|
949
|
+
description?: string | null;
|
|
950
|
+
ir: Record<string, unknown>;
|
|
951
|
+
}
|
|
952
|
+
/** Any of the three. A changed IR creates the next version; `description: null` clears it. */
|
|
953
|
+
export interface AuthoredGuardrailUpdate {
|
|
954
|
+
name?: string;
|
|
955
|
+
description?: string | null;
|
|
956
|
+
ir?: Record<string, unknown>;
|
|
957
|
+
}
|
|
958
|
+
export interface AuthoredGuardrailWriteResult {
|
|
959
|
+
ok: true;
|
|
960
|
+
guardrail: GuardrailDetail;
|
|
961
|
+
/** The IR changed: a new version, PROPOSED with no evidence, replaced the old one, which is now RETIRED. */
|
|
962
|
+
forked: boolean;
|
|
963
|
+
supersedes: string | null;
|
|
964
|
+
}
|
|
965
|
+
export interface GuardrailDeleteResult {
|
|
966
|
+
ok: boolean;
|
|
967
|
+
guardrail: GuardrailDetail;
|
|
968
|
+
}
|
|
969
|
+
export interface GuardrailReplay {
|
|
970
|
+
source: 'enforcement_log' | 'context_snapshots' | 'execution_traces' | 'none';
|
|
971
|
+
windowDays: number;
|
|
972
|
+
captured: number;
|
|
973
|
+
fires: number;
|
|
974
|
+
sample: Array<{
|
|
975
|
+
toolName: string;
|
|
976
|
+
at: string;
|
|
977
|
+
excerpt: string;
|
|
978
|
+
}>;
|
|
979
|
+
truncated: boolean;
|
|
980
|
+
unsupported: string[];
|
|
981
|
+
}
|
|
982
|
+
export interface GuardrailConflict {
|
|
983
|
+
kind: string;
|
|
984
|
+
token: string | null;
|
|
985
|
+
a: {
|
|
986
|
+
id: string;
|
|
987
|
+
quote: string;
|
|
988
|
+
};
|
|
989
|
+
b: {
|
|
990
|
+
id: string;
|
|
991
|
+
quote: string;
|
|
992
|
+
};
|
|
993
|
+
detail: string;
|
|
994
|
+
}
|
|
995
|
+
export interface ReviewOptions {
|
|
996
|
+
/** Recorded with the decision. */
|
|
997
|
+
reason?: string;
|
|
998
|
+
}
|
|
999
|
+
export interface DecisionReviewResult {
|
|
1000
|
+
ok: boolean;
|
|
1001
|
+
status: string;
|
|
1002
|
+
/** A short-lived bypass was written for the exact retried call. */
|
|
1003
|
+
bypassWritten?: boolean;
|
|
1004
|
+
}
|
|
1005
|
+
export type LoopRunStatus = 'ACTIVE' | 'PENDING_REVIEW' | 'COMPLETED' | 'FAILED' | 'KILLED';
|
|
1006
|
+
export interface LoopRun {
|
|
1007
|
+
loopRunId: string;
|
|
1008
|
+
name: string;
|
|
1009
|
+
status: LoopRunStatus;
|
|
1010
|
+
totalTokenCostUsd: string;
|
|
1011
|
+
budgetLimitUsd: string;
|
|
1012
|
+
[key: string]: unknown;
|
|
1013
|
+
}
|
|
1014
|
+
export interface StartLoopRunOptions {
|
|
1015
|
+
budgetLimitUsd?: number | string;
|
|
1016
|
+
/** SOP names active for the run. */
|
|
1017
|
+
sops?: string[];
|
|
1018
|
+
autoJudge?: boolean;
|
|
1019
|
+
}
|
|
1020
|
+
export interface CompleteLoopRunOptions {
|
|
1021
|
+
outcome?: 'SUCCEEDED' | 'FAILED';
|
|
1022
|
+
}
|
|
1023
|
+
export interface LoopRunReviewOptions {
|
|
1024
|
+
note?: string;
|
|
1025
|
+
}
|
|
1026
|
+
export interface LoopRunActionResult {
|
|
1027
|
+
ok: boolean;
|
|
1028
|
+
status?: string;
|
|
1029
|
+
outcome?: string;
|
|
1030
|
+
}
|
|
1031
|
+
export type FindingOutcome = 'TRUE_POSITIVE' | 'FALSE_POSITIVE';
|
|
1032
|
+
export interface Finding {
|
|
1033
|
+
finding_id: string;
|
|
1034
|
+
trace_id: string | null;
|
|
1035
|
+
session_id: string | null;
|
|
1036
|
+
loop_run_id: string | null;
|
|
1037
|
+
detector_id: string;
|
|
1038
|
+
anomaly_kind: string | null;
|
|
1039
|
+
severity: string | null;
|
|
1040
|
+
disposition: string | null;
|
|
1041
|
+
confidence: number;
|
|
1042
|
+
reason: string | null;
|
|
1043
|
+
harness: string | null;
|
|
1044
|
+
shadowed: boolean;
|
|
1045
|
+
outcome: FindingOutcome | null;
|
|
1046
|
+
outcome_by: string | null;
|
|
1047
|
+
outcome_at: string | null;
|
|
1048
|
+
outcome_note: string | null;
|
|
1049
|
+
created_at: string;
|
|
1050
|
+
}
|
|
1051
|
+
export interface FindingFilters {
|
|
1052
|
+
/** Only findings nobody has ruled on. */
|
|
1053
|
+
unadjudicated?: boolean;
|
|
1054
|
+
detectorId?: string;
|
|
1055
|
+
limit?: number;
|
|
1056
|
+
}
|
|
1057
|
+
export interface AdjudicateOptions {
|
|
1058
|
+
note?: string;
|
|
1059
|
+
}
|
|
1060
|
+
export interface FindingAdjudication {
|
|
1061
|
+
finding_id: string;
|
|
1062
|
+
outcome: FindingOutcome;
|
|
1063
|
+
}
|
|
1064
|
+
export interface FindingStats {
|
|
1065
|
+
detectors: Array<{
|
|
1066
|
+
detector_id: string;
|
|
1067
|
+
anomaly_kind: string | null;
|
|
1068
|
+
shadowed: boolean;
|
|
1069
|
+
total_findings: number;
|
|
1070
|
+
adjudicated: number;
|
|
1071
|
+
false_positives: number;
|
|
1072
|
+
/** Null when nothing has been ruled on. */
|
|
1073
|
+
false_positive_rate: number | null;
|
|
1074
|
+
}>;
|
|
1075
|
+
caveats: string[];
|
|
1076
|
+
}
|
|
1077
|
+
export interface ResponseEchoReportOptions {
|
|
1078
|
+
/** ISO 8601. */
|
|
1079
|
+
since?: string;
|
|
1080
|
+
until?: string;
|
|
1081
|
+
}
|
|
1082
|
+
export interface ResponseEchoReport {
|
|
1083
|
+
window: {
|
|
1084
|
+
since: string;
|
|
1085
|
+
until: string;
|
|
1086
|
+
};
|
|
1087
|
+
tracesIngested: number;
|
|
1088
|
+
refusal: string | null;
|
|
1089
|
+
patterns: Array<{
|
|
1090
|
+
pattern: string;
|
|
1091
|
+
findings: number;
|
|
1092
|
+
adjudicated: number;
|
|
1093
|
+
truePositives: number;
|
|
1094
|
+
falsePositives: number;
|
|
1095
|
+
falsePositiveRate: number | null;
|
|
1096
|
+
refusal: string | null;
|
|
1097
|
+
}>;
|
|
1098
|
+
}
|
|
1099
|
+
export interface IncidentFilters {
|
|
1100
|
+
/** `OPEN`, `RESOLVED` or `AUTO_RESOLVED`. */
|
|
1101
|
+
status?: string;
|
|
1102
|
+
/** `CRITICAL`, `HIGH`, `MEDIUM` or `LOW`. */
|
|
1103
|
+
severity?: string;
|
|
1104
|
+
/**
|
|
1105
|
+
* An anomaly category such as `SCOPE_VIOLATION`, or a system incident type:
|
|
1106
|
+
* `WASM_RULE_REFUSED` or `SYSTEM_ANOMALY`. The control plane refuses one it
|
|
1107
|
+
* does not know with a 400.
|
|
1108
|
+
*/
|
|
1109
|
+
type?: string;
|
|
1110
|
+
/** From 1; default 1. */
|
|
1111
|
+
page?: number;
|
|
1112
|
+
/** 1 to 100; default 20. */
|
|
1113
|
+
limit?: number;
|
|
1114
|
+
}
|
|
1115
|
+
/** One governance incident, with the route's snake_case keys. */
|
|
1116
|
+
export interface Incident {
|
|
1117
|
+
incident_id: string;
|
|
1118
|
+
workspace_id: string;
|
|
1119
|
+
trace_id: string | null;
|
|
1120
|
+
session_id: string | null;
|
|
1121
|
+
severity: 'CRITICAL' | 'HIGH' | 'MEDIUM' | 'LOW';
|
|
1122
|
+
/** The incident type: an anomaly category or a system incident type. */
|
|
1123
|
+
anomaly_type: string;
|
|
1124
|
+
description: string;
|
|
1125
|
+
resolution_status: string | null;
|
|
1126
|
+
resolved_by: string | null;
|
|
1127
|
+
resolved_at: string | null;
|
|
1128
|
+
escalation_chain: Record<string, unknown> | null;
|
|
1129
|
+
created_at: string | null;
|
|
1130
|
+
/** In a list only: how far up the review queue the incident ranks. */
|
|
1131
|
+
review_priority?: number;
|
|
1132
|
+
}
|
|
1133
|
+
export interface IncidentList extends ListEnvelope {
|
|
1134
|
+
/**
|
|
1135
|
+
* Ranked by review priority, not time. A list of 20 or more arrives
|
|
1136
|
+
* TOON-encoded and is decoded here, with each cell cut at 120 characters:
|
|
1137
|
+
* `getIncident` has the whole description.
|
|
1138
|
+
*/
|
|
1139
|
+
data: Incident[];
|
|
1140
|
+
meta: {
|
|
1141
|
+
total: number;
|
|
1142
|
+
page: number;
|
|
1143
|
+
limit: number;
|
|
1144
|
+
/** The review budget: how many of the matching incidents the ranked queue covers. */
|
|
1145
|
+
audit: {
|
|
1146
|
+
budget: number;
|
|
1147
|
+
matched: number;
|
|
1148
|
+
withheld: number;
|
|
1149
|
+
overBudget: boolean;
|
|
1150
|
+
};
|
|
1151
|
+
};
|
|
1152
|
+
}
|
|
1153
|
+
export interface TraceFilters {
|
|
1154
|
+
/** 1 to 100; default 20. */
|
|
1155
|
+
limit?: number;
|
|
1156
|
+
offset?: number;
|
|
1157
|
+
/** ISO 8601, or a relative duration such as `24h` or `7d`. */
|
|
1158
|
+
since?: string;
|
|
1159
|
+
enforcement?: 'BYPASS' | 'ENHANCE' | 'HIJACK' | 'KILL';
|
|
1160
|
+
model?: string;
|
|
1161
|
+
}
|
|
1162
|
+
export interface TraceSummary {
|
|
1163
|
+
traceId: string;
|
|
1164
|
+
timestamp: string;
|
|
1165
|
+
requestedModel: string;
|
|
1166
|
+
actualModelRouted: string;
|
|
1167
|
+
enforcementAction: string;
|
|
1168
|
+
complianceScore: number;
|
|
1169
|
+
actualCostUsd: number;
|
|
1170
|
+
anomalyDetected: string | null;
|
|
1171
|
+
breakGlass?: boolean;
|
|
1172
|
+
breakGlassRequestId?: string | null;
|
|
1173
|
+
}
|
|
1174
|
+
export interface TraceList extends ListEnvelope {
|
|
1175
|
+
traces: TraceSummary[];
|
|
1176
|
+
total: number;
|
|
1177
|
+
limit?: number;
|
|
1178
|
+
offset?: number;
|
|
1179
|
+
}
|
|
1180
|
+
export interface TraceDetail {
|
|
1181
|
+
traceId: string;
|
|
1182
|
+
sessionId: string;
|
|
1183
|
+
requestId: string;
|
|
1184
|
+
timestamp: string;
|
|
1185
|
+
requestedModel: string;
|
|
1186
|
+
actualModelRouted: string;
|
|
1187
|
+
enforcementAction: string;
|
|
1188
|
+
actualCostUsd: number;
|
|
1189
|
+
[key: string]: unknown;
|
|
1190
|
+
}
|
|
1191
|
+
export interface SealedRoot {
|
|
1192
|
+
root_id: string;
|
|
1193
|
+
loop_run_id: string | null;
|
|
1194
|
+
leaf_schema_version: number;
|
|
1195
|
+
merkle_root: string;
|
|
1196
|
+
leaf_count: number;
|
|
1197
|
+
first_trace_at: string;
|
|
1198
|
+
last_trace_at: string;
|
|
1199
|
+
signature_alg: string | null;
|
|
1200
|
+
signing_key_id: string | null;
|
|
1201
|
+
sealed_at: string;
|
|
1202
|
+
}
|
|
1203
|
+
export interface IntegrityRootList extends ListEnvelope {
|
|
1204
|
+
ok: boolean;
|
|
1205
|
+
data: SealedRoot[];
|
|
1206
|
+
leafSchemaVersion: number;
|
|
1207
|
+
}
|
|
1208
|
+
/**
|
|
1209
|
+
* The fields of a sealed root its signature covers, as
|
|
1210
|
+
* `GET /api/v1/integrity/roots/:rootId` serves them: what
|
|
1211
|
+
* `verifyIntegrityRoot` reads.
|
|
1212
|
+
*/
|
|
1213
|
+
export interface SignedIntegrityRoot {
|
|
1214
|
+
workspace_id: string;
|
|
1215
|
+
loop_run_id: string | null;
|
|
1216
|
+
leaf_schema_version: number;
|
|
1217
|
+
merkle_root: string;
|
|
1218
|
+
signature_alg: string | null;
|
|
1219
|
+
signature: string | null;
|
|
1220
|
+
signing_key_id: string | null;
|
|
1221
|
+
/** The chain link; in the signed bytes from preimage version 2 on. */
|
|
1222
|
+
previous_root?: string | null;
|
|
1223
|
+
/** The preimage the signature covers; absent from a control plane older than the column, which means 1. */
|
|
1224
|
+
signing_preimage_version?: number;
|
|
1225
|
+
}
|
|
1226
|
+
/**
|
|
1227
|
+
* What `verifyIntegrityRoot` established: `valid` a published key accepted
|
|
1228
|
+
* the signature, `invalid` the key the root names rejected it, `unsigned` no
|
|
1229
|
+
* key was configured when it was sealed, `unverifiable` the key is not
|
|
1230
|
+
* published or the root names an algorithm or preimage version this build
|
|
1231
|
+
* cannot check, `keys_unavailable` no key set was given. Only `invalid` says
|
|
1232
|
+
* the root changed.
|
|
1233
|
+
*/
|
|
1234
|
+
export type IntegrityRootSignatureState = 'valid' | 'invalid' | 'unsigned' | 'unverifiable' | 'keys_unavailable';
|
|
1235
|
+
export interface IntegrityRootDetail {
|
|
1236
|
+
ok: boolean;
|
|
1237
|
+
root: SealedRoot & SignedIntegrityRoot & {
|
|
1238
|
+
workspace_id: string;
|
|
1239
|
+
signature: string | null;
|
|
1240
|
+
previous_root: string | null;
|
|
1241
|
+
signing_preimage_version?: number;
|
|
1242
|
+
[key: string]: unknown;
|
|
1243
|
+
};
|
|
1244
|
+
leaves: Array<{
|
|
1245
|
+
trace_id: string;
|
|
1246
|
+
leaf_index: number;
|
|
1247
|
+
leaf_hash: string;
|
|
1248
|
+
}>;
|
|
1249
|
+
}
|
|
1250
|
+
export interface IntegrityRecompute {
|
|
1251
|
+
ok: boolean;
|
|
1252
|
+
verdict: 'match' | 'mismatch' | 'missing_traces';
|
|
1253
|
+
storedRoot: string;
|
|
1254
|
+
recomputedRoot: string | null;
|
|
1255
|
+
changedTraceIds: string[];
|
|
1256
|
+
missingTraceIds: string[];
|
|
1257
|
+
retentionExpired?: boolean;
|
|
1258
|
+
}
|
|
1259
|
+
/** The walk is the answer whether or not it found a break (the control plane answers a break with a 409). */
|
|
1260
|
+
export interface IntegrityChain {
|
|
1261
|
+
ok: boolean;
|
|
1262
|
+
workspaceId: string;
|
|
1263
|
+
rootsWalked: number;
|
|
1264
|
+
rootsNotWalked: number;
|
|
1265
|
+
unchainedRootIds: string[];
|
|
1266
|
+
breaks: Array<{
|
|
1267
|
+
rootId: string;
|
|
1268
|
+
namedPrevious: string;
|
|
1269
|
+
precedingRootId: string;
|
|
1270
|
+
precedingMerkleRoot: string;
|
|
1271
|
+
}>;
|
|
1272
|
+
intact: boolean;
|
|
1273
|
+
}
|
|
1274
|
+
export interface ConfigChain {
|
|
1275
|
+
ok: boolean;
|
|
1276
|
+
workspaceId: string;
|
|
1277
|
+
harnessType: string | null;
|
|
1278
|
+
snapshotsWalked: number;
|
|
1279
|
+
/** Saturates at 1: read it as "more snapshots than the walk covered". */
|
|
1280
|
+
snapshotsNotWalked: number;
|
|
1281
|
+
unchainedSnapshotIds: string[];
|
|
1282
|
+
breaks: Array<{
|
|
1283
|
+
snapshotId: string;
|
|
1284
|
+
harnessType: string;
|
|
1285
|
+
filePath: string;
|
|
1286
|
+
namedPrevious: string;
|
|
1287
|
+
precedingSnapshotId: string;
|
|
1288
|
+
precedingContentHash: string;
|
|
1289
|
+
}>;
|
|
1290
|
+
contentMismatches: Array<{
|
|
1291
|
+
snapshotId: string;
|
|
1292
|
+
harnessType: string;
|
|
1293
|
+
filePath: string;
|
|
1294
|
+
storedHash: string;
|
|
1295
|
+
recomputedHash: string;
|
|
1296
|
+
}>;
|
|
1297
|
+
snapshotsWithoutContent?: number;
|
|
1298
|
+
intact: boolean;
|
|
1299
|
+
}
|
|
1300
|
+
export interface CompliancePolicy {
|
|
1301
|
+
policyId: string;
|
|
1302
|
+
workspaceId: string;
|
|
1303
|
+
name: string;
|
|
1304
|
+
description: string | null;
|
|
1305
|
+
riskCategory: string | null;
|
|
1306
|
+
targetToolPattern: string;
|
|
1307
|
+
enforcementAction: string;
|
|
1308
|
+
interventionMode: string | null;
|
|
1309
|
+
priority: number | null;
|
|
1310
|
+
conditions: unknown;
|
|
1311
|
+
isActive: boolean | null;
|
|
1312
|
+
currentVersion: number;
|
|
1313
|
+
createdAt: string;
|
|
1314
|
+
updatedAt: string;
|
|
1315
|
+
}
|
|
1316
|
+
export interface PolicyChangeResult {
|
|
1317
|
+
ok: boolean;
|
|
1318
|
+
currentVersion?: number;
|
|
1319
|
+
}
|
|
1320
|
+
export interface RuleCandidateSource {
|
|
1321
|
+
candidateId: string;
|
|
1322
|
+
guardrailId: string | null;
|
|
1323
|
+
status: string;
|
|
1324
|
+
source: string;
|
|
1325
|
+
/** Lower-case hex; checked against `source` before it is returned. */
|
|
1326
|
+
sourceSha256: string;
|
|
1327
|
+
}
|
|
1328
|
+
export interface BundleUploadOptions {
|
|
1329
|
+
/** The upload's file name. Default `rule.wasm`. */
|
|
1330
|
+
fileName?: string;
|
|
1331
|
+
}
|
|
1332
|
+
export interface BundleUploadResult {
|
|
1333
|
+
accepted?: boolean;
|
|
1334
|
+
gates?: Array<{
|
|
1335
|
+
gate: string;
|
|
1336
|
+
passed: boolean;
|
|
1337
|
+
detail: string;
|
|
1338
|
+
}>;
|
|
1339
|
+
ruleId?: string;
|
|
1340
|
+
mode?: string;
|
|
1341
|
+
error?: string;
|
|
1342
|
+
detail?: string;
|
|
1343
|
+
}
|
|
1344
|
+
export interface WasmReplayOptions {
|
|
1345
|
+
limit?: number;
|
|
1346
|
+
/** ISO 8601. */
|
|
1347
|
+
since?: string;
|
|
1348
|
+
}
|
|
1349
|
+
export interface WasmReplayResult {
|
|
1350
|
+
ruleId: string;
|
|
1351
|
+
since: string | null;
|
|
1352
|
+
contextCount: number;
|
|
1353
|
+
wouldActCount: number;
|
|
1354
|
+
wouldActRate: number;
|
|
1355
|
+
verdictCounts: Record<string, number>;
|
|
1356
|
+
sampleMatches: Array<Record<string, unknown>>;
|
|
1357
|
+
}
|
|
1358
|
+
export interface SopSummary {
|
|
1359
|
+
sopId: string;
|
|
1360
|
+
title: string;
|
|
1361
|
+
contentHash?: string;
|
|
1362
|
+
[key: string]: unknown;
|
|
1363
|
+
}
|
|
1364
|
+
export interface SopDetail {
|
|
1365
|
+
sopId: string;
|
|
1366
|
+
title: string;
|
|
1367
|
+
riskTier: string;
|
|
1368
|
+
version: string;
|
|
1369
|
+
markdownContent: string;
|
|
1370
|
+
[key: string]: unknown;
|
|
1371
|
+
}
|
|
1372
|
+
/** The body `intutic sops push` sends, in the route's snake_case. */
|
|
1373
|
+
export interface SopInput {
|
|
1374
|
+
title: string;
|
|
1375
|
+
markdown_content: string;
|
|
1376
|
+
risk_tier?: string;
|
|
1377
|
+
complexity_tier?: string;
|
|
1378
|
+
version?: string;
|
|
1379
|
+
}
|
|
1380
|
+
export interface SopCreateResult {
|
|
1381
|
+
ok: boolean;
|
|
1382
|
+
sopId?: string;
|
|
1383
|
+
}
|
|
1384
|
+
export interface OrgSopInput {
|
|
1385
|
+
title: string;
|
|
1386
|
+
markdown_content: string;
|
|
1387
|
+
risk_tier?: string;
|
|
1388
|
+
}
|
|
1389
|
+
export interface OrgSop {
|
|
1390
|
+
orgSopId: string;
|
|
1391
|
+
orgId?: string;
|
|
1392
|
+
title: string;
|
|
1393
|
+
riskTier: string;
|
|
1394
|
+
createdAt: string;
|
|
1395
|
+
[key: string]: unknown;
|
|
1396
|
+
}
|
|
1397
|
+
export interface AttenuateOptions {
|
|
1398
|
+
/** 60 to 86400 seconds. */
|
|
1399
|
+
ttlSeconds?: number;
|
|
1400
|
+
}
|
|
1401
|
+
export interface AttenuationResult {
|
|
1402
|
+
/** The child `vk_` key: shown once, never stored. */
|
|
1403
|
+
childKey: string;
|
|
1404
|
+
childKeyId: string;
|
|
1405
|
+
attenuationChainId: string;
|
|
1406
|
+
grantedCaps: string[];
|
|
1407
|
+
expiresAt: string;
|
|
1408
|
+
}
|
|
1409
|
+
export interface AttenuationChainLink {
|
|
1410
|
+
chainId: string;
|
|
1411
|
+
parentKeyId: string;
|
|
1412
|
+
childKeyId: string;
|
|
1413
|
+
workspaceId: string;
|
|
1414
|
+
grantedCaps: string[];
|
|
1415
|
+
expiresAt: string;
|
|
1416
|
+
createdAt: string;
|
|
1417
|
+
}
|
|
1418
|
+
export interface PredictCostParams {
|
|
1419
|
+
/** Must be the key's own workspace. */
|
|
1420
|
+
workspaceId: string;
|
|
1421
|
+
model: string;
|
|
1422
|
+
inputTokenCount?: number;
|
|
1423
|
+
inputText?: string;
|
|
1424
|
+
}
|
|
1425
|
+
export interface CostPrediction {
|
|
1426
|
+
inputTokens: number;
|
|
1427
|
+
estimatedOutputTokens: number;
|
|
1428
|
+
estimatedReasoningTokens: number | null;
|
|
1429
|
+
estimatedCostUsd: number;
|
|
1430
|
+
confidence: 'high' | 'medium' | 'low';
|
|
1431
|
+
basedOnSamples: number;
|
|
1432
|
+
}
|
|
1433
|
+
export type MirrorAdoptionReport = {
|
|
1434
|
+
candidateModel: string;
|
|
1435
|
+
sufficientData: true;
|
|
1436
|
+
sampleCount: number;
|
|
1437
|
+
candidateBetter: number;
|
|
1438
|
+
originalBetter: number;
|
|
1439
|
+
tie: number;
|
|
1440
|
+
unjudged: number;
|
|
1441
|
+
faultRateDelta: number | null;
|
|
1442
|
+
averageCostDeltaUsd: number | null;
|
|
1443
|
+
averageLatencyDeltaMs: number | null;
|
|
1444
|
+
} | {
|
|
1445
|
+
candidateModel: string;
|
|
1446
|
+
sufficientData: false;
|
|
1447
|
+
sampleCount: number;
|
|
1448
|
+
minimumRequired: number;
|
|
1449
|
+
reason: string;
|
|
1450
|
+
};
|
|
1451
|
+
export {};
|
|
271
1452
|
//# sourceMappingURL=types.d.ts.map
|