forkit-connect 0.1.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.
Files changed (51) hide show
  1. package/QUICKSTART.md +55 -0
  2. package/README.md +96 -0
  3. package/dist/cli.d.ts +3 -0
  4. package/dist/cli.js +4724 -0
  5. package/dist/index.d.ts +7 -0
  6. package/dist/index.js +21 -0
  7. package/dist/launcher.d.ts +33 -0
  8. package/dist/launcher.js +9344 -0
  9. package/dist/ps-list-loader.d.ts +5 -0
  10. package/dist/ps-list-loader.js +20 -0
  11. package/dist/v1/agent-observation.d.ts +42 -0
  12. package/dist/v1/agent-observation.js +499 -0
  13. package/dist/v1/api.d.ts +276 -0
  14. package/dist/v1/api.js +390 -0
  15. package/dist/v1/credential-store.d.ts +92 -0
  16. package/dist/v1/credential-store.js +797 -0
  17. package/dist/v1/currency.d.ts +41 -0
  18. package/dist/v1/currency.js +127 -0
  19. package/dist/v1/daemon.d.ts +50 -0
  20. package/dist/v1/daemon.js +265 -0
  21. package/dist/v1/discovery.d.ts +61 -0
  22. package/dist/v1/discovery.js +168 -0
  23. package/dist/v1/filesystem-models.d.ts +11 -0
  24. package/dist/v1/filesystem-models.js +261 -0
  25. package/dist/v1/heartbeat.d.ts +45 -0
  26. package/dist/v1/heartbeat.js +463 -0
  27. package/dist/v1/lifecycle-monitor.d.ts +78 -0
  28. package/dist/v1/lifecycle-monitor.js +512 -0
  29. package/dist/v1/lmstudio.d.ts +11 -0
  30. package/dist/v1/lmstudio.js +148 -0
  31. package/dist/v1/ollama.d.ts +19 -0
  32. package/dist/v1/ollama.js +164 -0
  33. package/dist/v1/openai-compatible.d.ts +12 -0
  34. package/dist/v1/openai-compatible.js +124 -0
  35. package/dist/v1/process-scout.d.ts +50 -0
  36. package/dist/v1/process-scout.js +715 -0
  37. package/dist/v1/providers.d.ts +50 -0
  38. package/dist/v1/providers.js +106 -0
  39. package/dist/v1/service.d.ts +680 -0
  40. package/dist/v1/service.js +8286 -0
  41. package/dist/v1/state.d.ts +87 -0
  42. package/dist/v1/state.js +1318 -0
  43. package/dist/v1/test-credential-backend.d.ts +19 -0
  44. package/dist/v1/test-credential-backend.js +49 -0
  45. package/dist/v1/types.d.ts +873 -0
  46. package/dist/v1/types.js +3 -0
  47. package/dist/v1/update.d.ts +38 -0
  48. package/dist/v1/update.js +184 -0
  49. package/dist/v1/vitality-pulse.d.ts +36 -0
  50. package/dist/v1/vitality-pulse.js +512 -0
  51. package/package.json +53 -0
