@nimbus-dev/client 0.9.0 → 0.11.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/index.cjs +671 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mock-client.d.ts +56 -1
- package/dist/mock-client.d.ts.map +1 -1
- package/dist/mock-client.js +126 -0
- package/dist/mock-client.js.map +1 -1
- package/dist/nimbus-client.d.ts +595 -0
- package/dist/nimbus-client.d.ts.map +1 -1
- package/dist/nimbus-client.js +210 -1
- package/dist/nimbus-client.js.map +1 -1
- package/dist/validate.d.ts +46 -1
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +428 -0
- package/dist/validate.js.map +1 -1
- package/package.json +1 -1
package/dist/nimbus-client.d.ts
CHANGED
|
@@ -58,6 +58,71 @@ export type SessionTranscript = {
|
|
|
58
58
|
}>;
|
|
59
59
|
hasMore: boolean;
|
|
60
60
|
};
|
|
61
|
+
/**
|
|
62
|
+
* The role tag on a `session.*` memory chunk. Distinct from
|
|
63
|
+
* {@link SessionTranscript}'s `"user" | "assistant"` turns — session memory
|
|
64
|
+
* also stores `"tool"` chunks. Mirrors the Gateway's `SessionMemoryRole`
|
|
65
|
+
* (`memory/session-memory-store.ts`).
|
|
66
|
+
*/
|
|
67
|
+
export type SessionMemoryRole = "user" | "assistant" | "tool";
|
|
68
|
+
/** Parameters for {@link NimbusClient.sessionAppend}. */
|
|
69
|
+
export type SessionAppendParams = {
|
|
70
|
+
sessionId: string;
|
|
71
|
+
/** Non-empty after trimming — the Gateway rejects `""` or whitespace-only text. */
|
|
72
|
+
chunkText: string;
|
|
73
|
+
role: SessionMemoryRole;
|
|
74
|
+
};
|
|
75
|
+
/** Parameters for {@link NimbusClient.sessionRecall}. */
|
|
76
|
+
export type SessionRecallParams = {
|
|
77
|
+
sessionId: string;
|
|
78
|
+
query: string;
|
|
79
|
+
/** The Gateway clamps to 1..32; default 8. */
|
|
80
|
+
topK?: number;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* A single semantic-search hit over a session's memory chunks. Mirrors the
|
|
84
|
+
* Gateway's `SessionMemoryRecallHit` (`memory/session-memory-store.ts`).
|
|
85
|
+
*/
|
|
86
|
+
export type SessionRecallHit = {
|
|
87
|
+
chunkText: string;
|
|
88
|
+
role: SessionMemoryRole;
|
|
89
|
+
createdAt: number;
|
|
90
|
+
/** Vector distance — lower is a closer match. */
|
|
91
|
+
distance: number;
|
|
92
|
+
};
|
|
93
|
+
/** Result of {@link NimbusClient.sessionRecall}. */
|
|
94
|
+
export type SessionRecallResult = {
|
|
95
|
+
chunks: SessionRecallHit[];
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* One session's summary, as returned by {@link NimbusClient.sessionList}.
|
|
99
|
+
* Mirrors the Gateway's `listSessions()` row (`memory/session-memory-store.ts`).
|
|
100
|
+
*/
|
|
101
|
+
export type SessionListEntry = {
|
|
102
|
+
sessionId: string;
|
|
103
|
+
lastWriteAt: number;
|
|
104
|
+
chunkCount: number;
|
|
105
|
+
};
|
|
106
|
+
/** Result of {@link NimbusClient.sessionList}. */
|
|
107
|
+
export type SessionListResult = {
|
|
108
|
+
sessions: SessionListEntry[];
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Parameters for {@link NimbusClient.sessionClear}. Omit or pass an empty
|
|
112
|
+
* string for `sessionId` to clear every session (the Gateway's "clear all"
|
|
113
|
+
* path), matching `handleSessionClear`'s treatment of a blank id.
|
|
114
|
+
*/
|
|
115
|
+
export type SessionClearParams = {
|
|
116
|
+
sessionId?: string;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Result of {@link NimbusClient.sessionClear}. `cleared` is `"all"` when
|
|
120
|
+
* every session was cleared, otherwise the cleared session's id.
|
|
121
|
+
*/
|
|
122
|
+
export type SessionClearResult = {
|
|
123
|
+
ok: boolean;
|
|
124
|
+
cleared: string;
|
|
125
|
+
};
|
|
61
126
|
/**
|
|
62
127
|
* A single row of the append-only, BLAKE3-chained egress ledger.
|
|
63
128
|
* Mirrors the Gateway's `EgressRow` shape (`egress/egress-verify.ts`).
|
|
@@ -383,6 +448,399 @@ export type GatewayStatus = {
|
|
|
383
448
|
identity: IdentityStatus;
|
|
384
449
|
syncFreshnessMs: number;
|
|
385
450
|
};
|
|
451
|
+
/**
|
|
452
|
+
* A gap code attached to a DORA metric when it could not be fully computed
|
|
453
|
+
* (missing config, low sample size, etc.) — `null` when the metric is
|
|
454
|
+
* unqualified. Mirrors the Gateway's `DoraGap` (`metrics/dora.ts`).
|
|
455
|
+
*/
|
|
456
|
+
export type DoraGap = null | "no_pagerduty_mapping" | "no_repos" | "no_deployment_data" | "low_sample" | "approximate_lead_time" | "mixed_source";
|
|
457
|
+
/**
|
|
458
|
+
* A single DORA metric value. `value` is `null` when the service has no
|
|
459
|
+
* data for the window (or is unconfigured) — this is a normal, expected
|
|
460
|
+
* response shape, not an error. Mirrors the Gateway's `DoraMetricValue`
|
|
461
|
+
* (`metrics/dora.ts`).
|
|
462
|
+
*/
|
|
463
|
+
export type DoraMetricValue = {
|
|
464
|
+
value: number | null;
|
|
465
|
+
unit: string;
|
|
466
|
+
sample: number;
|
|
467
|
+
gap: DoraGap;
|
|
468
|
+
};
|
|
469
|
+
/** Parameters for {@link NimbusClient.metricsDora}. */
|
|
470
|
+
export type MetricsDoraParams = {
|
|
471
|
+
service: string;
|
|
472
|
+
/** `\d+(d|h)` duration string, e.g. `"7d"` or `"24h"`. The Gateway default is `"30d"`. */
|
|
473
|
+
since?: string;
|
|
474
|
+
};
|
|
475
|
+
/**
|
|
476
|
+
* Result of {@link NimbusClient.metricsDora}. Field names mirror the wire
|
|
477
|
+
* shape verbatim (snake_case) — the Gateway does not camelCase this
|
|
478
|
+
* response, so a translated copy here would be the thing that drifts.
|
|
479
|
+
* Mirrors the Gateway's `DoraMetricsResult` (`metrics/dora.ts`).
|
|
480
|
+
*
|
|
481
|
+
* An unconfigured service still resolves successfully: every metric comes
|
|
482
|
+
* back with `value: null` and a `gap` code (`"no_repos"` for the frequency
|
|
483
|
+
* metric, matching whatever placeholder the Gateway's
|
|
484
|
+
* `unconfiguredEnvelope()` uses) rather than the call rejecting.
|
|
485
|
+
*/
|
|
486
|
+
export type DoraMetricsResult = {
|
|
487
|
+
service: string;
|
|
488
|
+
since_ms: number;
|
|
489
|
+
computed_at: string;
|
|
490
|
+
metrics: {
|
|
491
|
+
deployment_frequency: DoraMetricValue;
|
|
492
|
+
lead_time_for_changes: DoraMetricValue;
|
|
493
|
+
change_failure_rate: DoraMetricValue;
|
|
494
|
+
mttr: DoraMetricValue;
|
|
495
|
+
};
|
|
496
|
+
};
|
|
497
|
+
/**
|
|
498
|
+
* A gap code attached to a `deploy.preflight` check when it could not be
|
|
499
|
+
* fully evaluated — `null` when unqualified. Mirrors the Gateway's
|
|
500
|
+
* `PreflightGap` (`preflight/preflight.ts`).
|
|
501
|
+
*/
|
|
502
|
+
export type PreflightGap = null | "no_pagerduty_mapping" | "no_repos" | "unknown_mergeable_state" | "pagerduty_urgency_without_priority";
|
|
503
|
+
/** An active-incident finding in a `deploy.preflight` result. */
|
|
504
|
+
export type IncidentFinding = {
|
|
505
|
+
id: string;
|
|
506
|
+
title: string;
|
|
507
|
+
status: "triggered" | "acknowledged";
|
|
508
|
+
severity: string;
|
|
509
|
+
opened_at_ms: number;
|
|
510
|
+
pagerduty_service_id: string;
|
|
511
|
+
url: string | null;
|
|
512
|
+
};
|
|
513
|
+
/** A failing-CI-run finding in a `deploy.preflight` result. */
|
|
514
|
+
export type CiFinding = {
|
|
515
|
+
id: string;
|
|
516
|
+
title: string;
|
|
517
|
+
conclusion: "failure" | "cancelled" | "timed_out";
|
|
518
|
+
modified_at_ms: number;
|
|
519
|
+
branch: string;
|
|
520
|
+
head_sha: string | null;
|
|
521
|
+
url: string | null;
|
|
522
|
+
};
|
|
523
|
+
/** A merge-conflict finding in a `deploy.preflight` result. */
|
|
524
|
+
export type PrFinding = {
|
|
525
|
+
id: string;
|
|
526
|
+
title: string;
|
|
527
|
+
number: number;
|
|
528
|
+
mergeable_state: string;
|
|
529
|
+
modified_at_ms: number;
|
|
530
|
+
url: string | null;
|
|
531
|
+
};
|
|
532
|
+
/** One `deploy.preflight` check: a count, its findings, and a gap code. Mirrors `PreflightCheck<F>`. */
|
|
533
|
+
export type PreflightCheck<F> = {
|
|
534
|
+
count: number;
|
|
535
|
+
findings: readonly F[];
|
|
536
|
+
gap: PreflightGap;
|
|
537
|
+
};
|
|
538
|
+
/** Parameters for {@link NimbusClient.deployPreflight}. */
|
|
539
|
+
export type DeployPreflightParams = {
|
|
540
|
+
service: string;
|
|
541
|
+
targetRef: string;
|
|
542
|
+
/** The Gateway clamps to 1..50; default 10. */
|
|
543
|
+
maxFindings?: number;
|
|
544
|
+
};
|
|
545
|
+
/**
|
|
546
|
+
* Result of {@link NimbusClient.deployPreflight}. Field names mirror the
|
|
547
|
+
* wire shape verbatim (snake_case), same rationale as {@link DoraMetricsResult}.
|
|
548
|
+
* Mirrors the Gateway's `DeployPreflightResult` (`preflight/preflight.ts`).
|
|
549
|
+
*
|
|
550
|
+
* An unconfigured service still resolves successfully: `verdict: "ok"` with
|
|
551
|
+
* every check at `count: 0` and a gap code, rather than the call rejecting.
|
|
552
|
+
*/
|
|
553
|
+
export type DeployPreflightResult = {
|
|
554
|
+
service: string;
|
|
555
|
+
target_ref: string;
|
|
556
|
+
computed_at: string;
|
|
557
|
+
verdict: "ok" | "warn";
|
|
558
|
+
checks: {
|
|
559
|
+
active_p1_incidents: PreflightCheck<IncidentFinding>;
|
|
560
|
+
failing_ci_runs: PreflightCheck<CiFinding>;
|
|
561
|
+
merge_conflicts: PreflightCheck<PrFinding>;
|
|
562
|
+
};
|
|
563
|
+
};
|
|
564
|
+
/**
|
|
565
|
+
* A connector's sync status. Mirrors the Gateway's `SyncStatus` (`sync/types.ts`).
|
|
566
|
+
*/
|
|
567
|
+
export type ConnectorSyncStatus = {
|
|
568
|
+
serviceId: string;
|
|
569
|
+
status: "ok" | "syncing" | "paused" | "backoff" | "error";
|
|
570
|
+
lastSyncAt: number | null;
|
|
571
|
+
nextSyncAt: number | null;
|
|
572
|
+
intervalMs: number;
|
|
573
|
+
itemCount: number;
|
|
574
|
+
lastError: string | null;
|
|
575
|
+
consecutiveFailures: number;
|
|
576
|
+
healthState?: string;
|
|
577
|
+
healthRetryAfterMs?: number | null;
|
|
578
|
+
depth: "metadata_only" | "summary" | "full";
|
|
579
|
+
enabled: boolean;
|
|
580
|
+
};
|
|
581
|
+
/**
|
|
582
|
+
* One recent sync attempt's telemetry, embedded in {@link ConnectorStatusResult}
|
|
583
|
+
* when `includeStats` is requested. Mirrors the Gateway's `SyncTelemetryRow`
|
|
584
|
+
* (`sync/scheduler-store.ts`).
|
|
585
|
+
*/
|
|
586
|
+
export type ConnectorSyncTelemetry = {
|
|
587
|
+
startedAt: number;
|
|
588
|
+
durationMs: number;
|
|
589
|
+
itemsUpserted: number;
|
|
590
|
+
itemsDeleted: number;
|
|
591
|
+
bytesTransferred: number | null;
|
|
592
|
+
hadMore: boolean;
|
|
593
|
+
errorMsg: string | null;
|
|
594
|
+
};
|
|
595
|
+
/** Parameters for {@link NimbusClient.connectorStatus}. */
|
|
596
|
+
export type ConnectorStatusParams = {
|
|
597
|
+
serviceId: string;
|
|
598
|
+
/** Include the last 15 sync-telemetry rows on the result. */
|
|
599
|
+
includeStats?: boolean;
|
|
600
|
+
};
|
|
601
|
+
/** Result of {@link NimbusClient.connectorStatus}. `telemetry` is present only when `includeStats: true` was passed. */
|
|
602
|
+
export type ConnectorStatusResult = ConnectorSyncStatus & {
|
|
603
|
+
telemetry?: ConnectorSyncTelemetry[];
|
|
604
|
+
};
|
|
605
|
+
/**
|
|
606
|
+
* One connector-health state transition, as returned by
|
|
607
|
+
* {@link NimbusClient.connectorHealthHistory}. Mirrors the Gateway's health
|
|
608
|
+
* history row (`connectors/health.ts`).
|
|
609
|
+
*/
|
|
610
|
+
export type ConnectorHealthHistoryEntry = {
|
|
611
|
+
id: number;
|
|
612
|
+
connectorId: string;
|
|
613
|
+
fromState: string | null;
|
|
614
|
+
toState: string;
|
|
615
|
+
reason: string | null;
|
|
616
|
+
occurredAtMs: number;
|
|
617
|
+
};
|
|
618
|
+
/**
|
|
619
|
+
* Parameters for {@link NimbusClient.connectorHealthHistory}. `service` is
|
|
620
|
+
* REQUIRED (the Gateway rejects a missing/invalid one) and must be a
|
|
621
|
+
* built-in connector id — not a user MCP id.
|
|
622
|
+
*/
|
|
623
|
+
export type ConnectorHealthHistoryParams = {
|
|
624
|
+
service: string;
|
|
625
|
+
/** The Gateway clamps to 1..500; default 100. */
|
|
626
|
+
limit?: number;
|
|
627
|
+
};
|
|
628
|
+
/**
|
|
629
|
+
* Parameters shared by {@link NimbusClient.connectorPause},
|
|
630
|
+
* {@link NimbusClient.connectorResume}. `serviceId` must already be a
|
|
631
|
+
* registered connector (the Gateway rejects an unknown one).
|
|
632
|
+
*/
|
|
633
|
+
export type ConnectorServiceParams = {
|
|
634
|
+
serviceId: string;
|
|
635
|
+
};
|
|
636
|
+
/** Parameters for {@link NimbusClient.connectorSetInterval}. */
|
|
637
|
+
export type ConnectorSetIntervalParams = {
|
|
638
|
+
serviceId: string;
|
|
639
|
+
intervalMs: number;
|
|
640
|
+
};
|
|
641
|
+
/**
|
|
642
|
+
* Parameters for {@link NimbusClient.connectorSetConfig}. Every field besides
|
|
643
|
+
* `serviceId` is optional — only the fields you pass are changed.
|
|
644
|
+
*/
|
|
645
|
+
export type ConnectorSetConfigParams = {
|
|
646
|
+
serviceId: string;
|
|
647
|
+
/** The Gateway enforces a minimum (`MIN_SYNC_INTERVAL_MS`, 60s). */
|
|
648
|
+
intervalMs?: number;
|
|
649
|
+
depth?: "metadata_only" | "summary" | "full";
|
|
650
|
+
enabled?: boolean;
|
|
651
|
+
};
|
|
652
|
+
/**
|
|
653
|
+
* Result of {@link NimbusClient.connectorSetConfig}. A field reads `null`
|
|
654
|
+
* when it was not part of the request — not "the value was cleared".
|
|
655
|
+
*/
|
|
656
|
+
export type ConnectorSetConfigResult = {
|
|
657
|
+
service: string;
|
|
658
|
+
intervalMs: number | null;
|
|
659
|
+
depth: string | null;
|
|
660
|
+
enabled: boolean | null;
|
|
661
|
+
};
|
|
662
|
+
/** Parameters for {@link NimbusClient.connectorSync}. */
|
|
663
|
+
export type ConnectorSyncParams = {
|
|
664
|
+
serviceId: string;
|
|
665
|
+
/** Clear the sync cursor first, forcing a full re-sync rather than incremental. */
|
|
666
|
+
full?: boolean;
|
|
667
|
+
};
|
|
668
|
+
/**
|
|
669
|
+
* Parameters for {@link NimbusClient.connectorAuth}. Field names beyond
|
|
670
|
+
* `serviceId` vary per provider: PAT-based connectors take
|
|
671
|
+
* `personalAccessToken`/`token` (aliases differ by provider), OAuth (PKCE)
|
|
672
|
+
* connectors take optional `scopes`/`port`, and several connectors have
|
|
673
|
+
* bespoke fields (`awsAccessKeyId`, `azureTenantId`, `gcpCredentialsJsonPath`,
|
|
674
|
+
* `atlassianEmail`/`apiBaseUrl` for jira/confluence, etc). See the Gateway's
|
|
675
|
+
* `ipc/connector-rpc-handlers/auth.ts` for the per-provider field list —
|
|
676
|
+
* there is no single shared shape to type here.
|
|
677
|
+
*/
|
|
678
|
+
export type ConnectorAuthParams = {
|
|
679
|
+
serviceId: string;
|
|
680
|
+
} & Record<string, unknown>;
|
|
681
|
+
/** Result of {@link NimbusClient.connectorAuth}: identical across every provider. */
|
|
682
|
+
export type ConnectorAuthResult = {
|
|
683
|
+
ok: true;
|
|
684
|
+
serviceId: string;
|
|
685
|
+
scopesGranted: string[];
|
|
686
|
+
};
|
|
687
|
+
/** Parameters for {@link NimbusClient.connectorAddMcp}. */
|
|
688
|
+
export type ConnectorAddMcpParams = {
|
|
689
|
+
/** Must match `mcp_<lowercase_letters_numbers_underscores>` (1-62 chars after the prefix). */
|
|
690
|
+
serviceId: string;
|
|
691
|
+
/** The full shell command line; the Gateway parses it into `command` + `args`. */
|
|
692
|
+
commandLine: string;
|
|
693
|
+
};
|
|
694
|
+
/**
|
|
695
|
+
* The denied/timed-out/consent-disconnected shape a HITL-gated `connector.*`
|
|
696
|
+
* call RESOLVES with (never thrown). See {@link ConnectorAddMcpResult}.
|
|
697
|
+
*/
|
|
698
|
+
export type GatedRejection = {
|
|
699
|
+
status: "rejected";
|
|
700
|
+
reason: string;
|
|
701
|
+
};
|
|
702
|
+
/**
|
|
703
|
+
* Result of {@link NimbusClient.connectorAddMcp}. `connector.addMcp` is
|
|
704
|
+
* **HITL-gated (I2)**: the call blocks until the owner answers the
|
|
705
|
+
* `agent.hitlBatch` consent request the Gateway raises for it (see
|
|
706
|
+
* {@link NimbusClientLike.subscribeHitl} / {@link NimbusClient.consentRespond}).
|
|
707
|
+
* The RESOLVED shape differs by outcome — an approval resolves
|
|
708
|
+
* `{ ok: true, serviceId }`; a denial (or a consent-channel disconnect)
|
|
709
|
+
* resolves — does NOT reject — {@link GatedRejection}. Narrow on
|
|
710
|
+
* `"status" in result` before reading either branch.
|
|
711
|
+
*/
|
|
712
|
+
export type ConnectorAddMcpResult = {
|
|
713
|
+
ok: true;
|
|
714
|
+
serviceId: string;
|
|
715
|
+
} | GatedRejection;
|
|
716
|
+
/** Parameters for {@link NimbusClient.connectorRemove}. */
|
|
717
|
+
export type ConnectorRemoveParams = {
|
|
718
|
+
serviceId: string;
|
|
719
|
+
};
|
|
720
|
+
/**
|
|
721
|
+
* Result of {@link NimbusClient.connectorRemove}. `connector.remove` is
|
|
722
|
+
* **HITL-gated (I2)** — shares the blocking + dual-shape contract documented
|
|
723
|
+
* on {@link ConnectorAddMcpResult}.
|
|
724
|
+
*/
|
|
725
|
+
export type ConnectorRemoveResult = {
|
|
726
|
+
ok: true;
|
|
727
|
+
itemsDeleted: number;
|
|
728
|
+
vaultKeysRemoved: string[];
|
|
729
|
+
} | GatedRejection;
|
|
730
|
+
/** Parameters for {@link NimbusClient.connectorReindex}. */
|
|
731
|
+
export type ConnectorReindexParams = {
|
|
732
|
+
service: string;
|
|
733
|
+
/**
|
|
734
|
+
* Default `"metadata_only"`. Only `"full"` is HITL-gated (I2) — and,
|
|
735
|
+
* unlike {@link NimbusClient.connectorAddMcp}/{@link NimbusClient.connectorRemove},
|
|
736
|
+
* a denial here REJECTS the promise (JSON-RPC error) rather than resolving
|
|
737
|
+
* to a {@link GatedRejection} shape.
|
|
738
|
+
*/
|
|
739
|
+
depth?: "metadata_only" | "summary" | "full";
|
|
740
|
+
};
|
|
741
|
+
/** Result of {@link NimbusClient.connectorReindex}. Mirrors the Gateway's `ReindexResult` (`connectors/reindex.ts`). */
|
|
742
|
+
export type ConnectorReindexResult = {
|
|
743
|
+
itemsAffected: number;
|
|
744
|
+
depth: "metadata_only" | "summary" | "full";
|
|
745
|
+
/**
|
|
746
|
+
* The gateway's `ReindexResult` declares three variants
|
|
747
|
+
* (`connectors/reindex.ts:14`). `"same"` is currently unreachable —
|
|
748
|
+
* `reindexConnector()` only ever constructs `"shallow"` or `"deepen"` — but the
|
|
749
|
+
* declared type is the contract, so accepting it keeps this from throwing on a
|
|
750
|
+
* legitimate response if that branch is ever activated.
|
|
751
|
+
*/
|
|
752
|
+
mode: "shallow" | "deepen" | "same";
|
|
753
|
+
};
|
|
754
|
+
/**
|
|
755
|
+
* A saved workflow, as returned by {@link NimbusClient.workflowList}. Mirrors
|
|
756
|
+
* the Gateway's raw `workflow` row verbatim (snake_case `steps_json` /
|
|
757
|
+
* `created_at` / `updated_at` — the Gateway does not camelCase this response).
|
|
758
|
+
*/
|
|
759
|
+
export type WorkflowRow = {
|
|
760
|
+
id: string;
|
|
761
|
+
name: string;
|
|
762
|
+
description: string | null;
|
|
763
|
+
steps_json: string;
|
|
764
|
+
created_at: number;
|
|
765
|
+
updated_at: number;
|
|
766
|
+
};
|
|
767
|
+
/** Result of {@link NimbusClient.workflowList}. */
|
|
768
|
+
export type WorkflowListResult = {
|
|
769
|
+
workflows: WorkflowRow[];
|
|
770
|
+
};
|
|
771
|
+
/** Parameters for {@link NimbusClient.workflowSave}. Upserts by `name`. */
|
|
772
|
+
export type WorkflowSaveParams = {
|
|
773
|
+
name: string;
|
|
774
|
+
description?: string | null;
|
|
775
|
+
/** Serialized step DAG. The Gateway does not parse it at save time. */
|
|
776
|
+
stepsJson: string;
|
|
777
|
+
};
|
|
778
|
+
/** Parameters for {@link NimbusClient.workflowDelete}. */
|
|
779
|
+
export type WorkflowDeleteParams = {
|
|
780
|
+
name: string;
|
|
781
|
+
};
|
|
782
|
+
/**
|
|
783
|
+
* One historical workflow run, as returned by {@link NimbusClient.workflowListRuns}.
|
|
784
|
+
* Mirrors the Gateway's `WorkflowRunHistoryRow` (`automation/workflow-run-history.ts`).
|
|
785
|
+
*/
|
|
786
|
+
export type WorkflowRunHistoryRow = {
|
|
787
|
+
id: string;
|
|
788
|
+
startedAt: number;
|
|
789
|
+
finishedAt: number | null;
|
|
790
|
+
durationMs: number | null;
|
|
791
|
+
status: string;
|
|
792
|
+
errorMsg: string | null;
|
|
793
|
+
dryRun: boolean;
|
|
794
|
+
paramsOverrideJson: string | null;
|
|
795
|
+
triggeredBy: string;
|
|
796
|
+
};
|
|
797
|
+
/** Parameters for {@link NimbusClient.workflowListRuns}. */
|
|
798
|
+
export type WorkflowListRunsParams = {
|
|
799
|
+
workflowName: string;
|
|
800
|
+
/** The Gateway clamps to 1..500. */
|
|
801
|
+
limit: number;
|
|
802
|
+
};
|
|
803
|
+
/** Result of {@link NimbusClient.workflowListRuns}. */
|
|
804
|
+
export type WorkflowListRunsResult = {
|
|
805
|
+
runs: WorkflowRunHistoryRow[];
|
|
806
|
+
};
|
|
807
|
+
/** One step's outcome within a {@link WorkflowRunResult}. */
|
|
808
|
+
export type WorkflowStepResult = {
|
|
809
|
+
label?: string;
|
|
810
|
+
status: string;
|
|
811
|
+
output?: string;
|
|
812
|
+
error?: string;
|
|
813
|
+
};
|
|
814
|
+
/**
|
|
815
|
+
* Result of {@link NimbusClient.workflowRun}. Mirrors the resolved value of
|
|
816
|
+
* the Gateway's `WorkflowRunHandler` (`ipc/workflow-invoke.ts`).
|
|
817
|
+
*/
|
|
818
|
+
export type WorkflowRunResult = {
|
|
819
|
+
runId: string;
|
|
820
|
+
dryRun: boolean;
|
|
821
|
+
stepResults: WorkflowStepResult[];
|
|
822
|
+
};
|
|
823
|
+
/**
|
|
824
|
+
* Parameters for {@link NimbusClient.workflowRun}. An ORDINARY promise call —
|
|
825
|
+
* NOT a stream: `workflow.run` awaits the whole run server-side and resolves
|
|
826
|
+
* with the final result (unlike `askStream`, which returns a `streamId`
|
|
827
|
+
* immediately and streams tokens as notifications). Passing `stream: true`
|
|
828
|
+
* additionally makes the Gateway emit `agent.chunk` notifications
|
|
829
|
+
* (`{ text: string }` — the same plumbing `agent.invoke`'s `stream` option
|
|
830
|
+
* uses) while the run executes; this client does not currently expose a
|
|
831
|
+
* subscription helper for that channel, so a caller wanting live output must
|
|
832
|
+
* listen for it on the lower-level transport.
|
|
833
|
+
*/
|
|
834
|
+
export type WorkflowRunParams = {
|
|
835
|
+
name: string;
|
|
836
|
+
triggeredBy?: string;
|
|
837
|
+
dryRun?: boolean;
|
|
838
|
+
stream?: boolean;
|
|
839
|
+
sessionId?: string;
|
|
840
|
+
agent?: string;
|
|
841
|
+
/** Per-step param overrides, keyed by step label. */
|
|
842
|
+
paramsOverride?: Record<string, Record<string, unknown>>;
|
|
843
|
+
};
|
|
386
844
|
/**
|
|
387
845
|
* The public surface shared by {@link NimbusClient} and
|
|
388
846
|
* {@link MockClient}. A consumer can type against this so the real client and
|
|
@@ -410,6 +868,14 @@ export interface NimbusClientLike {
|
|
|
410
868
|
cancelStream(streamId: string): Promise<{
|
|
411
869
|
ok: boolean;
|
|
412
870
|
}>;
|
|
871
|
+
sessionAppend(params: SessionAppendParams): Promise<{
|
|
872
|
+
ok: boolean;
|
|
873
|
+
}>;
|
|
874
|
+
sessionRecall(params: SessionRecallParams): Promise<SessionRecallResult>;
|
|
875
|
+
sessionList(): Promise<SessionListResult>;
|
|
876
|
+
sessionClear(params?: SessionClearParams): Promise<SessionClearResult>;
|
|
877
|
+
metricsDora(params: MetricsDoraParams): Promise<DoraMetricsResult>;
|
|
878
|
+
deployPreflight(params: DeployPreflightParams): Promise<DeployPreflightResult>;
|
|
413
879
|
queryItems(params: {
|
|
414
880
|
services?: string[];
|
|
415
881
|
types?: string[];
|
|
@@ -469,6 +935,37 @@ export interface NimbusClientLike {
|
|
|
469
935
|
agentsPreflight(p: PreflightParams, o?: {
|
|
470
936
|
timeoutMs?: number;
|
|
471
937
|
}): Promise<PreflightBrief>;
|
|
938
|
+
connectorListStatus(params?: {
|
|
939
|
+
serviceId?: string;
|
|
940
|
+
}): Promise<ConnectorSyncStatus[]>;
|
|
941
|
+
connectorStatus(params: ConnectorStatusParams): Promise<ConnectorStatusResult>;
|
|
942
|
+
connectorHealthHistory(params: ConnectorHealthHistoryParams): Promise<ConnectorHealthHistoryEntry[]>;
|
|
943
|
+
connectorPause(params: ConnectorServiceParams): Promise<{
|
|
944
|
+
ok: boolean;
|
|
945
|
+
}>;
|
|
946
|
+
connectorResume(params: ConnectorServiceParams): Promise<{
|
|
947
|
+
ok: boolean;
|
|
948
|
+
}>;
|
|
949
|
+
connectorSetInterval(params: ConnectorSetIntervalParams): Promise<{
|
|
950
|
+
ok: boolean;
|
|
951
|
+
}>;
|
|
952
|
+
connectorSetConfig(params: ConnectorSetConfigParams): Promise<ConnectorSetConfigResult>;
|
|
953
|
+
connectorSync(params: ConnectorSyncParams): Promise<{
|
|
954
|
+
ok: boolean;
|
|
955
|
+
}>;
|
|
956
|
+
connectorAuth(params: ConnectorAuthParams): Promise<ConnectorAuthResult>;
|
|
957
|
+
connectorAddMcp(params: ConnectorAddMcpParams): Promise<ConnectorAddMcpResult>;
|
|
958
|
+
connectorRemove(params: ConnectorRemoveParams): Promise<ConnectorRemoveResult>;
|
|
959
|
+
connectorReindex(params: ConnectorReindexParams): Promise<ConnectorReindexResult>;
|
|
960
|
+
workflowList(): Promise<WorkflowListResult>;
|
|
961
|
+
workflowSave(params: WorkflowSaveParams): Promise<{
|
|
962
|
+
id: string;
|
|
963
|
+
}>;
|
|
964
|
+
workflowDelete(params: WorkflowDeleteParams): Promise<{
|
|
965
|
+
ok: boolean;
|
|
966
|
+
}>;
|
|
967
|
+
workflowListRuns(params: WorkflowListRunsParams): Promise<WorkflowListRunsResult>;
|
|
968
|
+
workflowRun(params: WorkflowRunParams): Promise<WorkflowRunResult>;
|
|
472
969
|
close(): Promise<void>;
|
|
473
970
|
}
|
|
474
971
|
/**
|
|
@@ -540,6 +1037,31 @@ export declare class NimbusClient implements NimbusClientLike {
|
|
|
540
1037
|
cancelStream(streamId: string): Promise<{
|
|
541
1038
|
ok: boolean;
|
|
542
1039
|
}>;
|
|
1040
|
+
/** Append a chunk to a session's memory (read-write). */
|
|
1041
|
+
sessionAppend(params: SessionAppendParams): Promise<{
|
|
1042
|
+
ok: boolean;
|
|
1043
|
+
}>;
|
|
1044
|
+
/** Semantic search over a session's memory chunks (read-only). */
|
|
1045
|
+
sessionRecall(params: SessionRecallParams): Promise<SessionRecallResult>;
|
|
1046
|
+
/** List known sessions with their last-write time and chunk count (read-only). */
|
|
1047
|
+
sessionList(): Promise<SessionListResult>;
|
|
1048
|
+
/**
|
|
1049
|
+
* Clear one session's memory, or every session when `sessionId` is
|
|
1050
|
+
* omitted or `""`.
|
|
1051
|
+
*/
|
|
1052
|
+
sessionClear(params?: SessionClearParams): Promise<SessionClearResult>;
|
|
1053
|
+
/**
|
|
1054
|
+
* DORA metrics for a configured service over a lookback window. An
|
|
1055
|
+
* unconfigured `service` still resolves — every metric comes back with
|
|
1056
|
+
* `value: null` and a `gap` code rather than the call rejecting.
|
|
1057
|
+
*/
|
|
1058
|
+
metricsDora(params: MetricsDoraParams): Promise<DoraMetricsResult>;
|
|
1059
|
+
/**
|
|
1060
|
+
* Pre-deploy readiness checks (active P1 incidents, failing CI runs, merge
|
|
1061
|
+
* conflicts) for a configured service. An unconfigured `service` still
|
|
1062
|
+
* resolves — `verdict: "ok"` with every check at `count: 0` and a gap code.
|
|
1063
|
+
*/
|
|
1064
|
+
deployPreflight(params: DeployPreflightParams): Promise<DeployPreflightResult>;
|
|
543
1065
|
queryItems(params: {
|
|
544
1066
|
services?: string[];
|
|
545
1067
|
types?: string[];
|
|
@@ -611,6 +1133,79 @@ export declare class NimbusClient implements NimbusClientLike {
|
|
|
611
1133
|
* inspect the rejection.
|
|
612
1134
|
*/
|
|
613
1135
|
adminStatus(): Promise<GatewayStatus>;
|
|
1136
|
+
/** List every registered connector's sync status, or one when `serviceId` is passed (read-only). */
|
|
1137
|
+
connectorListStatus(params?: {
|
|
1138
|
+
serviceId?: string;
|
|
1139
|
+
}): Promise<ConnectorSyncStatus[]>;
|
|
1140
|
+
/** One connector's sync status, optionally with its last 15 sync-telemetry rows (read-only). */
|
|
1141
|
+
connectorStatus(params: ConnectorStatusParams): Promise<ConnectorStatusResult>;
|
|
1142
|
+
/** A connector's health-state transition history (read-only). */
|
|
1143
|
+
connectorHealthHistory(params: ConnectorHealthHistoryParams): Promise<ConnectorHealthHistoryEntry[]>;
|
|
1144
|
+
/** Pause a registered connector's scheduled sync (mutates state; not HITL-gated). */
|
|
1145
|
+
connectorPause(params: ConnectorServiceParams): Promise<{
|
|
1146
|
+
ok: boolean;
|
|
1147
|
+
}>;
|
|
1148
|
+
/** Resume a paused connector's scheduled sync (mutates state; not HITL-gated). */
|
|
1149
|
+
connectorResume(params: ConnectorServiceParams): Promise<{
|
|
1150
|
+
ok: boolean;
|
|
1151
|
+
}>;
|
|
1152
|
+
/** Change a connector's sync interval (mutates state; not HITL-gated). */
|
|
1153
|
+
connectorSetInterval(params: ConnectorSetIntervalParams): Promise<{
|
|
1154
|
+
ok: boolean;
|
|
1155
|
+
}>;
|
|
1156
|
+
/**
|
|
1157
|
+
* Update a connector's interval / depth / enabled state in one call
|
|
1158
|
+
* (mutates state; not HITL-gated). Only the fields you pass are changed.
|
|
1159
|
+
*/
|
|
1160
|
+
connectorSetConfig(params: ConnectorSetConfigParams): Promise<ConnectorSetConfigResult>;
|
|
1161
|
+
/** Force an immediate sync, optionally clearing the cursor for a full re-sync (mutates state; not HITL-gated). */
|
|
1162
|
+
connectorSync(params: ConnectorSyncParams): Promise<{
|
|
1163
|
+
ok: boolean;
|
|
1164
|
+
}>;
|
|
1165
|
+
/**
|
|
1166
|
+
* Authenticate a connector (PAT, OAuth PKCE, or bespoke credentials
|
|
1167
|
+
* depending on `serviceId` — see {@link ConnectorAuthParams}). Mutates
|
|
1168
|
+
* state (writes Vault secrets); not HITL-gated.
|
|
1169
|
+
*/
|
|
1170
|
+
connectorAuth(params: ConnectorAuthParams): Promise<ConnectorAuthResult>;
|
|
1171
|
+
/**
|
|
1172
|
+
* Register a user-defined MCP connector. **HITL-gated (I2)**: this call
|
|
1173
|
+
* blocks until the owner answers the `agent.hitlBatch` consent request the
|
|
1174
|
+
* Gateway raises for it — see {@link NimbusClient.subscribeHitl} and
|
|
1175
|
+
* {@link NimbusClient.consentRespond}. The resolved shape differs by
|
|
1176
|
+
* outcome; see {@link ConnectorAddMcpResult}.
|
|
1177
|
+
*/
|
|
1178
|
+
connectorAddMcp(params: ConnectorAddMcpParams): Promise<ConnectorAddMcpResult>;
|
|
1179
|
+
/**
|
|
1180
|
+
* Remove a connector: unregisters it from the scheduler, deletes its
|
|
1181
|
+
* indexed items, and clears its Vault secrets. **HITL-gated (I2)** — shares
|
|
1182
|
+
* the blocking + dual-shape contract documented on {@link connectorAddMcp};
|
|
1183
|
+
* see {@link ConnectorRemoveResult}.
|
|
1184
|
+
*/
|
|
1185
|
+
connectorRemove(params: ConnectorRemoveParams): Promise<ConnectorRemoveResult>;
|
|
1186
|
+
/**
|
|
1187
|
+
* Re-index a connector at a given depth. Only `depth: "full"` is HITL-gated
|
|
1188
|
+
* (I2); unlike {@link connectorAddMcp}/{@link connectorRemove}, a denial
|
|
1189
|
+
* here REJECTS the promise rather than resolving to a {@link GatedRejection}.
|
|
1190
|
+
*/
|
|
1191
|
+
connectorReindex(params: ConnectorReindexParams): Promise<ConnectorReindexResult>;
|
|
1192
|
+
/** List every saved workflow (read-only). */
|
|
1193
|
+
workflowList(): Promise<WorkflowListResult>;
|
|
1194
|
+
/** Create or update (upsert by `name`) a saved workflow. */
|
|
1195
|
+
workflowSave(params: WorkflowSaveParams): Promise<{
|
|
1196
|
+
id: string;
|
|
1197
|
+
}>;
|
|
1198
|
+
/** Delete a saved workflow by name. */
|
|
1199
|
+
workflowDelete(params: WorkflowDeleteParams): Promise<{
|
|
1200
|
+
ok: boolean;
|
|
1201
|
+
}>;
|
|
1202
|
+
/** A workflow's historical run log, most recent first (read-only). */
|
|
1203
|
+
workflowListRuns(params: WorkflowListRunsParams): Promise<WorkflowListRunsResult>;
|
|
1204
|
+
/**
|
|
1205
|
+
* Run a saved workflow to completion. An ORDINARY promise call — NOT a
|
|
1206
|
+
* stream; see {@link WorkflowRunParams} for the `stream` caveat.
|
|
1207
|
+
*/
|
|
1208
|
+
workflowRun(params: WorkflowRunParams): Promise<WorkflowRunResult>;
|
|
614
1209
|
close(): Promise<void>;
|
|
615
1210
|
}
|
|
616
1211
|
//# sourceMappingURL=nimbus-client.d.ts.map
|