@theokit/agents 7.3.0 → 7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth.d.ts +1 -1
- package/dist/auth.js +77 -70
- package/dist/auth.js.map +1 -1
- package/dist/bridge.js +1 -2
- package/dist/{chunk-CVDPGEJF.js → chunk-7ZQTOTK2.js} +164 -220
- package/dist/chunk-7ZQTOTK2.js.map +1 -0
- package/dist/{chunk-7ECCHM4N.js → chunk-NSJDG6XE.js} +448 -980
- package/dist/chunk-NSJDG6XE.js.map +1 -0
- package/dist/client-react.js +3 -9
- package/dist/client-react.js.map +1 -1
- package/dist/client.js +1 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +132 -363
- package/dist/index.js.map +1 -1
- package/dist/interactive.js +6 -3
- package/dist/interactive.js.map +1 -1
- package/dist/persistence.js +0 -2
- package/dist/persistence.js.map +1 -1
- package/dist/pty.js +7 -3
- package/dist/pty.js.map +1 -1
- package/dist/sandbox.js +26 -3
- package/dist/sandbox.js.map +1 -1
- package/dist/testing.js +3 -21
- package/dist/testing.js.map +1 -1
- package/dist/tools.js +55 -3
- package/dist/tools.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-7ECCHM4N.js.map +0 -1
- package/dist/chunk-CVDPGEJF.js.map +0 -1
- package/dist/chunk-Z4QWC7IK.js +0 -7
- package/dist/chunk-Z4QWC7IK.js.map +0 -1
package/dist/auth.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OAuthProviderConfig, CredentialStoreConfig, ResolvedCredential, ensureFreshCredential, OpenAIDeviceConfig, openaiDeviceLogin, OAuthTokens, DeviceDeps } from '@theokit/sdk/auth';
|
|
2
|
-
export { CredentialError, CredentialStoreConfig, DeviceCodeGrant, DeviceDeps, DeviceOAuthConfig, OAuthProviderConfig, OAuthTokens, OpenAIDeviceConfig, ResolveCredentialOptions, ResolvedCredential, authFilePath, credentialHome, deviceLogin, openaiDeviceLogin, pollDeviceToken, readAuthFile, readStoredOAuth, requestDeviceCode, writeCredential } from '@theokit/sdk/auth';
|
|
2
|
+
export { CredentialError, CredentialStoreConfig, DeviceCodeGrant, DeviceDeps, DeviceOAuthConfig, OAuthProviderConfig, OAuthTokens, OpenAIDeviceConfig, ResolveCredentialOptions, ResolvedCredential, authFilePath, credentialHome, deviceLogin, ensureFreshCredential, extractAccountId, openaiDeviceLogin, persistOAuthTokens, pollDeviceToken, readAuthFile, readStoredOAuth, refreshOAuthTokens, requestDeviceCode, writeCredential } from '@theokit/sdk/auth';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* M60 — `AuthProvider`, the OO contract that unifies the SDK's free OAuth-lifecycle functions
|
package/dist/auth.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__name
|
|
3
|
-
} from "./chunk-Z4QWC7IK.js";
|
|
4
|
-
|
|
5
1
|
// src/auth/auth-provider.ts
|
|
6
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
authFilePath,
|
|
4
|
+
ensureFreshCredential,
|
|
5
|
+
openaiDeviceLogin,
|
|
6
|
+
persistOAuthTokens,
|
|
7
|
+
readStoredOAuth
|
|
8
|
+
} from "@theokit/sdk/auth";
|
|
7
9
|
import { withFileLock } from "@theokit/sdk/persistence";
|
|
8
10
|
var RefreshFailure = class extends Error {
|
|
9
|
-
static {
|
|
10
|
-
__name(this, "RefreshFailure");
|
|
11
|
-
}
|
|
12
|
-
transitorio;
|
|
13
11
|
constructor(message, transitorio) {
|
|
14
|
-
super(message)
|
|
12
|
+
super(message);
|
|
13
|
+
this.transitorio = transitorio;
|
|
15
14
|
this.name = "RefreshFailure";
|
|
16
15
|
}
|
|
16
|
+
transitorio;
|
|
17
17
|
};
|
|
18
18
|
var MOTIVOS_TRANSITORIOS = [
|
|
19
19
|
"ETIMEDOUT",
|
|
@@ -26,39 +26,36 @@ var MOTIVOS_TRANSITORIOS = [
|
|
|
26
26
|
function classificarFalhaDeRefresh(err) {
|
|
27
27
|
const texto = err instanceof Error ? `${err.name}: ${err.message}` : String(err);
|
|
28
28
|
if (/invalid_grant|invalid_request|unauthorized_client/i.test(texto)) {
|
|
29
|
-
return new RefreshFailure(
|
|
29
|
+
return new RefreshFailure(
|
|
30
|
+
"o refresh token n\xE3o \xE9 mais v\xE1lido \u2014 refa\xE7a o login. Tentar de novo n\xE3o muda o resultado.",
|
|
31
|
+
false
|
|
32
|
+
);
|
|
30
33
|
}
|
|
31
34
|
const transitorio = MOTIVOS_TRANSITORIOS.some((m) => texto.includes(m)) || /\b(5\d{2})\b|timeout|network/i.test(texto);
|
|
32
|
-
return new RefreshFailure(
|
|
35
|
+
return new RefreshFailure(
|
|
36
|
+
transitorio ? "falha transit\xF3ria ao refrescar a credencial" : "falha ao refrescar a credencial",
|
|
37
|
+
transitorio
|
|
38
|
+
);
|
|
33
39
|
}
|
|
34
|
-
__name(classificarFalhaDeRefresh, "classificarFalhaDeRefresh");
|
|
35
40
|
function esperaComJitter(tentativa, baseMs = 200, aleatorio = Math.random) {
|
|
36
41
|
const base = baseMs * 2 ** tentativa;
|
|
37
42
|
return Math.round(base * (0.75 + aleatorio() * 0.5));
|
|
38
43
|
}
|
|
39
|
-
__name(esperaComJitter, "esperaComJitter");
|
|
40
44
|
var AuthProvider = class _AuthProvider {
|
|
41
|
-
static {
|
|
42
|
-
__name(this, "AuthProvider");
|
|
43
|
-
}
|
|
44
|
-
config;
|
|
45
|
-
store;
|
|
46
45
|
constructor(config, store) {
|
|
47
46
|
this.config = config;
|
|
48
47
|
this.store = store;
|
|
49
48
|
}
|
|
49
|
+
config;
|
|
50
|
+
store;
|
|
50
51
|
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
* Refresh a resolved credential if stale. Delegates to `ensureFreshCredential` with the held
|
|
53
|
+
* `config` + `store`; `env` (for reading the store's env overrides) + the `{ fetch, now }` HTTP deps
|
|
54
|
+
* thread through. Returns the fresh `ResolvedCredential` — never logs the rotated token.
|
|
55
|
+
*/
|
|
55
56
|
async ensureFresh(resolved, deps, env) {
|
|
56
57
|
if (resolved.kind !== "oauth") {
|
|
57
|
-
return ensureFreshCredential(resolved, {
|
|
58
|
-
config: this.config,
|
|
59
|
-
store: this.store,
|
|
60
|
-
env
|
|
61
|
-
}, deps);
|
|
58
|
+
return ensureFreshCredential(resolved, { config: this.config, store: this.store, env }, deps);
|
|
62
59
|
}
|
|
63
60
|
const caminho = authFilePath(this.store, env);
|
|
64
61
|
const emVoo = _AuthProvider.refreshEmVoo.get(caminho);
|
|
@@ -74,28 +71,24 @@ var AuthProvider = class _AuthProvider {
|
|
|
74
71
|
/** Refresh em voo por caminho de store — a chave é o arquivo, não a instância. */
|
|
75
72
|
static refreshEmVoo = /* @__PURE__ */ new Map();
|
|
76
73
|
/**
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
74
|
+
* O refresh propriamente dito, serializado entre PROCESSOS e com re-leitura.
|
|
75
|
+
*
|
|
76
|
+
* A re-leitura não é detalhe: sem ela o lock apenas serializa, e o segundo processo decide com o
|
|
77
|
+
* estado que leu ANTES de esperar — refrescando de novo e invalidando o token que o primeiro acabou
|
|
78
|
+
* de gravar. É o double-checked locking clássico, e é o que o teste de dois processos pega.
|
|
79
|
+
*/
|
|
83
80
|
refrescarSobLock(caminho, resolved, deps, env) {
|
|
84
81
|
return withFileLock(caminho, async () => {
|
|
85
82
|
const doDisco = readStoredOAuth(this.store, env);
|
|
86
|
-
const atual = doDisco !== void 0 ? {
|
|
87
|
-
...resolved,
|
|
88
|
-
apiKey: doDisco.access,
|
|
89
|
-
expiresAt: doDisco.expires
|
|
90
|
-
} : resolved;
|
|
83
|
+
const atual = doDisco !== void 0 ? { ...resolved, apiKey: doDisco.access, expiresAt: doDisco.expires } : resolved;
|
|
91
84
|
const MAX_TENTATIVAS = 3;
|
|
92
85
|
for (let tentativa = 0; ; tentativa++) {
|
|
93
86
|
try {
|
|
94
|
-
return await ensureFreshCredential(
|
|
95
|
-
|
|
96
|
-
store: this.store,
|
|
97
|
-
|
|
98
|
-
|
|
87
|
+
return await ensureFreshCredential(
|
|
88
|
+
atual,
|
|
89
|
+
{ config: this.config, store: this.store, env },
|
|
90
|
+
deps
|
|
91
|
+
);
|
|
99
92
|
} catch (err) {
|
|
100
93
|
const falha = classificarFalhaDeRefresh(err);
|
|
101
94
|
if (!falha.transitorio || tentativa >= MAX_TENTATIVAS - 1) throw falha;
|
|
@@ -105,25 +98,43 @@ var AuthProvider = class _AuthProvider {
|
|
|
105
98
|
});
|
|
106
99
|
}
|
|
107
100
|
/**
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
101
|
+
* Run the headless OpenAI device-login flow. Delegates to `openaiDeviceLogin` (which JWT-extracts the
|
|
102
|
+
* account id). `deviceConfig` is passed per-call because it is a distinct endpoint set from the
|
|
103
|
+
* refresh `config`. Returns `OAuthTokens` — the caller persists them via {@link AuthProvider.persist}.
|
|
104
|
+
*/
|
|
112
105
|
deviceLogin(deviceConfig, deps, hooks) {
|
|
113
106
|
return openaiDeviceLogin(deviceConfig, deps, hooks);
|
|
114
107
|
}
|
|
115
108
|
/**
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
109
|
+
* Persist freshly-obtained tokens through the held `store`. Delegates to `persistOAuthTokens` and
|
|
110
|
+
* returns the credential-file path (never the token). `env` selects the store's home override.
|
|
111
|
+
*/
|
|
119
112
|
persist(provider, tokens, env) {
|
|
120
113
|
return persistOAuthTokens(provider, tokens, this.store, env);
|
|
121
114
|
}
|
|
122
115
|
};
|
|
123
116
|
|
|
124
117
|
// src/auth-entry.ts
|
|
125
|
-
import {
|
|
126
|
-
|
|
118
|
+
import {
|
|
119
|
+
authFilePath as authFilePath2,
|
|
120
|
+
CredentialError,
|
|
121
|
+
credentialHome,
|
|
122
|
+
readAuthFile,
|
|
123
|
+
readStoredOAuth as readStoredOAuth2,
|
|
124
|
+
writeCredential
|
|
125
|
+
} from "@theokit/sdk/auth";
|
|
126
|
+
import {
|
|
127
|
+
deviceLogin,
|
|
128
|
+
openaiDeviceLogin as openaiDeviceLogin3,
|
|
129
|
+
pollDeviceToken,
|
|
130
|
+
requestDeviceCode
|
|
131
|
+
} from "@theokit/sdk/auth";
|
|
132
|
+
import {
|
|
133
|
+
ensureFreshCredential as ensureFreshCredential2,
|
|
134
|
+
extractAccountId,
|
|
135
|
+
persistOAuthTokens as persistOAuthTokens2,
|
|
136
|
+
refreshOAuthTokens
|
|
137
|
+
} from "@theokit/sdk/auth";
|
|
127
138
|
|
|
128
139
|
// src/auth/device-provider.ts
|
|
129
140
|
import { openaiDeviceLogin as openaiDeviceLogin2 } from "@theokit/sdk/auth";
|
|
@@ -135,12 +146,7 @@ var CODEX_OAUTH = {
|
|
|
135
146
|
clientId: process.env[CODEX_CLIENT_ID_ENV_VAR] ?? CODEX_CLIENT_ID,
|
|
136
147
|
authorizeEndpoint: `${CODEX_ISSUER}/oauth/authorize`,
|
|
137
148
|
tokenEndpoint: `${CODEX_ISSUER}/oauth/token`,
|
|
138
|
-
scopes: [
|
|
139
|
-
"openid",
|
|
140
|
-
"profile",
|
|
141
|
-
"email",
|
|
142
|
-
"offline_access"
|
|
143
|
-
],
|
|
149
|
+
scopes: ["openid", "profile", "email", "offline_access"],
|
|
144
150
|
redirectUri: `${CODEX_ISSUER}/deviceauth/callback`
|
|
145
151
|
};
|
|
146
152
|
var CODEX_DEVICE = {
|
|
@@ -158,7 +164,7 @@ var CODEX_PROVIDER = Object.freeze({
|
|
|
158
164
|
type: "oauth",
|
|
159
165
|
// Aponta para a variante da OpenAI. Um provider RFC 8628 apontaria para `deviceLogin`, e é
|
|
160
166
|
// assim que as duas formas coexistem sem discriminante.
|
|
161
|
-
authorize:
|
|
167
|
+
authorize: (deps, hooks) => openaiDeviceLogin2(CODEX_DEVICE, deps, hooks)
|
|
162
168
|
}),
|
|
163
169
|
Object.freeze({
|
|
164
170
|
label: "Manually enter API Key",
|
|
@@ -173,27 +179,24 @@ function comDefaults(deps) {
|
|
|
173
179
|
now: deps?.now ?? Date.now
|
|
174
180
|
};
|
|
175
181
|
}
|
|
176
|
-
__name(comDefaults, "comDefaults");
|
|
177
182
|
async function loginWithDevice(provider, method, store, hooks, opts = {}) {
|
|
178
183
|
if (provider.methods.length === 0) {
|
|
179
|
-
throw new TypeError(
|
|
184
|
+
throw new TypeError(
|
|
185
|
+
`o provider "${provider.name}" declara nenhum m\xE9todo de autentica\xE7\xE3o \u2014 n\xE3o h\xE1 o que escolher`
|
|
186
|
+
);
|
|
180
187
|
}
|
|
181
188
|
if (!provider.methods.includes(method)) {
|
|
182
189
|
throw new TypeError(`o m\xE9todo "${method.label}" n\xE3o pertence ao provider "${provider.name}"`);
|
|
183
190
|
}
|
|
184
191
|
if (method.type !== "oauth") {
|
|
185
|
-
throw new TypeError(
|
|
192
|
+
throw new TypeError(
|
|
193
|
+
`o m\xE9todo "${method.label}" \xE9 de chave (api key), n\xE3o \xE9 um m\xE9todo de device \u2014 use o caminho de chave`
|
|
194
|
+
);
|
|
186
195
|
}
|
|
187
196
|
const tokens = await method.authorize(comDefaults(opts.deps), hooks);
|
|
188
197
|
const path = new AuthProvider(provider.oauth, store).persist(provider.name, tokens, opts.env);
|
|
189
|
-
return tokens.accountId === void 0 ? {
|
|
190
|
-
path
|
|
191
|
-
} : {
|
|
192
|
-
path,
|
|
193
|
-
accountId: tokens.accountId
|
|
194
|
-
};
|
|
198
|
+
return tokens.accountId === void 0 ? { path } : { path, accountId: tokens.accountId };
|
|
195
199
|
}
|
|
196
|
-
__name(loginWithDevice, "loginWithDevice");
|
|
197
200
|
export {
|
|
198
201
|
AuthProvider,
|
|
199
202
|
CODEX_CLIENT_ID_ENV_VAR,
|
|
@@ -202,11 +205,15 @@ export {
|
|
|
202
205
|
authFilePath2 as authFilePath,
|
|
203
206
|
credentialHome,
|
|
204
207
|
deviceLogin,
|
|
208
|
+
ensureFreshCredential2 as ensureFreshCredential,
|
|
209
|
+
extractAccountId,
|
|
205
210
|
loginWithDevice,
|
|
206
211
|
openaiDeviceLogin3 as openaiDeviceLogin,
|
|
212
|
+
persistOAuthTokens2 as persistOAuthTokens,
|
|
207
213
|
pollDeviceToken,
|
|
208
214
|
readAuthFile,
|
|
209
215
|
readStoredOAuth2 as readStoredOAuth,
|
|
216
|
+
refreshOAuthTokens,
|
|
210
217
|
requestDeviceCode,
|
|
211
218
|
writeCredential
|
|
212
219
|
};
|
package/dist/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/auth/auth-provider.ts","../src/auth-entry.ts","../src/auth/device-provider.ts"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/auth/auth-provider.ts","../src/auth-entry.ts","../src/auth/device-provider.ts"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQP,SAAS,oBAAoB;AAiCtB,IAAM,iBAAN,cAA6B,MAAM;AAAA,EACxC,YACE,SAES,aACT;AACA,UAAM,OAAO;AAFJ;AAGT,SAAK,OAAO;AAAA,EACd;AAAA,EAJW;AAKb;AAMA,IAAM,uBAAuB;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGO,SAAS,0BAA0B,KAA8B;AACtE,QAAM,QAAQ,eAAe,QAAQ,GAAG,IAAI,IAAI,KAAK,IAAI,OAAO,KAAK,OAAO,GAAG;AAC/E,MAAI,qDAAqD,KAAK,KAAK,GAAG;AACpE,WAAO,IAAI;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACA,QAAM,cACJ,qBAAqB,KAAK,CAAC,MAAM,MAAM,SAAS,CAAC,CAAC,KAClD,gCAAgC,KAAK,KAAK;AAC5C,SAAO,IAAI;AAAA,IACT,cAAc,mDAAgD;A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