@introspection-sdk/introspection-browser 0.5.2 → 0.5.3
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/.turbo/turbo-build.log +1 -1
- package/README.md +29 -1
- package/dist/api/client.d.ts +6 -0
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +8 -0
- package/dist/api/client.js.map +1 -1
- package/dist/api/conversations.d.ts +84 -0
- package/dist/api/conversations.d.ts.map +1 -0
- package/dist/api/conversations.js +172 -0
- package/dist/api/conversations.js.map +1 -0
- package/dist/api/files.d.ts +61 -0
- package/dist/api/files.d.ts.map +1 -0
- package/dist/api/files.js +145 -0
- package/dist/api/files.js.map +1 -0
- package/dist/api/index.d.ts +3 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +2 -0
- package/dist/api/index.js.map +1 -1
- package/package.json +4 -4
- package/src/api/client.ts +8 -0
- package/src/api/conversations.ts +214 -0
- package/src/api/files.ts +196 -0
- package/src/api/index.ts +23 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
> @introspection-sdk/introspection-browser@0.5.
|
|
2
|
+
> @introspection-sdk/introspection-browser@0.5.3 build /home/runner/work/introspection-js-sdk/introspection-js-sdk/packages/introspection-browser
|
|
3
3
|
> tsc
|
|
4
4
|
|
package/README.md
CHANGED
|
@@ -86,6 +86,34 @@ Both `create` and `start` accept two optional task controls:
|
|
|
86
86
|
before the sandbox is torn down. `0` tears it down as soon as it's
|
|
87
87
|
provisioned; omit to use the deployment default. Clamped to the task timeout.
|
|
88
88
|
|
|
89
|
+
## Files and conversations
|
|
90
|
+
|
|
91
|
+
The same identity session also reaches `/v1/files` and (read-only)
|
|
92
|
+
`/v1/conversations` — no extra credential, just the cookie minted by
|
|
93
|
+
`connect()`:
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
// Files — CRUD + upload/download, all identity-scoped
|
|
97
|
+
await client.files.upload({ file: new Blob(["hi"]), name: "hi.txt" });
|
|
98
|
+
const page = await client.files.list({ visibility: "identity" });
|
|
99
|
+
const bytes = await client.files.download(page.records[0].id);
|
|
100
|
+
|
|
101
|
+
// Conversations — read-only projection over the telemetry store
|
|
102
|
+
for await (const summary of client.conversations.list()) {
|
|
103
|
+
console.log(summary.conversation_id);
|
|
104
|
+
}
|
|
105
|
+
// Resolve the latest turn of a conversation (Responses-API shape)
|
|
106
|
+
const turn = await client.conversations.retrieve(conversationId);
|
|
107
|
+
console.log(turn?.output_messages);
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
`client.files` mirrors the Node SDK's `FilesApi` (`list` / `upload` /
|
|
111
|
+
`createText` / `get` / `update` / `delete` / `download` / `downloadStream`,
|
|
112
|
+
plus `files.versions`). `client.conversations` mirrors `ConversationsApi`
|
|
113
|
+
(`list`, `retrieve`, and `conversations.items.list()` / `.get()`). Both `list`
|
|
114
|
+
helpers return a `Paginator` — `await` it for the first page or `for await` it
|
|
115
|
+
to auto-page.
|
|
116
|
+
|
|
89
117
|
> **CORS:** the Data Plane authorizes browser origins against its configured
|
|
90
118
|
> allowlist (`CORS_ORIGINS`). A new SPA origin must be present there for the
|
|
91
|
-
> cross-origin cookie exchange and task calls to succeed.
|
|
119
|
+
> cross-origin cookie exchange and task/file/conversation calls to succeed.
|
package/dist/api/client.d.ts
CHANGED
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
* before retrying.
|
|
20
20
|
*/
|
|
21
21
|
import { TasksClient } from "./tasks.js";
|
|
22
|
+
import { FilesClient } from "./files.js";
|
|
23
|
+
import { ConversationsClient } from "./conversations.js";
|
|
22
24
|
export interface IntrospectionApiClientOptions {
|
|
23
25
|
/** Data Plane REST base URL (e.g. `https://dp.us.introspection.dev`). */
|
|
24
26
|
dpUrl: string;
|
|
@@ -39,6 +41,10 @@ export declare class IntrospectionApiClient {
|
|
|
39
41
|
private readonly opts;
|
|
40
42
|
/** `/v1/tasks` operations bound to the DP session cookie. */
|
|
41
43
|
readonly tasks: TasksClient;
|
|
44
|
+
/** `/v1/files` operations bound to the DP session cookie. */
|
|
45
|
+
readonly files: FilesClient;
|
|
46
|
+
/** Read-only `/v1/conversations` projection bound to the session cookie. */
|
|
47
|
+
readonly conversations: ConversationsClient;
|
|
42
48
|
private readonly fetchImpl;
|
|
43
49
|
constructor(opts: IntrospectionApiClientOptions);
|
|
44
50
|
/**
|
package/dist/api/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,WAAW,6BAA6B;IAC5C,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACzC,2DAA2D;IAC3D,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,kDAAkD;IAClD,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC5C;AAED,qBAAa,sBAAsB;IAUrB,OAAO,CAAC,QAAQ,CAAC,IAAI;IATjC,6DAA6D;IAC7D,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,6DAA6D;IAC7D,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,4EAA4E;IAC5E,QAAQ,CAAC,aAAa,EAAE,mBAAmB,CAAC;IAE5C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;gBAEZ,IAAI,EAAE,6BAA6B;IAkBhE;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;YAIhB,QAAQ;IAiBtB,0EAA0E;YAC5D,UAAU;CAQzB"}
|
package/dist/api/client.js
CHANGED
|
@@ -20,10 +20,16 @@
|
|
|
20
20
|
*/
|
|
21
21
|
import { BrowserHttpClient, stripTrailingSlash, toApiError } from "./http.js";
|
|
22
22
|
import { TasksClient } from "./tasks.js";
|
|
23
|
+
import { FilesClient } from "./files.js";
|
|
24
|
+
import { ConversationsClient } from "./conversations.js";
|
|
23
25
|
export class IntrospectionApiClient {
|
|
24
26
|
opts;
|
|
25
27
|
/** `/v1/tasks` operations bound to the DP session cookie. */
|
|
26
28
|
tasks;
|
|
29
|
+
/** `/v1/files` operations bound to the DP session cookie. */
|
|
30
|
+
files;
|
|
31
|
+
/** Read-only `/v1/conversations` projection bound to the session cookie. */
|
|
32
|
+
conversations;
|
|
27
33
|
fetchImpl;
|
|
28
34
|
constructor(opts) {
|
|
29
35
|
this.opts = opts;
|
|
@@ -38,6 +44,8 @@ export class IntrospectionApiClient {
|
|
|
38
44
|
onUnauthorized: () => this.reexchange(),
|
|
39
45
|
});
|
|
40
46
|
this.tasks = new TasksClient(http);
|
|
47
|
+
this.files = new FilesClient(http);
|
|
48
|
+
this.conversations = new ConversationsClient(http);
|
|
41
49
|
}
|
|
42
50
|
/**
|
|
43
51
|
* Mint a token via `getToken` and redeem it at the DP for the
|
package/dist/api/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,iBAAiB,EA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AAI,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACrD,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,OAAO;QACX,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;IACxB,CAAC;IAEO,KAAK,CAAC,QAAQ;QACpB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACzC,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,SAAS,CAC9B,GAAG,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,oBAAoB,EAC1D;YACE,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,IAAI,EAAE,CAAC;aACvC;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YAChE,WAAW,EAAE,SAAS;SACvB,CACF,CAAC;QACF,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,MAAM,MAAM,UAAU,CAAC,GAAG,CAAC,CAAC;IAC3C,CAAC;IAED,0EAA0E;IAClE,KAAK,CAAC,UAAU;QACtB,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;YACtB,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cookie-authenticated, read-only Conversations client for the browser
|
|
3
|
+
* (`/v1/conversations`).
|
|
4
|
+
*
|
|
5
|
+
* Mirrors the Node SDK's runner-bound `ConversationsApi`, but rides the
|
|
6
|
+
* DP `intro_dp_session` cookie via {@link BrowserHttpClient} instead of a
|
|
7
|
+
* bearer token — so a single-page app reads conversation history with the
|
|
8
|
+
* same identity session it uses for tasks and files. Conversations are a
|
|
9
|
+
* projection over the immutable telemetry store: list summaries, walk a
|
|
10
|
+
* conversation's items, or `retrieve()` the resolved state of one turn.
|
|
11
|
+
*/
|
|
12
|
+
import type { ConversationItem, ConversationItemInclude, ConversationItemList, ConversationItemListParams, ConversationListParams, ConversationResponse, ConversationSummary } from "@introspection-sdk/types";
|
|
13
|
+
import { Paginator } from "@introspection-sdk/http";
|
|
14
|
+
import { BrowserHttpClient } from "./http.js";
|
|
15
|
+
/**
|
|
16
|
+
* Items of a conversation (`/v1/conversations/{id}/items`). Read-only.
|
|
17
|
+
*
|
|
18
|
+
* Paging is OpenAI-style underneath: the envelope has NO `next` token —
|
|
19
|
+
* `list()` drives `after` = the previous page's `last_id` while
|
|
20
|
+
* `has_more` is true.
|
|
21
|
+
*/
|
|
22
|
+
export declare class ConversationItemsClient {
|
|
23
|
+
private readonly http;
|
|
24
|
+
constructor(http: BrowserHttpClient);
|
|
25
|
+
/**
|
|
26
|
+
* List items of a conversation. `await` the result for the first page
|
|
27
|
+
* (an OpenAI-style {@link ConversationItemList} envelope), or
|
|
28
|
+
* `for await` it to stream every item across pages (fetched lazily —
|
|
29
|
+
* `limit` sets the page size, `after` the starting cursor; stop early to
|
|
30
|
+
* stop fetching). Pass `order: "asc"` to walk the transcript from the
|
|
31
|
+
* start.
|
|
32
|
+
*
|
|
33
|
+
* Items carry the turn-local delta in `input_messages` — only the
|
|
34
|
+
* messages new to that turn. Use `get()` for the full input history.
|
|
35
|
+
*/
|
|
36
|
+
list(conversationId: string, params?: ConversationItemListParams): Paginator<ConversationItem, ConversationItemList>;
|
|
37
|
+
/**
|
|
38
|
+
* Fetch a single conversation item. Unlike the list route, the
|
|
39
|
+
* detail's `input_messages` is the FULL input history for that span.
|
|
40
|
+
*/
|
|
41
|
+
get(conversationId: string, itemId: string, params?: {
|
|
42
|
+
include?: ConversationItemInclude[];
|
|
43
|
+
}): Promise<ConversationItem>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Read-only Conversations client (`/v1/conversations`).
|
|
47
|
+
*
|
|
48
|
+
* Both `list()` and `items.list()` are auto-paging, but they drive
|
|
49
|
+
* different wire protocols underneath: `list()` walks the standard
|
|
50
|
+
* Introspection cursor envelope's opaque `next` token, while
|
|
51
|
+
* `items.list()` walks an OpenAI-style envelope via `after` = the
|
|
52
|
+
* previous page's `last_id` while `has_more` is true.
|
|
53
|
+
*/
|
|
54
|
+
export declare class ConversationsClient {
|
|
55
|
+
private readonly http;
|
|
56
|
+
/** Items of a conversation — `conversations.items.list(...)` etc. */
|
|
57
|
+
readonly items: ConversationItemsClient;
|
|
58
|
+
constructor(http: BrowserHttpClient);
|
|
59
|
+
/**
|
|
60
|
+
* List conversation summaries matching `params`. `await` the result for
|
|
61
|
+
* the first page, or `for await` it to stream every summary across
|
|
62
|
+
* pages (fetched lazily — `limit` sets the page size, `next` the
|
|
63
|
+
* starting cursor; stop early to stop fetching).
|
|
64
|
+
*/
|
|
65
|
+
list(params?: ConversationListParams): Paginator<ConversationSummary>;
|
|
66
|
+
/**
|
|
67
|
+
* Responses-API-style retrieve: load the state of a conversation as of
|
|
68
|
+
* one item — the full input history, output, system instructions, and
|
|
69
|
+
* tool definitions of that turn.
|
|
70
|
+
*
|
|
71
|
+
* When `itemId` is omitted, the latest LLM turn is used: the first
|
|
72
|
+
* item (in descending order) whose `node_type` is `"assistant"` or
|
|
73
|
+
* whose `operation_name` is `"chat"`, falling back to the first item
|
|
74
|
+
* with a non-null `output_message`. Returns `null` when the
|
|
75
|
+
* conversation has no items.
|
|
76
|
+
*
|
|
77
|
+
* For the full per-turn transcript instead, iterate
|
|
78
|
+
* `items.list(conversationId, { order: "asc" })`.
|
|
79
|
+
*/
|
|
80
|
+
retrieve(conversationId: string, itemId?: string): Promise<ConversationResponse | null>;
|
|
81
|
+
/** Scan items in descending order for the most recent LLM turn. */
|
|
82
|
+
private findLatestTurnId;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=conversations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../../src/api/conversations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,0BAA0B,EAC1B,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EAIpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,SAAS,EAAkB,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAS9C;;;;;;GAMG;AACH,qBAAa,uBAAuB;IACtB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,iBAAiB;IAEpD;;;;;;;;;;OAUG;IACH,IAAI,CACF,cAAc,EAAE,MAAM,EACtB,MAAM,CAAC,EAAE,0BAA0B,GAClC,SAAS,CAAC,gBAAgB,EAAE,oBAAoB,CAAC;IAiBpD;;;OAGG;IACH,GAAG,CACD,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,uBAAuB,EAAE,CAAA;KAAE,GAC/C,OAAO,CAAC,gBAAgB,CAAC;CAO7B;AAED;;;;;;;;GAQG;AACH,qBAAa,mBAAmB;IAIlB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAHjC,qEAAqE;IACrE,QAAQ,CAAC,KAAK,EAAE,uBAAuB,CAAC;gBAEX,IAAI,EAAE,iBAAiB;IAIpD;;;;;OAKG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,sBAAsB,GAAG,SAAS,CAAC,mBAAmB,CAAC;IAYrE;;;;;;;;;;;;;OAaG;IACG,QAAQ,CACZ,cAAc,EAAE,MAAM,EACtB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA6BvC,mEAAmE;YACrD,gBAAgB;CAc/B"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cookie-authenticated, read-only Conversations client for the browser
|
|
3
|
+
* (`/v1/conversations`).
|
|
4
|
+
*
|
|
5
|
+
* Mirrors the Node SDK's runner-bound `ConversationsApi`, but rides the
|
|
6
|
+
* DP `intro_dp_session` cookie via {@link BrowserHttpClient} instead of a
|
|
7
|
+
* bearer token — so a single-page app reads conversation history with the
|
|
8
|
+
* same identity session it uses for tasks and files. Conversations are a
|
|
9
|
+
* projection over the immutable telemetry store: list summaries, walk a
|
|
10
|
+
* conversation's items, or `retrieve()` the resolved state of one turn.
|
|
11
|
+
*/
|
|
12
|
+
import { Paginator, cursorPaginate } from "@introspection-sdk/http";
|
|
13
|
+
/** Includes requested when building a {@link ConversationResponse}. */
|
|
14
|
+
const RESPONSE_INCLUDES = [
|
|
15
|
+
"gen_ai.input.messages",
|
|
16
|
+
"gen_ai.system_instructions",
|
|
17
|
+
"gen_ai.tool.definitions",
|
|
18
|
+
];
|
|
19
|
+
/**
|
|
20
|
+
* Items of a conversation (`/v1/conversations/{id}/items`). Read-only.
|
|
21
|
+
*
|
|
22
|
+
* Paging is OpenAI-style underneath: the envelope has NO `next` token —
|
|
23
|
+
* `list()` drives `after` = the previous page's `last_id` while
|
|
24
|
+
* `has_more` is true.
|
|
25
|
+
*/
|
|
26
|
+
export class ConversationItemsClient {
|
|
27
|
+
http;
|
|
28
|
+
constructor(http) {
|
|
29
|
+
this.http = http;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* List items of a conversation. `await` the result for the first page
|
|
33
|
+
* (an OpenAI-style {@link ConversationItemList} envelope), or
|
|
34
|
+
* `for await` it to stream every item across pages (fetched lazily —
|
|
35
|
+
* `limit` sets the page size, `after` the starting cursor; stop early to
|
|
36
|
+
* stop fetching). Pass `order: "asc"` to walk the transcript from the
|
|
37
|
+
* start.
|
|
38
|
+
*
|
|
39
|
+
* Items carry the turn-local delta in `input_messages` — only the
|
|
40
|
+
* messages new to that turn. Use `get()` for the full input history.
|
|
41
|
+
*/
|
|
42
|
+
list(conversationId, params) {
|
|
43
|
+
return new Paginator({
|
|
44
|
+
fetch: (after) => this.http.request({
|
|
45
|
+
method: "GET",
|
|
46
|
+
path: `/v1/conversations/${encodeURIComponent(conversationId)}/items`,
|
|
47
|
+
query: { ...params, after },
|
|
48
|
+
}),
|
|
49
|
+
items: (page) => page.data,
|
|
50
|
+
next: (page) => page.has_more && page.last_id !== null ? page.last_id : undefined,
|
|
51
|
+
}, params?.after);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Fetch a single conversation item. Unlike the list route, the
|
|
55
|
+
* detail's `input_messages` is the FULL input history for that span.
|
|
56
|
+
*/
|
|
57
|
+
get(conversationId, itemId, params) {
|
|
58
|
+
return this.http.request({
|
|
59
|
+
method: "GET",
|
|
60
|
+
path: `/v1/conversations/${encodeURIComponent(conversationId)}/items/${encodeURIComponent(itemId)}`,
|
|
61
|
+
query: params,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Read-only Conversations client (`/v1/conversations`).
|
|
67
|
+
*
|
|
68
|
+
* Both `list()` and `items.list()` are auto-paging, but they drive
|
|
69
|
+
* different wire protocols underneath: `list()` walks the standard
|
|
70
|
+
* Introspection cursor envelope's opaque `next` token, while
|
|
71
|
+
* `items.list()` walks an OpenAI-style envelope via `after` = the
|
|
72
|
+
* previous page's `last_id` while `has_more` is true.
|
|
73
|
+
*/
|
|
74
|
+
export class ConversationsClient {
|
|
75
|
+
http;
|
|
76
|
+
/** Items of a conversation — `conversations.items.list(...)` etc. */
|
|
77
|
+
items;
|
|
78
|
+
constructor(http) {
|
|
79
|
+
this.http = http;
|
|
80
|
+
this.items = new ConversationItemsClient(http);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* List conversation summaries matching `params`. `await` the result for
|
|
84
|
+
* the first page, or `for await` it to stream every summary across
|
|
85
|
+
* pages (fetched lazily — `limit` sets the page size, `next` the
|
|
86
|
+
* starting cursor; stop early to stop fetching).
|
|
87
|
+
*/
|
|
88
|
+
list(params) {
|
|
89
|
+
return cursorPaginate((next) => this.http.request({
|
|
90
|
+
method: "GET",
|
|
91
|
+
path: "/v1/conversations",
|
|
92
|
+
query: { ...params, next },
|
|
93
|
+
}), params?.next);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Responses-API-style retrieve: load the state of a conversation as of
|
|
97
|
+
* one item — the full input history, output, system instructions, and
|
|
98
|
+
* tool definitions of that turn.
|
|
99
|
+
*
|
|
100
|
+
* When `itemId` is omitted, the latest LLM turn is used: the first
|
|
101
|
+
* item (in descending order) whose `node_type` is `"assistant"` or
|
|
102
|
+
* whose `operation_name` is `"chat"`, falling back to the first item
|
|
103
|
+
* with a non-null `output_message`. Returns `null` when the
|
|
104
|
+
* conversation has no items.
|
|
105
|
+
*
|
|
106
|
+
* For the full per-turn transcript instead, iterate
|
|
107
|
+
* `items.list(conversationId, { order: "asc" })`.
|
|
108
|
+
*/
|
|
109
|
+
async retrieve(conversationId, itemId) {
|
|
110
|
+
const targetId = itemId ?? (await this.findLatestTurnId(conversationId));
|
|
111
|
+
if (targetId === null)
|
|
112
|
+
return null;
|
|
113
|
+
const detail = await this.items.get(conversationId, targetId, {
|
|
114
|
+
include: RESPONSE_INCLUDES,
|
|
115
|
+
});
|
|
116
|
+
const outputMessages = detail.gen_ai_output_messages ??
|
|
117
|
+
(detail.output_message ? [detail.output_message] : []);
|
|
118
|
+
return {
|
|
119
|
+
conversation_id: conversationId,
|
|
120
|
+
response_id: detail.response_id ?? null,
|
|
121
|
+
item_id: detail.id,
|
|
122
|
+
created_at: detail.created_at,
|
|
123
|
+
model: detail.model_name ??
|
|
124
|
+
detail.response_model ??
|
|
125
|
+
detail.request_model ??
|
|
126
|
+
null,
|
|
127
|
+
provider_name: detail.provider_name ?? null,
|
|
128
|
+
// The single-item route returns the FULL input history here.
|
|
129
|
+
input_messages: normalizeMessages(detail.input_messages),
|
|
130
|
+
output_messages: normalizeMessages(outputMessages),
|
|
131
|
+
system_instructions: detail.system_instructions ?? null,
|
|
132
|
+
tool_definitions: detail.tool_definitions ?? null,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/** Scan items in descending order for the most recent LLM turn. */
|
|
136
|
+
async findLatestTurnId(conversationId) {
|
|
137
|
+
let fallback = null;
|
|
138
|
+
for await (const item of this.items.list(conversationId, {
|
|
139
|
+
order: "desc",
|
|
140
|
+
})) {
|
|
141
|
+
if (item.node_type === "assistant" || item.operation_name === "chat") {
|
|
142
|
+
return item.id;
|
|
143
|
+
}
|
|
144
|
+
if (fallback === null && item.output_message != null)
|
|
145
|
+
fallback = item;
|
|
146
|
+
}
|
|
147
|
+
return fallback?.id ?? null;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Defensive normalization for {@link ConversationsClient.retrieve} only:
|
|
152
|
+
* older DP deployments emitted `tool_call_response` parts with a legacy
|
|
153
|
+
* `result` key instead of the semconv `response` key. Map it across so
|
|
154
|
+
* replayed history is always semconv-shaped.
|
|
155
|
+
*/
|
|
156
|
+
function normalizeMessages(messages) {
|
|
157
|
+
return messages.map((message) => ({
|
|
158
|
+
...message,
|
|
159
|
+
parts: message.parts.map(normalizePart),
|
|
160
|
+
}));
|
|
161
|
+
}
|
|
162
|
+
function normalizePart(part) {
|
|
163
|
+
if (part.type !== "tool_call_response")
|
|
164
|
+
return part;
|
|
165
|
+
const legacy = part;
|
|
166
|
+
if (legacy.response !== undefined || legacy.result === undefined) {
|
|
167
|
+
return part;
|
|
168
|
+
}
|
|
169
|
+
const { result, ...rest } = legacy;
|
|
170
|
+
return { ...rest, response: result };
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=conversations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"con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AoB;QAAE,OAAO,IAAI,CAAC;IACpD,MAAM,MAAM,GAAG,IAAmD,CAAC;IACnE,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QACjE,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;IACnC,OAAO,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cookie-authenticated Files client for the browser (`/v1/files`).
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the Node SDK's runner-bound `FilesApi`, but rides the DP
|
|
5
|
+
* `intro_dp_session` cookie via {@link BrowserHttpClient} instead of a
|
|
6
|
+
* bearer token — so a single-page app reads and writes files with the
|
|
7
|
+
* same identity session it uses for tasks and conversations. The DP
|
|
8
|
+
* derives the owning `identity_key` from the session JWT; per-identity
|
|
9
|
+
* file visibility is enforced server-side.
|
|
10
|
+
*/
|
|
11
|
+
import type { File as FileResource, FileCreateOptions, FileCreateTextParams, FileListParams, FileType, FileUpdateParams, ListParams } from "@introspection-sdk/types";
|
|
12
|
+
import { Paginator } from "@introspection-sdk/http";
|
|
13
|
+
import { BrowserHttpClient } from "./http.js";
|
|
14
|
+
export type FileUploadBody = {
|
|
15
|
+
file: Blob;
|
|
16
|
+
name?: string;
|
|
17
|
+
file_type?: FileType;
|
|
18
|
+
} | {
|
|
19
|
+
file: Uint8Array;
|
|
20
|
+
name: string;
|
|
21
|
+
file_type?: FileType;
|
|
22
|
+
contentType?: string;
|
|
23
|
+
};
|
|
24
|
+
/** Versions of a file (`/v1/files/{id}/versions`). */
|
|
25
|
+
export declare class FileVersionsClient {
|
|
26
|
+
private readonly http;
|
|
27
|
+
constructor(http: BrowserHttpClient);
|
|
28
|
+
/**
|
|
29
|
+
* List versions of a file. `await` the result for the first page, or
|
|
30
|
+
* `for await` it to stream every version across pages (fetched lazily;
|
|
31
|
+
* stop early to stop fetching).
|
|
32
|
+
*/
|
|
33
|
+
list(fileId: string, params?: ListParams): Paginator<FileResource>;
|
|
34
|
+
get(fileId: string, versionId: string): Promise<FileResource>;
|
|
35
|
+
create(fileId: string, body: FileUploadBody, options?: FileCreateOptions): Promise<FileResource>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Cookie-authenticated `/v1/files` client. Mirrors the Node SDK's
|
|
39
|
+
* `FilesApi` shape but is bound to a DP session cookie rather than a
|
|
40
|
+
* bearer token.
|
|
41
|
+
*/
|
|
42
|
+
export declare class FilesClient {
|
|
43
|
+
private readonly http;
|
|
44
|
+
readonly versions: FileVersionsClient;
|
|
45
|
+
constructor(http: BrowserHttpClient);
|
|
46
|
+
/**
|
|
47
|
+
* List files matching `params`. `await` the result for the first page,
|
|
48
|
+
* or `for await` it to stream every file across pages (fetched lazily —
|
|
49
|
+
* `limit` sets the page size, `next` the starting cursor; stop early to
|
|
50
|
+
* stop fetching).
|
|
51
|
+
*/
|
|
52
|
+
list(params?: FileListParams): Paginator<FileResource>;
|
|
53
|
+
upload(body: FileUploadBody, options?: FileCreateOptions): Promise<FileResource>;
|
|
54
|
+
createText(body: FileCreateTextParams, options?: FileCreateOptions): Promise<FileResource>;
|
|
55
|
+
get(fileId: string): Promise<FileResource>;
|
|
56
|
+
update(fileId: string, body: FileUpdateParams): Promise<FileResource>;
|
|
57
|
+
delete(fileId: string): Promise<void>;
|
|
58
|
+
download(fileId: string): Promise<Uint8Array>;
|
|
59
|
+
downloadStream(fileId: string): Promise<ReadableStream<Uint8Array>>;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/api/files.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,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,cAAc,EACpB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,YAAY,CAAC;IASxB,UAAU,CACR,IAAI,EAAE,oBAAoB,EAC1B,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,YAAY,CAAC;IAUxB,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAO1C,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,CAAC;IAQrE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQrC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAQ7C,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;CAOpE"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cookie-authenticated Files client for the browser (`/v1/files`).
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the Node SDK's runner-bound `FilesApi`, but rides the DP
|
|
5
|
+
* `intro_dp_session` cookie via {@link BrowserHttpClient} instead of a
|
|
6
|
+
* bearer token — so a single-page app reads and writes files with the
|
|
7
|
+
* same identity session it uses for tasks and conversations. The DP
|
|
8
|
+
* derives the owning `identity_key` from the session JWT; per-identity
|
|
9
|
+
* file visibility is enforced server-side.
|
|
10
|
+
*/
|
|
11
|
+
import { cursorPaginate } from "@introspection-sdk/http";
|
|
12
|
+
/** Versions of a file (`/v1/files/{id}/versions`). */
|
|
13
|
+
export class FileVersionsClient {
|
|
14
|
+
http;
|
|
15
|
+
constructor(http) {
|
|
16
|
+
this.http = http;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* List versions of a file. `await` the result for the first page, or
|
|
20
|
+
* `for await` it to stream every version across pages (fetched lazily;
|
|
21
|
+
* stop early to stop fetching).
|
|
22
|
+
*/
|
|
23
|
+
list(fileId, params) {
|
|
24
|
+
return cursorPaginate((next) => this.http.request({
|
|
25
|
+
method: "GET",
|
|
26
|
+
path: `/v1/files/${encodeURIComponent(fileId)}/versions`,
|
|
27
|
+
query: { ...params, next },
|
|
28
|
+
}), params?.next);
|
|
29
|
+
}
|
|
30
|
+
get(fileId, versionId) {
|
|
31
|
+
return this.http.request({
|
|
32
|
+
method: "GET",
|
|
33
|
+
path: `/v1/files/${encodeURIComponent(fileId)}/versions/${encodeURIComponent(versionId)}`,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
create(fileId, body, options) {
|
|
37
|
+
const form = toFormData(body, options);
|
|
38
|
+
return this.http.request({
|
|
39
|
+
method: "POST",
|
|
40
|
+
path: `/v1/files/${encodeURIComponent(fileId)}/versions`,
|
|
41
|
+
body: form,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Cookie-authenticated `/v1/files` client. Mirrors the Node SDK's
|
|
47
|
+
* `FilesApi` shape but is bound to a DP session cookie rather than a
|
|
48
|
+
* bearer token.
|
|
49
|
+
*/
|
|
50
|
+
export class FilesClient {
|
|
51
|
+
http;
|
|
52
|
+
versions;
|
|
53
|
+
constructor(http) {
|
|
54
|
+
this.http = http;
|
|
55
|
+
this.versions = new FileVersionsClient(http);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* List files matching `params`. `await` the result for the first page,
|
|
59
|
+
* or `for await` it to stream every file across pages (fetched lazily —
|
|
60
|
+
* `limit` sets the page size, `next` the starting cursor; stop early to
|
|
61
|
+
* stop fetching).
|
|
62
|
+
*/
|
|
63
|
+
list(params) {
|
|
64
|
+
return cursorPaginate((next) => this.http.request({
|
|
65
|
+
method: "GET",
|
|
66
|
+
path: "/v1/files",
|
|
67
|
+
query: { ...params, next },
|
|
68
|
+
}), params?.next);
|
|
69
|
+
}
|
|
70
|
+
upload(body, options) {
|
|
71
|
+
const form = toFormData(body, options);
|
|
72
|
+
return this.http.request({
|
|
73
|
+
method: "POST",
|
|
74
|
+
path: "/v1/files",
|
|
75
|
+
body: form,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
createText(body, options) {
|
|
79
|
+
return this.http.request({
|
|
80
|
+
method: "POST",
|
|
81
|
+
path: "/v1/files",
|
|
82
|
+
body: options?.visibility
|
|
83
|
+
? { ...body, visibility: options.visibility }
|
|
84
|
+
: body,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
get(fileId) {
|
|
88
|
+
return this.http.request({
|
|
89
|
+
method: "GET",
|
|
90
|
+
path: `/v1/files/${encodeURIComponent(fileId)}`,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
update(fileId, body) {
|
|
94
|
+
return this.http.request({
|
|
95
|
+
method: "PATCH",
|
|
96
|
+
path: `/v1/files/${encodeURIComponent(fileId)}`,
|
|
97
|
+
body,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
delete(fileId) {
|
|
101
|
+
return this.http.request({
|
|
102
|
+
method: "DELETE",
|
|
103
|
+
path: `/v1/files/${encodeURIComponent(fileId)}`,
|
|
104
|
+
expect: "empty",
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
download(fileId) {
|
|
108
|
+
return this.http.request({
|
|
109
|
+
method: "GET",
|
|
110
|
+
path: `/v1/files/${encodeURIComponent(fileId)}/content`,
|
|
111
|
+
expect: "bytes",
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
downloadStream(fileId) {
|
|
115
|
+
return this.http.request({
|
|
116
|
+
method: "GET",
|
|
117
|
+
path: `/v1/files/${encodeURIComponent(fileId)}/content`,
|
|
118
|
+
expect: "stream",
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function toFormData(body, options) {
|
|
123
|
+
const fd = new FormData();
|
|
124
|
+
if ("file" in body && body.file instanceof Blob) {
|
|
125
|
+
fd.append("file", body.file, body.name);
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
// Uint8Array branch — copy into a fresh ArrayBuffer so the Blob
|
|
129
|
+
// constructor sees a concrete ArrayBuffer (not ArrayBufferLike,
|
|
130
|
+
// which TS rejects under nodenext lib).
|
|
131
|
+
const u8 = body.file;
|
|
132
|
+
const ct = body.contentType ??
|
|
133
|
+
"application/octet-stream";
|
|
134
|
+
const ab = u8.buffer.slice(u8.byteOffset, u8.byteOffset + u8.byteLength);
|
|
135
|
+
fd.append("file", new Blob([ab], { type: ct }), body.name);
|
|
136
|
+
}
|
|
137
|
+
if (body.name)
|
|
138
|
+
fd.append("name", body.name);
|
|
139
|
+
if (body.file_type)
|
|
140
|
+
fd.append("file_type", body.file_type);
|
|
141
|
+
if (options?.visibility)
|
|
142
|
+
fd.append("visibility", options.visibility);
|
|
143
|
+
return fd;
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/api/files.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAYH,OAAO,EAAa,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAYpE,sDAAsD;AACtD,MAAM,OAAO,kBAAkB;IACA;IAA7B,YAA6B,IAAuB;QAAvB,SAAI,GAAJ,IAAI,CAAmB;IAAG,CAAC;IAExD;;;;OAIG;IACH,IAAI,CAAC,MAAc,EAAE,MAAmB;QACtC,OAAO,cAAc,CACnB,CAAC,IAAI,EAAE,EAAE,CACP,IAAI,CAAC,IAAI,CAAC,OAAO,CAA0B;YACzC,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,aAAa,kBAAkB,CAAC,MAAM,CAAC,WAAW;YACxD,KAAK,EAAE,EAAE,GAAG,MAAM,EAAE,IAAI,EAA6B;SACtD,CAAC,EACJ,MAAM,EAAE,IAAI,CACb,CAAC;IACJ,CAAC;IAED,GAAG,CAAC,MAAc,EAAE,SAA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+28,11 @@
|
|
|
28
28
|
*/
|
|
29
29
|
export { IntrospectionApiClient, type IntrospectionApiClientOptions, } from "./client.js";
|
|
30
30
|
export { TasksClient, TaskRunsClient, RunHandle, type CreateTaskParams, type StartTaskParams, } from "./tasks.js";
|
|
31
|
+
export { FilesClient, FileVersionsClient, type FileUploadBody, } from "./files.js";
|
|
32
|
+
export { ConversationsClient, ConversationItemsClient, } from "./conversations.js";
|
|
31
33
|
export { BrowserHttpClient, type BrowserHttpConfig } from "./http.js";
|
|
32
34
|
export { parseSse } from "./sse.js";
|
|
33
35
|
export { Paginator, cursorPaginate, type PageSource, } from "@introspection-sdk/http";
|
|
34
|
-
export type { Task, TaskRun, TaskStatus, TaskVisibility, TaskCreateResponse, TaskListParams, TaskUpdateParams, TaskRunCreateParams, TaskCancelResponse, RunIdentityInput, Paginated, SseEvent, } from "@introspection-sdk/types";
|
|
36
|
+
export type { Task, TaskRun, TaskStatus, TaskVisibility, TaskCreateResponse, TaskListParams, TaskUpdateParams, TaskRunCreateParams, TaskCancelResponse, RunIdentityInput, Paginated, SseEvent, File, FileType, FileListParams, FileUpdateParams, FileCreateTextParams, FileCreateOptions, ListParams, ConversationSummary, ConversationItem, ConversationItemList, ConversationListParams, ConversationItemListParams, ConversationItemInclude, ConversationResponse, } from "@introspection-sdk/types";
|
|
35
37
|
export { IntrospectionAPIError, AuthenticationError, InsufficientScopeError, NotFoundError, NetworkError, } from "@introspection-sdk/types";
|
|
36
38
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/api/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;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,EAAE,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EACL,SAAS,EACT,cAAc,EACd,KAAK,UAAU,GAChB,MAAM,yBAAyB,CAAC;AAGjC,YAAY,EACV,IAAI,EACJ,OAAO,EACP,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,SAAS,EACT,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;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,WAAW,EACX,kBAAkB,EAClB,KAAK,cAAc,GACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EACL,SAAS,EACT,cAAc,EACd,KAAK,UAAU,GAChB,MAAM,yBAAyB,CAAC;AAGjC,YAAY,EACV,IAAI,EACJ,OAAO,EACP,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,UAAU,EACV,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,0BAA0B,EAC1B,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,aAAa,EACb,YAAY,GACb,MAAM,0BAA0B,CAAC"}
|
package/dist/api/index.js
CHANGED
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
*/
|
|
29
29
|
export { IntrospectionApiClient, } from "./client.js";
|
|
30
30
|
export { TasksClient, TaskRunsClient, RunHandle, } from "./tasks.js";
|
|
31
|
+
export { FilesClient, FileVersionsClient, } from "./files.js";
|
|
32
|
+
export { ConversationsClient, ConversationItemsClient, } from "./conversations.js";
|
|
31
33
|
export { BrowserHttpClient } from "./http.js";
|
|
32
34
|
export { parseSse } from "./sse.js";
|
|
33
35
|
export { Paginator, cursorPaginate, } from "@introspection-sdk/http";
|
package/dist/api/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EACL,sBAAsB,GAEvB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,WAAW,EACX,cAAc,EACd,SAAS,GAGV,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,iBAAiB,EAA0B,MAAM,WAAW,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EACL,SAAS,EACT,cAAc,GAEf,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EACL,sBAAsB,GAEvB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,WAAW,EACX,cAAc,EACd,SAAS,GAGV,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,WAAW,EACX,kBAAkB,GAEnB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAA0B,MAAM,WAAW,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EACL,SAAS,EACT,cAAc,GAEf,MAAM,yBAAyB,CAAC;AA+BjC,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,aAAa,EACb,YAAY,GACb,MAAM,0BAA0B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@introspection-sdk/introspection-browser",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Introspection observability SDK for the browser",
|
|
6
6
|
"engines": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@types/node": "^22.19.
|
|
23
|
+
"@types/node": "^22.19.21",
|
|
24
24
|
"eslint": "^9.39.4",
|
|
25
25
|
"typescript": "5.9.3",
|
|
26
26
|
"@repo/eslint-config": "0.0.0",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"@opentelemetry/api-logs": "^0.219.0",
|
|
32
32
|
"@opentelemetry/sdk-logs": "^0.219.0",
|
|
33
33
|
"@opentelemetry/exporter-logs-otlp-http": "^0.219.0",
|
|
34
|
-
"@introspection-sdk/
|
|
35
|
-
"@introspection-sdk/
|
|
34
|
+
"@introspection-sdk/types": "0.5.3",
|
|
35
|
+
"@introspection-sdk/http": "0.5.3"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"lint": "eslint . --max-warnings 0",
|
package/src/api/client.ts
CHANGED
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
|
|
22
22
|
import { BrowserHttpClient, stripTrailingSlash, toApiError } from "./http.js";
|
|
23
23
|
import { TasksClient } from "./tasks.js";
|
|
24
|
+
import { FilesClient } from "./files.js";
|
|
25
|
+
import { ConversationsClient } from "./conversations.js";
|
|
24
26
|
|
|
25
27
|
export interface IntrospectionApiClientOptions {
|
|
26
28
|
/** Data Plane REST base URL (e.g. `https://dp.us.introspection.dev`). */
|
|
@@ -42,6 +44,10 @@ export interface IntrospectionApiClientOptions {
|
|
|
42
44
|
export class IntrospectionApiClient {
|
|
43
45
|
/** `/v1/tasks` operations bound to the DP session cookie. */
|
|
44
46
|
readonly tasks: TasksClient;
|
|
47
|
+
/** `/v1/files` operations bound to the DP session cookie. */
|
|
48
|
+
readonly files: FilesClient;
|
|
49
|
+
/** Read-only `/v1/conversations` projection bound to the session cookie. */
|
|
50
|
+
readonly conversations: ConversationsClient;
|
|
45
51
|
|
|
46
52
|
private readonly fetchImpl: typeof fetch;
|
|
47
53
|
|
|
@@ -59,6 +65,8 @@ export class IntrospectionApiClient {
|
|
|
59
65
|
onUnauthorized: () => this.reexchange(),
|
|
60
66
|
});
|
|
61
67
|
this.tasks = new TasksClient(http);
|
|
68
|
+
this.files = new FilesClient(http);
|
|
69
|
+
this.conversations = new ConversationsClient(http);
|
|
62
70
|
}
|
|
63
71
|
|
|
64
72
|
/**
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cookie-authenticated, read-only Conversations client for the browser
|
|
3
|
+
* (`/v1/conversations`).
|
|
4
|
+
*
|
|
5
|
+
* Mirrors the Node SDK's runner-bound `ConversationsApi`, but rides the
|
|
6
|
+
* DP `intro_dp_session` cookie via {@link BrowserHttpClient} instead of a
|
|
7
|
+
* bearer token — so a single-page app reads conversation history with the
|
|
8
|
+
* same identity session it uses for tasks and files. Conversations are a
|
|
9
|
+
* projection over the immutable telemetry store: list summaries, walk a
|
|
10
|
+
* conversation's items, or `retrieve()` the resolved state of one turn.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import type {
|
|
14
|
+
ConversationItem,
|
|
15
|
+
ConversationItemInclude,
|
|
16
|
+
ConversationItemList,
|
|
17
|
+
ConversationItemListParams,
|
|
18
|
+
ConversationListParams,
|
|
19
|
+
ConversationResponse,
|
|
20
|
+
ConversationSummary,
|
|
21
|
+
MessagePart,
|
|
22
|
+
Paginated,
|
|
23
|
+
ToolCallResponsePart,
|
|
24
|
+
} from "@introspection-sdk/types";
|
|
25
|
+
import { Paginator, cursorPaginate } from "@introspection-sdk/http";
|
|
26
|
+
import { BrowserHttpClient } from "./http.js";
|
|
27
|
+
|
|
28
|
+
/** Includes requested when building a {@link ConversationResponse}. */
|
|
29
|
+
const RESPONSE_INCLUDES: ConversationItemInclude[] = [
|
|
30
|
+
"gen_ai.input.messages",
|
|
31
|
+
"gen_ai.system_instructions",
|
|
32
|
+
"gen_ai.tool.definitions",
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Items of a conversation (`/v1/conversations/{id}/items`). Read-only.
|
|
37
|
+
*
|
|
38
|
+
* Paging is OpenAI-style underneath: the envelope has NO `next` token —
|
|
39
|
+
* `list()` drives `after` = the previous page's `last_id` while
|
|
40
|
+
* `has_more` is true.
|
|
41
|
+
*/
|
|
42
|
+
export class ConversationItemsClient {
|
|
43
|
+
constructor(private readonly http: BrowserHttpClient) {}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* List items of a conversation. `await` the result for the first page
|
|
47
|
+
* (an OpenAI-style {@link ConversationItemList} envelope), or
|
|
48
|
+
* `for await` it to stream every item across pages (fetched lazily —
|
|
49
|
+
* `limit` sets the page size, `after` the starting cursor; stop early to
|
|
50
|
+
* stop fetching). Pass `order: "asc"` to walk the transcript from the
|
|
51
|
+
* start.
|
|
52
|
+
*
|
|
53
|
+
* Items carry the turn-local delta in `input_messages` — only the
|
|
54
|
+
* messages new to that turn. Use `get()` for the full input history.
|
|
55
|
+
*/
|
|
56
|
+
list(
|
|
57
|
+
conversationId: string,
|
|
58
|
+
params?: ConversationItemListParams,
|
|
59
|
+
): Paginator<ConversationItem, ConversationItemList> {
|
|
60
|
+
return new Paginator(
|
|
61
|
+
{
|
|
62
|
+
fetch: (after) =>
|
|
63
|
+
this.http.request<ConversationItemList>({
|
|
64
|
+
method: "GET",
|
|
65
|
+
path: `/v1/conversations/${encodeURIComponent(conversationId)}/items`,
|
|
66
|
+
query: { ...params, after } as Record<string, unknown>,
|
|
67
|
+
}),
|
|
68
|
+
items: (page) => page.data,
|
|
69
|
+
next: (page) =>
|
|
70
|
+
page.has_more && page.last_id !== null ? page.last_id : undefined,
|
|
71
|
+
},
|
|
72
|
+
params?.after,
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Fetch a single conversation item. Unlike the list route, the
|
|
78
|
+
* detail's `input_messages` is the FULL input history for that span.
|
|
79
|
+
*/
|
|
80
|
+
get(
|
|
81
|
+
conversationId: string,
|
|
82
|
+
itemId: string,
|
|
83
|
+
params?: { include?: ConversationItemInclude[] },
|
|
84
|
+
): Promise<ConversationItem> {
|
|
85
|
+
return this.http.request<ConversationItem>({
|
|
86
|
+
method: "GET",
|
|
87
|
+
path: `/v1/conversations/${encodeURIComponent(conversationId)}/items/${encodeURIComponent(itemId)}`,
|
|
88
|
+
query: params as Record<string, unknown> | undefined,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Read-only Conversations client (`/v1/conversations`).
|
|
95
|
+
*
|
|
96
|
+
* Both `list()` and `items.list()` are auto-paging, but they drive
|
|
97
|
+
* different wire protocols underneath: `list()` walks the standard
|
|
98
|
+
* Introspection cursor envelope's opaque `next` token, while
|
|
99
|
+
* `items.list()` walks an OpenAI-style envelope via `after` = the
|
|
100
|
+
* previous page's `last_id` while `has_more` is true.
|
|
101
|
+
*/
|
|
102
|
+
export class ConversationsClient {
|
|
103
|
+
/** Items of a conversation — `conversations.items.list(...)` etc. */
|
|
104
|
+
readonly items: ConversationItemsClient;
|
|
105
|
+
|
|
106
|
+
constructor(private readonly http: BrowserHttpClient) {
|
|
107
|
+
this.items = new ConversationItemsClient(http);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* List conversation summaries matching `params`. `await` the result for
|
|
112
|
+
* the first page, or `for await` it to stream every summary across
|
|
113
|
+
* pages (fetched lazily — `limit` sets the page size, `next` the
|
|
114
|
+
* starting cursor; stop early to stop fetching).
|
|
115
|
+
*/
|
|
116
|
+
list(params?: ConversationListParams): Paginator<ConversationSummary> {
|
|
117
|
+
return cursorPaginate(
|
|
118
|
+
(next) =>
|
|
119
|
+
this.http.request<Paginated<ConversationSummary>>({
|
|
120
|
+
method: "GET",
|
|
121
|
+
path: "/v1/conversations",
|
|
122
|
+
query: { ...params, next } as Record<string, unknown>,
|
|
123
|
+
}),
|
|
124
|
+
params?.next,
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Responses-API-style retrieve: load the state of a conversation as of
|
|
130
|
+
* one item — the full input history, output, system instructions, and
|
|
131
|
+
* tool definitions of that turn.
|
|
132
|
+
*
|
|
133
|
+
* When `itemId` is omitted, the latest LLM turn is used: the first
|
|
134
|
+
* item (in descending order) whose `node_type` is `"assistant"` or
|
|
135
|
+
* whose `operation_name` is `"chat"`, falling back to the first item
|
|
136
|
+
* with a non-null `output_message`. Returns `null` when the
|
|
137
|
+
* conversation has no items.
|
|
138
|
+
*
|
|
139
|
+
* For the full per-turn transcript instead, iterate
|
|
140
|
+
* `items.list(conversationId, { order: "asc" })`.
|
|
141
|
+
*/
|
|
142
|
+
async retrieve(
|
|
143
|
+
conversationId: string,
|
|
144
|
+
itemId?: string,
|
|
145
|
+
): Promise<ConversationResponse | null> {
|
|
146
|
+
const targetId = itemId ?? (await this.findLatestTurnId(conversationId));
|
|
147
|
+
if (targetId === null) return null;
|
|
148
|
+
|
|
149
|
+
const detail = await this.items.get(conversationId, targetId, {
|
|
150
|
+
include: RESPONSE_INCLUDES,
|
|
151
|
+
});
|
|
152
|
+
const outputMessages =
|
|
153
|
+
detail.gen_ai_output_messages ??
|
|
154
|
+
(detail.output_message ? [detail.output_message] : []);
|
|
155
|
+
return {
|
|
156
|
+
conversation_id: conversationId,
|
|
157
|
+
response_id: detail.response_id ?? null,
|
|
158
|
+
item_id: detail.id,
|
|
159
|
+
created_at: detail.created_at,
|
|
160
|
+
model:
|
|
161
|
+
detail.model_name ??
|
|
162
|
+
detail.response_model ??
|
|
163
|
+
detail.request_model ??
|
|
164
|
+
null,
|
|
165
|
+
provider_name: detail.provider_name ?? null,
|
|
166
|
+
// The single-item route returns the FULL input history here.
|
|
167
|
+
input_messages: normalizeMessages(detail.input_messages),
|
|
168
|
+
output_messages: normalizeMessages(outputMessages),
|
|
169
|
+
system_instructions: detail.system_instructions ?? null,
|
|
170
|
+
tool_definitions: detail.tool_definitions ?? null,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/** Scan items in descending order for the most recent LLM turn. */
|
|
175
|
+
private async findLatestTurnId(
|
|
176
|
+
conversationId: string,
|
|
177
|
+
): Promise<string | null> {
|
|
178
|
+
let fallback: ConversationItem | null = null;
|
|
179
|
+
for await (const item of this.items.list(conversationId, {
|
|
180
|
+
order: "desc",
|
|
181
|
+
})) {
|
|
182
|
+
if (item.node_type === "assistant" || item.operation_name === "chat") {
|
|
183
|
+
return item.id;
|
|
184
|
+
}
|
|
185
|
+
if (fallback === null && item.output_message != null) fallback = item;
|
|
186
|
+
}
|
|
187
|
+
return fallback?.id ?? null;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Defensive normalization for {@link ConversationsClient.retrieve} only:
|
|
193
|
+
* older DP deployments emitted `tool_call_response` parts with a legacy
|
|
194
|
+
* `result` key instead of the semconv `response` key. Map it across so
|
|
195
|
+
* replayed history is always semconv-shaped.
|
|
196
|
+
*/
|
|
197
|
+
function normalizeMessages<T extends { parts: MessagePart[] }>(
|
|
198
|
+
messages: T[],
|
|
199
|
+
): T[] {
|
|
200
|
+
return messages.map((message) => ({
|
|
201
|
+
...message,
|
|
202
|
+
parts: message.parts.map(normalizePart),
|
|
203
|
+
}));
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function normalizePart(part: MessagePart): MessagePart {
|
|
207
|
+
if (part.type !== "tool_call_response") return part;
|
|
208
|
+
const legacy = part as ToolCallResponsePart & { result?: unknown };
|
|
209
|
+
if (legacy.response !== undefined || legacy.result === undefined) {
|
|
210
|
+
return part;
|
|
211
|
+
}
|
|
212
|
+
const { result, ...rest } = legacy;
|
|
213
|
+
return { ...rest, response: result };
|
|
214
|
+
}
|
package/src/api/files.ts
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cookie-authenticated Files client for the browser (`/v1/files`).
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the Node SDK's runner-bound `FilesApi`, but rides the DP
|
|
5
|
+
* `intro_dp_session` cookie via {@link BrowserHttpClient} instead of a
|
|
6
|
+
* bearer token — so a single-page app reads and writes files with the
|
|
7
|
+
* same identity session it uses for tasks and conversations. The DP
|
|
8
|
+
* derives the owning `identity_key` from the session JWT; per-identity
|
|
9
|
+
* file visibility is enforced server-side.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type {
|
|
13
|
+
File as FileResource,
|
|
14
|
+
FileCreateOptions,
|
|
15
|
+
FileCreateTextParams,
|
|
16
|
+
FileListParams,
|
|
17
|
+
FileType,
|
|
18
|
+
FileUpdateParams,
|
|
19
|
+
ListParams,
|
|
20
|
+
Paginated,
|
|
21
|
+
} from "@introspection-sdk/types";
|
|
22
|
+
import { Paginator, cursorPaginate } from "@introspection-sdk/http";
|
|
23
|
+
import { BrowserHttpClient } from "./http.js";
|
|
24
|
+
|
|
25
|
+
export type FileUploadBody =
|
|
26
|
+
| { file: Blob; name?: string; file_type?: FileType }
|
|
27
|
+
| {
|
|
28
|
+
file: Uint8Array;
|
|
29
|
+
name: string;
|
|
30
|
+
file_type?: FileType;
|
|
31
|
+
contentType?: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** Versions of a file (`/v1/files/{id}/versions`). */
|
|
35
|
+
export class FileVersionsClient {
|
|
36
|
+
constructor(private readonly http: BrowserHttpClient) {}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* List versions of a file. `await` the result for the first page, or
|
|
40
|
+
* `for await` it to stream every version across pages (fetched lazily;
|
|
41
|
+
* stop early to stop fetching).
|
|
42
|
+
*/
|
|
43
|
+
list(fileId: string, params?: ListParams): Paginator<FileResource> {
|
|
44
|
+
return cursorPaginate(
|
|
45
|
+
(next) =>
|
|
46
|
+
this.http.request<Paginated<FileResource>>({
|
|
47
|
+
method: "GET",
|
|
48
|
+
path: `/v1/files/${encodeURIComponent(fileId)}/versions`,
|
|
49
|
+
query: { ...params, next } as Record<string, unknown>,
|
|
50
|
+
}),
|
|
51
|
+
params?.next,
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
get(fileId: string, versionId: string): Promise<FileResource> {
|
|
56
|
+
return this.http.request<FileResource>({
|
|
57
|
+
method: "GET",
|
|
58
|
+
path: `/v1/files/${encodeURIComponent(fileId)}/versions/${encodeURIComponent(versionId)}`,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
create(
|
|
63
|
+
fileId: string,
|
|
64
|
+
body: FileUploadBody,
|
|
65
|
+
options?: FileCreateOptions,
|
|
66
|
+
): Promise<FileResource> {
|
|
67
|
+
const form = toFormData(body, options);
|
|
68
|
+
return this.http.request<FileResource>({
|
|
69
|
+
method: "POST",
|
|
70
|
+
path: `/v1/files/${encodeURIComponent(fileId)}/versions`,
|
|
71
|
+
body: form,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Cookie-authenticated `/v1/files` client. Mirrors the Node SDK's
|
|
78
|
+
* `FilesApi` shape but is bound to a DP session cookie rather than a
|
|
79
|
+
* bearer token.
|
|
80
|
+
*/
|
|
81
|
+
export class FilesClient {
|
|
82
|
+
readonly versions: FileVersionsClient;
|
|
83
|
+
|
|
84
|
+
constructor(private readonly http: BrowserHttpClient) {
|
|
85
|
+
this.versions = new FileVersionsClient(http);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* List files matching `params`. `await` the result for the first page,
|
|
90
|
+
* or `for await` it to stream every file across pages (fetched lazily —
|
|
91
|
+
* `limit` sets the page size, `next` the starting cursor; stop early to
|
|
92
|
+
* stop fetching).
|
|
93
|
+
*/
|
|
94
|
+
list(params?: FileListParams): Paginator<FileResource> {
|
|
95
|
+
return cursorPaginate(
|
|
96
|
+
(next) =>
|
|
97
|
+
this.http.request<Paginated<FileResource>>({
|
|
98
|
+
method: "GET",
|
|
99
|
+
path: "/v1/files",
|
|
100
|
+
query: { ...params, next } as Record<string, unknown>,
|
|
101
|
+
}),
|
|
102
|
+
params?.next,
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
upload(
|
|
107
|
+
body: FileUploadBody,
|
|
108
|
+
options?: FileCreateOptions,
|
|
109
|
+
): Promise<FileResource> {
|
|
110
|
+
const form = toFormData(body, options);
|
|
111
|
+
return this.http.request<FileResource>({
|
|
112
|
+
method: "POST",
|
|
113
|
+
path: "/v1/files",
|
|
114
|
+
body: form,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
createText(
|
|
119
|
+
body: FileCreateTextParams,
|
|
120
|
+
options?: FileCreateOptions,
|
|
121
|
+
): Promise<FileResource> {
|
|
122
|
+
return this.http.request<FileResource>({
|
|
123
|
+
method: "POST",
|
|
124
|
+
path: "/v1/files",
|
|
125
|
+
body: options?.visibility
|
|
126
|
+
? { ...body, visibility: options.visibility }
|
|
127
|
+
: body,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
get(fileId: string): Promise<FileResource> {
|
|
132
|
+
return this.http.request<FileResource>({
|
|
133
|
+
method: "GET",
|
|
134
|
+
path: `/v1/files/${encodeURIComponent(fileId)}`,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
update(fileId: string, body: FileUpdateParams): Promise<FileResource> {
|
|
139
|
+
return this.http.request<FileResource>({
|
|
140
|
+
method: "PATCH",
|
|
141
|
+
path: `/v1/files/${encodeURIComponent(fileId)}`,
|
|
142
|
+
body,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
delete(fileId: string): Promise<void> {
|
|
147
|
+
return this.http.request<void>({
|
|
148
|
+
method: "DELETE",
|
|
149
|
+
path: `/v1/files/${encodeURIComponent(fileId)}`,
|
|
150
|
+
expect: "empty",
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
download(fileId: string): Promise<Uint8Array> {
|
|
155
|
+
return this.http.request<Uint8Array>({
|
|
156
|
+
method: "GET",
|
|
157
|
+
path: `/v1/files/${encodeURIComponent(fileId)}/content`,
|
|
158
|
+
expect: "bytes",
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
downloadStream(fileId: string): Promise<ReadableStream<Uint8Array>> {
|
|
163
|
+
return this.http.request<ReadableStream<Uint8Array>>({
|
|
164
|
+
method: "GET",
|
|
165
|
+
path: `/v1/files/${encodeURIComponent(fileId)}/content`,
|
|
166
|
+
expect: "stream",
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function toFormData(
|
|
172
|
+
body: FileUploadBody,
|
|
173
|
+
options?: FileCreateOptions,
|
|
174
|
+
): FormData {
|
|
175
|
+
const fd = new FormData();
|
|
176
|
+
if ("file" in body && body.file instanceof Blob) {
|
|
177
|
+
fd.append("file", body.file, body.name);
|
|
178
|
+
} else {
|
|
179
|
+
// Uint8Array branch — copy into a fresh ArrayBuffer so the Blob
|
|
180
|
+
// constructor sees a concrete ArrayBuffer (not ArrayBufferLike,
|
|
181
|
+
// which TS rejects under nodenext lib).
|
|
182
|
+
const u8 = (body as { file: Uint8Array }).file;
|
|
183
|
+
const ct =
|
|
184
|
+
(body as { contentType?: string }).contentType ??
|
|
185
|
+
"application/octet-stream";
|
|
186
|
+
const ab = u8.buffer.slice(
|
|
187
|
+
u8.byteOffset,
|
|
188
|
+
u8.byteOffset + u8.byteLength,
|
|
189
|
+
) as ArrayBuffer;
|
|
190
|
+
fd.append("file", new Blob([ab], { type: ct }), body.name);
|
|
191
|
+
}
|
|
192
|
+
if (body.name) fd.append("name", body.name);
|
|
193
|
+
if (body.file_type) fd.append("file_type", body.file_type);
|
|
194
|
+
if (options?.visibility) fd.append("visibility", options.visibility);
|
|
195
|
+
return fd;
|
|
196
|
+
}
|
package/src/api/index.ts
CHANGED
|
@@ -38,6 +38,15 @@ export {
|
|
|
38
38
|
type CreateTaskParams,
|
|
39
39
|
type StartTaskParams,
|
|
40
40
|
} from "./tasks.js";
|
|
41
|
+
export {
|
|
42
|
+
FilesClient,
|
|
43
|
+
FileVersionsClient,
|
|
44
|
+
type FileUploadBody,
|
|
45
|
+
} from "./files.js";
|
|
46
|
+
export {
|
|
47
|
+
ConversationsClient,
|
|
48
|
+
ConversationItemsClient,
|
|
49
|
+
} from "./conversations.js";
|
|
41
50
|
export { BrowserHttpClient, type BrowserHttpConfig } from "./http.js";
|
|
42
51
|
export { parseSse } from "./sse.js";
|
|
43
52
|
export {
|
|
@@ -60,6 +69,20 @@ export type {
|
|
|
60
69
|
RunIdentityInput,
|
|
61
70
|
Paginated,
|
|
62
71
|
SseEvent,
|
|
72
|
+
File,
|
|
73
|
+
FileType,
|
|
74
|
+
FileListParams,
|
|
75
|
+
FileUpdateParams,
|
|
76
|
+
FileCreateTextParams,
|
|
77
|
+
FileCreateOptions,
|
|
78
|
+
ListParams,
|
|
79
|
+
ConversationSummary,
|
|
80
|
+
ConversationItem,
|
|
81
|
+
ConversationItemList,
|
|
82
|
+
ConversationListParams,
|
|
83
|
+
ConversationItemListParams,
|
|
84
|
+
ConversationItemInclude,
|
|
85
|
+
ConversationResponse,
|
|
63
86
|
} from "@introspection-sdk/types";
|
|
64
87
|
export {
|
|
65
88
|
IntrospectionAPIError,
|