@kici-dev/orchestrator 0.1.5 → 0.1.7

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.
@@ -0,0 +1,26 @@
1
+ import type { AppConfig } from '../config.js';
2
+ import type { SourceManager } from './source-manager.js';
3
+ import type { ProviderSource } from '../entry-helpers.js';
4
+ /** One active generic-webhook routing-key row (subset consumed here). */
5
+ export interface GenericRoutingKeyRow {
6
+ routing_key: string;
7
+ provider_type: string;
8
+ name: string;
9
+ has_git_config: boolean;
10
+ }
11
+ /**
12
+ * Build the full provider-source list the orchestrator advertises to the
13
+ * Platform: GitHub-app sources from the {@link SourceManager} plus every
14
+ * *servable* generic-webhook source.
15
+ *
16
+ * Used both at boot and by the live republish closure (platform mode). It MUST
17
+ * return the complete set every time — a live source change re-sends the whole
18
+ * list via `platformClient.updateSources()`, which diffs against the previously
19
+ * sent set; a partial list would make the Platform deregister the sources that
20
+ * happened to be omitted.
21
+ *
22
+ * The generic-row loader is injected (rather than taking a `db`) so the merge
23
+ * logic is unit-testable without a live database.
24
+ */
25
+ export declare function buildPlatformProviderSources(sourceManager: Pick<SourceManager, 'getSources'>, loadGenericRows: () => Promise<GenericRoutingKeyRow[]>, config: AppConfig): Promise<ProviderSource[]>;
26
+ //# sourceMappingURL=build-platform-sources.d.ts.map
@@ -42,7 +42,21 @@ export declare class SourceManager {
42
42
  private currentSources;
43
43
  private debounceTimer;
44
44
  private readonly debounceMs;
45
+ /**
46
+ * Change callback. Stored in a mutable field (not read off `opts`) so a
47
+ * mode-specific hook can rewire it after construction — the platform-mode
48
+ * boot wires it to push the full source list to the Platform via
49
+ * `platformClient.updateSources()`. Defaults to the (possibly no-op) value
50
+ * passed at construction.
51
+ */
52
+ private onSourcesChanged;
45
53
  constructor(opts: SourceManagerOptions);
54
+ /**
55
+ * Replace the change callback after construction. The SourceManager is built
56
+ * early (before the Platform client exists); the platform-mode boot calls
57
+ * this once the client is ready so live source changes propagate upstream.
58
+ */
59
+ setOnSourcesChanged(cb: SourceManagerOptions['onSourcesChanged']): void;
46
60
  /** Get current ProviderRegistry (rebuilt on each reload). */
47
61
  getRegistry(): ProviderRegistry;
48
62
  /** Get current sources for Platform registration. */
@@ -18,7 +18,7 @@
18
18
  import { type Kysely } from 'kysely';
19
19
  import type { Database } from '../db/types.js';
20
20
  import type { ExecutionTracker } from '../reporting/execution-tracker.js';
21
- import type { CommitStatusReporter } from '../reporting/commit-status.js';
21
+ import type { CheckRunReporter } from '../reporting/check-run-reporter.js';
22
22
  import type { ScalerManager } from '../scaler/manager.js';
23
23
  import type { Dispatcher } from '../agent/dispatcher.js';
24
24
  import type { AgentRegistry } from '../agent/registry.js';
@@ -26,7 +26,7 @@ import type { HeldRunStore } from '../environments/held-runs.js';
26
26
  export interface StaleRunDetectorDeps {
27
27
  db: Kysely<Database>;
28
28
  executionTracker: ExecutionTracker;
29
- commitStatusReporter?: CommitStatusReporter;
29
+ checkRunReporter?: CheckRunReporter;
30
30
  scalerManager?: ScalerManager;
31
31
  dispatcher: Dispatcher;
32
32
  registry: AgentRegistry;
@@ -40,7 +40,7 @@ export interface StaleRunDetectorDeps {
40
40
  export declare class StaleRunDetector {
41
41
  private readonly db;
42
42
  private readonly executionTracker;
43
- private readonly commitStatusReporter?;
43
+ private readonly checkRunReporter?;
44
44
  private readonly scalerManager?;
45
45
  private readonly dispatcher;
46
46
  private readonly registry;