@introspection-sdk/introspection-node 0.5.3 → 0.5.5
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/dist/client.d.ts +3 -4
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +3 -6
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +2 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/resources/runtimes.d.ts +4 -74
- package/dist/resources/runtimes.d.ts.map +1 -1
- package/dist/resources/runtimes.js +5 -169
- package/dist/resources/runtimes.js.map +1 -1
- package/dist/runner.d.ts +2 -3
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +3 -3
- package/dist/runner.js.map +1 -1
- package/package.json +7 -7
- package/src/client.ts +3 -6
- package/src/index.ts +9 -6
- package/src/resources/runtimes.ts +14 -217
- package/src/runner.ts +8 -3
- package/dist/runner-resources/conversations.d.ts +0 -73
- package/dist/runner-resources/conversations.d.ts.map +0 -1
- package/dist/runner-resources/conversations.js +0 -161
- package/dist/runner-resources/conversations.js.map +0 -1
- package/dist/runner-resources/files.d.ts +0 -45
- package/dist/runner-resources/files.d.ts.map +0 -1
- package/dist/runner-resources/files.js +0 -129
- package/dist/runner-resources/files.js.map +0 -1
- package/dist/runner-resources/tasks.d.ts +0 -45
- package/dist/runner-resources/tasks.d.ts.map +0 -1
- package/dist/runner-resources/tasks.js +0 -127
- package/dist/runner-resources/tasks.js.map +0 -1
- package/src/runner-resources/conversations.ts +0 -202
- package/src/runner-resources/files.ts +0 -179
- package/src/runner-resources/tasks.ts +0 -158
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
> @introspection-sdk/introspection-node@0.5.
|
|
2
|
+
> @introspection-sdk/introspection-node@0.5.5 build /home/runner/work/introspection-js-sdk/introspection-js-sdk/packages/introspection-node
|
|
3
3
|
> tsc
|
|
4
4
|
|
package/dist/client.d.ts
CHANGED
|
@@ -24,7 +24,6 @@ import { type RecipesApi } from "./resources/recipes.js";
|
|
|
24
24
|
* ```typescript
|
|
25
25
|
* const client = new IntrospectionClient({
|
|
26
26
|
* token: process.env.INTROSPECTION_TOKEN,
|
|
27
|
-
* projectId: "proj_…",
|
|
28
27
|
* });
|
|
29
28
|
*
|
|
30
29
|
* // Open a runner from a runtime, then drive it.
|
|
@@ -43,11 +42,11 @@ export declare class IntrospectionClient {
|
|
|
43
42
|
readonly cpHttp: HttpClient;
|
|
44
43
|
/** @internal — passed through to Runner so it can build its own DP HTTP client. */
|
|
45
44
|
readonly advancedOptions: AdvancedOptions;
|
|
46
|
-
readonly projectId: string | undefined;
|
|
47
45
|
/**
|
|
48
46
|
* CRUD on `/v1/runtimes` and the `(idOrName) => RuntimeHandle` factory.
|
|
49
|
-
* Call as `client.runtimes("customer-agent").run()
|
|
50
|
-
* `
|
|
47
|
+
* Call as `client.runtimes("customer-agent").run()`. The project is taken
|
|
48
|
+
* from the API key server-side; pass `project_id` to a CRUD helper only to
|
|
49
|
+
* override it per call.
|
|
51
50
|
*/
|
|
52
51
|
readonly runtimes: RuntimesApi & RuntimeHandleFactory;
|
|
53
52
|
/**
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,cAAc,EACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAExE
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,cAAc,EACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAExE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,mBAAmB;IAC9B,2EAA2E;IAC3E,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,mFAAmF;IACnF,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAE1C;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,WAAW,GAAG,oBAAoB,CAAC;IAEtD;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,cAAc,GAAG,uBAAuB,CAAC;IAE/D;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;gBAEjB,OAAO,GAAE,0BAA+B;IAgCpD,wCAAwC;IAClC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAKhC"}
|
package/dist/client.js
CHANGED
|
@@ -23,7 +23,6 @@ import { attachRecipes } from "./resources/recipes.js";
|
|
|
23
23
|
* ```typescript
|
|
24
24
|
* const client = new IntrospectionClient({
|
|
25
25
|
* token: process.env.INTROSPECTION_TOKEN,
|
|
26
|
-
* projectId: "proj_…",
|
|
27
26
|
* });
|
|
28
27
|
*
|
|
29
28
|
* // Open a runner from a runtime, then drive it.
|
|
@@ -42,11 +41,11 @@ export class IntrospectionClient {
|
|
|
42
41
|
cpHttp;
|
|
43
42
|
/** @internal — passed through to Runner so it can build its own DP HTTP client. */
|
|
44
43
|
advancedOptions;
|
|
45
|
-
projectId;
|
|
46
44
|
/**
|
|
47
45
|
* CRUD on `/v1/runtimes` and the `(idOrName) => RuntimeHandle` factory.
|
|
48
|
-
* Call as `client.runtimes("customer-agent").run()
|
|
49
|
-
* `
|
|
46
|
+
* Call as `client.runtimes("customer-agent").run()`. The project is taken
|
|
47
|
+
* from the API key server-side; pass `project_id` to a CRUD helper only to
|
|
48
|
+
* override it per call.
|
|
50
49
|
*/
|
|
51
50
|
runtimes;
|
|
52
51
|
/**
|
|
@@ -63,8 +62,6 @@ export class IntrospectionClient {
|
|
|
63
62
|
const token = options.token || process.env.INTROSPECTION_TOKEN || "";
|
|
64
63
|
const advanced = options.advanced || {};
|
|
65
64
|
this.advancedOptions = advanced;
|
|
66
|
-
this.projectId =
|
|
67
|
-
options.projectId || process.env.INTROSPECTION_PROJECT_ID || undefined;
|
|
68
65
|
const baseApiUrl = advanced.baseApiUrl ||
|
|
69
66
|
process.env.INTROSPECTION_BASE_API_URL ||
|
|
70
67
|
"https://api.introspection.dev";
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,YAAY,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EACL,cAAc,GAGf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,iBAAiB,GAGlB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAAmB,MAAM,wBAAwB,CAAC;AAExE
|
|
1
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,CAAC;QAEH,IAAI,CAAC,QAAQ,GAAG,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAClD,IAAI,CAAC,WAAW,GAAG,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACxD,IAAI,CAAC,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAE1C,SAAS,CAAC,IAAI,CAAC,wCAAwC,UAAU,EAAE,CAAC,CAAC;IACvE,CAAC;IAED,wCAAwC;IACxC,KAAK,CAAC,QAAQ;QACZ,kEAAkE;QAClE,gDAAgD;QAChD,SAAS,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC3D,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,11 +10,8 @@
|
|
|
10
10
|
*/
|
|
11
11
|
export { IntrospectionClient } from "./client.js";
|
|
12
12
|
export type { AdvancedOptions, IntrospectionClientOptions, FeedbackOptions, UserTraits, } from "./types.js";
|
|
13
|
-
export {
|
|
14
|
-
export type { StartParams } from "
|
|
15
|
-
export { FilesApi, FileVersionsApi } from "./runner-resources/files.js";
|
|
16
|
-
export type { FileUploadBody } from "./runner-resources/files.js";
|
|
17
|
-
export { ConversationsApi, ConversationItemsApi, } from "./runner-resources/conversations.js";
|
|
13
|
+
export { ConversationItemsApi, ConversationsApi, FileVersionsApi, FilesApi, RunHandle, SharesApi, TaskRunsApi, TasksApi, } from "@introspection-sdk/http";
|
|
14
|
+
export type { FileUploadBody, StartParams } from "@introspection-sdk/http";
|
|
18
15
|
export { HttpClient } from "./http.js";
|
|
19
16
|
export type { ResolvedApiConfig } from "./http.js";
|
|
20
17
|
export { parseSse } from "./streaming.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAA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,qCAAqC,GACtC,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,QAAQ,IAAI,cAAc,GAC3B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,oCAAoC,EACpC,uCAAuC,EACvC,uCAAuC,EACvC,mCAAmC,GACpC,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,eAAe,EACf,aAAa,EACb,yBAAyB,EACzB,UAAU,EACV,UAAU,GACX,MAAM,wBAAwB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -12,9 +12,7 @@
|
|
|
12
12
|
export { IntrospectionClient } from "./client.js";
|
|
13
13
|
// Runner-bound REST namespaces (runner.tasks, runner.files,
|
|
14
14
|
// runner.conversations) + HTTP/SSE.
|
|
15
|
-
export {
|
|
16
|
-
export { FilesApi, FileVersionsApi } from "./runner-resources/files.js";
|
|
17
|
-
export { ConversationsApi, ConversationItemsApi, } from "./runner-resources/conversations.js";
|
|
15
|
+
export { ConversationItemsApi, ConversationsApi, FileVersionsApi, FilesApi, RunHandle, SharesApi, TaskRunsApi, TasksApi, } from "@introspection-sdk/http";
|
|
18
16
|
export { HttpClient } from "./http.js";
|
|
19
17
|
export { parseSse } from "./streaming.js";
|
|
20
18
|
// Runner + CP resources.
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,eAAe;AACf,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAUlD,4DAA4D;AAC5D,oCAAoC;AACpC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,eAAe;AACf,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAUlD,4DAA4D;AAC5D,oCAAoC;AACpC,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,QAAQ,EACR,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,GACT,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,yBAAyB;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EACL,WAAW,EACX,aAAa,EACb,cAAc,EACd,MAAM,GACP,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAgEnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,WAAW,EACX,YAAY,EACZ,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAiBlC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,kEAAkE;AAClE,OAAO,EACL,+BAA+B,EAC/B,gCAAgC,EAChC,8BAA8B,EAC9B,qCAAqC,GACtC,MAAM,wBAAwB,CAAC;AAShC,2DAA2D;AAC3D,OAAO,EACL,oCAAoC,EACpC,uCAAuC,EACvC,uCAAuC,EACvC,mCAAmC,GACpC,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,82 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RuntimeHandle, RuntimesClient, isUuid, type RuntimeHandleFactory as SharedRuntimeHandleFactory } from "@introspection-sdk/http";
|
|
2
2
|
import type { HttpClient } from "../http.js";
|
|
3
3
|
import type { IntrospectionClient } from "../client.js";
|
|
4
|
-
import { Paginator } from "../pagination.js";
|
|
5
4
|
import { Runner } from "../runner.js";
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
identity?: {
|
|
9
|
-
user_id?: string;
|
|
10
|
-
anonymous_id?: string;
|
|
11
|
-
conversation_id?: string;
|
|
12
|
-
};
|
|
13
|
-
ttl_seconds?: number;
|
|
14
|
-
recipe_id?: Uuid;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Programmatic CRUD for `/v1/runtimes` on the CP. Mounted on the
|
|
18
|
-
* IntrospectionClient as a callable hybrid (see `RuntimeHandleFactory`).
|
|
19
|
-
*/
|
|
20
|
-
export declare class RuntimesApi {
|
|
21
|
-
private readonly http;
|
|
5
|
+
export { RuntimeHandle, isUuid };
|
|
6
|
+
export declare class RuntimesApi extends RuntimesClient<Runner> {
|
|
22
7
|
private readonly client;
|
|
23
8
|
constructor(http: HttpClient, client: IntrospectionClient);
|
|
24
|
-
/**
|
|
25
|
-
* List runtimes matching `params`. `await` the result for the first
|
|
26
|
-
* page, or `for await` it to stream every runtime across pages (fetched
|
|
27
|
-
* lazily — `limit` sets the page size, `next` the starting cursor; stop
|
|
28
|
-
* early to stop fetching).
|
|
29
|
-
*/
|
|
30
|
-
list(params: RuntimeListParams): Paginator<Runtime>;
|
|
31
|
-
get(id: Uuid, params: {
|
|
32
|
-
project_id?: Uuid;
|
|
33
|
-
}): Promise<Runtime>;
|
|
34
|
-
create(input: RuntimeCreate): Promise<Runtime>;
|
|
35
|
-
update(id: Uuid, input: RuntimeUpdate): Promise<Runtime>;
|
|
36
|
-
delete(id: Uuid): Promise<void>;
|
|
37
|
-
/** Resolve a name to a runtime by querying `/v1/runtimes?name=…`. */
|
|
38
|
-
resolveByName(name: string, projectId?: Uuid): Promise<Runtime>;
|
|
39
|
-
/** POST `/v1/runtimes/{id}/run` and wrap the result in a `Runner`. */
|
|
40
|
-
runById(id: Uuid, opts?: RunRequest): Promise<Runner>;
|
|
41
|
-
activateById(id: Uuid, params?: {
|
|
42
|
-
project_id?: Uuid;
|
|
43
|
-
}): Promise<Runtime>;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Handle returned by `client.runtimes(idOrName)`. Resolves the underlying
|
|
47
|
-
* runtime id lazily — if you pass a UUID, no extra lookup happens; if you
|
|
48
|
-
* pass a name, the first call that needs the id will hit
|
|
49
|
-
* `/v1/runtimes?name=…`.
|
|
50
|
-
*/
|
|
51
|
-
export declare class RuntimeHandle {
|
|
52
|
-
private readonly api;
|
|
53
|
-
private readonly client;
|
|
54
|
-
private readonly idOrName;
|
|
55
|
-
private resolvedId;
|
|
56
|
-
private readonly pinnedRecipeId;
|
|
57
|
-
constructor(api: RuntimesApi, client: IntrospectionClient, idOrName: string, pinnedRecipeId?: Uuid | null);
|
|
58
|
-
private resolveId;
|
|
59
|
-
/**
|
|
60
|
-
* Pin to a specific recipe — canary a previous version. Subsequent
|
|
61
|
-
* `.run()` calls on the returned handle open a runner against the
|
|
62
|
-
* runtime row in this name whose `recipe_id` matches `recipe.id`
|
|
63
|
-
* (resolved server-side by CP).
|
|
64
|
-
*
|
|
65
|
-
* Returns a new child {@link RuntimeHandle}; the original handle is
|
|
66
|
-
* unaffected. Accepts a {@link Recipe} object (uses `.id`) or a
|
|
67
|
-
* recipe id string.
|
|
68
|
-
*/
|
|
69
|
-
pin(recipe: Recipe | string): RuntimeHandle;
|
|
70
|
-
run(opts?: RunRequest): Promise<Runner>;
|
|
71
|
-
activate(params?: {
|
|
72
|
-
projectId?: Uuid;
|
|
73
|
-
}): Promise<Runtime>;
|
|
74
9
|
}
|
|
75
|
-
|
|
76
|
-
* Callable hybrid: `client.runtimes` exposes the CRUD methods of
|
|
77
|
-
* `RuntimesApi` AND can be invoked as a function returning a
|
|
78
|
-
* `RuntimeHandle`. Realised by `attachRuntimes` below.
|
|
79
|
-
*/
|
|
80
|
-
export type RuntimeHandleFactory = (idOrName: string) => RuntimeHandle;
|
|
10
|
+
export type RuntimeHandleFactory = SharedRuntimeHandleFactory<Runner>;
|
|
81
11
|
export declare function attachRuntimes(client: IntrospectionClient, http: HttpClient): RuntimesApi & RuntimeHandleFactory;
|
|
82
12
|
//# sourceMappingURL=runtimes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimes.d.ts","sourceRoot":"","sources":["../../src/resources/runtimes.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"runtimes.d.ts","sourceRoot":"","sources":["../../src/resources/runtimes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,cAAc,EAEd,MAAM,EACN,KAAK,oBAAoB,IAAI,0BAA0B,EACxD,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC;AAEjC,qBAAa,WAAY,SAAQ,cAAc,CAAC,MAAM,CAAC;IAGnD,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADvB,IAAI,EAAE,UAAU,EACC,MAAM,EAAE,mBAAmB;CAI/C;AAED,MAAM,MAAM,oBAAoB,GAAG,0BAA0B,CAAC,MAAM,CAAC,CAAC;AAEtE,wBAAgB,cAAc,CAC5B,MAAM,EAAE,mBAAmB,EAC3B,IAAI,EAAE,UAAU,GACf,WAAW,GAAG,oBAAoB,CAGpC"}
|
|
@@ -1,179 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { cursorPaginate } from "../pagination.js";
|
|
1
|
+
import { RuntimeHandle, RuntimesClient, attachRuntimes as attachSharedRuntimes, isUuid, } from "@introspection-sdk/http";
|
|
3
2
|
import { Runner } from "../runner.js";
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
return UUID_RE.test(value);
|
|
7
|
-
}
|
|
8
|
-
function toRunBody(opts) {
|
|
9
|
-
if (!opts)
|
|
10
|
-
return undefined;
|
|
11
|
-
const out = {};
|
|
12
|
-
if (opts.identity)
|
|
13
|
-
out.identity = opts.identity;
|
|
14
|
-
if (opts.ttl_seconds !== undefined)
|
|
15
|
-
out.ttl_seconds = opts.ttl_seconds;
|
|
16
|
-
if (opts.recipe_id !== undefined)
|
|
17
|
-
out.recipe_id = opts.recipe_id;
|
|
18
|
-
return out;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Programmatic CRUD for `/v1/runtimes` on the CP. Mounted on the
|
|
22
|
-
* IntrospectionClient as a callable hybrid (see `RuntimeHandleFactory`).
|
|
23
|
-
*/
|
|
24
|
-
export class RuntimesApi {
|
|
25
|
-
http;
|
|
3
|
+
export { RuntimeHandle, isUuid };
|
|
4
|
+
export class RuntimesApi extends RuntimesClient {
|
|
26
5
|
client;
|
|
27
6
|
constructor(http, client) {
|
|
28
|
-
this.
|
|
29
|
-
this.client = client;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* List runtimes matching `params`. `await` the result for the first
|
|
33
|
-
* page, or `for await` it to stream every runtime across pages (fetched
|
|
34
|
-
* lazily — `limit` sets the page size, `next` the starting cursor; stop
|
|
35
|
-
* early to stop fetching).
|
|
36
|
-
*/
|
|
37
|
-
list(params) {
|
|
38
|
-
return cursorPaginate((next) => this.http.request({
|
|
39
|
-
method: "GET",
|
|
40
|
-
path: "/v1/runtimes",
|
|
41
|
-
query: { ...params, next },
|
|
42
|
-
}), params.next);
|
|
43
|
-
}
|
|
44
|
-
get(id, params) {
|
|
45
|
-
return this.http.request({
|
|
46
|
-
method: "GET",
|
|
47
|
-
path: `/v1/runtimes/${encodeURIComponent(id)}`,
|
|
48
|
-
query: params,
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
create(input) {
|
|
52
|
-
return this.http.request({
|
|
53
|
-
method: "POST",
|
|
54
|
-
path: "/v1/runtimes",
|
|
55
|
-
body: input,
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
update(id, input) {
|
|
59
|
-
return this.http.request({
|
|
60
|
-
method: "PATCH",
|
|
61
|
-
path: `/v1/runtimes/${encodeURIComponent(id)}`,
|
|
62
|
-
body: input,
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
delete(id) {
|
|
66
|
-
return this.http.request({
|
|
67
|
-
method: "DELETE",
|
|
68
|
-
path: `/v1/runtimes/${encodeURIComponent(id)}`,
|
|
69
|
-
expect: "empty",
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
/** Resolve a name to a runtime by querying `/v1/runtimes?name=…`. */
|
|
73
|
-
async resolveByName(name, projectId) {
|
|
74
|
-
for await (const r of this.list({
|
|
75
|
-
project_id: projectId,
|
|
76
|
-
name,
|
|
77
|
-
limit: 2,
|
|
78
|
-
})) {
|
|
79
|
-
if (r.name === name)
|
|
80
|
-
return r;
|
|
81
|
-
}
|
|
82
|
-
throw new NotFoundError({
|
|
83
|
-
message: `Runtime '${name}' not found${projectId ? ` in project ${projectId}` : ""}`,
|
|
84
|
-
status: 404,
|
|
85
|
-
code: "not_found",
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
/** POST `/v1/runtimes/{id}/run` and wrap the result in a `Runner`. */
|
|
89
|
-
async runById(id, opts) {
|
|
90
|
-
const spec = await this.http.request({
|
|
91
|
-
method: "POST",
|
|
92
|
-
path: `/v1/runtimes/${encodeURIComponent(id)}/run`,
|
|
93
|
-
body: toRunBody(opts) ?? {},
|
|
94
|
-
});
|
|
95
|
-
const source = {
|
|
96
|
-
kind: "runtime",
|
|
97
|
-
id,
|
|
98
|
-
options: opts,
|
|
99
|
-
};
|
|
100
|
-
return new Runner(this.client, source, spec);
|
|
101
|
-
}
|
|
102
|
-
async activateById(id, params) {
|
|
103
|
-
return this.http.request({
|
|
104
|
-
method: "POST",
|
|
105
|
-
path: `/v1/runtimes/${encodeURIComponent(id)}/activate`,
|
|
106
|
-
query: params,
|
|
107
|
-
body: {},
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Handle returned by `client.runtimes(idOrName)`. Resolves the underlying
|
|
113
|
-
* runtime id lazily — if you pass a UUID, no extra lookup happens; if you
|
|
114
|
-
* pass a name, the first call that needs the id will hit
|
|
115
|
-
* `/v1/runtimes?name=…`.
|
|
116
|
-
*/
|
|
117
|
-
export class RuntimeHandle {
|
|
118
|
-
api;
|
|
119
|
-
client;
|
|
120
|
-
idOrName;
|
|
121
|
-
resolvedId;
|
|
122
|
-
pinnedRecipeId;
|
|
123
|
-
constructor(api, client, idOrName, pinnedRecipeId = null) {
|
|
124
|
-
this.api = api;
|
|
7
|
+
super(http, (source, spec) => new Runner(this.client, source, spec));
|
|
125
8
|
this.client = client;
|
|
126
|
-
this.idOrName = idOrName;
|
|
127
|
-
this.resolvedId = isUuid(idOrName) ? idOrName : null;
|
|
128
|
-
this.pinnedRecipeId = pinnedRecipeId;
|
|
129
|
-
}
|
|
130
|
-
async resolveId() {
|
|
131
|
-
if (this.resolvedId)
|
|
132
|
-
return this.resolvedId;
|
|
133
|
-
const runtime = await this.api.resolveByName(this.idOrName, this.client.projectId);
|
|
134
|
-
this.resolvedId = runtime.id;
|
|
135
|
-
return runtime.id;
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Pin to a specific recipe — canary a previous version. Subsequent
|
|
139
|
-
* `.run()` calls on the returned handle open a runner against the
|
|
140
|
-
* runtime row in this name whose `recipe_id` matches `recipe.id`
|
|
141
|
-
* (resolved server-side by CP).
|
|
142
|
-
*
|
|
143
|
-
* Returns a new child {@link RuntimeHandle}; the original handle is
|
|
144
|
-
* unaffected. Accepts a {@link Recipe} object (uses `.id`) or a
|
|
145
|
-
* recipe id string.
|
|
146
|
-
*/
|
|
147
|
-
pin(recipe) {
|
|
148
|
-
const recipeId = typeof recipe === "string" ? recipe : recipe.id;
|
|
149
|
-
return new RuntimeHandle(this.api, this.client, this.idOrName, recipeId);
|
|
150
|
-
}
|
|
151
|
-
async run(opts) {
|
|
152
|
-
const id = await this.resolveId();
|
|
153
|
-
const merged = this.pinnedRecipeId !== null
|
|
154
|
-
? { ...(opts ?? {}), recipe_id: this.pinnedRecipeId }
|
|
155
|
-
: opts;
|
|
156
|
-
return this.api.runById(id, merged);
|
|
157
|
-
}
|
|
158
|
-
async activate(params) {
|
|
159
|
-
const id = await this.resolveId();
|
|
160
|
-
return this.api.activateById(id, { project_id: params?.projectId });
|
|
161
9
|
}
|
|
162
10
|
}
|
|
163
11
|
export function attachRuntimes(client, http) {
|
|
164
12
|
const api = new RuntimesApi(http, client);
|
|
165
|
-
|
|
166
|
-
// Mount the API methods on the factory function. Using bound copies so
|
|
167
|
-
// the methods can be invoked off the proxy without losing `this`.
|
|
168
|
-
const hybrid = factory;
|
|
169
|
-
hybrid.list = api.list.bind(api);
|
|
170
|
-
hybrid.get = api.get.bind(api);
|
|
171
|
-
hybrid.create = api.create.bind(api);
|
|
172
|
-
hybrid.update = api.update.bind(api);
|
|
173
|
-
hybrid.delete = api.delete.bind(api);
|
|
174
|
-
hybrid.resolveByName = api.resolveByName.bind(api);
|
|
175
|
-
hybrid.runById = api.runById.bind(api);
|
|
176
|
-
hybrid.activateById = api.activateById.bind(api);
|
|
177
|
-
return hybrid;
|
|
13
|
+
return attachSharedRuntimes(api);
|
|
178
14
|
}
|
|
179
15
|
//# sourceMappingURL=runtimes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimes.js","sourceRoot":"","sources":["../../src/resources/runtimes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runtimes.js","sourceRoot":"","sources":["../../src/resources/runtimes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,cAAc,EACd,cAAc,IAAI,oBAAoB,EACtC,MAAM,GAEP,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC;AAEjC,MAAM,OAAO,WAAY,SAAQ,cAAsB;IAGlC;IAFnB,YACE,IAAgB,EACC,MAA2B;QAE5C,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;QAFpD,WAAM,GAAN,MAAM,CAAqB;IAG9C,CAAC;CACF;AAID,MAAM,UAAU,cAAc,CAC5B,MAA2B,EAC3B,IAAgB;IAEhB,MAAM,GAAG,GAAG,IAAI,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC1C,OAAO,oBAAoB,CAAC,GAAG,CAAuC,CAAC;AACzE,CAAC"}
|
package/dist/runner.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { type RunnerContext, type RunnerDeployment, type RunnerSpec, type RunRequest, type Uuid } from "@introspection-sdk/types";
|
|
2
|
-
import { TasksApi } from "
|
|
3
|
-
import { FilesApi } from "./runner-resources/files.js";
|
|
4
|
-
import { ConversationsApi } from "./runner-resources/conversations.js";
|
|
2
|
+
import { ConversationsApi, FilesApi, SharesApi, TasksApi } from "@introspection-sdk/http";
|
|
5
3
|
import type { IntrospectionClient } from "./client.js";
|
|
6
4
|
/**
|
|
7
5
|
* Where this Runner came from, so `refresh()` can call CP again with the
|
|
@@ -37,6 +35,7 @@ export declare class Runner {
|
|
|
37
35
|
readonly tasks: TasksApi;
|
|
38
36
|
readonly files: FilesApi;
|
|
39
37
|
readonly conversations: ConversationsApi;
|
|
38
|
+
readonly shares: SharesApi;
|
|
40
39
|
constructor(client: IntrospectionClient, source: RunnerSource, spec: RunnerSpec);
|
|
41
40
|
/** DP REST base URL the runner is bound to. */
|
|
42
41
|
get dpEndpoint(): string;
|
package/dist/runner.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,IAAI,EACV,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,IAAI,EACV,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD;;;;GAIG;AACH,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,UAAU,CAAA;CAAE,GACnD;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC;AAE3D;;;;;;;;;;GAUG;AACH,qBAAa,MAAM;IAYf,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAZzB,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,MAAM,CAAS;IAGvB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,aAAa,EAAE,gBAAgB,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;gBAGR,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,YAAY,EACrC,IAAI,EAAE,UAAU;IAYlB,+CAA+C;IAC/C,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,oDAAoD;IACpD,IAAI,UAAU,IAAI,QAAQ,CAAC,gBAAgB,CAAC,CAE3C;IAED,0CAA0C;IAC1C,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,iCAAiC;IACjC,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,mEAAmE;IACnE,IAAI,OAAO,IAAI,QAAQ,CAAC,aAAa,CAAC,CAErC;IAED,2CAA2C;IAC3C,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAID;;;;;;;;;OASG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAgB9B;;;;;;OAMG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAM5B,OAAO,CAAC,SAAS;IAUjB;;;;;OAKG;IACH,OAAO,CAAC,WAAW;IAiBnB,OAAO,CAAC,UAAU;YAUJ,gBAAgB;CAgB/B"}
|
package/dist/runner.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { RunnerExpiredError, } from "@introspection-sdk/types";
|
|
2
|
+
import { ConversationsApi, FilesApi, SharesApi, TasksApi, } from "@introspection-sdk/http";
|
|
2
3
|
import { HttpClient } from "./http.js";
|
|
3
|
-
import { TasksApi } from "./runner-resources/tasks.js";
|
|
4
|
-
import { FilesApi } from "./runner-resources/files.js";
|
|
5
|
-
import { ConversationsApi } from "./runner-resources/conversations.js";
|
|
6
4
|
/**
|
|
7
5
|
* Live handle to a Data Plane sandbox. Holds the bearer JWT, the DP
|
|
8
6
|
* endpoint URL, and the runtime/experiment context, and exposes the
|
|
@@ -24,6 +22,7 @@ export class Runner {
|
|
|
24
22
|
tasks;
|
|
25
23
|
files;
|
|
26
24
|
conversations;
|
|
25
|
+
shares;
|
|
27
26
|
constructor(client, source, spec) {
|
|
28
27
|
this.client = client;
|
|
29
28
|
this.source = source;
|
|
@@ -32,6 +31,7 @@ export class Runner {
|
|
|
32
31
|
this.tasks = new TasksApi(this.guardedHttp(this.http));
|
|
33
32
|
this.files = new FilesApi(this.guardedHttp(this.http));
|
|
34
33
|
this.conversations = new ConversationsApi(this.guardedHttp(this.http));
|
|
34
|
+
this.shares = new SharesApi(this.guardedHttp(this.http));
|
|
35
35
|
}
|
|
36
36
|
// --- public accessors ---
|
|
37
37
|
/** DP REST base URL the runner is bound to. */
|
package/dist/runner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,GAMnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,
|
|
1
|
+
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,GAMnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,QAAQ,GACT,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAYvC;;;;;;;;;;GAUG;AACH,MAAM,OAAO,MAAM;IAYE;IACA;IAZX,IAAI,CAAa;IACjB,IAAI,CAAa;IACjB,MAAM,GAAG,KAAK,CAAC;IAEvB,uBAAuB;IACd,KAAK,CAAW;IAChB,KAAK,CAAW;IAChB,aAAa,CAAmB;IAChC,MAAM,CAAY;IAE3B,YACmB,MAA2B,EAC3B,MAAoB,EACrC,IAAgB;QAFC,WAAM,GAAN,MAAM,CAAqB;QAC3B,WAAM,GAAN,MAAM,CAAc;QAGrC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAC7B,IAAI,CAAC,KAAK,GAAG,IAAI,QAAQ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
1
1
|
{
|
|
2
2
|
"name": "@introspection-sdk/introspection-node",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Introspection observability SDK for Node.js",
|
|
6
6
|
"engines": {
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"ai": "^6.0.206",
|
|
57
57
|
"openai": "^6.42.0",
|
|
58
58
|
"typescript": "5.9.3",
|
|
59
|
-
"@repo/
|
|
60
|
-
"@repo/
|
|
59
|
+
"@repo/typescript-config": "0.0.0",
|
|
60
|
+
"@repo/eslint-config": "0.0.0"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@openai/agents": ">=0.0.1",
|
|
@@ -139,10 +139,10 @@
|
|
|
139
139
|
"@opentelemetry/api": "^1.9.1",
|
|
140
140
|
"https-proxy-agent": "^7.0.6",
|
|
141
141
|
"proxy-from-env": "^2.1.0",
|
|
142
|
-
"@introspection-sdk/types": "0.5.
|
|
143
|
-
"@introspection-sdk/
|
|
144
|
-
"@introspection-sdk/
|
|
145
|
-
"@introspection-sdk/introspection-
|
|
142
|
+
"@introspection-sdk/types": "0.5.5",
|
|
143
|
+
"@introspection-sdk/http": "0.5.5",
|
|
144
|
+
"@introspection-sdk/introspection-pi": "0.5.5",
|
|
145
|
+
"@introspection-sdk/introspection-proxy": "0.5.5"
|
|
146
146
|
},
|
|
147
147
|
"scripts": {
|
|
148
148
|
"lint": "eslint . --max-warnings 0",
|
package/src/client.ts
CHANGED
|
@@ -35,7 +35,6 @@ import { attachRecipes, type RecipesApi } from "./resources/recipes.js";
|
|
|
35
35
|
* ```typescript
|
|
36
36
|
* const client = new IntrospectionClient({
|
|
37
37
|
* token: process.env.INTROSPECTION_TOKEN,
|
|
38
|
-
* projectId: "proj_…",
|
|
39
38
|
* });
|
|
40
39
|
*
|
|
41
40
|
* // Open a runner from a runtime, then drive it.
|
|
@@ -54,12 +53,12 @@ export class IntrospectionClient {
|
|
|
54
53
|
readonly cpHttp: HttpClient;
|
|
55
54
|
/** @internal — passed through to Runner so it can build its own DP HTTP client. */
|
|
56
55
|
readonly advancedOptions: AdvancedOptions;
|
|
57
|
-
readonly projectId: string | undefined;
|
|
58
56
|
|
|
59
57
|
/**
|
|
60
58
|
* CRUD on `/v1/runtimes` and the `(idOrName) => RuntimeHandle` factory.
|
|
61
|
-
* Call as `client.runtimes("customer-agent").run()
|
|
62
|
-
* `
|
|
59
|
+
* Call as `client.runtimes("customer-agent").run()`. The project is taken
|
|
60
|
+
* from the API key server-side; pass `project_id` to a CRUD helper only to
|
|
61
|
+
* override it per call.
|
|
63
62
|
*/
|
|
64
63
|
readonly runtimes: RuntimesApi & RuntimeHandleFactory;
|
|
65
64
|
|
|
@@ -79,8 +78,6 @@ export class IntrospectionClient {
|
|
|
79
78
|
const token = options.token || process.env.INTROSPECTION_TOKEN || "";
|
|
80
79
|
const advanced = options.advanced || {};
|
|
81
80
|
this.advancedOptions = advanced;
|
|
82
|
-
this.projectId =
|
|
83
|
-
options.projectId || process.env.INTROSPECTION_PROJECT_ID || undefined;
|
|
84
81
|
const baseApiUrl =
|
|
85
82
|
advanced.baseApiUrl ||
|
|
86
83
|
process.env.INTROSPECTION_BASE_API_URL ||
|
package/src/index.ts
CHANGED
|
@@ -22,14 +22,17 @@ export type {
|
|
|
22
22
|
|
|
23
23
|
// Runner-bound REST namespaces (runner.tasks, runner.files,
|
|
24
24
|
// runner.conversations) + HTTP/SSE.
|
|
25
|
-
export { TasksApi, TaskRunsApi, RunHandle } from "./runner-resources/tasks.js";
|
|
26
|
-
export type { StartParams } from "./runner-resources/tasks.js";
|
|
27
|
-
export { FilesApi, FileVersionsApi } from "./runner-resources/files.js";
|
|
28
|
-
export type { FileUploadBody } from "./runner-resources/files.js";
|
|
29
25
|
export {
|
|
30
|
-
ConversationsApi,
|
|
31
26
|
ConversationItemsApi,
|
|
32
|
-
|
|
27
|
+
ConversationsApi,
|
|
28
|
+
FileVersionsApi,
|
|
29
|
+
FilesApi,
|
|
30
|
+
RunHandle,
|
|
31
|
+
SharesApi,
|
|
32
|
+
TaskRunsApi,
|
|
33
|
+
TasksApi,
|
|
34
|
+
} from "@introspection-sdk/http";
|
|
35
|
+
export type { FileUploadBody, StartParams } from "@introspection-sdk/http";
|
|
33
36
|
export { HttpClient } from "./http.js";
|
|
34
37
|
export type { ResolvedApiConfig } from "./http.js";
|
|
35
38
|
export { parseSse } from "./streaming.js";
|