@pdpp/local-collector 0.1.0-beta.4 → 0.1.0-beta.6

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/README.md CHANGED
@@ -7,6 +7,13 @@ ships only the local collector runner, the device-exporter client, and bundled
7
7
  Claude Code / Codex connector entrypoints. Browser/Patchright-backed connectors
8
8
  stay out of this package until each has its own publishability review.
9
9
 
10
+ For filesystem-class collectors, the local device or host supervisor decides
11
+ when the process runs. The reference server owns enrollment, ingestion, state,
12
+ health diagnostics, and optional desired-freshness/request-run signals, but it
13
+ does not start local processes. `PDPP_CONNECTION_ID` is the stable
14
+ connection/source identity for a specific device/account/home binding; the
15
+ enrollment response currently names that value `source_instance_id`.
16
+
10
17
  ## Usage
11
18
 
12
19
  ```bash
@@ -1,14 +1,44 @@
1
1
  #!/usr/bin/env node
2
- import { existsSync } from "node:fs";
2
+ import { existsSync, readFileSync } from "node:fs";
3
3
  import { basename, dirname, extname, join } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import { ALLOW_CUSTOM_COMMAND_ENV, CollectorCustomCommandRefusedError, CollectorUsageError, } from "../src/errors.js";
6
6
  import { BUNDLED_CONNECTOR_IDS, COLLECTOR_PROTOCOL_VERSION, COLLECTOR_RUNTIME_CAPABILITIES, LocalDeviceOutbox, enrollCollector, getBundledConnector, isMainModule, runCollectorConnector, } from "../src/runner.js";
7
7
  const DEFAULT_QUEUE_PATH = join(dirname(fileURLToPath(import.meta.url)), "..", ".pdpp-data", "collector-runner-queue.json");
8
8
  const LOCAL_COLLECTOR_PACKAGE_NAME = "@pdpp/local-collector";
9
- const LOCAL_COLLECTOR_PACKAGE_VERSION = "0.0.0";
9
+ const LOCAL_COLLECTOR_PACKAGE_VERSION_FALLBACK = "0.0.0";
10
+ export function resolveLocalCollectorPackageVersion(startUrl = import.meta.url) {
11
+ let current = typeof startUrl === "string" && !startUrl.startsWith("file:")
12
+ ? dirname(startUrl)
13
+ : dirname(fileURLToPath(startUrl));
14
+ for (;;) {
15
+ const manifestPath = join(current, "package.json");
16
+ if (existsSync(manifestPath)) {
17
+ try {
18
+ const manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
19
+ if (manifest.name === LOCAL_COLLECTOR_PACKAGE_NAME &&
20
+ typeof manifest.version === "string" &&
21
+ manifest.version) {
22
+ return manifest.version;
23
+ }
24
+ }
25
+ catch {
26
+ }
27
+ }
28
+ const parent = dirname(current);
29
+ if (parent === current) {
30
+ return LOCAL_COLLECTOR_PACKAGE_VERSION_FALLBACK;
31
+ }
32
+ current = parent;
33
+ }
34
+ }
10
35
  const HELP_TEXT = `pdpp-local-collector — PDPP local collector runner.
11
36
 
37
+ Ownership: the local device/host supervisor decides when filesystem-class
38
+ collectors run. The reference server owns enrollment, ingestion, state, health
39
+ diagnostics, and optional desired-freshness/request-run signals; it does not
40
+ start local processes.
41
+
12
42
  Subcommands:
13
43
  advertise Print runtime capabilities and protocol version.
14
44
  status Print local durable outbox health as JSON.
@@ -30,6 +60,8 @@ Subcommands:
30
60
  [--run-id <id>]
31
61
 
32
62
  Public connectors: ${BUNDLED_CONNECTOR_IDS.join(", ")}.
63
+ Connection id is the stable source identity for one device/account/home binding;
64
+ enrollment responses currently return it as source_instance_id.
33
65
  Browser-bound connectors stay in the monorepo until each has its own
34
66
  publishability review.
35
67
 
@@ -146,9 +178,10 @@ export function inspectLocalOutboxStatus(options) {
146
178
  },
147
179
  package: {
148
180
  name: LOCAL_COLLECTOR_PACKAGE_NAME,
149
- version: LOCAL_COLLECTOR_PACKAGE_VERSION,
181
+ version: resolveLocalCollectorPackageVersion(),
150
182
  },
151
183
  source: {
184
+ connection_id: options.sourceInstanceId ?? null,
152
185
  source_instance_id: options.sourceInstanceId ?? null,
153
186
  },
154
187
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdpp/local-collector",
3
- "version": "0.1.0-beta.4",
3
+ "version": "0.1.0-beta.6",
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,