@pdpp/local-collector 0.7.6 → 0.7.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.
@@ -99,10 +99,12 @@ Subcommands:
99
99
  [--queue <path>]
100
100
  [--connection-id <id>]
101
101
  [--source-instance-id <id>]
102
+ [--profile <name>] Optional profile name under the collector profile dir.
102
103
  doctor Print local durable outbox operator diagnostics as JSON.
103
104
  [--queue <path>]
104
105
  [--connection-id <id>]
105
106
  [--source-instance-id <id>]
107
+ [--profile <name>] Optional profile name under the collector profile dir.
106
108
  retry-dead-letters Requeue local dead-letter outbox rows.
107
109
  [--queue <path>]
108
110
  [--connection-id <id>]
@@ -162,9 +164,10 @@ async function main() {
162
164
  return;
163
165
  }
164
166
  if (options.command === "status" || options.command === "doctor") {
165
- const status = inspectLocalOutboxStatus(options);
167
+ const inspectOptions = resolveInspectionOptions(options);
168
+ const status = inspectLocalOutboxStatus(inspectOptions);
166
169
  if (options.command === "doctor") {
167
- const errorSummary = readLocalOutboxDeadLetterErrorSummary(options);
170
+ const errorSummary = readLocalOutboxDeadLetterErrorSummary(inspectOptions);
168
171
  process.stdout.write(`${JSON.stringify(buildLocalOutboxDoctor(status, errorSummary), null, 2)}\n`);
169
172
  return;
170
173
  }
@@ -667,6 +670,30 @@ function resolveRecoveryOptions(options) {
667
670
  profileSource: "configured_queue",
668
671
  };
669
672
  }
673
+ export function resolveInspectionOptions(options) {
674
+ const sourceInstanceId = options.sourceInstanceId?.trim();
675
+ if (!sourceInstanceId || options.explicitOptions?.has("--queue") === true) {
676
+ return options;
677
+ }
678
+ const lookup = findLocalCollectorProfiles({
679
+ profileName: options.profile ?? null,
680
+ sourceInstanceId,
681
+ });
682
+ if (lookup.matches.length > 1) {
683
+ throw new CollectorUsageError(`${options.command} found ${lookup.matches.length} local collector profiles for source_instance_id '${sourceInstanceId}'. ` +
684
+ "Pass --profile <name> to disambiguate.");
685
+ }
686
+ if (lookup.matches.length === 1) {
687
+ return applyProfileEnv(options, lookup.matches[0]);
688
+ }
689
+ const configuredQueue = options.queuePath !== DEFAULT_QUEUE_PATH || Boolean(process.env.PDPP_COLLECTOR_QUEUE?.trim());
690
+ if (!configuredQueue) {
691
+ throw new CollectorUsageError(`${options.command} could not find a local collector profile for source_instance_id '${sourceInstanceId}'. ` +
692
+ "Run this on the collector host after enrollment, pass --profile <name>, or set PDPP_COLLECTOR_QUEUE/--queue explicitly. " +
693
+ "Refusing to inspect the package default queue because it is often unrelated to the enrolled collector.");
694
+ }
695
+ return options;
696
+ }
670
697
  function hasDeadLetters(status) {
671
698
  return status.outbox.counts.dead_letter > 0;
672
699
  }
@@ -1,8 +1,8 @@
1
1
  const COLLECTOR_BUILD_SOURCE_SENTINEL = "source";
2
2
  const COLLECTOR_BUILD_INFO = {
3
- builtAt: "2026-06-17T16:03:49.097Z",
4
- revision: "0138c31864ab",
5
- version: "0.7.6",
3
+ builtAt: "2026-06-17T16:27:39.528Z",
4
+ revision: "6603ca9f72be",
5
+ version: "0.7.7",
6
6
  };
7
7
  function buildAgentVersion(info = COLLECTOR_BUILD_INFO) {
8
8
  return `${info.version}+${info.revision}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdpp/local-collector",
3
- "version": "0.7.6",
3
+ "version": "0.7.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,