limbo-ai 1.24.4 → 1.24.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/cli.js +1 -1
- package/package.json +1 -1
- package/setup-server/server.js +18 -22
- package/test/setup-server.test.js +9 -10
package/cli.js
CHANGED
|
@@ -1283,7 +1283,7 @@ function decodeJwtPayload(token) {
|
|
|
1283
1283
|
|
|
1284
1284
|
function writeAuthProfilesToDocker(store) {
|
|
1285
1285
|
const json = JSON.stringify(store, null, 2);
|
|
1286
|
-
const destDir = '/home/limbo/.zeroclaw
|
|
1286
|
+
const destDir = '/home/limbo/.zeroclaw';
|
|
1287
1287
|
const destFile = `${destDir}/auth-profiles.json`;
|
|
1288
1288
|
spawnSync('docker', [
|
|
1289
1289
|
'compose', 'run', '--rm', '--no-deps', '--entrypoint', 'sh', 'limbo',
|
package/package.json
CHANGED
package/setup-server/server.js
CHANGED
|
@@ -229,52 +229,48 @@ function decodeJwtPayload(token) {
|
|
|
229
229
|
return JSON.parse(Buffer.from(parts[1], 'base64url').toString());
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
// ZeroClaw auth-profiles.json
|
|
233
|
-
//
|
|
234
|
-
//
|
|
235
|
-
// After writing, `zeroclaw auth use --provider X --profile Y` activates it.
|
|
232
|
+
// ZeroClaw auth-profiles.json — must match the structure used by the CLI
|
|
233
|
+
// (cli.js buildAnthropicAuthProfile / buildCodexAuthProfile).
|
|
234
|
+
// Path: ~/.zeroclaw/agents/main/agent/auth-profiles.json
|
|
236
235
|
|
|
237
236
|
function buildCodexAuthProfile(profile) {
|
|
238
|
-
const
|
|
239
|
-
const profileId = `openai-codex:${profileName}`;
|
|
237
|
+
const profileId = profile.email ? `openai-codex:${profile.email}` : 'openai-codex:default';
|
|
240
238
|
return {
|
|
241
239
|
version: 1,
|
|
242
240
|
profiles: {
|
|
243
241
|
[profileId]: {
|
|
244
|
-
|
|
245
|
-
kind: 'oauth',
|
|
242
|
+
type: 'oauth',
|
|
246
243
|
provider: 'openai-codex',
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
244
|
+
access: profile.access,
|
|
245
|
+
refresh: profile.refresh,
|
|
246
|
+
expires: profile.expires,
|
|
247
|
+
accountId: profile.accountId || '',
|
|
251
248
|
},
|
|
252
249
|
},
|
|
253
|
-
order: {
|
|
254
|
-
lastGood: {
|
|
250
|
+
order: {},
|
|
251
|
+
lastGood: {},
|
|
255
252
|
usageStats: {},
|
|
256
253
|
};
|
|
257
254
|
}
|
|
258
255
|
|
|
259
256
|
function buildAnthropicAuthProfile(token) {
|
|
260
|
-
const profileName = 'default';
|
|
261
|
-
const profileId = `anthropic:${profileName}`;
|
|
262
257
|
return {
|
|
263
258
|
version: 1,
|
|
264
259
|
profiles: {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
kind: 'token',
|
|
260
|
+
'anthropic:token': {
|
|
261
|
+
type: 'token',
|
|
268
262
|
provider: 'anthropic',
|
|
269
|
-
|
|
263
|
+
token,
|
|
270
264
|
},
|
|
271
265
|
},
|
|
272
|
-
order: { anthropic: [
|
|
273
|
-
lastGood: {
|
|
266
|
+
order: { anthropic: ['anthropic:token'] },
|
|
267
|
+
lastGood: {},
|
|
274
268
|
usageStats: {},
|
|
275
269
|
};
|
|
276
270
|
}
|
|
277
271
|
|
|
272
|
+
// ZeroClaw resolves auth profiles from the state dir root: ~/.zeroclaw/auth-profiles.json
|
|
273
|
+
// See: ZeroClaw src/auth/profiles.rs — state_dir.join("auth-profiles.json")
|
|
278
274
|
const AUTH_PROFILES_FILE = path.join(ZEROCLAW_STATE, 'auth-profiles.json');
|
|
279
275
|
|
|
280
276
|
function writeAuthProfiles(store) {
|
|
@@ -177,13 +177,12 @@ describe('buildCodexAuthProfile', () => {
|
|
|
177
177
|
};
|
|
178
178
|
const result = buildCodexAuthProfile(profile);
|
|
179
179
|
assert.strictEqual(result.version, 1);
|
|
180
|
-
const pid = 'openai-codex:
|
|
180
|
+
const pid = 'openai-codex:test@example.com';
|
|
181
181
|
assert.ok(result.profiles[pid], 'profile entry exists');
|
|
182
182
|
assert.strictEqual(result.profiles[pid].provider, 'openai-codex');
|
|
183
|
-
assert.strictEqual(result.profiles[pid].
|
|
184
|
-
assert.strictEqual(result.profiles[pid].
|
|
185
|
-
assert.strictEqual(result.profiles[pid].
|
|
186
|
-
assert.deepStrictEqual(result.order, { 'openai-codex': [pid] });
|
|
183
|
+
assert.strictEqual(result.profiles[pid].type, 'oauth');
|
|
184
|
+
assert.strictEqual(result.profiles[pid].access, 'access-tok');
|
|
185
|
+
assert.strictEqual(result.profiles[pid].refresh, 'refresh-tok');
|
|
187
186
|
});
|
|
188
187
|
|
|
189
188
|
it('builds correct structure without email (accountId empty)', () => {
|
|
@@ -194,7 +193,7 @@ describe('buildCodexAuthProfile', () => {
|
|
|
194
193
|
};
|
|
195
194
|
const result = buildCodexAuthProfile(profile);
|
|
196
195
|
const pid = 'openai-codex:default';
|
|
197
|
-
assert.strictEqual(result.profiles[pid].
|
|
196
|
+
assert.strictEqual(result.profiles[pid].accountId, '');
|
|
198
197
|
});
|
|
199
198
|
});
|
|
200
199
|
|
|
@@ -202,17 +201,17 @@ describe('buildAnthropicAuthProfile', () => {
|
|
|
202
201
|
it('builds correct structure', () => {
|
|
203
202
|
const result = buildAnthropicAuthProfile('sk-ant-test123');
|
|
204
203
|
assert.strictEqual(result.version, 1);
|
|
205
|
-
const pid = 'anthropic:
|
|
204
|
+
const pid = 'anthropic:token';
|
|
206
205
|
assert.ok(result.profiles[pid], 'profile entry exists');
|
|
207
206
|
assert.strictEqual(result.profiles[pid].provider, 'anthropic');
|
|
208
|
-
assert.strictEqual(result.profiles[pid].
|
|
209
|
-
assert.strictEqual(result.profiles[pid].
|
|
207
|
+
assert.strictEqual(result.profiles[pid].type, 'token');
|
|
208
|
+
assert.strictEqual(result.profiles[pid].token, 'sk-ant-test123');
|
|
210
209
|
});
|
|
211
210
|
|
|
212
211
|
it('order includes anthropic key', () => {
|
|
213
212
|
const result = buildAnthropicAuthProfile('sk-ant-xyz');
|
|
214
213
|
assert.ok(result.order.anthropic, 'order has anthropic key');
|
|
215
|
-
assert.deepStrictEqual(result.order.anthropic, ['anthropic:
|
|
214
|
+
assert.deepStrictEqual(result.order.anthropic, ['anthropic:token']);
|
|
216
215
|
});
|
|
217
216
|
});
|
|
218
217
|
|