@o11y-one/sdk 0.0.0 → 0.1.1

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
@@ -16,7 +16,7 @@ import { O11yClient, classify } from "@o11y-one/sdk";
16
16
  import { AgenticEvaluationService } from "@o11y-one/api-agentic/o11y_one/agentic/v1/evaluation_pb";
17
17
 
18
18
  const o11y = new O11yClient({
19
- baseUrl: "https://api.o11y.one",
19
+ baseUrl: "https://grpc.o11y.one",
20
20
  credential: process.env.O11Y_API_KEY, // o11y_mach.<selector>.<secret>
21
21
  orgId: process.env.O11Y_ORG_ID,
22
22
  });
@@ -76,9 +76,11 @@ JWT and a machine credential presented there is rejected.
76
76
 
77
77
  ## Runtime support
78
78
 
79
- The default transport is Connect over HTTP via `@connectrpc/connect-web`, which
80
- needs only a spec-compatible `fetch`. That covers browsers, Node 26, Deno, Bun
81
- and Cloudflare Workers. `@connectrpc/connect-node` is a dependency for callers
82
- who want the Node-specific HTTP/2 transport and construct it themselves; pass
83
- the resulting transport's options through `ClientOptions` or build your own
84
- transport and install `credentialInterceptor()` on it.
79
+ The default transport is gRPC-web via `@connectrpc/connect-web`, which needs
80
+ only a spec-compatible `fetch`. That covers browsers, Node 26, Deno, Bun and
81
+ Cloudflare Workers. `@connectrpc/connect-node` is a dependency for callers who
82
+ want the Node-specific HTTP/2 transport and construct it themselves; pass the
83
+ resulting transport's options through `ClientOptions` or build your own
84
+ transport and install `credentialInterceptor()` on it. The API serves gRPC and
85
+ gRPC-web only, so a transport you build must speak one of those, not the
86
+ Connect protocol.
package/dist/client.d.ts CHANGED
@@ -9,11 +9,11 @@
9
9
  * rot the first time a field is added upstream.
10
10
  */
11
11
  import { type Client, type Interceptor, type Transport } from "@connectrpc/connect";
12
- import { type ConnectTransportOptions } from "@connectrpc/connect-web";
12
+ import { type GrpcWebTransportOptions } from "@connectrpc/connect-web";
13
13
  import type { DescService } from "@bufbuild/protobuf";
