@pdpp/local-collector 0.16.5 → 0.16.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.
@@ -1,8 +1,8 @@
1
1
  const COLLECTOR_BUILD_SOURCE_SENTINEL = "source";
2
2
  const COLLECTOR_BUILD_INFO = {
3
- builtAt: "2026-06-25T19:27:11.013Z",
4
- revision: "5d38746de95a",
5
- version: "0.16.5",
3
+ builtAt: "2026-06-25T21:41:51.440Z",
4
+ revision: "eb6e76051969",
5
+ version: "0.16.7",
6
6
  };
7
7
  function buildAgentVersion(info = COLLECTOR_BUILD_INFO) {
8
8
  return `${info.version}+${info.revision}`;
@@ -59,6 +59,7 @@ export interface CollectorConnectorSpec extends ConnectorPlacementInput {
59
59
  readonly command: string;
60
60
  readonly connector_id: string;
61
61
  readonly env?: NodeJS.ProcessEnv;
62
+ readonly resources?: Readonly<Record<string, readonly string[]>>;
62
63
  readonly streams: readonly string[];
63
64
  readonly streamsToBackfill?: readonly string[];
64
65
  }
@@ -111,7 +112,7 @@ export declare class CollectorStateReadError extends Error {
111
112
  }
112
113
  export declare function runCollectorConnector(config: CollectorRunConfig): Promise<CollectorRunResult>;
113
114
  export declare function summarizeCollectorCompleteness(coverageByStore: Map<string, CollectorCoverageStatus> | null): CollectorCompletenessSummary | null;
114
- export declare function buildCollectorStartMessage(streams: readonly string[], streamsToBackfill?: readonly string[], priorState?: Readonly<Record<string, unknown>> | null): StartMessage;
115
+ export declare function buildCollectorStartMessage(streams: readonly string[], streamsToBackfill?: readonly string[], priorState?: Readonly<Record<string, unknown>> | null, resources?: Readonly<Record<string, readonly string[]>>): StartMessage;
115
116
  export declare function transformRecordsToCollectorEnvelopes(input: {
116
117
  batchId: string;
117
118
  batchSeq: number;
@@ -533,7 +533,7 @@ async function streamConnectorIntoOutbox(input) {
533
533
  child.stdin.on("error", () => {
534
534
  });
535
535
  child.stderr.on("data", (chunk) => stderr.push(chunk));
536
- child.stdin.end(`${JSON.stringify(buildCollectorStartMessage(input.config.connector.streams, input.config.connector.streamsToBackfill, input.priorState))}\n`);
536
+ child.stdin.end(`${JSON.stringify(buildCollectorStartMessage(input.config.connector.streams, input.config.connector.streamsToBackfill, input.priorState, input.config.connector.resources))}\n`);
537
537
  let exitCode;
538
538
  try {
539
539
  [exitCode] = await Promise.all([exitPromise, outputPromise]);
@@ -748,9 +748,14 @@ async function safeHeartbeat(client, request) {
748
748
  catch {
749
749
  }
750
750
  }
751
- export function buildCollectorStartMessage(streams, streamsToBackfill = [], priorState) {
751
+ export function buildCollectorStartMessage(streams, streamsToBackfill = [], priorState, resources = {}) {
752
752
  const start = {
753
- scope: { streams: streams.map((name) => ({ name })) },
753
+ scope: {
754
+ streams: streams.map((name) => {
755
+ const streamResources = resources[name]?.filter((value) => typeof value === "string" && value.length > 0);
756
+ return streamResources && streamResources.length > 0 ? { name, resources: streamResources } : { name };
757
+ }),
758
+ },
754
759
  type: "START",
755
760
  };
756
761
  if (streamsToBackfill.length > 0) {
@@ -311,12 +311,12 @@ function makeEmitRecord(deps) {
311
311
  for (const [streamName, scope] of requested) {
312
312
  resFilters.set(streamName, resourceSet(scope));
313
313
  }
314
- const emitRecord = (stream, data) => {
314
+ const emitRecord = (stream, data, options = {}) => {
315
315
  if (data.id == null) {
316
316
  return Promise.resolve();
317
317
  }
318
318
  const rs = resFilters.get(stream);
319
- if (rs && !rs.has(String(data.id))) {
319
+ if (!options.skipResourceFilter && rs && !rs.has(String(data.id))) {
320
320
  return Promise.resolve();
321
321
  }
322
322
  if (isTombstone?.(stream, data)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdpp/local-collector",
3
- "version": "0.16.5",
3
+ "version": "0.16.7",
4
4
  "description": "Publishable local collector runtime for PDPP: filesystem-class connectors (Claude Code, Codex) plus the device-exporter ingest client.",
5
5
  "type": "module",
6
6
  "private": false,