@@ -0,0 +1,680 @@
1
+ import { type ObservedAgentToolCallInput, type ObservedAgentToolCallResult, type ObservedAgentToolName } from './agent-observation';
2
+ import { type SecureCredentialBackend } from './credential-store';
3
+ import { type AgentProcessMetadata, type ProcessListEntry } from './process-scout';
4
+ import { LocalStateStore } from './state';
5
+ import { type VitalityPulseDependencies } from './vitality-pulse';
6
+ import { type MonitorPassResult } from './lifecycle-monitor';
7
+ import type { AgentLink, AgentModelUsageLedgerSummary, AgentReviewSnapshot, AgentType, BuildDatasetRef, BuildSession, BuildSessionStatus, C2SessionControlSource, C2SessionMode, C2SessionState, C2SessionSummary, C2LifecycleEvent, C2LiteEventType, ConnectBindingState, ConnectHandoffPayload, ConnectIdentityState, ConnectPermissionsSummary, ConnectServicesSummary, ConnectState, ConnectConfig, ConnectEffectiveBindingState, ServiceEntitlements, DaemonScanSummary, DaemonStatus, DetectedAgent, DetectedModel, DeliveredNotification, EvolutionReviewSnapshot, ModelEvolutionCandidate, DiscoveryClassification, DiscoveryMode, ModelBinding, ProviderHealthStatus, NotificationCandidate, NotificationSuggestedAction, RuntimePassportStatus, RuntimeType, SmartRegistrationInbox, SmartRegistrationInboxAction, PulseStatus, ReviewSnapshot, SanitizedProcessMetadata, ShadowFinding, TrayMenuModel, TrayStatusColor, TrainingLifecycleEventType, VitalityPulseEvent, VitalityPulseSummary, PendingReview } from './types';
8
+ export type NotificationSender = (title: string, message: string, candidate?: NotificationCandidate) => boolean;
9
+ export interface StatusResult {
10
+ runtimeId: string;
11
+ authenticated: boolean;
12
+ sessionIndicator: 'missing' | 'jwt-like' | 'opaque';
13
+ workspaceId: string | null;
14
+ projectId: string | null;
15
+ discoveryMode: DiscoveryMode;
16
+ daemonRunning: boolean;
17
+ daemonPid: number | null;
18
+ lastDaemonScanAt: string | null;
19
+ lastPulseAt: string | null;
20
+ detectedRuntimes: number;
21
+ detectedModels: number;
22
+ modelBindings: number;
23
+ queueDepth: number;
24
+ stateFile: string;
25
+ backendBaseUrl: string;
26
+ }
27
+ export interface DoctorCheck {
28
+ name: string;
29
+ status: 'PASS' | 'FAIL' | 'WARN';
30
+ details: string;
31
+ }
32
+ export interface RuntimeScanSummary {
33
+ runtime: string;
34
+ endpoint: string;
35
+ ok: boolean;
36
+ modelsFound: number;
37
+ error: string | null;
38
+ }
39
+ export interface ScanRuntimeResult {
40
+ ok: boolean;
41
+ models: DetectedModel[];
42
+ message: string;
43
+ runtimes: RuntimeScanSummary[];
44
+ discoveryMode: DiscoveryMode;
45
+ newModels: number;
46
+ alreadyKnownModels: number;
47
+ duplicateDiscoveriesSkipped: number;
48
+ findings: ShadowFinding[];
49
+ summary: DaemonScanSummary;
50
+ }
51
+ export interface DiscoveryCycleResult extends ScanRuntimeResult {
52
+ queue: QueueDraftSummary;
53
+ sync: {
54
+ processed: number;
55
+ succeeded: number;
56
+ failed: number;
57
+ };
58
+ }
59
+ export interface QueueDraftSummary {
60
+ queued: number;
61
+ skippedPending: number;
62
+ skippedBound: number;
63
+ skippedIgnored: number;
64
+ skippedDuplicate: number;
65
+ }
66
+ export interface ConnectActionScope {
67
+ bindingId: string | null;
68
+ connectDeviceId: string | null;
69
+ workspaceId: string;
70
+ projectId: string;
71
+ authoritative: boolean;
72
+ }
73
+ export interface ConnectBindingScopeSelectionResult {
74
+ workspaceId: string | null;
75
+ projectId: string | null;
76
+ bindingId: string | null;
77
+ bindingState: ConnectBindingState | null;
78
+ scopeSynced: boolean;
79
+ authoritative: boolean;
80
+ message: string;
81
+ }
82
+ export interface ConnectSelectionResult {
83
+ action: 'draft_created' | 'draft_queued' | 'passport_registered' | 'already_pending' | 'already_bound';
84
+ selector: string;
85
+ model: DetectedModel;
86
+ payload: Record<string, unknown> | null;
87
+ draftId: string | null;
88
+ gaid: string | null;
89
+ registrationKey: string;
90
+ bindingStatus: ModelBinding['status'];
91
+ }
92
+ export interface AgentWorkspaceObservationStatusResult {
93
+ agent: DetectedAgent;
94
+ observationEnabled: boolean;
95
+ observationSource: string | null;
96
+ workspaceRootHash: string | null;
97
+ workspaceId: string | null;
98
+ projectId: string | null;
99
+ observedToolCount: number;
100
+ blockedToolCount: number;
101
+ timedOutToolCount: number;
102
+ lastObservedTool: string | null;
103
+ lastObservedToolAt: string | null;
104
+ lastToolDecision: string | null;
105
+ allowed: boolean;
106
+ reviewRequired: boolean;
107
+ reasonCode: string;
108
+ message: string;
109
+ scope: ConnectActionScope | null;
110
+ privacySummary: string;
111
+ }
112
+ export interface AgentWorkspaceObservationEnableResult extends AgentWorkspaceObservationStatusResult {
113
+ enabledAt: string | null;
114
+ }
115
+ export interface C2StatusResult {
116
+ authenticated: boolean;
117
+ bound: boolean;
118
+ runtimeSignalKeyConfigured: boolean;
119
+ pendingEvents: number;
120
+ localOnlyEvents: number;
121
+ syncedEvents: number;
122
+ lastSyncAt: string | null;
123
+ lastSyncError: string | null;
124
+ boundGaid: string | null;
125
+ }
126
+ export interface C2SyncResult {
127
+ attempted: number;
128
+ succeeded: number;
129
+ failed: number;
130
+ pending: number;
131
+ synced: number;
132
+ lastSyncAt: string | null;
133
+ lastSyncError: string | null;
134
+ }
135
+ interface RemotePassportReconcileResult {
136
+ checked: boolean;
137
+ matched: number;
138
+ autoConnected: number;
139
+ status: 'not_authenticated' | 'synced' | 'unavailable';
140
+ error: string | null;
141
+ }
142
+ export interface TrainInitResult {
143
+ buildSession: BuildSession;
144
+ draftAction: 'draft_created' | 'draft_queued';
145
+ draftId: string | null;
146
+ gaid: string | null;
147
+ payload: Record<string, unknown>;
148
+ }
149
+ export interface BuildSessionStatusSummary {
150
+ build_session_id: string;
151
+ model_name: string;
152
+ framework: string;
153
+ task: string;
154
+ build_status: BuildSessionStatus;
155
+ draft_status: 'draft_created' | 'draft_queued' | 'bound' | 'local_only';
156
+ draft_id: string | null;
157
+ passport_gaid: string | null;
158
+ dataset_refs_count: number;
159
+ versions_count: number;
160
+ metrics_count: number;
161
+ latest_lifecycle_event: TrainingLifecycleEventType | null;
162
+ c2_sync_status: {
163
+ pending: number;
164
+ synced: number;
165
+ last_error: string | null;
166
+ } | null;
167
+ updated_at: string;
168
+ }
169
+ export interface AgentScanResult {
170
+ agents: DetectedAgent[];
171
+ newAgents: number;
172
+ knownAgents: number;
173
+ inactiveMarked: number;
174
+ }
175
+ export interface AgentStatusResult {
176
+ detectedAgents: number;
177
+ connectedAgents: number;
178
+ linkedAgents: number;
179
+ unlinkedAgents: number;
180
+ latestAgentLifecycleEvent: C2LiteEventType | null;
181
+ c2SyncStatus: {
182
+ pending: number;
183
+ synced: number;
184
+ lastError: string | null;
185
+ } | null;
186
+ }
187
+ export interface TrayStatusResult {
188
+ daemonRunning: boolean;
189
+ detectedModels: number;
190
+ detectedAgents: number;
191
+ shadowOrUnconnectedCount: number;
192
+ pulseStatus: PulseStatus;
193
+ c2PendingCount: number;
194
+ recommendedNextAction: NotificationSuggestedAction | null;
195
+ statusColor: TrayStatusColor;
196
+ }
197
+ export interface NotificationStatusResult {
198
+ enabled: boolean;
199
+ notification_min_interval_seconds: number;
200
+ delivered_count: number;
201
+ last_delivered_at: string | null;
202
+ recent_deliveries: DeliveredNotification[];
203
+ }
204
+ export interface NotificationDeliveryResult {
205
+ delivered: number;
206
+ suppressed: number;
207
+ fallback: boolean;
208
+ disabled: boolean;
209
+ notifications: NotificationCandidate[];
210
+ }
211
+ export interface ConnectInitResult {
212
+ identity: ConnectIdentityState;
213
+ entitlements: ServiceEntitlements;
214
+ permissions: ConnectPermissionsSummary;
215
+ privacy_summary: string;
216
+ }
217
+ export interface RuntimeReviewEntry {
218
+ runtime_gaid: string;
219
+ runtime_name: string;
220
+ runtime_type: string;
221
+ status: RuntimePassportStatus;
222
+ health_status: ProviderHealthStatus;
223
+ linked_models_count: number;
224
+ linked_agents_count: number;
225
+ source_endpoint_label: string;
226
+ recommended_action: string;
227
+ }
228
+ export interface RuntimeReviewSummary {
229
+ total_runtimes: number;
230
+ runtimes: RuntimeReviewEntry[];
231
+ }
232
+ export interface RuntimePassportStatusResult {
233
+ total_runtimes: number;
234
+ online_runtimes: number;
235
+ offline_runtimes: number;
236
+ linked_runtimes: number;
237
+ unlinked_runtimes: number;
238
+ unhealthy_runtimes: number;
239
+ latest_runtime_lifecycle_event: C2LiteEventType | null;
240
+ c2_pending_count: number;
241
+ }
242
+ export interface ConnectStatusOverview {
243
+ device_paired: boolean;
244
+ workspace_id: string | null;
245
+ project_id: string | null;
246
+ binding_state: ConnectBindingState | null;
247
+ lifecycle_note: string | null;
248
+ daemon_status: 'running' | 'stopped';
249
+ models_discovered: number;
250
+ agents_discovered: number;
251
+ runtimes_discovered: number;
252
+ paused_session_count: number;
253
+ revoked_session_count: number;
254
+ credential_reconnect_needed: boolean;
255
+ ready_to_connect_count: number;
256
+ needs_confirmation_count: number;
257
+ connected_count: number;
258
+ c2_sync_pending: number;
259
+ privacy_mode: 'metadata only';
260
+ next_recommended_action: SmartRegistrationInboxAction | null;
261
+ }
262
+ export declare class ConnectV1Service {
263
+ private readonly stateStore;
264
+ private readonly credentialStore;
265
+ constructor(stateDir?: string, options?: {
266
+ credentialBackend?: SecureCredentialBackend;
267
+ legacyCredentialBackend?: SecureCredentialBackend | null;
268
+ });
269
+ getStateStore(): LocalStateStore;
270
+ private getStoredSessionRef;
271
+ private getEnvironmentSessionRef;
272
+ private getActiveSessionRef;
273
+ private getSessionRefSource;
274
+ readSessionRef(): string | null;
275
+ private hasSessionRef;
276
+ private clearStoredRuntimeSignalSecrets;
277
+ private clearStoredSessionCredential;
278
+ private clearCredentialReconnectNeededSessions;
279
+ private getEffectiveBindingState;
280
+ getEffectiveBinding(): ConnectEffectiveBindingState | null;
281
+ private getBindingScope;
282
+ private getLocalWorkspaceProjectScope;
283
+ private getBindingActionConfig;
284
+ private buildLocalScopeActionStatus;
285
+ getBindingActionStatus(action: 'draft_creation' | 'evidence_sync' | 'runtime_session_sync' | 'lineage_suggestions', state?: ConnectState): {
286
+ allowed: boolean;
287
+ reviewRequired: boolean;
288
+ reasonCode: string;
289
+ message: string;
290
+ bindingState: ConnectBindingState | null;
291
+ };
292
+ private getAuthorizedBindingForAction;
293
+ private getAuthorizedScopeForAction;
294
+ getActionScope(action: 'draft_creation' | 'evidence_sync' | 'runtime_session_sync' | 'lineage_suggestions', state?: ConnectState): ConnectActionScope | null;
295
+ private canAttemptScopedBackendAction;
296
+ getBindingLifecycleNotice(state?: ConnectState): string | null;
297
+ private getBindingActionErrorCode;
298
+ private bindingRequiresReconnect;
299
+ private filterInboxActionsForBinding;
300
+ private resolveInboxActionForBinding;
301
+ buildDeviceConnectStartPayload(): {
302
+ connect_device_id: string | null;
303
+ connect_public_key: string | null;
304
+ device_label: string | null;
305
+ client_version: string | null;
306
+ platform: string | null;
307
+ arch: string | null;
308
+ };
309
+ private migrateLegacyCredentials;
310
+ private getIdentityState;
311
+ private hasStoredPrivateKey;
312
+ private getIdentityReadiness;
313
+ private buildServiceEntitlements;
314
+ private syncServiceEntitlements;
315
+ private syncIdentityFromLocalState;
316
+ private createConnectIdentity;
317
+ initializeConnectIdentity(): ConnectInitResult;
318
+ setSessionRef(sessionRef: string | null): void;
319
+ private mergeEffectiveBindingRecord;
320
+ private syncBindingScopeAndConsent;
321
+ refreshEffectiveBinding(options?: {
322
+ skipAutoScopeSync?: boolean;
323
+ }): Promise<ConnectEffectiveBindingState | null>;
324
+ setBindings(workspaceId: string | null, projectId: string | null): void;
325
+ private buildStandardBindingConsentProfile;
326
+ bindWorkspaceProject(workspaceId: string | null, projectId: string | null): Promise<ConnectBindingScopeSelectionResult>;
327
+ getStatus(): StatusResult;
328
+ getConfig(): ConnectConfig;
329
+ getServiceEntitlements(): ServiceEntitlements;
330
+ private getApiClient;
331
+ private ensureRuntimePassportIdentity;
332
+ private findRuntimePassportByGaid;
333
+ private findRuntimePassportForRuntime;
334
+ private findDetectedRuntimeForModel;
335
+ private createOrUpdateRuntimePassport;
336
+ private syncRuntimePassportAssociations;
337
+ private ensureRuntimePassportForModel;
338
+ private extractBackendErrorCode;
339
+ private isBindingSyncDriftCode;
340
+ private shouldHaltScopedSyncAfterFailure;
341
+ private reconcileScopedBackendFailure;
342
+ private findC2Session;
343
+ private buildSyntheticGovernorSessionId;
344
+ private queueC2SessionAcknowledgement;
345
+ private upsertObservedC2Session;
346
+ observeDeploymentSession(input: {
347
+ sessionId: string;
348
+ passportGaid: string;
349
+ runtimeGaid?: string | null;
350
+ modelName?: string | null;
351
+ agentId?: string | null;
352
+ workspaceId?: string | null;
353
+ projectId?: string | null;
354
+ sessionMode: C2SessionMode;
355
+ controlSource: C2SessionControlSource;
356
+ lastSeenAt?: string | null;
357
+ lastControlSeenAt?: string | null;
358
+ metadata?: Record<string, unknown>;
359
+ }): C2SessionState;
360
+ observeBackendCommunicationState(input: {
361
+ passportGaid: string | null;
362
+ runtimeGaid?: string | null;
363
+ modelName?: string | null;
364
+ agentId?: string | null;
365
+ sessionId?: string | null;
366
+ status: number;
367
+ body?: unknown;
368
+ source: 'heartbeat' | 'runtimeSignal' | 'draft_sync' | 'deployments';
369
+ }): C2SessionState | null;
370
+ observeTransientRuntimeSyncFailure(input: {
371
+ passportGaid: string | null;
372
+ runtimeGaid?: string | null;
373
+ modelName?: string | null;
374
+ agentId?: string | null;
375
+ sessionId?: string | null;
376
+ source: 'heartbeat' | 'runtimeSignal' | 'draft_sync' | 'deployments';
377
+ reason?: string | null;
378
+ status?: number | null;
379
+ details?: unknown;
380
+ }): C2SessionState | null;
381
+ getC2SessionSummary(): C2SessionSummary;
382
+ syncC2SessionsFromBackend(options?: {
383
+ suppressErrors?: boolean;
384
+ }): Promise<C2SessionSummary>;
385
+ private buildInboxItemId;
386
+ private isDeferredReviewActive;
387
+ private getModelReviewDisposition;
388
+ private getRuntimeReviewDisposition;
389
+ private buildModelVerificationSummary;
390
+ private buildRuntimeVerificationSummary;
391
+ private findConnectableModelForRuntime;
392
+ private clearModelReviewDeferral;
393
+ private buildPassportMatchSuggestionForModel;
394
+ private normalizeRemotePassportList;
395
+ private loadRemoteWorkspaceNameMaps;
396
+ private remotePassportMetadataValue;
397
+ private scoreRemotePassportForModel;
398
+ private findRemotePassportMatchForModel;
399
+ private autoConnectRemotePassportModel;
400
+ reconcileOwnedPassportsFromForkit(): Promise<RemotePassportReconcileResult>;
401
+ private autoConnectMatchedModel;
402
+ private findAgentModelCandidate;
403
+ private getDefaultRuntimeSignalApiKey;
404
+ private findBindingByGaid;
405
+ private getPrimaryBoundBinding;
406
+ private setRuntimeSignalApiKeyForGaid;
407
+ private resolveRuntimeSignalApiKeyForEvent;
408
+ /**
409
+ * Promote local-only events (no passport_gaid) by assigning the given gaid.
410
+ * Safe to call after a model is bound: events were observed on this device
411
+ * for the same model, we just didn't know the gaid at record time.
412
+ */
413
+ private backfillLocalOnlyC2Events;
414
+ /**
415
+ * If a runtime signal API key is available in the environment and a bound
416
+ * GAID exists but no key is stored yet, persist the key automatically.
417
+ * Triggers a GAID backfill on local-only events to make them syncable.
418
+ * Returns true if a new key was stored.
419
+ */
420
+ autoConfigureRuntimeSignalKeyFromEnv(): boolean;
421
+ /**
422
+ * Explicitly configure a runtime signal API key for a GAID and promote all
423
+ * pre-binding local-only events to syncable by backfilling the GAID.
424
+ * Validates key format: 8–512 printable ASCII characters.
425
+ */
426
+ configureRuntimeSignalKey(options: {
427
+ gaid: string;
428
+ apiKey: string;
429
+ }): {
430
+ stored: boolean;
431
+ backfilled: number;
432
+ gaid: string;
433
+ keyRef: string | null;
434
+ };
435
+ /**
436
+ * After login, automatically create a runtime-signal API key for every bound
437
+ * passport that doesn't already have one stored locally.
438
+ *
439
+ * This is what makes "login once → everything works" possible.
440
+ * The user never needs to run `c2 set-key` manually.
441
+ */
442
+ autoProvisionRuntimeSignalKeys(options?: {
443
+ suppressErrors?: boolean;
444
+ }): Promise<{
445
+ provisioned: string[];
446
+ skipped: string[];
447
+ failed: string[];
448
+ }>;
449
+ /**
450
+ * Run one pass of the deep lifecycle monitoring engine.
451
+ * Called every daemon scan cycle automatically — no configuration needed.
452
+ */
453
+ runLifecycleMonitoringPass(): MonitorPassResult;
454
+ /**
455
+ * Return all pending human-review items (or all reviews regardless of status).
456
+ */
457
+ getPendingReviews(options?: {
458
+ all?: boolean;
459
+ }): PendingReview[];
460
+ /**
461
+ * Human confirms or dismisses a review item.
462
+ * If `auto_confirm_after_first` is set on the review, future detections of
463
+ * the same kind for the same subject will be auto-confirmed.
464
+ */
465
+ resolveReview(reviewId: string, decision: 'confirmed' | 'dismissed'): {
466
+ resolved: boolean;
467
+ message: string;
468
+ };
469
+ private buildC2LifecycleEvent;
470
+ private recordC2LifecycleEvents;
471
+ private getC2EventSyncSummary;
472
+ recordC2LifecycleEvent(input: {
473
+ eventType: C2LiteEventType;
474
+ occurredAt?: string;
475
+ runtimeGaid?: string | null;
476
+ runtimeName?: string | null;
477
+ runtimeType?: RuntimeType | null;
478
+ modelName?: string | null;
479
+ discoveryHash?: string | null;
480
+ registrationKey?: string | null;
481
+ passportGaid?: string | null;
482
+ workspaceId?: string | null;
483
+ projectId?: string | null;
484
+ pulseStatus?: PulseStatus | null;
485
+ connectionClassification?: DiscoveryClassification | null;
486
+ daemonRunning?: boolean | null;
487
+ shadowCandidateReason?: string | null;
488
+ metadata?: Record<string, unknown>;
489
+ }): C2LifecycleEvent;
490
+ getC2Status(): C2StatusResult;
491
+ private findAgentByIdOrName;
492
+ private findAgentLink;
493
+ private findLinkedModelForAgent;
494
+ private closeActiveAgentModelUsage;
495
+ private recordAgentModelUsageObservation;
496
+ private refreshAgentModelUsageFromLinks;
497
+ private buildObservedAgentCandidate;
498
+ private buildAgentObservationStatus;
499
+ private updateAgentObservationMetadata;
500
+ private buildConnectSelfAgentCandidate;
501
+ private buildDetectedAgent;
502
+ private queueAgentC2Event;
503
+ private countC2ForAgent;
504
+ scanAgents(options?: {
505
+ processEntries?: ProcessListEntry[];
506
+ agentProcessResults?: AgentProcessMetadata[];
507
+ detectedAt?: string;
508
+ discoverySource?: 'process_scan' | 'daemon_scan';
509
+ includeConnectSelf?: boolean;
510
+ }): Promise<AgentScanResult>;
511
+ buildAgentReviewSnapshot(): AgentReviewSnapshot;
512
+ connectAgent(selector: string): DetectedAgent;
513
+ registerObservedAgent(input: {
514
+ agentName: string;
515
+ agentType: AgentType;
516
+ signature: string;
517
+ processName?: string | null;
518
+ executableName?: string | null;
519
+ matchedTerms?: string[];
520
+ commandHash?: string | null;
521
+ pathHash?: string | null;
522
+ metadata?: Record<string, unknown>;
523
+ }): Promise<DetectedAgent>;
524
+ enableAgentWorkspaceObservation(selector: string, input: {
525
+ workspaceRoot: string;
526
+ source: 'vscode_extension' | 'mcp_server' | 'coding_agent';
527
+ allowedTools?: ObservedAgentToolName[];
528
+ }): AgentWorkspaceObservationEnableResult;
529
+ disableAgentWorkspaceObservation(selector: string, input?: {
530
+ source?: 'vscode_extension' | 'mcp_server' | 'coding_agent';
531
+ reason?: string;
532
+ }): AgentWorkspaceObservationStatusResult;
533
+ getAgentWorkspaceObservationStatus(selector: string): AgentWorkspaceObservationStatusResult;
534
+ runObservedAgentTool(selector: string, input: Omit<ObservedAgentToolCallInput, 'workspaceRoot'> & {
535
+ workspaceRoot: string;
536
+ }): Promise<ObservedAgentToolCallResult>;
537
+ private buildAgentDraftPayload;
538
+ connectAgentPassport(selector: string): Promise<DetectedAgent>;
539
+ linkAgentToModel(selector: string, modelSelector: string): AgentLink;
540
+ getAgentStatus(): AgentStatusResult;
541
+ getAgentModelUsageLedger(selector?: string): AgentModelUsageLedgerSummary;
542
+ buildSmartRegistrationInbox(): SmartRegistrationInbox;
543
+ getConnectStatusOverview(): ConnectStatusOverview;
544
+ private resolveRecommendedNextAction;
545
+ getTrayStatus(): TrayStatusResult;
546
+ private getInboxDetailText;
547
+ private getInboxDetailBoolean;
548
+ private resolveScopeSuggestion;
549
+ private maybeRecordScopeMismatchEvidence;
550
+ private getNotificationScopeSummaryFromInbox;
551
+ private getNotificationScopeSummary;
552
+ private getNotificationRuntimeLabel;
553
+ private getNotificationSourceSummary;
554
+ getNotificationCandidates(): NotificationCandidate[];
555
+ private getNotificationTargetId;
556
+ private wasNotificationRecentlyDelivered;
557
+ private markNotificationDelivered;
558
+ getNotificationStatus(limit?: number): NotificationStatusResult;
559
+ deliverPendingNotifications(options?: {
560
+ candidates?: NotificationCandidate[];
561
+ force?: boolean;
562
+ notificationSender?: NotificationSender;
563
+ recordDelivery?: boolean;
564
+ deliveredAt?: string;
565
+ }): NotificationDeliveryResult;
566
+ sendTestNotification(options?: {
567
+ notificationSender?: NotificationSender;
568
+ }): NotificationDeliveryResult;
569
+ buildTrayMenuModel(): TrayMenuModel;
570
+ getConnectPermissions(): ConnectPermissionsSummary;
571
+ getConnectServices(): ConnectServicesSummary;
572
+ private buildEvolutionSnapshot;
573
+ private buildFallbackEvolutionBaseline;
574
+ private ensureEvolutionBaselineForBinding;
575
+ private findLatestBuildSessionForEvolution;
576
+ private deriveEvolutionChangeTypes;
577
+ private buildEvolutionCandidateEventFingerprint;
578
+ private recordEvolutionCandidate;
579
+ syncEvolutionCandidates(): ModelEvolutionCandidate[];
580
+ reviewModelEvolution(): EvolutionReviewSnapshot;
581
+ private buildSignedEvent;
582
+ buildConnectHandoff(): ConnectHandoffPayload;
583
+ private buildTrainingLifecycleEvent;
584
+ private findBuildSession;
585
+ private requireBuildSession;
586
+ private buildTrainingDraftPayload;
587
+ private queueTrainingC2Event;
588
+ private countC2ForBuildSession;
589
+ private buildBuildSessionSummary;
590
+ private saveBuildSession;
591
+ private shouldFallbackToQueuedTrainingDraft;
592
+ initTrainingBuildSession(input: {
593
+ modelName: string;
594
+ framework: string;
595
+ task: string;
596
+ datasetRef?: string | null;
597
+ }): Promise<TrainInitResult>;
598
+ recordTrainingLifecycleEvent(buildSessionId: string, eventType: Exclude<TrainingLifecycleEventType, 'training_initialized'>, metadata?: Record<string, unknown>): BuildSession;
599
+ recordTrainingDatasetChange(buildSessionId: string, datasetRef: string, changeType: BuildDatasetRef['change_type']): BuildSession;
600
+ recordTrainingMetric(buildSessionId: string, metricName: string, metricValue: number): BuildSession;
601
+ recordTrainingVersion(buildSessionId: string, versionName: string, reason: string): BuildSession;
602
+ recordTrainingArtifact(buildSessionId: string, artifactPath: string, hashArtifact: boolean): BuildSession;
603
+ getTrainingStatus(buildSessionId?: string): BuildSessionStatusSummary | BuildSessionStatusSummary[];
604
+ markBuildSessionDraftPublished(draftId: string, passportGaid: string | null, workspaceId: string | null, projectId: string | null): BuildSession | null;
605
+ private buildC2RuntimeSignalPayload;
606
+ private runtimeRecommendedAction;
607
+ getRuntimePassportReview(): RuntimeReviewSummary;
608
+ getRuntimePassportStatus(): RuntimePassportStatusResult;
609
+ private buildRuntimeHandoffSummary;
610
+ flushC2LifecycleEvents(options?: {
611
+ runtimeSignalApiKey?: string | null;
612
+ gaid?: string | null;
613
+ suppressErrors?: boolean;
614
+ }): Promise<C2SyncResult>;
615
+ private buildC2ScanEvents;
616
+ private buildPulseTransitionEvents;
617
+ setDiscoveryMode(mode: DiscoveryMode): ConnectConfig;
618
+ setDaemonIntervalSeconds(seconds: number): ConnectConfig;
619
+ setNotificationsEnabled(enabled: boolean): ConnectConfig;
620
+ setNotificationMinIntervalSeconds(seconds: number): ConnectConfig;
621
+ setEvolutionBridgeEnabled(enabled: boolean): ConnectConfig;
622
+ private isProcessAlive;
623
+ getDaemonStatus(): DaemonStatus;
624
+ markDaemonStarted(pid: number): DaemonStatus;
625
+ markDaemonStopped(lastError: string | null): DaemonStatus;
626
+ recordDaemonScan(summary: DaemonScanSummary): DaemonStatus;
627
+ recordDaemonError(lastError: string): DaemonStatus;
628
+ getPulseSummary(): VitalityPulseSummary | null;
629
+ getPulseHistory(limit?: number): VitalityPulseEvent[];
630
+ recordPulseSummary(summary: VitalityPulseSummary): VitalityPulseSummary;
631
+ recordPulseError(lastError: string): string;
632
+ runVitalityPulseCycle(dependencies?: VitalityPulseDependencies): Promise<VitalityPulseSummary>;
633
+ private findBindingForModel;
634
+ private findPendingQueueItem;
635
+ private countDetectionEvents;
636
+ private parseDraftResponse;
637
+ private withDraftBindingPayload;
638
+ private withRuntimeBindingPayload;
639
+ private buildConnectDraftPayload;
640
+ private resolveModelSelection;
641
+ private buildModelReviewEntry;
642
+ buildReviewSnapshot(summary?: DaemonScanSummary, options?: {
643
+ recordEvent?: boolean;
644
+ }): ReviewSnapshot;
645
+ connectDetectedModel(selector: string, options?: {
646
+ visibility?: 'private' | 'public';
647
+ destination?: 'draft' | 'passport';
648
+ }): Promise<ConnectSelectionResult>;
649
+ private resolveRuntimePassportSelection;
650
+ connectRuntimeSuggestion(selector: string): Promise<ConnectSelectionResult>;
651
+ private buildModelFindings;
652
+ private buildProviderFindings;
653
+ private buildProcessFindings;
654
+ private buildDaemonSummary;
655
+ scanRuntime(options?: {
656
+ processScoutResults?: SanitizedProcessMetadata[];
657
+ includeProcessScout?: boolean;
658
+ }): Promise<ScanRuntimeResult>;
659
+ runDiscoveryCycle(options?: {
660
+ processScoutResults?: SanitizedProcessMetadata[];
661
+ }): Promise<DiscoveryCycleResult>;
662
+ queueModelDraftsFromDetected(): QueueDraftSummary;
663
+ processQueue(): Promise<{
664
+ processed: number;
665
+ succeeded: number;
666
+ failed: number;
667
+ }>;
668
+ queueHeartbeatRuntimeSignal(gaid: string | null, apiKey: string | null): string | null;
669
+ queueConfiguredHeartbeatRuntimeSignal(gaid: string | null): string | null;
670
+ runDoctorChecks(): Promise<DoctorCheck[]>;
671
+ markModelIgnored(modelName: string, digest: string): boolean;
672
+ deferDetectedModel(selector: string, deferHours?: number): boolean;
673
+ markRuntimeIgnored(selector: string): boolean;
674
+ deferRuntimeSuggestion(selector: string, deferHours?: number): boolean;
675
+ notImplemented(feature: string): never;
676
+ ensureNoProductionPolicyBypass(): void;
677
+ createEvidenceId(): string;
678
+ }
679
+ export {};
680
+ //# sourceMappingURL=service.d.ts.map