agent-shim 11.79.0 → 11.81.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/README.md +2 -2
- package/dist/cli.cjs +215 -87
- package/dist/index.cjs +161 -70
- package/dist/index.mjs +161 -70
- package/dist/types/index.d.ts +12 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -163,7 +163,7 @@ function providerFilePath(directory, name, source) {
|
|
|
163
163
|
}
|
|
164
164
|
return path.join(directory, `${name}.json`);
|
|
165
165
|
}
|
|
166
|
-
var FILESYSTEM_COMPONENT_BYTES, MAX_PID_DIGITS, UUID_CHARS, ATOMIC_WRITE_OVERHEAD_BYTES, FARM_SWAP_OVERHEAD_BYTES, MAX_NAME_BYTES, FILE_NAME_PATTERN, FILE_NAME, FILE_NAME_RULE, STORED_NAME_RULE, FileNameSchema, StoredNameSchema, UnsafeNameError, InvalidProviderNameError;
|
|
166
|
+
var FILESYSTEM_COMPONENT_BYTES, MAX_PID_DIGITS, UUID_CHARS, ATOMIC_WRITE_OVERHEAD_BYTES, FARM_SWAP_OVERHEAD_BYTES, MAX_NAME_BYTES, FILE_NAME_PATTERN, FILE_NAME, FILE_NAME_RULE, STORED_NAME_RULE, FileNameSchema, StoredNameSchema, LABEL_FORBIDDEN, IDENTITY_LABEL_RULE, IdentityLabelSchema, UnsafeNameError, InvalidProviderNameError;
|
|
167
167
|
var init_names = __esm({
|
|
168
168
|
"src/config/names.ts"() {
|
|
169
169
|
"use strict";
|
|
@@ -180,6 +180,9 @@ var init_names = __esm({
|
|
|
180
180
|
STORED_NAME_RULE = `must be non-empty, at most ${String(MAX_NAME_BYTES)} bytes, not "." or "..", and contain no path separator or NUL`;
|
|
181
181
|
FileNameSchema = z.string().min(1).regex(FILE_NAME, FILE_NAME_RULE);
|
|
182
182
|
StoredNameSchema = z.string().min(1).max(MAX_NAME_BYTES).refine(isStoredName, STORED_NAME_RULE);
|
|
183
|
+
LABEL_FORBIDDEN = /[\p{Cc}\p{Zl}\p{Zp}]/u;
|
|
184
|
+
IDENTITY_LABEL_RULE = `must be non-empty single-line text of at most ${String(MAX_NAME_BYTES)} characters, with no control characters and no leading or trailing whitespace`;
|
|
185
|
+
IdentityLabelSchema = z.string().min(1).max(MAX_NAME_BYTES).refine((label) => label === label.trim() && !LABEL_FORBIDDEN.test(label), IDENTITY_LABEL_RULE);
|
|
183
186
|
UnsafeNameError = class extends CliError {
|
|
184
187
|
constructor(attemptedName, kind, rule = STORED_NAME_RULE, source) {
|
|
185
188
|
super(`${source === void 0 ? "" : `${source}: `}${JSON.stringify(attemptedName)} is not a valid ${kind} name: a name ${rule}.`);
|
|
@@ -1206,6 +1209,8 @@ var init_schema = __esm({
|
|
|
1206
1209
|
IdentitySchema = z3.strictObject({
|
|
1207
1210
|
$schema: z3.string().optional(),
|
|
1208
1211
|
name: FileNameSchema,
|
|
1212
|
+
/** What the identity is for, in the person's words, drawn beside its name in `identity list` and `show`, the launch banner and the statusline. Display only: the name stays the key for lookup, paths, keychain service names and pools. */
|
|
1213
|
+
label: IdentityLabelSchema.optional(),
|
|
1209
1214
|
defaultConfigProfile: StoredNameSchema.optional(),
|
|
1210
1215
|
/** The provider this identity exists for: a launch on the identity routes through it unless `--provider`, `--no-provider` or a cascade layer's `launch.provider` says otherwise. Its sessions run on the provider's credential, so the identity needs no stored login. */
|
|
1211
1216
|
provider: StoredNameSchema.optional(),
|
|
@@ -4740,7 +4745,7 @@ var init_package = __esm({
|
|
|
4740
4745
|
"package.json"() {
|
|
4741
4746
|
package_default = {
|
|
4742
4747
|
name: "agent-shim",
|
|
4743
|
-
version: "11.
|
|
4748
|
+
version: "11.81.0",
|
|
4744
4749
|
description: "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
|
|
4745
4750
|
license: "MIT",
|
|
4746
4751
|
author: "Joseph Mearman <joseph@mearman.co.uk>",
|
|
@@ -7012,6 +7017,78 @@ var init_account = __esm({
|
|
|
7012
7017
|
}
|
|
7013
7018
|
});
|
|
7014
7019
|
|
|
7020
|
+
// src/usage/accountDescription.ts
|
|
7021
|
+
function describeAccountOrganisation(account) {
|
|
7022
|
+
const parts = [account.organizationName, account.organizationType].filter((part) => part !== void 0);
|
|
7023
|
+
return parts.length === 0 ? void 0 : parts.join(", ");
|
|
7024
|
+
}
|
|
7025
|
+
var init_accountDescription = __esm({
|
|
7026
|
+
"src/usage/accountDescription.ts"() {
|
|
7027
|
+
"use strict";
|
|
7028
|
+
}
|
|
7029
|
+
});
|
|
7030
|
+
|
|
7031
|
+
// src/identityAccounts.ts
|
|
7032
|
+
function readIdentityAccount(fs14, identitiesDir, identity) {
|
|
7033
|
+
try {
|
|
7034
|
+
const account = readAccountMetadata(fs14, identitiesDir, identity);
|
|
7035
|
+
return account === void 0 ? void 0 : { account };
|
|
7036
|
+
} catch (error) {
|
|
7037
|
+
if (error instanceof AccountMetadataError) {
|
|
7038
|
+
return { problem: error.message };
|
|
7039
|
+
}
|
|
7040
|
+
throw error;
|
|
7041
|
+
}
|
|
7042
|
+
}
|
|
7043
|
+
function summariseIdentityAccount(account) {
|
|
7044
|
+
const summary = {
|
|
7045
|
+
...account.emailAddress === void 0 ? {} : { emailAddress: account.emailAddress },
|
|
7046
|
+
...account.organizationName === void 0 ? {} : { organizationName: account.organizationName },
|
|
7047
|
+
...account.organizationType === void 0 ? {} : { organizationType: account.organizationType },
|
|
7048
|
+
...account.organizationRole === void 0 ? {} : { organizationRole: account.organizationRole },
|
|
7049
|
+
...account.billingType === void 0 ? {} : { billingType: account.billingType },
|
|
7050
|
+
...account.seatTier === void 0 ? {} : { seatTier: account.seatTier }
|
|
7051
|
+
};
|
|
7052
|
+
return Object.keys(summary).length === 0 ? void 0 : summary;
|
|
7053
|
+
}
|
|
7054
|
+
function loginKeyOf(account) {
|
|
7055
|
+
return account.accountUuid === void 0 ? void 0 : JSON.stringify([account.accountUuid, account.organizationUuid ?? null]);
|
|
7056
|
+
}
|
|
7057
|
+
function collectByLogin(items, loginOf) {
|
|
7058
|
+
const groups = /* @__PURE__ */ new Map();
|
|
7059
|
+
for (const item of items) {
|
|
7060
|
+
const key = loginOf(item) ?? /* @__PURE__ */ Symbol("no login");
|
|
7061
|
+
const group = groups.get(key);
|
|
7062
|
+
if (group === void 0) {
|
|
7063
|
+
groups.set(key, [item]);
|
|
7064
|
+
} else {
|
|
7065
|
+
group.push(item);
|
|
7066
|
+
}
|
|
7067
|
+
}
|
|
7068
|
+
return [...groups.values()];
|
|
7069
|
+
}
|
|
7070
|
+
function groupSharedLogins(items, loginOf) {
|
|
7071
|
+
return collectByLogin(items, loginOf).filter((group) => group.length > 1);
|
|
7072
|
+
}
|
|
7073
|
+
function joinNames(names) {
|
|
7074
|
+
const last = names.at(-1);
|
|
7075
|
+
return names.length < 2 || last === void 0 ? names.join("") : `${names.slice(0, -1).join(", ")} and ${last}`;
|
|
7076
|
+
}
|
|
7077
|
+
function describeAccountHolder(summary) {
|
|
7078
|
+
const organisation = describeAccountOrganisation(summary);
|
|
7079
|
+
if (summary.emailAddress === void 0) {
|
|
7080
|
+
return organisation;
|
|
7081
|
+
}
|
|
7082
|
+
return organisation === void 0 ? summary.emailAddress : `${summary.emailAddress} (${organisation})`;
|
|
7083
|
+
}
|
|
7084
|
+
var init_identityAccounts = __esm({
|
|
7085
|
+
"src/identityAccounts.ts"() {
|
|
7086
|
+
"use strict";
|
|
7087
|
+
init_account();
|
|
7088
|
+
init_accountDescription();
|
|
7089
|
+
}
|
|
7090
|
+
});
|
|
7091
|
+
|
|
7015
7092
|
// src/usage/rateLimit.ts
|
|
7016
7093
|
function epochSecondsToIso(value) {
|
|
7017
7094
|
if (value === void 0) {
|
|
@@ -7379,6 +7456,9 @@ function assessRefusedNested(member, nested, nowMs) {
|
|
|
7379
7456
|
};
|
|
7380
7457
|
}
|
|
7381
7458
|
function assess(member, nowMs) {
|
|
7459
|
+
if (member.sameLoginAs !== void 0) {
|
|
7460
|
+
return { candidate: { identity: member.identity, class: "ineligible", plan: planOf(member.account), reasons: [`same login as ${member.sameLoginAs}`] } };
|
|
7461
|
+
}
|
|
7382
7462
|
const nested = member.nested;
|
|
7383
7463
|
if (nested === void 0) {
|
|
7384
7464
|
return assessIdentity(member, nowMs);
|
|
@@ -7853,6 +7933,29 @@ function loadPoolMembers(fs14, paths, identities, nowMs) {
|
|
|
7853
7933
|
}
|
|
7854
7934
|
});
|
|
7855
7935
|
}
|
|
7936
|
+
function snapshotAgeKey(member) {
|
|
7937
|
+
return member.snapshot === void 0 ? Number.NEGATIVE_INFINITY : Date.parse(member.snapshot.updatedAt);
|
|
7938
|
+
}
|
|
7939
|
+
function collapseSharedLogins(members) {
|
|
7940
|
+
const groups = groupSharedLogins(members, (member) => member.nested === void 0 && member.account !== void 0 ? loginKeyOf(member.account) : void 0);
|
|
7941
|
+
const representativeOf = /* @__PURE__ */ new Map();
|
|
7942
|
+
for (const group of groups) {
|
|
7943
|
+
const representative = group.reduce((freshest, member) => snapshotAgeKey(member) > snapshotAgeKey(freshest) ? member : freshest);
|
|
7944
|
+
for (const member of group) {
|
|
7945
|
+
if (member !== representative) {
|
|
7946
|
+
representativeOf.set(member, representative.identity);
|
|
7947
|
+
}
|
|
7948
|
+
}
|
|
7949
|
+
}
|
|
7950
|
+
return members.map((member) => {
|
|
7951
|
+
const representative = representativeOf.get(member);
|
|
7952
|
+
return representative === void 0 ? member : { ...member, sameLoginAs: representative };
|
|
7953
|
+
});
|
|
7954
|
+
}
|
|
7955
|
+
function stickyOnRepresentative(sticky, members) {
|
|
7956
|
+
const twin = sticky === void 0 ? void 0 : members.find((member) => member.identity === sticky.identity && member.sameLoginAs !== void 0);
|
|
7957
|
+
return sticky === void 0 || twin?.sameLoginAs === void 0 ? sticky : { ...sticky, identity: twin.sameLoginAs };
|
|
7958
|
+
}
|
|
7856
7959
|
function rankPoolGraph(input) {
|
|
7857
7960
|
return rankNamedPool(input, input.poolName, [], input.sticky);
|
|
7858
7961
|
}
|
|
@@ -7880,13 +7983,15 @@ function rankNamedPool(input, poolName, stack, sticky) {
|
|
|
7880
7983
|
members.push(typeof entry === "string" ? nested.member : { ...nested.member, policy: entry.when });
|
|
7881
7984
|
missing.push(...nested.missing);
|
|
7882
7985
|
}
|
|
7986
|
+
const collapsed = collapseSharedLogins(members);
|
|
7987
|
+
const stickyPick = stickyOnRepresentative(sticky, collapsed);
|
|
7883
7988
|
const ranking = rankPool({
|
|
7884
|
-
members,
|
|
7989
|
+
members: collapsed,
|
|
7885
7990
|
nowMs: input.nowMs,
|
|
7886
7991
|
resuming: input.resuming,
|
|
7887
7992
|
...input.resumeContextTokens === void 0 ? {} : { resumeContextTokens: input.resumeContextTokens },
|
|
7888
7993
|
...input.committedContextTokens === void 0 ? {} : { committedContextTokens: input.committedContextTokens },
|
|
7889
|
-
...
|
|
7994
|
+
...stickyPick === void 0 ? {} : { sticky: stickyPick },
|
|
7890
7995
|
...pool.preference === void 0 ? {} : { preference: pool.preference }
|
|
7891
7996
|
});
|
|
7892
7997
|
return { ranking, missing };
|
|
@@ -7972,6 +8077,7 @@ var init_poolPick = __esm({
|
|
|
7972
8077
|
init_cliError();
|
|
7973
8078
|
init_identity();
|
|
7974
8079
|
init_schema();
|
|
8080
|
+
init_identityAccounts();
|
|
7975
8081
|
init_account();
|
|
7976
8082
|
init_pick();
|
|
7977
8083
|
init_read();
|
|
@@ -11465,9 +11571,15 @@ function movedRows(facts) {
|
|
|
11465
11571
|
}
|
|
11466
11572
|
return [];
|
|
11467
11573
|
}
|
|
11574
|
+
function identityText(facts) {
|
|
11575
|
+
if (facts.identity === void 0) {
|
|
11576
|
+
return "(none)";
|
|
11577
|
+
}
|
|
11578
|
+
return facts.identityLabel === void 0 ? facts.identity : `${facts.identity} (${facts.identityLabel})`;
|
|
11579
|
+
}
|
|
11468
11580
|
function decisionRows(facts) {
|
|
11469
11581
|
return [
|
|
11470
|
-
{ label: "identity", value: facts
|
|
11582
|
+
{ label: "identity", value: identityText(facts), detail: facts.identitySource },
|
|
11471
11583
|
...facts.pool === void 0 ? [] : [
|
|
11472
11584
|
{
|
|
11473
11585
|
label: "pool",
|
|
@@ -11996,6 +12108,7 @@ function decideLaunch(params, readOnly) {
|
|
|
11996
12108
|
return {
|
|
11997
12109
|
parsedArgv,
|
|
11998
12110
|
identityDecision,
|
|
12111
|
+
identityLabel: loadedIdentity?.config.label,
|
|
11999
12112
|
poolPick,
|
|
12000
12113
|
poolRanking,
|
|
12001
12114
|
lastRanAs,
|
|
@@ -12026,6 +12139,7 @@ function prepareLaunch(params) {
|
|
|
12026
12139
|
const rows = [
|
|
12027
12140
|
...decisionRows({
|
|
12028
12141
|
identity: identityDecision.name,
|
|
12142
|
+
identityLabel: decided.identityLabel,
|
|
12029
12143
|
identitySource: identityDecision.source,
|
|
12030
12144
|
pool: poolPick,
|
|
12031
12145
|
ranking: resolvedFlags.explain ? poolRanking : void 0,
|
|
@@ -16621,6 +16735,12 @@ function setIdentityProvider(paths, identityName, providerName) {
|
|
|
16621
16735
|
}
|
|
16622
16736
|
return applyPatch(identityJsonPath(paths, identityName), IdentitySchema, { provider: providerName });
|
|
16623
16737
|
}
|
|
16738
|
+
function setIdentityLabel(paths, identityName, label) {
|
|
16739
|
+
if (!identityExists(paths, identityName)) {
|
|
16740
|
+
throw new IdentityNotFoundError(identityName);
|
|
16741
|
+
}
|
|
16742
|
+
return applyPatch(identityJsonPath(paths, identityName), IdentitySchema, { label });
|
|
16743
|
+
}
|
|
16624
16744
|
function setAllowAmbientCredential(paths, identityName, allow) {
|
|
16625
16745
|
if (!identityExists(paths, identityName)) {
|
|
16626
16746
|
throw new IdentityNotFoundError(identityName);
|
|
@@ -16669,65 +16789,7 @@ init_realPorts();
|
|
|
16669
16789
|
import fs11 from "node:fs";
|
|
16670
16790
|
import path29 from "node:path";
|
|
16671
16791
|
init_signIn();
|
|
16672
|
-
|
|
16673
|
-
// src/identityAccounts.ts
|
|
16674
|
-
init_account();
|
|
16675
|
-
|
|
16676
|
-
// src/usage/accountDescription.ts
|
|
16677
|
-
function describeAccountOrganisation(account) {
|
|
16678
|
-
const parts = [account.organizationName, account.organizationType].filter((part) => part !== void 0);
|
|
16679
|
-
return parts.length === 0 ? void 0 : parts.join(", ");
|
|
16680
|
-
}
|
|
16681
|
-
|
|
16682
|
-
// src/identityAccounts.ts
|
|
16683
|
-
function readIdentityAccount(fs14, identitiesDir, identity) {
|
|
16684
|
-
try {
|
|
16685
|
-
const account = readAccountMetadata(fs14, identitiesDir, identity);
|
|
16686
|
-
return account === void 0 ? void 0 : { account };
|
|
16687
|
-
} catch (error) {
|
|
16688
|
-
if (error instanceof AccountMetadataError) {
|
|
16689
|
-
return { problem: error.message };
|
|
16690
|
-
}
|
|
16691
|
-
throw error;
|
|
16692
|
-
}
|
|
16693
|
-
}
|
|
16694
|
-
function summariseIdentityAccount(account) {
|
|
16695
|
-
const summary = {
|
|
16696
|
-
...account.emailAddress === void 0 ? {} : { emailAddress: account.emailAddress },
|
|
16697
|
-
...account.organizationName === void 0 ? {} : { organizationName: account.organizationName },
|
|
16698
|
-
...account.organizationType === void 0 ? {} : { organizationType: account.organizationType },
|
|
16699
|
-
...account.organizationRole === void 0 ? {} : { organizationRole: account.organizationRole },
|
|
16700
|
-
...account.billingType === void 0 ? {} : { billingType: account.billingType },
|
|
16701
|
-
...account.seatTier === void 0 ? {} : { seatTier: account.seatTier }
|
|
16702
|
-
};
|
|
16703
|
-
return Object.keys(summary).length === 0 ? void 0 : summary;
|
|
16704
|
-
}
|
|
16705
|
-
function loginKeyOf(account) {
|
|
16706
|
-
return account.accountUuid === void 0 ? void 0 : JSON.stringify([account.accountUuid, account.organizationUuid ?? null]);
|
|
16707
|
-
}
|
|
16708
|
-
function collectByLogin(items, loginOf) {
|
|
16709
|
-
const groups = /* @__PURE__ */ new Map();
|
|
16710
|
-
for (const item of items) {
|
|
16711
|
-
const key = loginOf(item) ?? /* @__PURE__ */ Symbol("no login");
|
|
16712
|
-
const group = groups.get(key);
|
|
16713
|
-
if (group === void 0) {
|
|
16714
|
-
groups.set(key, [item]);
|
|
16715
|
-
} else {
|
|
16716
|
-
group.push(item);
|
|
16717
|
-
}
|
|
16718
|
-
}
|
|
16719
|
-
return [...groups.values()];
|
|
16720
|
-
}
|
|
16721
|
-
function groupSharedLogins(items, loginOf) {
|
|
16722
|
-
return collectByLogin(items, loginOf).filter((group) => group.length > 1);
|
|
16723
|
-
}
|
|
16724
|
-
function describeAccountHolder(summary) {
|
|
16725
|
-
const organisation = describeAccountOrganisation(summary);
|
|
16726
|
-
if (summary.emailAddress === void 0) {
|
|
16727
|
-
return organisation;
|
|
16728
|
-
}
|
|
16729
|
-
return organisation === void 0 ? summary.emailAddress : `${summary.emailAddress} (${organisation})`;
|
|
16730
|
-
}
|
|
16792
|
+
init_identityAccounts();
|
|
16731
16793
|
|
|
16732
16794
|
// src/codex/siwcStore.ts
|
|
16733
16795
|
import { z as z26 } from "zod";
|
|
@@ -17081,6 +17143,27 @@ init_providerAliases();
|
|
|
17081
17143
|
init_providersStore();
|
|
17082
17144
|
init_guard();
|
|
17083
17145
|
init_identity();
|
|
17146
|
+
|
|
17147
|
+
// src/poolSharedLogins.ts
|
|
17148
|
+
init_identityAccounts();
|
|
17149
|
+
init_identity();
|
|
17150
|
+
function sharedLoginMembers(members, accountOf) {
|
|
17151
|
+
const known = members.flatMap((identity) => {
|
|
17152
|
+
const account = poolNameOf(identity) === void 0 ? accountOf(identity) : void 0;
|
|
17153
|
+
return account === void 0 ? [] : [{ identity, account }];
|
|
17154
|
+
});
|
|
17155
|
+
return groupSharedLogins(known, (entry) => loginKeyOf(entry.account)).flatMap((group) => {
|
|
17156
|
+
const first = group[0];
|
|
17157
|
+
return first === void 0 ? [] : [{ members: group.map((entry) => entry.identity), account: first.account }];
|
|
17158
|
+
});
|
|
17159
|
+
}
|
|
17160
|
+
function describeSharedLoginMembers(poolName, shared) {
|
|
17161
|
+
const summary = summariseIdentityAccount(shared.account);
|
|
17162
|
+
const holder = summary === void 0 ? void 0 : describeAccountHolder(summary);
|
|
17163
|
+
return `Pool "${poolName}" lists ${joinNames(shared.members)}, which hold the same login${holder === void 0 ? "" : ` (${holder})`}, so they share one quota window. A launch ranks them as one candidate and never fails over from one to another; keep one of them in the pool.`;
|
|
17164
|
+
}
|
|
17165
|
+
|
|
17166
|
+
// src/doctorReport.ts
|
|
17084
17167
|
init_extends();
|
|
17085
17168
|
var DOCTOR_SEVERITIES = ["pass", "warn", "fail"];
|
|
17086
17169
|
var DOCTOR_SECTIONS = [
|
|
@@ -17103,10 +17186,6 @@ var DOCTOR_SECTIONS = [
|
|
|
17103
17186
|
"frontdoor",
|
|
17104
17187
|
"models"
|
|
17105
17188
|
];
|
|
17106
|
-
function joinNames(names) {
|
|
17107
|
-
const last = names.at(-1);
|
|
17108
|
-
return names.length < 2 || last === void 0 ? names.join("") : `${names.slice(0, -1).join(", ")} and ${last}`;
|
|
17109
|
-
}
|
|
17110
17189
|
function refinePathShadow(status, ownExecutablePath, realpath) {
|
|
17111
17190
|
if (status.status !== "shadowed") {
|
|
17112
17191
|
return status;
|
|
@@ -17419,6 +17498,7 @@ function runDoctor(params) {
|
|
|
17419
17498
|
}
|
|
17420
17499
|
const validatedGlobalConfig = params.globalConfig.raw === void 0 ? void 0 : validateJson(GlobalConfigSchema, params.globalConfig);
|
|
17421
17500
|
const pools = validatedGlobalConfig?.ok === true ? validatedGlobalConfig.data.pools ?? {} : {};
|
|
17501
|
+
const accountByIdentity = new Map(params.identities.flatMap((entry) => validIdentityNames.has(entry.name) && entry.account !== void 0 ? [[entry.name, entry.account]] : []));
|
|
17422
17502
|
for (const [poolName, pool] of Object.entries(pools)) {
|
|
17423
17503
|
const missing = pool.identities.filter((member) => poolNameOf(poolMemberIdentity(member)) === void 0 && !validIdentityNames.has(poolMemberIdentity(member)));
|
|
17424
17504
|
const undefinedPools = pool.identities.flatMap((member) => {
|
|
@@ -17434,6 +17514,9 @@ function runDoctor(params) {
|
|
|
17434
17514
|
];
|
|
17435
17515
|
push("pool", "fail", `Pool "${poolName}" names ${problems.join(" and ")}.`, poolName);
|
|
17436
17516
|
}
|
|
17517
|
+
for (const shared of sharedLoginMembers(pool.identities.map(poolMemberIdentity), (identityName) => accountByIdentity.get(identityName))) {
|
|
17518
|
+
push("pool", "warn", describeSharedLoginMembers(poolName, shared), poolName);
|
|
17519
|
+
}
|
|
17437
17520
|
}
|
|
17438
17521
|
const reportedCycles = /* @__PURE__ */ new Set();
|
|
17439
17522
|
for (const poolName of Object.keys(pools).sort()) {
|
|
@@ -18051,6 +18134,7 @@ init_providersStore();
|
|
|
18051
18134
|
|
|
18052
18135
|
// src/frontdoor/configSchemas.ts
|
|
18053
18136
|
init_schema();
|
|
18137
|
+
init_names();
|
|
18054
18138
|
init_statusline();
|
|
18055
18139
|
import { z as z30 } from "zod";
|
|
18056
18140
|
var RemovalConfirmationSchema = z30.boolean();
|
|
@@ -18077,6 +18161,7 @@ var mutationOutput = (kind, action) => z30.strictObject({ action: z30.literal(ac
|
|
|
18077
18161
|
var storedMutationOutput = (kind, action, value) => z30.strictObject({ action: z30.literal(action), kind: z30.literal(kind), name: z30.string(), value });
|
|
18078
18162
|
var IdentityValueSchema = z30.strictObject({
|
|
18079
18163
|
name: z30.string(),
|
|
18164
|
+
label: z30.string().optional(),
|
|
18080
18165
|
defaultConfigProfile: z30.string().optional(),
|
|
18081
18166
|
provider: z30.string().optional(),
|
|
18082
18167
|
allowAmbientCredential: z30.boolean(),
|
|
@@ -18097,6 +18182,8 @@ var ConfigNameInputSchema = z30.strictObject({ name: z30.string().min(1) });
|
|
|
18097
18182
|
var ConfigIdentityAddOutputSchema = storedMutationOutput("identity", "created", IdentityValueSchema);
|
|
18098
18183
|
var ConfigIdentitySetInputSchema = z30.strictObject({
|
|
18099
18184
|
name: z30.string().min(1),
|
|
18185
|
+
/** The identity's display label; `false` clears it. */
|
|
18186
|
+
label: z30.union([IdentityLabelSchema, z30.literal(false)]).optional(),
|
|
18100
18187
|
defaultConfigProfile: z30.union([z30.string().min(1), z30.literal(false)]).optional(),
|
|
18101
18188
|
/** The provider the identity exists for; `false` clears it. */
|
|
18102
18189
|
provider: z30.union([z30.string().min(1), z30.literal(false)]).optional(),
|
|
@@ -18243,6 +18330,7 @@ function identityValue(name, paths) {
|
|
|
18243
18330
|
}
|
|
18244
18331
|
return {
|
|
18245
18332
|
name: identity.name,
|
|
18333
|
+
...identity.label === void 0 ? {} : { label: identity.label },
|
|
18246
18334
|
...identity.defaultConfigProfile === void 0 ? {} : { defaultConfigProfile: identity.defaultConfigProfile },
|
|
18247
18335
|
...identity.provider === void 0 ? {} : { provider: identity.provider },
|
|
18248
18336
|
allowAmbientCredential: identity.allowAmbientCredential,
|
|
@@ -18277,9 +18365,9 @@ function createConfigApiRouter(deps) {
|
|
|
18277
18365
|
return { action: "created", kind: "identity", name: input.name, value: identityValue(input.name, paths) };
|
|
18278
18366
|
})
|
|
18279
18367
|
),
|
|
18280
|
-
set: route("/rest/config/identity/set", "Update an identity's default profile, provider, ambient-credential setting, credential or anchors").input(ConfigIdentitySetInputSchema).output(ConfigIdentitySetOutputSchema).handler(
|
|
18368
|
+
set: route("/rest/config/identity/set", "Update an identity's label, default profile, provider, ambient-credential setting, credential or anchors").input(ConfigIdentitySetInputSchema).output(ConfigIdentitySetOutputSchema).handler(
|
|
18281
18369
|
({ input }) => guarded(() => {
|
|
18282
|
-
requireChange(input.defaultConfigProfile !== void 0 || input.provider !== void 0 || input.allowAmbientCredential !== void 0 || input.credential !== void 0 || input.anchors !== void 0, "defaultConfigProfile, provider, allowAmbientCredential, credential or anchors");
|
|
18370
|
+
requireChange(input.label !== void 0 || input.defaultConfigProfile !== void 0 || input.provider !== void 0 || input.allowAmbientCredential !== void 0 || input.credential !== void 0 || input.anchors !== void 0, "label, defaultConfigProfile, provider, allowAmbientCredential, credential or anchors");
|
|
18283
18371
|
if (!identityExists(paths, input.name)) {
|
|
18284
18372
|
throw new IdentityNotFoundError(input.name);
|
|
18285
18373
|
}
|
|
@@ -18289,6 +18377,9 @@ function createConfigApiRouter(deps) {
|
|
|
18289
18377
|
if (typeof input.provider === "string") {
|
|
18290
18378
|
requireProviderExists(paths, input.provider);
|
|
18291
18379
|
}
|
|
18380
|
+
if (input.label !== void 0) {
|
|
18381
|
+
setIdentityLabel(paths, input.name, input.label === false ? void 0 : input.label);
|
|
18382
|
+
}
|
|
18292
18383
|
if (input.defaultConfigProfile !== void 0) {
|
|
18293
18384
|
setDefaultConfigProfile(paths, input.name, input.defaultConfigProfile === false ? void 0 : input.defaultConfigProfile);
|
|
18294
18385
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5412,6 +5412,7 @@ type GlobalConfig = z.infer<typeof GlobalConfigSchema>;
|
|
|
5412
5412
|
declare const IdentitySchema: z.ZodObject<{
|
|
5413
5413
|
$schema: z.ZodOptional<z.ZodString>;
|
|
5414
5414
|
name: z.ZodString;
|
|
5415
|
+
label: z.ZodOptional<z.ZodString>;
|
|
5415
5416
|
defaultConfigProfile: z.ZodOptional<z.ZodString>;
|
|
5416
5417
|
provider: z.ZodOptional<z.ZodString>;
|
|
5417
5418
|
allowAmbientCredential: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -9476,6 +9477,7 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
|
|
|
9476
9477
|
name: zod.ZodString;
|
|
9477
9478
|
value: zod.ZodObject<{
|
|
9478
9479
|
name: zod.ZodString;
|
|
9480
|
+
label: zod.ZodOptional<zod.ZodString>;
|
|
9479
9481
|
defaultConfigProfile: zod.ZodOptional<zod.ZodString>;
|
|
9480
9482
|
provider: zod.ZodOptional<zod.ZodString>;
|
|
9481
9483
|
allowAmbientCredential: zod.ZodBoolean;
|
|
@@ -9529,6 +9531,7 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
|
|
|
9529
9531
|
}, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
|
|
9530
9532
|
set: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
|
|
9531
9533
|
name: zod.ZodString;
|
|
9534
|
+
label: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodString, zod.ZodLiteral<false>]>>;
|
|
9532
9535
|
defaultConfigProfile: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodString, zod.ZodLiteral<false>]>>;
|
|
9533
9536
|
provider: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodString, zod.ZodLiteral<false>]>>;
|
|
9534
9537
|
allowAmbientCredential: zod.ZodOptional<zod.ZodBoolean>;
|
|
@@ -9583,6 +9586,7 @@ declare function createConfigApiRouter(deps: ConfigApiDeps): {
|
|
|
9583
9586
|
name: zod.ZodString;
|
|
9584
9587
|
value: zod.ZodObject<{
|
|
9585
9588
|
name: zod.ZodString;
|
|
9589
|
+
label: zod.ZodOptional<zod.ZodString>;
|
|
9586
9590
|
defaultConfigProfile: zod.ZodOptional<zod.ZodString>;
|
|
9587
9591
|
provider: zod.ZodOptional<zod.ZodString>;
|
|
9588
9592
|
allowAmbientCredential: zod.ZodBoolean;
|
|
@@ -16548,6 +16552,7 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
|
|
|
16548
16552
|
name: zod.ZodString;
|
|
16549
16553
|
value: zod.ZodObject<{
|
|
16550
16554
|
name: zod.ZodString;
|
|
16555
|
+
label: zod.ZodOptional<zod.ZodString>;
|
|
16551
16556
|
defaultConfigProfile: zod.ZodOptional<zod.ZodString>;
|
|
16552
16557
|
provider: zod.ZodOptional<zod.ZodString>;
|
|
16553
16558
|
allowAmbientCredential: zod.ZodBoolean;
|
|
@@ -16601,6 +16606,7 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
|
|
|
16601
16606
|
}, zod_v4_core.$strict>, MergedErrorMap<$ErrorMap, TErrorMap>>;
|
|
16602
16607
|
set: _orpc_server.DecoratedProcedure<DoorApiContext & object, IntersectPick<TInitialContext, $OutContext>, zod.ZodObject<{
|
|
16603
16608
|
name: zod.ZodString;
|
|
16609
|
+
label: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodString, zod.ZodLiteral<false>]>>;
|
|
16604
16610
|
defaultConfigProfile: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodString, zod.ZodLiteral<false>]>>;
|
|
16605
16611
|
provider: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodString, zod.ZodLiteral<false>]>>;
|
|
16606
16612
|
allowAmbientCredential: zod.ZodOptional<zod.ZodBoolean>;
|
|
@@ -16655,6 +16661,7 @@ declare function createDoorApiRouter(deps: DoorApiDeps): {
|
|
|
16655
16661
|
name: zod.ZodString;
|
|
16656
16662
|
value: zod.ZodObject<{
|
|
16657
16663
|
name: zod.ZodString;
|
|
16664
|
+
label: zod.ZodOptional<zod.ZodString>;
|
|
16658
16665
|
defaultConfigProfile: zod.ZodOptional<zod.ZodString>;
|
|
16659
16666
|
provider: zod.ZodOptional<zod.ZodString>;
|
|
16660
16667
|
allowAmbientCredential: zod.ZodBoolean;
|
|
@@ -21074,6 +21081,7 @@ declare const ConfigIdentityAddOutputSchema: z.ZodObject<{
|
|
|
21074
21081
|
name: z.ZodString;
|
|
21075
21082
|
value: z.ZodObject<{
|
|
21076
21083
|
name: z.ZodString;
|
|
21084
|
+
label: z.ZodOptional<z.ZodString>;
|
|
21077
21085
|
defaultConfigProfile: z.ZodOptional<z.ZodString>;
|
|
21078
21086
|
provider: z.ZodOptional<z.ZodString>;
|
|
21079
21087
|
allowAmbientCredential: z.ZodBoolean;
|
|
@@ -21128,6 +21136,7 @@ declare const ConfigIdentityAddOutputSchema: z.ZodObject<{
|
|
|
21128
21136
|
/** `defaultConfigProfile: false` clears it; `credential: false` removes the credential block, returning the identity to its stored login. At least one field must be present. */
|
|
21129
21137
|
declare const ConfigIdentitySetInputSchema: z.ZodObject<{
|
|
21130
21138
|
name: z.ZodString;
|
|
21139
|
+
label: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
|
|
21131
21140
|
defaultConfigProfile: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
|
|
21132
21141
|
provider: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
|
|
21133
21142
|
allowAmbientCredential: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -21183,6 +21192,7 @@ declare const ConfigIdentitySetOutputSchema: z.ZodObject<{
|
|
|
21183
21192
|
name: z.ZodString;
|
|
21184
21193
|
value: z.ZodObject<{
|
|
21185
21194
|
name: z.ZodString;
|
|
21195
|
+
label: z.ZodOptional<z.ZodString>;
|
|
21186
21196
|
defaultConfigProfile: z.ZodOptional<z.ZodString>;
|
|
21187
21197
|
provider: z.ZodOptional<z.ZodString>;
|
|
21188
21198
|
allowAmbientCredential: z.ZodBoolean;
|
|
@@ -26336,6 +26346,8 @@ interface PoolMember {
|
|
|
26336
26346
|
readonly records: readonly UsageRecord[];
|
|
26337
26347
|
/** Present when this member stands for a nested `pool:<name>` entry rather than a direct identity. */
|
|
26338
26348
|
readonly nested?: NestedContribution;
|
|
26349
|
+
/** The member that represents this member's login in the ranking, when both hold the same login and so draw on one quota window. This member is then ineligible as a candidate of its own, since ranking it beside its representative would count one window twice and could fail over to a login that is limited too. */
|
|
26350
|
+
readonly sameLoginAs?: string;
|
|
26339
26351
|
/** The member entry's policy condition, from the object form of a pool member: definite false skips the member as ineligible by policy, indeterminate demotes it to last within its class, naming the missing fact either way. */
|
|
26340
26352
|
readonly policy?: WhenCondition;
|
|
26341
26353
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-shim",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.81.0",
|
|
4
4
|
"description": "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Joseph Mearman <joseph@mearman.co.uk>",
|