@byok-sdk/client 0.15.0 → 0.16.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.
@@ -53,6 +53,8 @@ export declare class AgentMessageOutbox {
53
53
  activate(taskId: string, sessionRef: string, isCurrent?: () => boolean): Promise<AgentMessageOutboxRecord | undefined>;
54
54
  /** Local lifecycle cancellation, never a synthesized consumer disposition. */
55
55
  revoke(taskId: string): Promise<void>;
56
+ /** The same terminal classification used by operator receipts and archival. */
57
+ terminalRecords(): readonly AgentMessageOutboxRecord[];
56
58
  private isTerminalEvidence;
57
59
  publishPayload(record: AgentMessageOutboxRecord): AgentMessagePublishPayload;
58
60
  applyDisposition(taskId: string, input: unknown): Promise<'accepted' | 'held' | 'refused' | 'mismatch' | 'unknown'>;
@@ -14,16 +14,8 @@ export interface CollectDiagnosticsOptions {
14
14
  connectControl?: typeof connectControlClient;
15
15
  runtimeProbeTimeoutMs?: number;
16
16
  }
17
- export type OperationalHealthFixResult = {
18
- status: 'not-needed';
19
- reason: 'missing' | 'valid';
20
- } | {
21
- status: 'quarantined';
22
- evidenceName: string;
23
- manifestName: string;
24
- sha256: string;
25
- sizeBytes: number;
26
- };
17
+ import type { OperationalHealthFixResult } from './types';
18
+ export type { OperationalHealthFixResult } from './types';
27
19
  export declare function collectDiagnostics(config: DaemonConfig, storeDir: string, options?: CollectDiagnosticsOptions): Promise<DiagnosticsSnapshot>;
28
20
  export declare function stableIdentifierHash(value: string): string;
29
21
  /**
@@ -0,0 +1,63 @@
1
+ import { type AgentRef } from '@byok-sdk/protocol';
2
+ import type { DaemonConfig } from '../daemon/create-daemon';
3
+ import type { OperationalHealthFixResult } from './types';
4
+ import type { DiagnoseDeviceOptions } from './device-doctor';
5
+ declare const MESSAGES: {
6
+ readonly 'confirmation-required': 'Explicit confirmation is required for this local maintenance action.';
7
+ readonly 'invalid-input': 'The maintenance action requires valid explicit inputs.';
8
+ readonly 'daemon-running': 'Stop the host daemon before local maintenance.';
9
+ readonly 'store-busy': 'Another operation owns the device store.';
10
+ readonly 'agent-busy': 'Another operation owns the Agent home.';
11
+ readonly 'target-mismatch': 'The stored device or Agent records do not match the authorized target.';
12
+ readonly 'source-unavailable': 'The local source cannot be accessed safely; preserve it for inspection.';
13
+ readonly 'output-exists': 'The selected output already exists; it will not be overwritten.';
14
+ readonly 'operation-failed': 'The maintenance operation did not complete; preserve evidence before retrying.';
15
+ };
16
+ export type DeviceOperatorErrorCode = keyof typeof MESSAGES;
17
+ /** Closed codes only: never attach filesystem/OS error text, paths or nested causes. */
18
+ export declare class DeviceOperatorError extends Error {
19
+ readonly code: DeviceOperatorErrorCode;
20
+ constructor(code: DeviceOperatorErrorCode);
21
+ }
22
+ export interface ConfirmDeviceMaintenanceInput {
23
+ confirmed: true;
24
+ }
25
+ export type DeviceHealthQuarantineResult = OperationalHealthFixResult & {
26
+ action: 'quarantine-operational-health';
27
+ scope: 'device';
28
+ };
29
+ export interface ExportDeviceSupportBundleInput extends DiagnoseDeviceOptions {
30
+ /** Absolute, previously unused file in an existing directory. */
31
+ outputPath: string;
32
+ }
33
+ export interface DeviceSupportBundleExportResult {
34
+ action: 'export-support-bundle';
35
+ scope: 'device';
36
+ status: 'written';
37
+ bundleVersion: 1;
38
+ }
39
+ export interface ArchiveAgentTerminalMessagesInput extends ConfirmDeviceMaintenanceInput {
40
+ expectedTenantId: string;
41
+ expectedDeviceId: string;
42
+ /** Selects one Agent home. Historical profile revisions are preserved verbatim. */
43
+ agentRef: AgentRef;
44
+ /** Absolute NEW directory in an existing parent; contains sensitive audit bodies. */
45
+ archiveDirectory: string;
46
+ }
47
+ export type AgentTerminalMessagesArchiveResult = {
48
+ action: 'archive-terminal-messages';
49
+ scope: 'agent';
50
+ } & ({
51
+ status: 'not-needed';
52
+ } | {
53
+ status: 'archived';
54
+ archivedRecords: number;
55
+ archiveFileName: string;
56
+ });
57
+ /** Quarantines confirmed-corrupt health only; the host owns supervisor stop/restart. */
58
+ export declare function quarantineDeviceOperationalHealth(config: DaemonConfig, input: ConfirmDeviceMaintenanceInput): Promise<DeviceHealthQuarantineResult>;
59
+ /** Read-only source observation; publishes only the SDK allowlisted bundle, never raw logs. */
60
+ export declare function exportDeviceSupportBundle(config: DaemonConfig, input: ExportDeviceSupportBundleInput): Promise<DeviceSupportBundleExportResult>;
61
+ /** Archive refused/revoked evidence for one Agent under device and Agent single-writer leases. */
62
+ export declare function archiveAgentTerminalMessages(config: DaemonConfig, input: ArchiveAgentTerminalMessagesInput): Promise<AgentTerminalMessagesArchiveResult>;
63
+ export {};
@@ -80,3 +80,13 @@ export interface DiagnosticsSnapshot {
80
80
  };
81
81
  checks: DiagnosticCheck[];
82
82
  }
83
+ export type OperationalHealthFixResult = {
84
+ status: 'not-needed';
85
+ reason: 'missing' | 'valid';
86
+ } | {
87
+ status: 'quarantined';
88
+ evidenceName: string;
89
+ manifestName: string;
90
+ sha256: string;
91
+ sizeBytes: number;
92
+ };
package/dist/index.d.ts CHANGED
@@ -84,3 +84,5 @@ export type { ClaudeAdapterOptions } from './adapters/claude/claude-adapter';
84
84
  export { CodexAdapter, type CodexAdapterOptions } from './adapters/codex/codex-adapter';
85
85
  export { diagnoseDevice, repairDeviceEnrollmentMetadata, DeviceMetadataRepairError } from './diagnostics/device-doctor';
86
86
  export type { DiagnoseDeviceOptions, DiagnosticsSnapshot, DiagnosticCheck, DiagnosticStatus, RepairDeviceEnrollmentMetadataInput, DeviceMetadataRepairResult, DeviceMetadataRepairErrorCode, } from './diagnostics/device-doctor';
87
+ export { quarantineDeviceOperationalHealth, exportDeviceSupportBundle, archiveAgentTerminalMessages, DeviceOperatorError } from './diagnostics/operator-actions';
88
+ export type { ConfirmDeviceMaintenanceInput, DeviceHealthQuarantineResult, ExportDeviceSupportBundleInput, DeviceSupportBundleExportResult, ArchiveAgentTerminalMessagesInput, AgentTerminalMessagesArchiveResult, DeviceOperatorErrorCode } from './diagnostics/operator-actions';