14
14
  export interface ClientOptions {
15
15
  /**
16
- * Base URL of the O11y One Connect endpoint, e.g. `https://api.o11y.one`.
16
+ * Base URL of the O11y One gRPC endpoint, e.g. `https://grpc.o11y.one`.
17
17
  * No trailing path — connect-es appends `/<package>.<Service>/<Method>`.
18
18
  */
19
19
  baseUrl: string;
@@ -39,7 +39,7 @@ export interface ClientOptions {
39
39
  * `typeof globalThis.fetch`, which would force the DOM lib into this package's
40
40
  * compilation for the sake of one type and drag every DOM global in with it.
41
41
  */
42
- fetch?: ConnectTransportOptions["fetch"];
42
+ fetch?: GrpcWebTransportOptions["fetch"];
43
43
  }
44
44
  /**
45
45
  * An interceptor that stamps the credential and scoping headers onto every
@@ -70,14 +70,16 @@ export declare function credentialInterceptor(options: {
70
70
  tenantId?: string;
71
71
  }): Interceptor;
72
72
  /**
73
- * Build a Connect transport with the credential interceptor installed.
73
+ * Build a gRPC-web transport with the credential interceptor installed.
74
74
  *
75
- * Protocol note: Connect over HTTP, not gRPC. It is the protocol o11y-web
76
- * already speaks and the one that survives proxies and CI egress rules without
77
- * HTTP/2 prior knowledge. `createConnectTransport` from `@connectrpc/connect-web`
78
- * works in browsers, in Node 26 (whose global fetch is sufficient), and in
79
- * Workers; `@connectrpc/connect-node` is a dependency only for callers who need
80
- * the Node-specific HTTP/2 transport and reach for it themselves.
75
+ * Protocol note: gRPC-web, not Connect. The API serves gRPC and gRPC-web and
76
+ * does not speak the Connect protocol; gRPC-web is the one of the two that
77
+ * needs no HTTP/2 prior knowledge, so it survives proxies and CI egress rules,
78
+ * and it is what o11y-web speaks. `createGrpcWebTransport` from
79
+ * `@connectrpc/connect-web` works in browsers, in Node 26 (whose global fetch
80
+ * is sufficient), and in Workers; `@connectrpc/connect-node` is a dependency
81
+ * only for callers who need the Node-specific HTTP/2 transport and reach for it
82
+ * themselves.
81
83
  */
82
84
  export declare function createTransport(options: ClientOptions): Transport;
83
85
  /**
package/dist/client.js CHANGED
@@ -9,7 +9,7 @@
9
9
  * rot the first time a field is added upstream.
10
10
  */
11
11
  import { createClient } from "@connectrpc/connect";
12
- import { createConnectTransport, } from "@connectrpc/connect-web";
12
+ import { createGrpcWebTransport, } from "@connectrpc/connect-web";
13
13
  import { assertLooksLikeMachineCredential, CREDENTIAL_HEADER, ORG_ID_HEADER, TENANT_ID_HEADER, } from "./auth.js";
14
14
  /**
15
15
  * An interceptor that stamps the credential and scoping headers onto every
@@ -52,17 +52,19 @@ export function credentialInterceptor(options) {
52
52
  };
53
53
  }
54
54
  /**
55
- * Build a Connect transport with the credential interceptor installed.
55
+ * Build a gRPC-web transport with the credential interceptor installed.
56
56
  *
57
- * Protocol note: Connect over HTTP, not gRPC. It is the protocol o11y-web
58
- * already speaks and the one that survives proxies and CI egress rules without
59
- * HTTP/2 prior knowledge. `createConnectTransport` from `@connectrpc/connect-web`
60
- * works in browsers, in Node 26 (whose global fetch is sufficient), and in
61
- * Workers; `@connectrpc/connect-node` is a dependency only for callers who need
62
- * the Node-specific HTTP/2 transport and reach for it themselves.
57
+ * Protocol note: gRPC-web, not Connect. The API serves gRPC and gRPC-web and
58
+ * does not speak the Connect protocol; gRPC-web is the one of the two that
59
+ * needs no HTTP/2 prior knowledge, so it survives proxies and CI egress rules,
60
+ * and it is what o11y-web speaks. `createGrpcWebTransport` from
61
+ * `@connectrpc/connect-web` works in browsers, in Node 26 (whose global fetch
62
+ * is sufficient), and in Workers; `@connectrpc/connect-node` is a dependency
63
+ * only for callers who need the Node-specific HTTP/2 transport and reach for it
64
+ * themselves.
63
65
  */
64
66
  export function createTransport(options) {
65
- return createConnectTransport({
67
+ return createGrpcWebTransport({
66
68
  baseUrl: options.baseUrl,
67
69
  // Binary wire format: smaller, and it round-trips proto3 field presence
68
70
  // without the JSON mapping's ambiguities.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o11y-one/sdk",
3
- "version": "0.0.0",
3
+ "version": "0.1.1",
4
4
  "description": "Hand-written client wrapper over @o11y-one/api-agentic: transport construction, credential injection, and the O11y One error taxonomy.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -19,7 +19,7 @@
19
19
  "@connectrpc/connect": "^2.2.0",
20
20
  "@connectrpc/connect-node": "^2.2.0",
21
21
  "@connectrpc/connect-web": "^2.2.0",
22
- "@o11y-one/api-agentic": "0.0.0"
22
+ "@o11y-one/api-agentic": "0.1.1"
23
23
  },
24
24
  "devDependencies": {
25
25
  "typescript": "^7.0.2"