@introspection-sdk/introspection-browser 0.31.0 → 0.35.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 CHANGED
@@ -59,7 +59,7 @@ customer web origins.
59
59
  Plane URL, so the SPA needs no Introspection config of its own.
60
60
  2. `client.connect()` redeems the token at the **Data Plane**
61
61
  `POST /v1/oauth/exchange` for an HttpOnly session cookie, named for the
62
- token's environment lane (see [Environments](#environments)).
62
+ token's environment lane and project (see [Environments](#environments)).
63
63
  3. `client.tasks.start({ runtime_id })` and friends ride that cookie against
64
64
  the Data Plane for tasks, files, conversations, and shares.
65
65
 
@@ -78,7 +78,7 @@ const client = new IntrospectionApiClient({
78
78
  getToken: () => token,
79
79
  });
80
80
 
81
- await client.connect(); // -> intro_dp_<environment> session cookie
81
+ await client.connect(); // -> intro_dp_<lane>_<project> session cookie
82
82
 
83
83
  const run = await client.tasks.start({
84
84
  prompt: "Summarize my latest order",
@@ -105,17 +105,21 @@ named recipe agent instead.
105
105
 
106
106
  ### Environments
107
107
 
108
- The session cookie is named for its environment lane —
109
- `intro_dp_development`, `intro_dp_staging`, `intro_dp_production` — so an app
110
- running more than one lane holds a live session for **each** in one browser. A
111
- single shared name gave the browser one slot, so a second `connect()` evicted
112
- the first.
113
-
114
- **You never pass the environment in.** Your backend picks the lane when it
115
- mints the token; the Data Plane reads it off the token's claim and returns it,
116
- and the client sends it back as the `lane` query parameter so the right cookie
117
- is resolved. A query parameter, not a header, so requests stay CORS-simple and
118
- skip the preflight a custom header forces on every call:
108
+ The session cookie is a signed `browser_session` JWT named for its environment
109
+ lane **and** project — `intro_dp_{lane}_{base64url(project_uuid_bytes)}`, e.g.
110
+ `intro_dp_production_AZLVpGw-ehCAAAAAAAAAAQ` — so an app running more than one
111
+ lane or project holds a live session for **each** in one browser. A single
112
+ shared name gave the browser one slot, so a second `connect()` evicted the
113
+ first.
114
+
115
+ **You never pass the environment or project in.** Your backend picks them when
116
+ it mints the token; the Data Plane reads them off the token's claims and
117
+ returns them, and the client sends them back as the `lane` and `project_id`
118
+ query parameters so the right cookie is resolved. Both are selectors, not
119
+ credentials: the cookie's own signed lane and project are checked against
120
+ them, so naming one this browser holds no cookie for grants nothing. Query
121
+ parameters, not headers, so requests stay CORS-simple and skip the preflight a
122
+ custom header forces on every call:
119
123
 
120
124
  ```typescript
121
125
  const dev = new IntrospectionApiClient({
@@ -129,11 +133,12 @@ const prod = new IntrospectionApiClient({
129
133
 
130
134
  await Promise.all([dev.connect(), prod.connect()]);
131
135
 
132
- dev.environment; // "development" -> cookie intro_dp_development
133
- prod.environment; // "production" -> cookie intro_dp_production
136
+ dev.environment; // "development" -> cookie intro_dp_development_<project>
137
+ prod.environment; // "production" -> cookie intro_dp_production_<project>
138
+ dev.projectId; // the project the token was minted for
134
139
 
135
- await dev.tasks.list(); // GET /v1/tasks?lane=development
136
- await prod.tasks.list(); // GET /v1/tasks?lane=production
140
+ await dev.tasks.list(); // GET /v1/tasks?lane=development&project_id=<uuid>
141
+ await prod.tasks.list(); // GET /v1/tasks?lane=production&project_id=<uuid>
137
142
  ```
138
143
 
139
144
  `client.environment` is `undefined` until `connect()` resolves. The optional
@@ -141,10 +146,16 @@ await prod.tasks.list(); // GET /v1/tasks?lane=production
141
146
  if it disagrees with the token, `connect()` throws rather than silently
142
147
  preferring one — the token is the authority.
143
148
 
144
- > **Requires a Data Plane that returns `environment` from
145
- > `/v1/oauth/exchange`.** Against an older deployment `client.environment`
146
- > stays `undefined`, no header is sent, and a single-lane app keeps working
147
- > unchanged.
149
+ Without `project_id` the Data Plane picks the lane's most recently issued
150
+ cookie, so a page that connected to two projects on one lane would silently
151
+ read whichever exchanged last; sending it is what keeps two clients on one lane
152
+ apart.
153
+
154
+ > **Requires a Data Plane that returns `environment` and `project_id` from
155
+ > `/v1/oauth/exchange`.** Against an older deployment that omits `project_id`,
156
+ > `client.projectId` stays `undefined` and only `lane` is sent; one that also
157
+ > omits `environment` leaves `client.environment` `undefined` and sends
158
+ > neither, so a single-lane app keeps working unchanged.
148
159
 
149
160
  ## Files and conversations
150
161
 
@@ -14,10 +14,12 @@
14
14
  * is needed, resolves its `runtime_id` server-side. The SPA fetches
15
15
  * the token through the `getToken` callback.
16
16
  * 2. `connect()` redeems the token at the DP `POST /v1/oauth/exchange`
17
- * for an HttpOnly session cookie, named for the token's environment lane
18
- * (`intro_dp_development` / `intro_dp_staging` / `intro_dp_production`).
19
- * Distinct names mean an app running several lanes holds a live session
20
- * for each in one browser instead of the newest evicting the last.
17
+ * for an HttpOnly session cookie named for the token's environment lane
18
+ * and project (`intro_dp_{lane}_{base64url(project_uuid_bytes)}`).
19
+ * Distinct names mean an app running several lanes or projects holds a
20
+ * live session for each in one browser instead of the newest evicting
21
+ * the last. Every request names the lane and project it means in the
22
+ * `?lane=` / `?project_id=` query — selectors, not credentials.
21
23
  * 3. Every subsequent call rides that cookie (`credentials: "include"`)
22
24
  * — `client.tasks.start({ runtime_id })`, `.get(...)`, run streaming,
23
25
  * etc.
@@ -71,6 +73,8 @@ export declare class IntrospectionApiClient {
71
73
  * scope — two clients on one page holding different lanes is the point.
72
74
  */
73
75
  private resolvedEnvironment?;
76
+ /** Project established by the most recent exchange; per instance likewise. */
77
+ private resolvedProjectId?;
74
78
  /** The exchange currently in flight, shared by every concurrent 401. */
75
79
  private inFlightExchange?;
76
80
  constructor(opts: IntrospectionApiClientOptions);
@@ -90,6 +94,12 @@ export declare class IntrospectionApiClient {
90
94
  * was given one.
91
95
  */
92
96
  get environment(): Environment | undefined;
97
+ /**
98
+ * Project this client is connected to, once `connect()` has resolved.
99
+ * `undefined` before the first exchange, or against a DP that does not
100
+ * return `project_id`, in which case requests name only the lane.
101
+ */
102
+ get projectId(): string | undefined;
93
103
  /**
94
104
  * Mint a token via `getToken` and redeem it at the DP for the session
95
105
  * cookie. Call once before issuing task requests.
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"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4E;IAC5E,IAAI,aAAa,IAAI,mBAAmB,CAEvC;IAED,+DAA+D;IAC/D,IAAI,MAAM,IAAI,YAAY,CAEzB;IAED,mEAAmE;IACnE,IAAI,WAAW,IAAI,iBAAiB,CAEnC;IAED;;;;OAIG;IACH,IAAI,WAAW,IAAI,WAAW,GAAG,SAAS,CAEzC;IAED;;;;OAIG;IACH,IAAI,SAAS,IAAI,MAAM,GAAG,SAAS,CAElC;IAED;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;YAIhB,QAAQ;IAwCtB;;;;;;;OAOG;YACW,UAAU;CASzB"}
@@ -14,10 +14,12 @@
14
14
  * is needed, resolves its `runtime_id` server-side. The SPA fetches
15
15
  * the token through the `getToken` callback.
16
16
  * 2. `connect()` redeems the token at the DP `POST /v1/oauth/exchange`
17
- * for an HttpOnly session cookie, named for the token's environment lane
18
- * (`intro_dp_development` / `intro_dp_staging` / `intro_dp_production`).
19
- * Distinct names mean an app running several lanes holds a live session
20
- * for each in one browser instead of the newest evicting the last.
17
+ * for an HttpOnly session cookie named for the token's environment lane
18
+ * and project (`intro_dp_{lane}_{base64url(project_uuid_bytes)}`).
19
+ * Distinct names mean an app running several lanes or projects holds a
20
+ * live session for each in one browser instead of the newest evicting
21
+ * the last. Every request names the lane and project it means in the
22
+ * `?lane=` / `?project_id=` query — selectors, not credentials.
21
23
  * 3. Every subsequent call rides that cookie (`credentials: "include"`)
22
24
  * — `client.tasks.start({ runtime_id })`, `.get(...)`, run streaming,
23
25
  * etc.
@@ -39,6 +41,8 @@ export class IntrospectionApiClient {
39
41
  * scope — two clients on one page holding different lanes is the point.
40
42
  */
41
43
  resolvedEnvironment;
44
+ /** Project established by the most recent exchange; per instance likewise. */
45
+ resolvedProjectId;
42
46
  /** The exchange currently in flight, shared by every concurrent 401. */
43
47
  inFlightExchange;
44
48
  constructor(opts) {
@@ -58,6 +62,7 @@ export class IntrospectionApiClient {
58
62
  fetch: this.fetchImpl,
59
63
  onUnauthorized: () => this.reexchange(),
60
64
  environment: () => this.resolvedEnvironment,
65
+ projectId: () => this.resolvedProjectId,
61
66
  });
62
67
  this.cookieClients = {
63
68
  tasks: new TasksClient(http),
@@ -95,6 +100,14 @@ export class IntrospectionApiClient {
95
100
  get environment() {
96
101
  return this.resolvedEnvironment;
97
102
  }
103
+ /**
104
+ * Project this client is connected to, once `connect()` has resolved.
105
+ * `undefined` before the first exchange, or against a DP that does not
106
+ * return `project_id`, in which case requests name only the lane.
107
+ */
108
+ get projectId() {
109
+ return this.resolvedProjectId;
110
+ }
98
111
  /**
99
112
  * Mint a token via `getToken` and redeem it at the DP for the session
100
113
  * cookie. Call once before issuing task requests.
@@ -128,6 +141,10 @@ export class IntrospectionApiClient {
128
141
  }
129
142
  this.resolvedEnvironment = body.environment;
130
143
  }
144
+ // Overwritten, not kept, when absent: naming a project whose cookie this
145
+ // exchange did not establish would be a 401/409, while omitting it falls
146
+ // back to the lane's newest cookie, which is the one just issued.
147
+ this.resolvedProjectId = body.project_id || undefined;
131
148
  }
132
149
  /**
133
150
  * 401 recovery: re-exchange, reporting success so the call can retry.
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,YAAY,GACb,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AA4CzC,MAAM,OAAO,sBAAsB;IAWJ;IAVZ,SAAS,CAAe;IACxB,aAAa,CAAgB;IAC9C;;;OAGG;IACK,mBAAmB,CAAe;IAC1C,wEAAwE;IAChE,gBAAgB,CAAoB;IAE5C,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CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC;gBACxE,MAAM,IAAI,KAAK,CACb,uDAAuD;oBACrD,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,wCAAwC;oBACjE,IAAI,IAAI,CAAC,WAAW,IAAI,CAC3B,CAAC;YACJ,CAAC;YACD,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,WAAW,CAAC;QAC9C,CAAC;QACD,yEAAyE;QACzE,yEAAyE;QACzE,kEAAkE;QAClE,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,UAAU,IAAI,SAAS,CAAC;IACxD,CAAC;IAED;;;;;;;OAOG;IACK,KAAK,CAAC,UAAU;QACtB,IAAI,CAAC,gBAAgB,KAAK,IAAI,CAAC,QAAQ,EAAE;aACtC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;aAChB,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC;aAClB,OAAO,CAAC,GAAG,EAAE;YACZ,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;QACpC,CAAC,CAAC,CAAC;QACL,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;CACF"}
@@ -10,13 +10,15 @@
10
10
  * credential ever lives in JavaScript. A 401 (expired session cookie)
11
11
  * triggers a single `onUnauthorized` refresh + retry.
12
12
  *
13
- * The session cookie is named for its environment lane
14
- * (`intro_dp_development` / `intro_dp_staging` / `intro_dp_production`), so an
15
- * app running several lanes holds a live session for each in one browser. When
16
- * more than one is present the DP cannot tell which a request means, so we name
17
- * it in the {@link LANE_QUERY_PARAM} query parameter. A query parameter rather
18
- * than a header because a custom header makes every cross-origin request pay a
19
- * CORS preflight.
13
+ * The session cookie is a CP-signed `browser_session` JWT named per lane and
14
+ * project — `intro_dp_{lane}_{base64url(project_uuid_bytes)}`, e.g.
15
+ * `intro_dp_production_AZLVpGw-ehCAAAAAAAAAAQ` — so one browser holds a live
16
+ * session for each lane and project it connected to. When more than one is
17
+ * present the DP cannot tell which a request means, so we name it in the
18
+ * {@link LANE_QUERY_PARAM} and {@link PROJECT_ID_QUERY_PARAM} query parameters;
19
+ * with only the lane, the DP falls back to that lane's most recently issued
20
+ * cookie. Query parameters rather than headers because a custom header makes
21
+ * every cross-origin request pay a CORS preflight.
20
22
  */
21
23
  import { BaseHttpClient, stripTrailingSlash, toApiError } from "@introspection-sdk/http";
22
24
  import type { Environment } from "@introspection-sdk/types";
@@ -30,6 +32,15 @@ export { stripTrailingSlash, toApiError };
30
32
  * nothing rather than granting anything.
31
33
  */
32
34
  export declare const LANE_QUERY_PARAM = "lane";
35
+ /**
36
+ * Query parameter naming which project's session cookie, within the lane, the
37
+ * DP should resolve.
38
+ *
39
+ * A selector, not a credential: the cookie's own signed project is checked
40
+ * against it server-side, so naming a project this browser holds no cookie for
41
+ * is a 401 rather than access to that project.
42
+ */
43
+ export declare const PROJECT_ID_QUERY_PARAM = "project_id";
33
44
  /**
34
45
  * Header form of the lane selector, which the DP still accepts.
35
46
  *
@@ -58,6 +69,12 @@ export interface BrowserHttpConfig {
58
69
  * re-exchange.
59
70
  */
60
71
  environment?: () => Environment | undefined;
72
+ /**
73
+ * Reads the project established by the most recent exchange, read per
74
+ * request for the same reason as {@link environment}. `undefined` against a
75
+ * DP that does not return one, in which case only the lane is sent.
76
+ */
77
+ projectId?: () => string | undefined;
61
78
  }
62
79
  /**
63
80
  * Cookie-authenticated HTTP wrapper bound to one DP endpoint. Has no
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/api/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,UAAU,EACX,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAK5D,OAAO,EAAE,kBA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C3D,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACxC;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,WAAW,GAAG,SAAS,CAAC;IAC5C;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;CACtC;AAED;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,cAAc;gBACvC,GAAG,EAAE,iBAAiB;CAuBnC"}
package/dist/api/http.js CHANGED
@@ -10,13 +10,15 @@
10
10
  * credential ever lives in JavaScript. A 401 (expired session cookie)
11
11
  * triggers a single `onUnauthorized` refresh + retry.
12
12
  *
13
- * The session cookie is named for its environment lane
14
- * (`intro_dp_development` / `intro_dp_staging` / `intro_dp_production`), so an
15
- * app running several lanes holds a live session for each in one browser. When
16
- * more than one is present the DP cannot tell which a request means, so we name
17
- * it in the {@link LANE_QUERY_PARAM} query parameter. A query parameter rather
18
- * than a header because a custom header makes every cross-origin request pay a
19
- * CORS preflight.
13
+ * The session cookie is a CP-signed `browser_session` JWT named per lane and
14
+ * project — `intro_dp_{lane}_{base64url(project_uuid_bytes)}`, e.g.
15
+ * `intro_dp_production_AZLVpGw-ehCAAAAAAAAAAQ` — so one browser holds a live
16
+ * session for each lane and project it connected to. When more than one is
17
+ * present the DP cannot tell which a request means, so we name it in the
18
+ * {@link LANE_QUERY_PARAM} and {@link PROJECT_ID_QUERY_PARAM} query parameters;
19
+ * with only the lane, the DP falls back to that lane's most recently issued
20
+ * cookie. Query parameters rather than headers because a custom header makes
21
+ * every cross-origin request pay a CORS preflight.
20
22
  */
21
23
  import { BaseHttpClient, stripTrailingSlash, toApiError, } from "@introspection-sdk/http";
22
24
  import { resolveBrowserFetch } from "./fetch.js";
@@ -31,6 +33,15 @@ export { stripTrailingSlash, toApiError };
31
33
  * nothing rather than granting anything.
32
34
  */
33
35
  export const LANE_QUERY_PARAM = "lane";
36
+ /**
37
+ * Query parameter naming which project's session cookie, within the lane, the
38
+ * DP should resolve.
39
+ *
40
+ * A selector, not a credential: the cookie's own signed project is checked
41
+ * against it server-side, so naming a project this browser holds no cookie for
42
+ * is a 401 rather than access to that project.
43
+ */
44
+ export const PROJECT_ID_QUERY_PARAM = "project_id";
34
45
  /**
35
46
  * Header form of the lane selector, which the DP still accepts.
36
47
  *
@@ -51,11 +62,17 @@ export class BrowserHttpClient extends BaseHttpClient {
51
62
  additionalHeaders: cfg.additionalHeaders,
52
63
  transport: {
53
64
  // No bearer token and no header — the HttpOnly cookie is the
54
- // credential, and the lane selector rides the URL.
65
+ // credential, and the lane and project selectors ride the URL.
55
66
  authHeaders: () => ({}),
56
67
  authQuery: () => {
68
+ const query = {};
57
69
  const environment = cfg.environment?.();
58
- return environment ? { [LANE_QUERY_PARAM]: environment } : {};
70
+ if (environment)
71
+ query[LANE_QUERY_PARAM] = environment;
72
+ const projectId = cfg.projectId?.();
73
+ if (projectId)
74
+ query[PROJECT_ID_QUERY_PARAM] = projectId;
75
+ return query;
59
76
  },
60
77
  credentials: "include",
61
78
  onUnauthorized: cfg.onUnauthorized,
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/api/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,UAAU,GACX,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,4EAA4E;AAC5E,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,CAAC;AAE1C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,6BAA6B,CAAC;AAyBhE;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,cAAc;IAC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CAAC,MAAM;YAClB,uEAAuE;YACvE,KAAK,EAAE,mBAAmB,CAAC,GAAG,CAAC,KAAK,CAAC;YACrC,iBAAiB,EAAE,GAAG,CAAC,iBAAiB;YACxC,SAAS,EAAE;gBACT,6DAA6D;gBAC7D,+DAA+D;gBAC/D,WAAW,EAAE,GAA2B,EAAE,CAAC,CAAC,EAAE,CAAC;gBAC/C,SAAS,EAAE,GAA2B,EAAE;oBACtC,MAAM,KAAK,GAA2B,EAAE,CAAC;oBACzC,MAAM,WAAW,GAAG,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC;oBACxC,IAAI,WAAW;wBAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,WAAW,CAAC;oBACvD,MAAM,SAAS,GAAG,GAAG,CAAC,SAAS,EAAE,EAAE,CAAC;oBACpC,IAAI,SAAS;wBAAE,KAAK,CAAC,sBAAsB,CAAC,GAAG,SAAS,CAAC;oBACzD,OAAO,KAAK,CAAC;gBACf,CAAC;gBACD,WAAW,EAAE,SAAS;gBACtB,cAAc,EAAE,GAAG,CAAC,cAAc;aACnC;SACF,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -26,7 +26,7 @@
26
26
  * getToken: () => token,
27
27
  * });
28
28
  *
29
- * await client.connect(); // -> intro_dp_<environment> session cookie
29
+ * await client.connect(); // -> intro_dp_<lane>_<project> session cookie
30
30
  * const run = await client.tasks.start({
31
31
  * prompt: "Summarize my latest order",
32
32
  * runtime_id: runtimeId,
@@ -37,7 +37,7 @@
37
37
  export { IntrospectionApiClient, type IntrospectionApiClientOptions, } from "./client.js";
38
38
  export { TasksClient, TaskRunsClient, RunHandle, type CreateTaskParams, type StartTaskParams, } from "./tasks.js";
39
39
  export { AutomationsClient, ConversationItemsClient, ConversationsClient, FileVersionsClient, FilesClient, SharesClient, type FileUploadBody, } from "@introspection-sdk/http";
40
- export { BrowserHttpClient, ENVIRONMENT_HEADER, LANE_QUERY_PARAM, type BrowserHttpConfig, } from "./http.js";
40
+ export { BrowserHttpClient, ENVIRONMENT_HEADER, LANE_QUERY_PARAM, PROJECT_ID_QUERY_PARAM, type BrowserHttpConfig, } from "./http.js";
41
41
  export { Paginator, cursorPaginate, type PageSource, } from "@introspection-sdk/http";
42
42
  export { TranscriptAccumulator, foldAgui, foldSpans, mergeTranscripts, } from "@introspection-sdk/http";
43
43
  export { EventType } from "@introspection-sdk/types";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EACL,sBAAsB,EACtB,KAAK,6BAA6B,GACnC,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,WAAW,EACX,cAAc,EACd,SAAS,EACT,KAAK,gBAAgB,EACrB,KAAK,eAAe,GACrB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,KAAK,cAAc,GACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,iBAAiB,GACvB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,SAAS,EACT,cAAc,EACd,KAAK,UAAU,GAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,qBAAqB,EACrB,QAAQ,EACR,SAAS,EACT,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAGlC,YAAY,EACV,SAAS,EACT,SAAS,EACT,WAAW,EACX,SAAS,EACT,OAAO,EACP,WAAW,EACX,aAAa,EACb,IAAI,EACJ,OAAO,EACP,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,SAAS,EACT,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,uBAAuB,EACvB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,UAAU,EACV,sBAAsB,EACtB,oBAAoB,EACpB,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,aAAa,EACb,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,kBAAkB,GACnB,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EACL,sBAAsB,EACtB,KAAK,6BAA6B,GACnC,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,WAAW,EACX,cAAc,EACd,SAAS,EACT,KAAK,gBAAgB,EACrB,KAAK,eAAe,GACrB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,KAAK,cAAc,GACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,KAAK,iBAAiB,GACvB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,SAAS,EACT,cAAc,EACd,KAAK,UAAU,GAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,qBAAqB,EACrB,QAAQ,EACR,SAAS,EACT,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAGlC,YAAY,EACV,SAAS,EACT,SAAS,EACT,WAAW,EACX,SAAS,EACT,OAAO,EACP,WAAW,EACX,aAAa,EACb,IAAI,EACJ,OAAO,EACP,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,SAAS,EACT,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,uBAAuB,EACvB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,UAAU,EACV,sBAAsB,EACtB,oBAAoB,EACpB,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,aAAa,EACb,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,kBAAkB,GACnB,MAAM,0BAA0B,CAAC"}
package/dist/api/index.js CHANGED
@@ -26,7 +26,7 @@
26
26
  * getToken: () => token,
27
27
  * });
28
28
  *
29
- * await client.connect(); // -> intro_dp_<environment> session cookie
29
+ * await client.connect(); // -> intro_dp_<lane>_<project> session cookie
30
30
  * const run = await client.tasks.start({
31
31
  * prompt: "Summarize my latest order",
32
32
  * runtime_id: runtimeId,
@@ -37,7 +37,7 @@
37
37
  export { IntrospectionApiClient, } from "./client.js";
38
38
  export { TasksClient, TaskRunsClient, RunHandle, } from "./tasks.js";
39
39
  export { AutomationsClient, ConversationItemsClient, ConversationsClient, FileVersionsClient, FilesClient, SharesClient, } from "@introspection-sdk/http";
40
- export { BrowserHttpClient, ENVIRONMENT_HEADER, LANE_QUERY_PARAM, } from "./http.js";
40
+ export { BrowserHttpClient, ENVIRONMENT_HEADER, LANE_QUERY_PARAM, PROJECT_ID_QUERY_PARAM, } from "./http.js";
41
41
  export { Paginator, cursorPaginate, } from "@introspection-sdk/http";
42
42
  export { TranscriptAccumulator, foldAgui, foldSpans, mergeTranscripts, } from "@introspection-sdk/http";
43
43
  export { EventType } from "@introspection-sdk/types";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EACL,sBAAsB,GAEvB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,WAAW,EACX,cAAc,EACd,SAAS,GAGV,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,YAAY,GAEb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,GAEjB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,SAAS,EACT,cAAc,GAEf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,qBAAqB,EACrB,QAAQ,EACR,SAAS,EACT,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAsDlC,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,aAAa,EACb,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,kBAAkB,GACnB,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EACL,sBAAsB,GAEvB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,WAAW,EACX,cAAc,EACd,SAAS,GAGV,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,YAAY,GAEb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,GAEvB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,SAAS,EACT,cAAc,GAEf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,qBAAqB,EACrB,QAAQ,EACR,SAAS,EACT,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAsDlC,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,aAAa,EACb,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,kBAAkB,GACnB,MAAM,0BAA0B,CAAC"}
package/dist/version.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  /** Version information for introspection-sdk browser package. */
2
- export declare const VERSION = "0.31.0";
2
+ export declare const VERSION = "0.35.0";
3
3
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  /** Version information for introspection-sdk browser package. */
2
- export const VERSION = "0.31.0"; // x-release-please-version
2
+ export const VERSION = "0.35.0"; // x-release-please-version
3
3
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@introspection-sdk/introspection-browser",
3
- "version": "0.31.0",
3
+ "version": "0.35.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,18 +31,18 @@
31
31
  "@types/node": "^22.20.5",
32
32
  "eslint": "^9.39.5",
33
33
  "typescript": "5.9.3",
34
- "@repo/eslint-config": "0.0.0",
35
- "@repo/typescript-config": "0.0.0"
34
+ "@repo/typescript-config": "0.0.0",
35
+ "@repo/eslint-config": "0.0.0"
36
36
  },
37
37
  "dependencies": {
38
38
  "@opentelemetry/api": "^1.9.1",
39
- "@opentelemetry/api-logs": "^0.222.0",
40
- "@opentelemetry/sdk-logs": "^0.222.0",
41
- "@opentelemetry/exporter-logs-otlp-http": "^0.222.0",
42
- "@opentelemetry/resources": "^2.11.0",
39
+ "@opentelemetry/api-logs": "^0.223.0",
40
+ "@opentelemetry/sdk-logs": "^0.223.0",
41
+ "@opentelemetry/exporter-logs-otlp-http": "^0.223.0",
42
+ "@opentelemetry/resources": "^2.12.0",
43
43
  "@opentelemetry/semantic-conventions": "^1.38.0",
44
- "@introspection-sdk/types": "0.31.0",
45
- "@introspection-sdk/http": "0.31.0"
44
+ "@introspection-sdk/types": "0.35.0",
45
+ "@introspection-sdk/http": "0.35.0"
46
46
  },
47
47
  "scripts": {
48
48
  "lint": "eslint . --max-warnings 0",