@introspection-sdk/introspection-node 0.5.4 → 0.5.6
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/auth.d.ts +127 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +112 -0
- package/dist/auth.js.map +1 -0
- package/dist/client.d.ts +30 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +35 -0
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +4 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -4
- 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 -171
- package/dist/resources/runtimes.js.map +1 -1
- package/dist/runner.d.ts +1 -4
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +1 -4
- package/dist/runner.js.map +1 -1
- package/package.json +7 -7
- package/src/auth.ts +236 -0
- package/src/client.ts +38 -0
- package/src/index.ts +23 -7
- package/src/resources/runtimes.ts +14 -216
- package/src/runner.ts +6 -4
- 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 -125
- package/dist/runner-resources/files.js.map +0 -1
- package/dist/runner-resources/shares.d.ts +0 -27
- package/dist/runner-resources/shares.d.ts.map +0 -1
- package/dist/runner-resources/shares.js +0 -50
- package/dist/runner-resources/shares.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 -162
- package/src/runner-resources/shares.ts +0 -62
- package/src/runner-resources/tasks.ts +0 -158
|
@@ -1,181 +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
|
-
// The project is scoped by the API key server-side — no client-level
|
|
134
|
-
// project to thread through the name lookup.
|
|
135
|
-
const runtime = await this.api.resolveByName(this.idOrName);
|
|
136
|
-
this.resolvedId = runtime.id;
|
|
137
|
-
return runtime.id;
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Pin to a specific recipe — canary a previous version. Subsequent
|
|
141
|
-
* `.run()` calls on the returned handle open a runner against the
|
|
142
|
-
* runtime row in this name whose `recipe_id` matches `recipe.id`
|
|
143
|
-
* (resolved server-side by CP).
|
|
144
|
-
*
|
|
145
|
-
* Returns a new child {@link RuntimeHandle}; the original handle is
|
|
146
|
-
* unaffected. Accepts a {@link Recipe} object (uses `.id`) or a
|
|
147
|
-
* recipe id string.
|
|
148
|
-
*/
|
|
149
|
-
pin(recipe) {
|
|
150
|
-
const recipeId = typeof recipe === "string" ? recipe : recipe.id;
|
|
151
|
-
return new RuntimeHandle(this.api, this.client, this.idOrName, recipeId);
|
|
152
|
-
}
|
|
153
|
-
async run(opts) {
|
|
154
|
-
const id = await this.resolveId();
|
|
155
|
-
const merged = this.pinnedRecipeId !== null
|
|
156
|
-
? { ...(opts ?? {}), recipe_id: this.pinnedRecipeId }
|
|
157
|
-
: opts;
|
|
158
|
-
return this.api.runById(id, merged);
|
|
159
|
-
}
|
|
160
|
-
async activate(params) {
|
|
161
|
-
const id = await this.resolveId();
|
|
162
|
-
return this.api.activateById(id, { project_id: params?.projectId });
|
|
163
9
|
}
|
|
164
10
|
}
|
|
165
11
|
export function attachRuntimes(client, http) {
|
|
166
12
|
const api = new RuntimesApi(http, client);
|
|
167
|
-
|
|
168
|
-
// Mount the API methods on the factory function. Using bound copies so
|
|
169
|
-
// the methods can be invoked off the proxy without losing `this`.
|
|
170
|
-
const hybrid = factory;
|
|
171
|
-
hybrid.list = api.list.bind(api);
|
|
172
|
-
hybrid.get = api.get.bind(api);
|
|
173
|
-
hybrid.create = api.create.bind(api);
|
|
174
|
-
hybrid.update = api.update.bind(api);
|
|
175
|
-
hybrid.delete = api.delete.bind(api);
|
|
176
|
-
hybrid.resolveByName = api.resolveByName.bind(api);
|
|
177
|
-
hybrid.runById = api.runById.bind(api);
|
|
178
|
-
hybrid.activateById = api.activateById.bind(api);
|
|
179
|
-
return hybrid;
|
|
13
|
+
return attachSharedRuntimes(api);
|
|
180
14
|
}
|
|
181
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,8 +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";
|
|
5
|
-
import { SharesApi } from "./runner-resources/shares.js";
|
|
2
|
+
import { ConversationsApi, FilesApi, SharesApi, TasksApi } from "@introspection-sdk/http";
|
|
6
3
|
import type { IntrospectionClient } from "./client.js";
|
|
7
4
|
/**
|
|
8
5
|
* Where this Runner came from, so `refresh()` can call CP again with the
|
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,9 +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
|
-
import { SharesApi } from "./runner-resources/shares.js";
|
|
7
4
|
/**
|
|
8
5
|
* Live handle to a Data Plane sandbox. Holds the bearer JWT, the DP
|
|
9
6
|
* endpoint URL, and the runtime/experiment context, and exposes the
|
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":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@introspection-sdk/introspection-node",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.6",
|
|
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/eslint-config": "0.0.0",
|
|
60
|
+
"@repo/typescript-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/
|
|
143
|
-
"@introspection-sdk/
|
|
144
|
-
"@introspection-sdk/
|
|
145
|
-
"@introspection-sdk/introspection-proxy": "0.5.
|
|
142
|
+
"@introspection-sdk/introspection-pi": "0.5.6",
|
|
143
|
+
"@introspection-sdk/http": "0.5.6",
|
|
144
|
+
"@introspection-sdk/types": "0.5.6",
|
|
145
|
+
"@introspection-sdk/introspection-proxy": "0.5.6"
|
|
146
146
|
},
|
|
147
147
|
"scripts": {
|
|
148
148
|
"lint": "eslint . --max-warnings 0",
|
package/src/auth.ts
ADDED
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Service-account (machine) authentication for the Control Plane.
|
|
3
|
+
*
|
|
4
|
+
* Mints a short-lived, project-scoped Introspection access token via the
|
|
5
|
+
* OAuth 2.0 `client_credentials` grant against CP `POST /v1/oauth/token`.
|
|
6
|
+
* This is the headless / CI counterpart to a long-lived API key: the
|
|
7
|
+
* confidential Application's `client_id` + `client_secret` stay server-side,
|
|
8
|
+
* and you re-mint when the token expires (no refresh token is issued).
|
|
9
|
+
*
|
|
10
|
+
* The minted `access_token` is an ordinary CP bearer token, so it drops
|
|
11
|
+
* straight into the existing client surface — pass it to
|
|
12
|
+
* {@link IntrospectionClient}, or use
|
|
13
|
+
* {@link IntrospectionClient.fromServiceAccount} to mint and construct in one
|
|
14
|
+
* call, and the usual `client.runtimes("name").run()` flow works unchanged.
|
|
15
|
+
*/
|
|
16
|
+
import { stripTrailingSlash, toApiError } from "@introspection-sdk/http";
|
|
17
|
+
|
|
18
|
+
const DEFAULT_BASE_API_URL = "https://api.introspection.dev";
|
|
19
|
+
const GRANT_TYPE_CLIENT_CREDENTIALS = "client_credentials";
|
|
20
|
+
const GRANT_TYPE_TOKEN_EXCHANGE =
|
|
21
|
+
"urn:ietf:params:oauth:grant-type:token-exchange";
|
|
22
|
+
const GRANT_TYPE_AUTHORIZATION_CODE = "authorization_code";
|
|
23
|
+
const SUBJECT_TOKEN_TYPE_ID_TOKEN = "urn:ietf:params:oauth:token-type:id_token";
|
|
24
|
+
|
|
25
|
+
function resolveBaseApiUrl(baseApiUrl?: string): string {
|
|
26
|
+
return stripTrailingSlash(
|
|
27
|
+
baseApiUrl ??
|
|
28
|
+
process.env.INTROSPECTION_BASE_API_URL ??
|
|
29
|
+
DEFAULT_BASE_API_URL,
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function resolveFetch(custom?: typeof fetch): typeof fetch {
|
|
34
|
+
const fetchImpl = custom ?? globalThis.fetch;
|
|
35
|
+
if (!fetchImpl) {
|
|
36
|
+
throw new Error(
|
|
37
|
+
"global fetch is unavailable; pass `fetch` or run on Node 18+",
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
return fetchImpl;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async function postTokenForm(
|
|
44
|
+
baseApiUrl: string,
|
|
45
|
+
form: URLSearchParams,
|
|
46
|
+
fetchImpl: typeof fetch,
|
|
47
|
+
): Promise<OAuthToken> {
|
|
48
|
+
const res = await fetchImpl(`${baseApiUrl}/v1/oauth/token`, {
|
|
49
|
+
method: "POST",
|
|
50
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
51
|
+
body: form.toString(),
|
|
52
|
+
cache: "no-store",
|
|
53
|
+
});
|
|
54
|
+
if (!res.ok) throw await toApiError(res);
|
|
55
|
+
return (await res.json()) as OAuthToken;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* CP `POST /v1/oauth/token` response. No refresh token is issued for the
|
|
60
|
+
* machine grants — re-mint when it expires.
|
|
61
|
+
*/
|
|
62
|
+
export interface OAuthToken {
|
|
63
|
+
/** Project-scoped RS256 access token (`Authorization: Bearer …`). */
|
|
64
|
+
access_token: string;
|
|
65
|
+
/** Always `"Bearer"`. */
|
|
66
|
+
token_type: string;
|
|
67
|
+
/** Token lifetime in seconds. */
|
|
68
|
+
expires_in: number;
|
|
69
|
+
/** The granted (scope-capped) scope, when the CP returns one. */
|
|
70
|
+
scope: string | null;
|
|
71
|
+
/**
|
|
72
|
+
* Data Plane API base URL for the token's project, resolved by the CP the
|
|
73
|
+
* same way it is for the CLI login. `null` when the deployment can't be
|
|
74
|
+
* resolved; the caller then needs an explicit DP URL. Hand this to the
|
|
75
|
+
* browser SDK as `dpUrl` so the SPA connects without separate DP config.
|
|
76
|
+
*/
|
|
77
|
+
dp_url: string | null;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface ServiceAccountTokenParams {
|
|
81
|
+
/** Confidential Application client id (`intro_app_…`). */
|
|
82
|
+
clientId: string;
|
|
83
|
+
/** Confidential Application client secret (`intro_sk_…`). */
|
|
84
|
+
clientSecret: string;
|
|
85
|
+
/**
|
|
86
|
+
* Project the token is scoped to. Required by the CP `client_credentials`
|
|
87
|
+
* grant — the minted token is project-scoped and the project must belong to
|
|
88
|
+
* the Application's organization.
|
|
89
|
+
*/
|
|
90
|
+
projectId: string;
|
|
91
|
+
/**
|
|
92
|
+
* Optional space-separated scope. Capped server-side to the Application's
|
|
93
|
+
* `allowed_scopes`; omit to receive the Application's default scope.
|
|
94
|
+
*/
|
|
95
|
+
scope?: string;
|
|
96
|
+
/**
|
|
97
|
+
* CP API base URL. Defaults to `INTROSPECTION_BASE_API_URL` or
|
|
98
|
+
* `https://api.introspection.dev`.
|
|
99
|
+
*/
|
|
100
|
+
baseApiUrl?: string;
|
|
101
|
+
/** Custom `fetch` (for tests or non-standard runtimes). */
|
|
102
|
+
fetch?: typeof fetch;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Back-compat alias: the `client_credentials` response is the same shape as
|
|
107
|
+
* every other `/v1/oauth/token` response.
|
|
108
|
+
*/
|
|
109
|
+
export type ServiceAccountToken = OAuthToken;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Mint a project-scoped CP access token from confidential service-account
|
|
113
|
+
* credentials. See {@link ServiceAccountTokenParams}.
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```typescript
|
|
117
|
+
* const { access_token, dp_url } = await serviceAccountToken({
|
|
118
|
+
* clientId: process.env.INTROSPECTION_SERVICE_ACCOUNT_CLIENT_ID!,
|
|
119
|
+
* clientSecret: process.env.INTROSPECTION_SERVICE_ACCOUNT_CLIENT_SECRET!,
|
|
120
|
+
* projectId: process.env.INTRO_PROJECT_ID!,
|
|
121
|
+
* });
|
|
122
|
+
* const client = new IntrospectionClient({ token: access_token });
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
export async function serviceAccountToken(
|
|
126
|
+
params: ServiceAccountTokenParams,
|
|
127
|
+
): Promise<OAuthToken> {
|
|
128
|
+
const form = new URLSearchParams({
|
|
129
|
+
grant_type: GRANT_TYPE_CLIENT_CREDENTIALS,
|
|
130
|
+
client_id: params.clientId,
|
|
131
|
+
client_secret: params.clientSecret,
|
|
132
|
+
project_id: params.projectId,
|
|
133
|
+
});
|
|
134
|
+
if (params.scope) form.set("scope", params.scope);
|
|
135
|
+
return postTokenForm(
|
|
136
|
+
resolveBaseApiUrl(params.baseApiUrl),
|
|
137
|
+
form,
|
|
138
|
+
resolveFetch(params.fetch),
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export interface AuthorizationCodeParams {
|
|
143
|
+
/** The authorization code returned to the redirect URI. */
|
|
144
|
+
code: string;
|
|
145
|
+
/** Public SPA Application `client_id` (PKCE — no secret). */
|
|
146
|
+
clientId: string;
|
|
147
|
+
/** The redirect URI the code was issued for (must match the authorize call). */
|
|
148
|
+
redirectUri: string;
|
|
149
|
+
/** The PKCE `code_verifier` paired with the authorize-step challenge. */
|
|
150
|
+
codeVerifier: string;
|
|
151
|
+
/**
|
|
152
|
+
* CP API base URL. Defaults to `INTROSPECTION_BASE_API_URL` or
|
|
153
|
+
* `https://api.introspection.dev`.
|
|
154
|
+
*/
|
|
155
|
+
baseApiUrl?: string;
|
|
156
|
+
/** Custom `fetch` (for tests or non-standard runtimes). */
|
|
157
|
+
fetch?: typeof fetch;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* RFC 6749 / PKCE `authorization_code` exchange against CP
|
|
162
|
+
* `POST /v1/oauth/token`. Run it in your backend so the browser hosted-login
|
|
163
|
+
* flow does not hand-roll the token POST.
|
|
164
|
+
*/
|
|
165
|
+
export async function authorizationCodeToken(
|
|
166
|
+
params: AuthorizationCodeParams,
|
|
167
|
+
): Promise<OAuthToken> {
|
|
168
|
+
const form = new URLSearchParams({
|
|
169
|
+
grant_type: GRANT_TYPE_AUTHORIZATION_CODE,
|
|
170
|
+
code: params.code,
|
|
171
|
+
client_id: params.clientId,
|
|
172
|
+
redirect_uri: params.redirectUri,
|
|
173
|
+
code_verifier: params.codeVerifier,
|
|
174
|
+
});
|
|
175
|
+
return postTokenForm(
|
|
176
|
+
resolveBaseApiUrl(params.baseApiUrl),
|
|
177
|
+
form,
|
|
178
|
+
resolveFetch(params.fetch),
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export interface TokenExchangeParams {
|
|
183
|
+
/** The end user's subject token (e.g. a partner-IdP `id_token`). */
|
|
184
|
+
subjectToken: string;
|
|
185
|
+
/** The federated Application's `client_id` (public client — no secret). */
|
|
186
|
+
clientId: string;
|
|
187
|
+
/** Project the minted DP token is scoped to. */
|
|
188
|
+
projectId: string;
|
|
189
|
+
/**
|
|
190
|
+
* The subject token's type URI. Defaults to
|
|
191
|
+
* `urn:ietf:params:oauth:token-type:id_token`.
|
|
192
|
+
*/
|
|
193
|
+
subjectTokenType?: string;
|
|
194
|
+
/** Optional space-separated scope, capped server-side. */
|
|
195
|
+
scope?: string;
|
|
196
|
+
/**
|
|
197
|
+
* CP API base URL. Defaults to `INTROSPECTION_BASE_API_URL` or
|
|
198
|
+
* `https://api.introspection.dev`.
|
|
199
|
+
*/
|
|
200
|
+
baseApiUrl?: string;
|
|
201
|
+
/** Custom `fetch` (for tests or non-standard runtimes). */
|
|
202
|
+
fetch?: typeof fetch;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* RFC 8693 token-exchange against CP `POST /v1/oauth/token`: trade an end
|
|
207
|
+
* user's partner-IdP token for a project-scoped DP access token for a
|
|
208
|
+
* `member_type=customer` member. Intended to run server-side in a broker (the
|
|
209
|
+
* subject token shouldn't be re-handled in the browser longer than needed).
|
|
210
|
+
*
|
|
211
|
+
* @example
|
|
212
|
+
* ```typescript
|
|
213
|
+
* const { access_token, dp_url } = await tokenExchange({
|
|
214
|
+
* subjectToken: idTokenFromPartnerIdp,
|
|
215
|
+
* clientId: process.env.FEDERATED_CLIENT_ID!,
|
|
216
|
+
* projectId: process.env.INTRO_PROJECT_ID!,
|
|
217
|
+
* });
|
|
218
|
+
* ```
|
|
219
|
+
*/
|
|
220
|
+
export async function tokenExchange(
|
|
221
|
+
params: TokenExchangeParams,
|
|
222
|
+
): Promise<OAuthToken> {
|
|
223
|
+
const form = new URLSearchParams({
|
|
224
|
+
grant_type: GRANT_TYPE_TOKEN_EXCHANGE,
|
|
225
|
+
subject_token: params.subjectToken,
|
|
226
|
+
subject_token_type: params.subjectTokenType ?? SUBJECT_TOKEN_TYPE_ID_TOKEN,
|
|
227
|
+
client_id: params.clientId,
|
|
228
|
+
project_id: params.projectId,
|
|
229
|
+
});
|
|
230
|
+
if (params.scope) form.set("scope", params.scope);
|
|
231
|
+
return postTokenForm(
|
|
232
|
+
resolveBaseApiUrl(params.baseApiUrl),
|
|
233
|
+
form,
|
|
234
|
+
resolveFetch(params.fetch),
|
|
235
|
+
);
|
|
236
|
+
}
|
package/src/client.ts
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
import type { AdvancedOptions } from "@introspection-sdk/types";
|
|
16
16
|
import { logger as sdkLogger } from "./utils.js";
|
|
17
17
|
import type { IntrospectionClientOptions } from "./types.js";
|
|
18
|
+
import { serviceAccountToken, type ServiceAccountTokenParams } from "./auth.js";
|
|
18
19
|
import { HttpClient } from "./http.js";
|
|
19
20
|
import {
|
|
20
21
|
attachRuntimes,
|
|
@@ -106,6 +107,43 @@ export class IntrospectionClient {
|
|
|
106
107
|
sdkLogger.info(`IntrospectionClient initialized: api=${baseApiUrl}`);
|
|
107
108
|
}
|
|
108
109
|
|
|
110
|
+
/**
|
|
111
|
+
* Authenticate as a confidential service account and return a ready
|
|
112
|
+
* client.
|
|
113
|
+
*
|
|
114
|
+
* Mints a short-lived, project-scoped CP access token via the
|
|
115
|
+
* `client_credentials` grant (see {@link serviceAccountToken}) and wires
|
|
116
|
+
* it in as the bearer token, so the runtime flow works exactly as it does
|
|
117
|
+
* with an API key:
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```typescript
|
|
121
|
+
* const client = await IntrospectionClient.fromServiceAccount({
|
|
122
|
+
* clientId: process.env.INTROSPECTION_SERVICE_ACCOUNT_CLIENT_ID!,
|
|
123
|
+
* clientSecret: process.env.INTROSPECTION_SERVICE_ACCOUNT_CLIENT_SECRET!,
|
|
124
|
+
* projectId: process.env.INTRO_PROJECT_ID!,
|
|
125
|
+
* });
|
|
126
|
+
*
|
|
127
|
+
* // Resolved fresh from the runtime name on every call.
|
|
128
|
+
* const runner = await client.runtimes("customer-agent").run({
|
|
129
|
+
* identity: { user_id: "u_demo" },
|
|
130
|
+
* });
|
|
131
|
+
* ```
|
|
132
|
+
*
|
|
133
|
+
* The token is not auto-refreshed: it lives for `expires_in` seconds, so
|
|
134
|
+
* re-mint (call this again) for long-lived processes once it lapses.
|
|
135
|
+
*/
|
|
136
|
+
static async fromServiceAccount(
|
|
137
|
+
params: ServiceAccountTokenParams & { serviceName?: string },
|
|
138
|
+
): Promise<IntrospectionClient> {
|
|
139
|
+
const { access_token } = await serviceAccountToken(params);
|
|
140
|
+
return new IntrospectionClient({
|
|
141
|
+
token: access_token,
|
|
142
|
+
serviceName: params.serviceName,
|
|
143
|
+
advanced: { baseApiUrl: params.baseApiUrl, fetch: params.fetch },
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
109
147
|
/** Close the underlying HTTP client. */
|
|
110
148
|
async shutdown(): Promise<void> {
|
|
111
149
|
// HttpClient has no persistent connections to close, but reserved
|
package/src/index.ts
CHANGED
|
@@ -12,6 +12,20 @@
|
|
|
12
12
|
// REST client.
|
|
13
13
|
export { IntrospectionClient } from "./client.js";
|
|
14
14
|
|
|
15
|
+
// Machine / federated / hosted-login OAuth token helpers.
|
|
16
|
+
export {
|
|
17
|
+
serviceAccountToken,
|
|
18
|
+
tokenExchange,
|
|
19
|
+
authorizationCodeToken,
|
|
20
|
+
} from "./auth.js";
|
|
21
|
+
export type {
|
|
22
|
+
ServiceAccountTokenParams,
|
|
23
|
+
ServiceAccountToken,
|
|
24
|
+
TokenExchangeParams,
|
|
25
|
+
AuthorizationCodeParams,
|
|
26
|
+
OAuthToken,
|
|
27
|
+
} from "./auth.js";
|
|
28
|
+
|
|
15
29
|
// Configuration / event types shared with the OTel surface.
|
|
16
30
|
export type {
|
|
17
31
|
AdvancedOptions,
|
|
@@ -22,15 +36,17 @@ export type {
|
|
|
22
36
|
|
|
23
37
|
// Runner-bound REST namespaces (runner.tasks, runner.files,
|
|
24
38
|
// 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
39
|
export {
|
|
30
|
-
ConversationsApi,
|
|
31
40
|
ConversationItemsApi,
|
|
32
|
-
|
|
33
|
-
|
|
41
|
+
ConversationsApi,
|
|
42
|
+
FileVersionsApi,
|
|
43
|
+
FilesApi,
|
|
44
|
+
RunHandle,
|
|
45
|
+
SharesApi,
|
|
46
|
+
TaskRunsApi,
|
|
47
|
+
TasksApi,
|
|
48
|
+
} from "@introspection-sdk/http";
|
|
49
|
+
export type { FileUploadBody, StartParams } from "@introspection-sdk/http";
|
|
34
50
|
export { HttpClient } from "./http.js";
|
|
35
51
|
export type { ResolvedApiConfig } from "./http.js";
|
|
36
52
|
export { parseSse } from "./streaming.js";
|