claude-use 6.1.0 → 6.2.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 +14 -2
- package/dist/cli.cjs +5163 -4561
- package/dist/index.cjs +12 -3
- package/dist/index.mjs +12 -3
- package/dist/types/config/schema.d.ts +12 -0
- package/dist/types/paths.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -215,10 +215,18 @@ var ConfigProfileSchema = import_zod.z.strictObject({
|
|
|
215
215
|
entries: EntriesSchema.optional(),
|
|
216
216
|
launch: LaunchSchema.optional()
|
|
217
217
|
});
|
|
218
|
+
var POOL_SELECTOR_PREFIX = "pool:";
|
|
219
|
+
var POOL_NAME_PATTERN = "[A-Za-z0-9][A-Za-z0-9._-]*";
|
|
220
|
+
var IDENTITY_NAME_PATTERN = "[A-Za-z0-9][A-Za-z0-9._@-]*";
|
|
221
|
+
var PoolNameSchema = import_zod.z.string().min(1).regex(new RegExp(`^${POOL_NAME_PATTERN}$`));
|
|
222
|
+
var IdentitySelectorSchema = import_zod.z.string().min(1).regex(new RegExp(`^(${POOL_SELECTOR_PREFIX}${POOL_NAME_PATTERN}|${IDENTITY_NAME_PATTERN})$`));
|
|
223
|
+
var PoolSchema = import_zod.z.strictObject({
|
|
224
|
+
identities: import_zod.z.array(import_zod.z.string().min(1).regex(new RegExp(`^${IDENTITY_NAME_PATTERN}$`))).min(1).refine((names) => new Set(names).size === names.length, { message: "pool members must be unique" })
|
|
225
|
+
});
|
|
218
226
|
var DirectoryRuleSchema = ConfigProfileSchema.omit({ description: true }).extend({
|
|
219
227
|
path: import_zod.z.string().min(1),
|
|
220
228
|
configProfile: import_zod.z.string().min(1).optional(),
|
|
221
|
-
identity:
|
|
229
|
+
identity: IdentitySelectorSchema.optional(),
|
|
222
230
|
when: WhenSchema.optional()
|
|
223
231
|
});
|
|
224
232
|
var DirectoryRulesSchema = import_zod.z.strictObject({
|
|
@@ -227,7 +235,7 @@ var DirectoryRulesSchema = import_zod.z.strictObject({
|
|
|
227
235
|
});
|
|
228
236
|
var PortableConfigSchema = ConfigProfileSchema.omit({ description: true }).extend({
|
|
229
237
|
configProfile: import_zod.z.string().min(1).optional(),
|
|
230
|
-
identity:
|
|
238
|
+
identity: IdentitySelectorSchema.optional(),
|
|
231
239
|
when: WhenSchema.optional()
|
|
232
240
|
});
|
|
233
241
|
var HEADROOM_MODES = ["cache", "token"];
|
|
@@ -275,7 +283,8 @@ var GlobalConfigSchema = import_zod.z.strictObject({
|
|
|
275
283
|
entries: EntriesSchema.optional(),
|
|
276
284
|
launch: LaunchSchema.optional(),
|
|
277
285
|
headroom: HeadroomGlobalConfigSchema.optional(),
|
|
278
|
-
frontdoor: FrontDoorGlobalConfigSchema.optional()
|
|
286
|
+
frontdoor: FrontDoorGlobalConfigSchema.optional(),
|
|
287
|
+
pools: import_zod.z.record(PoolNameSchema, PoolSchema).optional()
|
|
279
288
|
});
|
|
280
289
|
var IdentitySchema = import_zod.z.strictObject({
|
|
281
290
|
$schema: import_zod.z.string().optional(),
|
package/dist/index.mjs
CHANGED
|
@@ -141,10 +141,18 @@ var ConfigProfileSchema = z.strictObject({
|
|
|
141
141
|
entries: EntriesSchema.optional(),
|
|
142
142
|
launch: LaunchSchema.optional()
|
|
143
143
|
});
|
|
144
|
+
var POOL_SELECTOR_PREFIX = "pool:";
|
|
145
|
+
var POOL_NAME_PATTERN = "[A-Za-z0-9][A-Za-z0-9._-]*";
|
|
146
|
+
var IDENTITY_NAME_PATTERN = "[A-Za-z0-9][A-Za-z0-9._@-]*";
|
|
147
|
+
var PoolNameSchema = z.string().min(1).regex(new RegExp(`^${POOL_NAME_PATTERN}$`));
|
|
148
|
+
var IdentitySelectorSchema = z.string().min(1).regex(new RegExp(`^(${POOL_SELECTOR_PREFIX}${POOL_NAME_PATTERN}|${IDENTITY_NAME_PATTERN})$`));
|
|
149
|
+
var PoolSchema = z.strictObject({
|
|
150
|
+
identities: z.array(z.string().min(1).regex(new RegExp(`^${IDENTITY_NAME_PATTERN}$`))).min(1).refine((names) => new Set(names).size === names.length, { message: "pool members must be unique" })
|
|
151
|
+
});
|
|
144
152
|
var DirectoryRuleSchema = ConfigProfileSchema.omit({ description: true }).extend({
|
|
145
153
|
path: z.string().min(1),
|
|
146
154
|
configProfile: z.string().min(1).optional(),
|
|
147
|
-
identity:
|
|
155
|
+
identity: IdentitySelectorSchema.optional(),
|
|
148
156
|
when: WhenSchema.optional()
|
|
149
157
|
});
|
|
150
158
|
var DirectoryRulesSchema = z.strictObject({
|
|
@@ -153,7 +161,7 @@ var DirectoryRulesSchema = z.strictObject({
|
|
|
153
161
|
});
|
|
154
162
|
var PortableConfigSchema = ConfigProfileSchema.omit({ description: true }).extend({
|
|
155
163
|
configProfile: z.string().min(1).optional(),
|
|
156
|
-
identity:
|
|
164
|
+
identity: IdentitySelectorSchema.optional(),
|
|
157
165
|
when: WhenSchema.optional()
|
|
158
166
|
});
|
|
159
167
|
var HEADROOM_MODES = ["cache", "token"];
|
|
@@ -201,7 +209,8 @@ var GlobalConfigSchema = z.strictObject({
|
|
|
201
209
|
entries: EntriesSchema.optional(),
|
|
202
210
|
launch: LaunchSchema.optional(),
|
|
203
211
|
headroom: HeadroomGlobalConfigSchema.optional(),
|
|
204
|
-
frontdoor: FrontDoorGlobalConfigSchema.optional()
|
|
212
|
+
frontdoor: FrontDoorGlobalConfigSchema.optional(),
|
|
213
|
+
pools: z.record(PoolNameSchema, PoolSchema).optional()
|
|
205
214
|
});
|
|
206
215
|
var IdentitySchema = z.strictObject({
|
|
207
216
|
$schema: z.string().optional(),
|
|
@@ -422,6 +422,15 @@ export declare const ConfigProfileSchema: z.ZodObject<{
|
|
|
422
422
|
}, z.core.$strict>>;
|
|
423
423
|
}, z.core.$strict>;
|
|
424
424
|
export type ConfigProfile = z.infer<typeof ConfigProfileSchema>;
|
|
425
|
+
/** The prefix that turns a pool name into an identity selector. `:` is outside an identity name's character set, so a selector can never be mistaken for an identity. */
|
|
426
|
+
export declare const POOL_SELECTOR_PREFIX = "pool:";
|
|
427
|
+
/** A pool's own name: the identity alphabet minus `@`, since a pool is never an email address. */
|
|
428
|
+
export declare const PoolNameSchema: z.ZodString;
|
|
429
|
+
/** A named, explicit set of identities to choose among at launch. Never implicit: a pool lists its members, so an identity that bills a client is only ever picked when someone put it there. */
|
|
430
|
+
declare const PoolSchema: z.ZodObject<{
|
|
431
|
+
identities: z.ZodArray<z.ZodString>;
|
|
432
|
+
}, z.core.$strict>;
|
|
433
|
+
export type Pool = z.infer<typeof PoolSchema>;
|
|
425
434
|
/** One directory rule in `~/.claude-use/directory-rules.json`, scoped to an explicit absolute (or `~`-rooted) path. */
|
|
426
435
|
export declare const DirectoryRuleSchema: z.ZodObject<{
|
|
427
436
|
entries: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
@@ -657,6 +666,9 @@ export declare const GlobalConfigSchema: z.ZodObject<{
|
|
|
657
666
|
frontdoor: z.ZodOptional<z.ZodObject<{
|
|
658
667
|
idleShutdownMinutes: z.ZodOptional<z.ZodNumber>;
|
|
659
668
|
}, z.core.$strict>>;
|
|
669
|
+
pools: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
670
|
+
identities: z.ZodArray<z.ZodString>;
|
|
671
|
+
}, z.core.$strict>>>;
|
|
660
672
|
}, z.core.$strict>;
|
|
661
673
|
export type GlobalConfig = z.infer<typeof GlobalConfigSchema>;
|
|
662
674
|
/**
|
package/dist/types/paths.d.ts
CHANGED
|
@@ -58,6 +58,8 @@ export interface LayoutPaths {
|
|
|
58
58
|
readonly usageLogDir: string;
|
|
59
59
|
/** Directory of the latest-state snapshots, one `<identity>.json` per identity: the stable file other tools read. */
|
|
60
60
|
readonly usageSnapshotsDir: string;
|
|
61
|
+
/** The last identity picked from a pool for each directory, so a conversation stays on the account whose prompt cache is warm. */
|
|
62
|
+
readonly usagePicksFile: string;
|
|
61
63
|
}
|
|
62
64
|
/**
|
|
63
65
|
* Resolves the current CLAUDE_USE_HOME root: the environment variable when set to a non-empty string, otherwise `~/.claude-use`. An empty string counts as unset, consistent with how this project treats empty-string environment variables elsewhere (see the ambient-credential guard).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-use",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.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": "Apache-2.0",
|
|
6
6
|
"author": "Joseph Mearman <joseph@mearman.co.uk>",
|