forkit-connect 0.1.12 → 0.1.13

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/launcher.js CHANGED
@@ -7592,11 +7592,11 @@ function renderLauncherHtml(launcherToken) {
7592
7592
  }
7593
7593
 
7594
7594
  function canReviewDefer(item) {
7595
- return Boolean(item && (item.kind === 'model' || item.kind === 'runtime') && item.inboxGroup !== 'ignored');
7595
+ return Boolean(item && (item.kind === 'model' || item.kind === 'agent' || item.kind === 'runtime') && item.inboxGroup !== 'ignored');
7596
7596
  }
7597
7597
 
7598
7598
  function canReviewIgnore(item) {
7599
- return Boolean(item && (item.kind === 'model' || item.kind === 'runtime') && item.inboxGroup !== 'ignored');
7599
+ return Boolean(item && (item.kind === 'model' || item.kind === 'agent' || item.kind === 'runtime') && item.inboxGroup !== 'ignored');
7600
7600
  }
7601
7601
 
7602
7602
  function getQuickReviewItems() {
@@ -11239,10 +11239,8 @@ function createLauncherApp(options) {
11239
11239
  return;
11240
11240
  }
11241
11241
  if (kind === 'agent') {
11242
- response.status(400).json({
11243
- ok: false,
11244
- message: 'Agent defer is not available yet in the local review surface.',
11245
- });
11242
+ options.service.deferDetectedAgent(selector, Number.isFinite(hours) ? hours : 24);
11243
+ response.json({ ok: true, message: 'Agent review deferred for 24 hours.' });
11246
11244
  return;
11247
11245
  }
11248
11246
  response.status(400).json({ ok: false, message: 'Unsupported review kind.' });
@@ -11271,10 +11269,8 @@ function createLauncherApp(options) {
11271
11269
  return;
11272
11270
  }
11273
11271
  if (kind === 'agent') {
11274
- response.status(400).json({
11275
- ok: false,
11276
- message: 'Agent ignore is not available yet in the local review surface.',
11277
- });
11272
+ options.service.ignoreDetectedAgent(selector);
11273
+ response.json({ ok: true, message: 'Agent review ignored locally.' });
11278
11274
  return;
11279
11275
  }
11280
11276
  response.status(400).json({ ok: false, message: 'Unsupported review kind.' });
@@ -402,6 +402,7 @@ export declare class ConnectV1Service {
402
402
  private buildInboxItemId;
403
403
  private isDeferredReviewActive;
404
404
  private getModelReviewDisposition;
405
+ private getAgentReviewDisposition;
405
406
  private getRuntimeReviewDisposition;
406
407
  private buildModelVerificationSummary;
407
408
  private buildRuntimeVerificationSummary;
@@ -768,7 +769,9 @@ export declare class ConnectV1Service {
768
769
  runDoctorChecks(): Promise<DoctorCheck[]>;
769
770
  markModelIgnored(modelName: string, digest: string): boolean;
770
771
  ignoreDetectedModel(selector: string): boolean;
772
+ ignoreDetectedAgent(selector: string): boolean;
771
773
  deferDetectedModel(selector: string, deferHours?: number): boolean;
774
+ deferDetectedAgent(selector: string, deferHours?: number): boolean;
772
775
  markRuntimeIgnored(selector: string): boolean;
773
776
  deferRuntimeSuggestion(selector: string, deferHours?: number): boolean;
774
777
  ignoreRuntimeSuggestion(selector: string): boolean;
@@ -2153,6 +2153,15 @@ class ConnectV1Service {
2153
2153
  }
2154
2154
  return 'active';
2155
2155
  }
2156
+ getAgentReviewDisposition(agent) {
2157
+ if (agent.review_state === 'ignored') {
2158
+ return 'ignored';
2159
+ }
2160
+ if (agent.review_state === 'deferred' && this.isDeferredReviewActive(agent.review_deferred_until)) {
2161
+ return 'deferred';
2162
+ }
2163
+ return 'active';
2164
+ }
2156
2165
  getRuntimeReviewDisposition(runtimePassport) {
2157
2166
  if (runtimePassport.review_state === 'ignored') {
2158
2167
  return 'ignored';
@@ -3607,6 +3616,8 @@ class ConnectV1Service {
3607
3616
  source_label: input.candidate.source_label ?? null,
3608
3617
  detection_reason: input.candidate.reason ?? null,
3609
3618
  },
3619
+ review_state: input.existing?.review_state,
3620
+ review_deferred_until: input.existing?.review_deferred_until ?? null,
3610
3621
  };
3611
3622
  }
3612
3623
  queueAgentC2Event(agent, eventType, metadata = {}, occurredAt) {
@@ -4434,29 +4445,35 @@ class ConnectV1Service {
4434
4445
  const sourceLabel = typeof metadata.source_label === 'string' && metadata.source_label.trim()
4435
4446
  ? metadata.source_label.trim()
4436
4447
  : null;
4437
- const reviewDisposition = link
4448
+ const agentReviewStatus = link
4438
4449
  ? 'linked_agent'
4439
4450
  : agent.agent_type === 'unknown_ai_tool'
4440
4451
  ? 'unknown_ai_tool'
4441
4452
  : agent.detected_at === agent.last_seen_at
4442
4453
  ? 'new_agent'
4443
4454
  : 'known_agent';
4455
+ const reviewDisposition = this.getAgentReviewDisposition(agent);
4456
+ if (reviewDisposition === 'deferred') {
4457
+ continue;
4458
+ }
4444
4459
  const agentObservation = this.buildAgentObservationStatus(agent);
4445
- const group = agent.status === 'inactive'
4460
+ const group = reviewDisposition === 'ignored'
4446
4461
  ? 'ignored'
4447
- : link
4448
- ? 'connected'
4449
- : candidate.model
4450
- ? 'needs_confirmation'
4451
- : 'ready_to_connect';
4462
+ : agent.status === 'inactive'
4463
+ ? 'ignored'
4464
+ : link
4465
+ ? 'connected'
4466
+ : candidate.model
4467
+ ? 'needs_confirmation'
4468
+ : 'ready_to_connect';
4452
4469
  const observedWorkspaceId = normalizeDisplayText(metadata.observation_workspace_id ?? metadata.workspaceId ?? metadata.workspace_id);
4453
4470
  const observedProjectId = normalizeDisplayText(metadata.observation_project_id ?? metadata.projectId ?? metadata.project_id);
4454
4471
  const scopeSuggestion = this.resolveScopeSuggestion(currentState, observedWorkspaceId, observedProjectId);
4455
4472
  const itemId = this.buildInboxItemId('agent', agent.agent_id);
4456
4473
  const recommendedAction = link ? 'open_on_forkit' : 'link_agent_to_model';
4457
4474
  const allowedActions = this.filterInboxActionsForBinding(link
4458
- ? ['open_on_forkit', 'ignore']
4459
- : ['link_agent_to_model', 'ignore', 'open_on_forkit'], currentState);
4475
+ ? ['open_on_forkit', 'defer', 'ignore']
4476
+ : ['link_agent_to_model', 'defer', 'ignore', 'open_on_forkit'], currentState);
4460
4477
  if (scopeSuggestion.scope_mismatch_detected && scopeSuggestion.scope_mismatch_reason) {
4461
4478
  this.maybeRecordScopeMismatchEvidence(currentState, {
4462
4479
  itemType: 'agent',
@@ -4501,7 +4518,8 @@ class ConnectV1Service {
4501
4518
  last_observed_tool_at: agentObservation.lastObservedToolAt,
4502
4519
  last_tool_decision: agentObservation.lastToolDecision,
4503
4520
  source_label: sourceLabel,
4504
- review_disposition: reviewDisposition,
4521
+ review_disposition: agentReviewStatus,
4522
+ local_review_disposition: reviewDisposition,
4505
4523
  scope_suggestion: scopeSuggestion.scope_suggestion,
4506
4524
  scope_suggestion_kind: scopeSuggestion.scope_suggestion_kind,
4507
4525
  scope_suggestion_source_label: scopeSuggestion.scope_suggestion_source_label,
@@ -9024,6 +9042,21 @@ class ConnectV1Service {
9024
9042
  const model = this.resolveModelSelection(selector, state);
9025
9043
  return this.markModelIgnored(model.model, model.digest);
9026
9044
  }
9045
+ ignoreDetectedAgent(selector) {
9046
+ const state = this.stateStore.readState();
9047
+ const agent = this.findAgentByIdOrName(state, selector);
9048
+ if (!agent)
9049
+ return false;
9050
+ const nextAgents = state.detected_agents.map((item) => item.agent_id === agent.agent_id
9051
+ ? {
9052
+ ...item,
9053
+ review_state: 'ignored',
9054
+ review_deferred_until: null,
9055
+ }
9056
+ : item);
9057
+ this.stateStore.replaceDetectedAgents(nextAgents);
9058
+ return true;
9059
+ }
9027
9060
  deferDetectedModel(selector, deferHours = 24) {
9028
9061
  const state = this.stateStore.readState();
9029
9062
  const model = this.resolveModelSelection(selector, state);
@@ -9038,6 +9071,22 @@ class ConnectV1Service {
9038
9071
  this.stateStore.replaceDetectedModels(nextModels);
9039
9072
  return true;
9040
9073
  }
9074
+ deferDetectedAgent(selector, deferHours = 24) {
9075
+ const state = this.stateStore.readState();
9076
+ const agent = this.findAgentByIdOrName(state, selector);
9077
+ if (!agent)
9078
+ return false;
9079
+ const deferredUntil = new Date(Date.now() + Math.max(1, deferHours) * 60 * 60 * 1000).toISOString();
9080
+ const nextAgents = state.detected_agents.map((item) => item.agent_id === agent.agent_id
9081
+ ? {
9082
+ ...item,
9083
+ review_state: 'deferred',
9084
+ review_deferred_until: deferredUntil,
9085
+ }
9086
+ : item);
9087
+ this.stateStore.replaceDetectedAgents(nextAgents);
9088
+ return true;
9089
+ }
9041
9090
  markRuntimeIgnored(selector) {
9042
9091
  const state = this.stateStore.readState();
9043
9092
  const runtimePassport = this.resolveRuntimePassportSelection(selector, state);
@@ -569,6 +569,8 @@ export interface DetectedAgent {
569
569
  persistence?: 'temporary' | 'permanent';
570
570
  discovery_sources: AgentDiscoverySource[];
571
571
  metadata: Record<string, unknown>;
572
+ review_state?: ReviewDisposition | undefined;
573
+ review_deferred_until?: string | null;
572
574
  }
573
575
  /**
574
576
  * AgentLink (M2: Agent Class Metadata in linkage)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forkit-connect",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "Forkit Connect Local Engine - The Global AI Governance Fabric",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",