agent-relay 11.1.1 → 11.3.0
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 +80 -0
- package/dist/cli/agent-relay-mcp.d.ts +1 -0
- package/dist/cli/agent-relay-mcp.d.ts.map +1 -1
- package/dist/cli/agent-relay-mcp.js +10 -3
- package/dist/cli/agent-relay-mcp.js.map +1 -1
- package/dist/cli/bootstrap.d.ts +14 -0
- package/dist/cli/bootstrap.d.ts.map +1 -1
- package/dist/cli/bootstrap.js +83 -7
- package/dist/cli/bootstrap.js.map +1 -1
- package/dist/cli/commands/agent.d.ts.map +1 -1
- package/dist/cli/commands/agent.js +12 -0
- package/dist/cli/commands/agent.js.map +1 -1
- package/dist/cli/commands/cloud-integration.d.ts +6 -0
- package/dist/cli/commands/cloud-integration.d.ts.map +1 -0
- package/dist/cli/commands/cloud-integration.js +282 -0
- package/dist/cli/commands/cloud-integration.js.map +1 -0
- package/dist/cli/commands/cloud-room.d.ts +11 -0
- package/dist/cli/commands/cloud-room.d.ts.map +1 -0
- package/dist/cli/commands/cloud-room.js +569 -0
- package/dist/cli/commands/cloud-room.js.map +1 -0
- package/dist/cli/commands/cloud.d.ts.map +1 -1
- package/dist/cli/commands/cloud.js +14 -3
- package/dist/cli/commands/cloud.js.map +1 -1
- package/dist/cli/commands/core.d.ts +2 -0
- package/dist/cli/commands/core.d.ts.map +1 -1
- package/dist/cli/commands/core.js +11 -5
- package/dist/cli/commands/core.js.map +1 -1
- package/dist/cli/commands/local-agent.d.ts.map +1 -1
- package/dist/cli/commands/local-agent.js +13 -1
- package/dist/cli/commands/local-agent.js.map +1 -1
- package/dist/cli/commands/node.js +4 -0
- package/dist/cli/commands/node.js.map +1 -1
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +9 -0
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/lib/attach-drive.d.ts +37 -18
- package/dist/cli/lib/attach-drive.d.ts.map +1 -1
- package/dist/cli/lib/attach-drive.js +178 -75
- package/dist/cli/lib/attach-drive.js.map +1 -1
- package/dist/cli/lib/attach-passthrough.d.ts +5 -0
- package/dist/cli/lib/attach-passthrough.d.ts.map +1 -1
- package/dist/cli/lib/attach-passthrough.js +108 -31
- package/dist/cli/lib/attach-passthrough.js.map +1 -1
- package/dist/cli/lib/attach-view.d.ts +2 -0
- package/dist/cli/lib/attach-view.d.ts.map +1 -1
- package/dist/cli/lib/attach-view.js +10 -0
- package/dist/cli/lib/attach-view.js.map +1 -1
- package/dist/cli/lib/attach.d.ts +127 -11
- package/dist/cli/lib/attach.d.ts.map +1 -1
- package/dist/cli/lib/attach.js +471 -31
- package/dist/cli/lib/attach.js.map +1 -1
- package/dist/cli/lib/broker-lifecycle.d.ts +3 -2
- package/dist/cli/lib/broker-lifecycle.d.ts.map +1 -1
- package/dist/cli/lib/broker-lifecycle.js +63 -5
- package/dist/cli/lib/broker-lifecycle.js.map +1 -1
- package/dist/cli/lib/sdk-client.d.ts.map +1 -1
- package/dist/cli/lib/sdk-client.js +10 -1
- package/dist/cli/lib/sdk-client.js.map +1 -1
- package/dist/cli/mcp/action-schema.d.ts +2 -2
- package/dist/cli/mcp/action-schema.d.ts.map +1 -1
- package/dist/cli/mcp/action-schema.js +1 -1
- package/dist/cli/mcp/action-schema.js.map +1 -1
- package/dist/cli/mcp/messaging-tools.js +5 -5
- package/dist/cli/mcp/messaging-tools.js.map +1 -1
- package/dist/cli/mcp/tool-results.d.ts +1 -1
- package/dist/cli/mcp/tool-results.d.ts.map +1 -1
- package/dist/cli/mcp/tool-results.js +1 -1
- package/dist/cli/mcp/tool-results.js.map +1 -1
- package/dist/cli/telemetry/client.d.ts +16 -0
- package/dist/cli/telemetry/client.d.ts.map +1 -1
- package/dist/cli/telemetry/client.js +122 -5
- package/dist/cli/telemetry/client.js.map +1 -1
- package/dist/cli/telemetry/config.d.ts +14 -1
- package/dist/cli/telemetry/config.d.ts.map +1 -1
- package/dist/cli/telemetry/config.js +10 -0
- package/dist/cli/telemetry/config.js.map +1 -1
- package/dist/cli/telemetry/events.d.ts +35 -0
- package/dist/cli/telemetry/events.d.ts.map +1 -1
- package/dist/cli/telemetry/index.d.ts +1 -1
- package/dist/cli/telemetry/index.d.ts.map +1 -1
- package/dist/cli/telemetry/index.js +1 -1
- package/dist/cli/telemetry/index.js.map +1 -1
- package/dist/cli/telemetry/posthog-config.d.ts +21 -15
- package/dist/cli/telemetry/posthog-config.d.ts.map +1 -1
- package/dist/cli/telemetry/posthog-config.js +32 -21
- package/dist/cli/telemetry/posthog-config.js.map +1 -1
- package/dist/cli/telemetry/posthog-key.d.ts +18 -0
- package/dist/cli/telemetry/posthog-key.d.ts.map +1 -0
- package/dist/cli/telemetry/posthog-key.js +18 -0
- package/dist/cli/telemetry/posthog-key.js.map +1 -0
- package/dist/index.cjs +3453 -32342
- package/package.json +11 -11
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* PostHog configuration.
|
|
3
3
|
*
|
|
4
|
-
* Environment variables (read at runtime):
|
|
5
|
-
* AGENT_RELAY_POSTHOG_KEY - PostHog write key. Set by published-artifact
|
|
6
|
-
* builds via GitHub Actions secret. When unset,
|
|
7
|
-
* telemetry runs as a no-op so forks, local dev,
|
|
8
|
-
* and CI test runs don't pollute the production
|
|
9
|
-
* project.
|
|
10
|
-
* POSTHOG_API_KEY - Per-process override (mainly for local
|
|
11
|
-
* debugging or staging). Wins over
|
|
12
|
-
* `AGENT_RELAY_POSTHOG_KEY` when set.
|
|
13
|
-
* POSTHOG_HOST - Override host URL. Defaults to the hosted
|
|
14
|
-
* Agent Relay ingestion proxy.
|
|
15
|
-
*
|
|
16
4
|
* Key selection order:
|
|
17
|
-
* 1. POSTHOG_API_KEY
|
|
18
|
-
*
|
|
19
|
-
*
|
|
5
|
+
* 1. `POSTHOG_API_KEY` — per-process override (local debugging,
|
|
6
|
+
* staging swaps). Wins everywhere.
|
|
7
|
+
* 2. `AGENT_RELAY_POSTHOG_KEY` — runtime env, and the name the bun standalone
|
|
8
|
+
* build substitutes via `--define`.
|
|
9
|
+
* 3. `BUILD_TIME_POSTHOG_KEY` — baked into the published npm tarball by
|
|
10
|
+
* `scripts/inject-posthog-key.mjs`.
|
|
11
|
+
* 4. None → returns `null` and `initTelemetry()` becomes a no-op, which is
|
|
12
|
+
* what forks, local dev, and CI runs get.
|
|
13
|
+
*
|
|
14
|
+
* `POSTHOG_HOST` overrides the ingestion host; it defaults to the hosted Agent
|
|
15
|
+
* Relay proxy.
|
|
16
|
+
*
|
|
17
|
+
* ## The env reads must stay literal
|
|
18
|
+
*
|
|
19
|
+
* These MUST remain static `process.env.NAME` member expressions. The bun
|
|
20
|
+
* `--define` used for the standalone binary performs a *syntactic* substitution
|
|
21
|
+
* of exactly `process.env.AGENT_RELAY_POSTHOG_KEY`; a computed lookup such as
|
|
22
|
+
* `process.env[name]` is a different expression and is silently left alone. An
|
|
23
|
+
* earlier `readKey(name: string)` helper did exactly that, so every standalone
|
|
24
|
+
* binary shipped with telemetry permanently disabled even though the define was
|
|
25
|
+
* present in the release workflow. Do not refactor these back behind a variable.
|
|
20
26
|
*/
|
|
21
27
|
export declare function getPostHogConfig(): {
|
|
22
28
|
apiKey: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"posthog-config.d.ts","sourceRoot":"","sources":["../../../src/cli/telemetry/posthog-config.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"posthog-config.d.ts","sourceRoot":"","sources":["../../../src/cli/telemetry/posthog-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAYH,wBAAgB,gBAAgB,IAAI;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAuB1E"}
|
|
@@ -1,26 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* PostHog configuration.
|
|
3
3
|
*
|
|
4
|
-
* Environment variables (read at runtime):
|
|
5
|
-
* AGENT_RELAY_POSTHOG_KEY - PostHog write key. Set by published-artifact
|
|
6
|
-
* builds via GitHub Actions secret. When unset,
|
|
7
|
-
* telemetry runs as a no-op so forks, local dev,
|
|
8
|
-
* and CI test runs don't pollute the production
|
|
9
|
-
* project.
|
|
10
|
-
* POSTHOG_API_KEY - Per-process override (mainly for local
|
|
11
|
-
* debugging or staging). Wins over
|
|
12
|
-
* `AGENT_RELAY_POSTHOG_KEY` when set.
|
|
13
|
-
* POSTHOG_HOST - Override host URL. Defaults to the hosted
|
|
14
|
-
* Agent Relay ingestion proxy.
|
|
15
|
-
*
|
|
16
4
|
* Key selection order:
|
|
17
|
-
* 1. POSTHOG_API_KEY
|
|
18
|
-
*
|
|
19
|
-
*
|
|
5
|
+
* 1. `POSTHOG_API_KEY` — per-process override (local debugging,
|
|
6
|
+
* staging swaps). Wins everywhere.
|
|
7
|
+
* 2. `AGENT_RELAY_POSTHOG_KEY` — runtime env, and the name the bun standalone
|
|
8
|
+
* build substitutes via `--define`.
|
|
9
|
+
* 3. `BUILD_TIME_POSTHOG_KEY` — baked into the published npm tarball by
|
|
10
|
+
* `scripts/inject-posthog-key.mjs`.
|
|
11
|
+
* 4. None → returns `null` and `initTelemetry()` becomes a no-op, which is
|
|
12
|
+
* what forks, local dev, and CI runs get.
|
|
13
|
+
*
|
|
14
|
+
* `POSTHOG_HOST` overrides the ingestion host; it defaults to the hosted Agent
|
|
15
|
+
* Relay proxy.
|
|
16
|
+
*
|
|
17
|
+
* ## The env reads must stay literal
|
|
18
|
+
*
|
|
19
|
+
* These MUST remain static `process.env.NAME` member expressions. The bun
|
|
20
|
+
* `--define` used for the standalone binary performs a *syntactic* substitution
|
|
21
|
+
* of exactly `process.env.AGENT_RELAY_POSTHOG_KEY`; a computed lookup such as
|
|
22
|
+
* `process.env[name]` is a different expression and is silently left alone. An
|
|
23
|
+
* earlier `readKey(name: string)` helper did exactly that, so every standalone
|
|
24
|
+
* binary shipped with telemetry permanently disabled even though the define was
|
|
25
|
+
* present in the release workflow. Do not refactor these back behind a variable.
|
|
20
26
|
*/
|
|
27
|
+
import { BUILD_TIME_POSTHOG_KEY } from './posthog-key.js';
|
|
21
28
|
const HOST = 'https://i.agentrelay.com';
|
|
22
|
-
function
|
|
23
|
-
const raw = process.env[name];
|
|
29
|
+
function nonEmpty(raw) {
|
|
24
30
|
if (!raw)
|
|
25
31
|
return null;
|
|
26
32
|
const trimmed = raw.trim();
|
|
@@ -29,13 +35,18 @@ function readKey(name) {
|
|
|
29
35
|
export function getPostHogConfig() {
|
|
30
36
|
const host = process.env.POSTHOG_HOST || HOST;
|
|
31
37
|
// Process-level override wins for local debugging / staging swaps.
|
|
32
|
-
const override =
|
|
38
|
+
const override = nonEmpty(process.env.POSTHOG_API_KEY);
|
|
33
39
|
if (override) {
|
|
34
40
|
return { apiKey: override, host };
|
|
35
41
|
}
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
const
|
|
42
|
+
// Runtime env, and the bun standalone's `--define` target. Literal access —
|
|
43
|
+
// see the module comment.
|
|
44
|
+
const injected = nonEmpty(process.env.AGENT_RELAY_POSTHOG_KEY);
|
|
45
|
+
if (injected) {
|
|
46
|
+
return { apiKey: injected, host };
|
|
47
|
+
}
|
|
48
|
+
// Baked into the published npm artifact at release time.
|
|
49
|
+
const baked = nonEmpty(BUILD_TIME_POSTHOG_KEY);
|
|
39
50
|
if (baked) {
|
|
40
51
|
return { apiKey: baked, host };
|
|
41
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"posthog-config.js","sourceRoot":"","sources":["../../../src/cli/telemetry/posthog-config.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"posthog-config.js","sourceRoot":"","sources":["../../../src/cli/telemetry/posthog-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,MAAM,IAAI,GAAG,0BAA0B,CAAC;AAExC,SAAS,QAAQ,CAAC,GAAuB;IACvC,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IAC3B,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,IAAI,CAAC;IAE9C,mEAAmE;IACnE,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACvD,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACpC,CAAC;IAED,4EAA4E;IAC5E,0BAA0B;IAC1B,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;IAC/D,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACpC,CAAC;IAED,yDAAyD;IACzD,MAAM,KAAK,GAAG,QAAQ,CAAC,sBAAsB,CAAC,CAAC;IAC/C,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACjC,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build-time PostHog write key.
|
|
3
|
+
*
|
|
4
|
+
* The published npm package is plain `tsc` output — there is no bundler step
|
|
5
|
+
* that could inline an env var, and `npm publish --ignore-scripts` rules out a
|
|
6
|
+
* prepublish hook. So the release pipeline rewrites the *compiled* form of this
|
|
7
|
+
* module (`scripts/inject-posthog-key.mjs`) after `npm run build`, and the value
|
|
8
|
+
* ships inside the tarball.
|
|
9
|
+
*
|
|
10
|
+
* The key is a PostHog project ingest key: write-only and public by design, the
|
|
11
|
+
* same category as a Sentry DSN. The Rust broker already ships one via
|
|
12
|
+
* `option_env!`; this is the TypeScript equivalent.
|
|
13
|
+
*
|
|
14
|
+
* Empty here is the correct default — forks, local dev, and CI builds that never
|
|
15
|
+
* run the injection step ship with telemetry disabled.
|
|
16
|
+
*/
|
|
17
|
+
export declare const BUILD_TIME_POSTHOG_KEY = "";
|
|
18
|
+
//# sourceMappingURL=posthog-key.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posthog-key.d.ts","sourceRoot":"","sources":["../../../src/cli/telemetry/posthog-key.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,sBAAsB,KAAK,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build-time PostHog write key.
|
|
3
|
+
*
|
|
4
|
+
* The published npm package is plain `tsc` output — there is no bundler step
|
|
5
|
+
* that could inline an env var, and `npm publish --ignore-scripts` rules out a
|
|
6
|
+
* prepublish hook. So the release pipeline rewrites the *compiled* form of this
|
|
7
|
+
* module (`scripts/inject-posthog-key.mjs`) after `npm run build`, and the value
|
|
8
|
+
* ships inside the tarball.
|
|
9
|
+
*
|
|
10
|
+
* The key is a PostHog project ingest key: write-only and public by design, the
|
|
11
|
+
* same category as a Sentry DSN. The Rust broker already ships one via
|
|
12
|
+
* `option_env!`; this is the TypeScript equivalent.
|
|
13
|
+
*
|
|
14
|
+
* Empty here is the correct default — forks, local dev, and CI builds that never
|
|
15
|
+
* run the injection step ship with telemetry disabled.
|
|
16
|
+
*/
|
|
17
|
+
export const BUILD_TIME_POSTHOG_KEY = 'phc_2uDu01GtnLABJpVkWw4ri1OgScLU90aEmXmDjufGdqr';
|
|
18
|
+
//# sourceMappingURL=posthog-key.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posthog-key.js","sourceRoot":"","sources":["../../../src/cli/telemetry/posthog-key.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC"}
|