@memberjunction/cli 6.3.0-edge.1 → 6.3.0-edge.3
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 +1052 -359
- package/dist/baseline/connection.d.ts.map +1 -1
- package/dist/baseline/connection.js +12 -1
- package/dist/baseline/connection.js.map +1 -1
- package/dist/commands/agent/init.d.ts +3 -0
- package/dist/commands/agent/init.d.ts.map +1 -1
- package/dist/commands/agent/init.js +102 -46
- package/dist/commands/agent/init.js.map +1 -1
- package/dist/commands/agent/usage.d.ts +7 -0
- package/dist/commands/agent/usage.d.ts.map +1 -0
- package/dist/commands/agent/usage.js +10 -0
- package/dist/commands/agent/usage.js.map +1 -0
- package/dist/commands/ai/actions/list.d.ts.map +1 -1
- package/dist/commands/ai/actions/list.js +18 -14
- package/dist/commands/ai/actions/list.js.map +1 -1
- package/dist/commands/ai/actions/run.d.ts.map +1 -1
- package/dist/commands/ai/actions/run.js +15 -8
- package/dist/commands/ai/actions/run.js.map +1 -1
- package/dist/commands/ai/agents/list.d.ts.map +1 -1
- package/dist/commands/ai/agents/list.js +18 -14
- package/dist/commands/ai/agents/list.js.map +1 -1
- package/dist/commands/ai/agents/run.d.ts.map +1 -1
- package/dist/commands/ai/agents/run.js +19 -8
- package/dist/commands/ai/agents/run.js.map +1 -1
- package/dist/commands/ai/audit/agent-run.d.ts.map +1 -1
- package/dist/commands/ai/audit/agent-run.js +62 -56
- package/dist/commands/ai/audit/agent-run.js.map +1 -1
- package/dist/commands/ai/prompts/list.d.ts.map +1 -1
- package/dist/commands/ai/prompts/list.js +6 -3
- package/dist/commands/ai/prompts/list.js.map +1 -1
- package/dist/commands/ai/prompts/run.d.ts.map +1 -1
- package/dist/commands/ai/prompts/run.js +17 -10
- package/dist/commands/ai/prompts/run.js.map +1 -1
- package/dist/commands/app/install.d.ts +4 -0
- package/dist/commands/app/install.d.ts.map +1 -1
- package/dist/commands/app/install.js +36 -1
- package/dist/commands/app/install.js.map +1 -1
- package/dist/commands/app/upgrade.d.ts +1 -0
- package/dist/commands/app/upgrade.d.ts.map +1 -1
- package/dist/commands/app/upgrade.js +9 -0
- package/dist/commands/app/upgrade.js.map +1 -1
- package/dist/commands/codegen/manifest.d.ts +40 -0
- package/dist/commands/codegen/manifest.d.ts.map +1 -1
- package/dist/commands/codegen/manifest.js +124 -3
- package/dist/commands/codegen/manifest.js.map +1 -1
- package/dist/commands/diag/usage.d.ts +7 -0
- package/dist/commands/diag/usage.d.ts.map +1 -0
- package/dist/commands/diag/usage.js +10 -0
- package/dist/commands/diag/usage.js.map +1 -0
- package/dist/commands/doctor/index.d.ts +6 -0
- package/dist/commands/doctor/index.d.ts.map +1 -1
- package/dist/commands/doctor/index.js +42 -0
- package/dist/commands/doctor/index.js.map +1 -1
- package/dist/commands/explorer/postbuild.d.ts +14 -0
- package/dist/commands/explorer/postbuild.d.ts.map +1 -0
- package/dist/commands/explorer/postbuild.js +49 -0
- package/dist/commands/explorer/postbuild.js.map +1 -0
- package/dist/commands/explorer/usage.d.ts +7 -0
- package/dist/commands/explorer/usage.d.ts.map +1 -0
- package/dist/commands/explorer/usage.js +10 -0
- package/dist/commands/explorer/usage.js.map +1 -0
- package/dist/commands/harness/account/add.d.ts +22 -0
- package/dist/commands/harness/account/add.d.ts.map +1 -0
- package/dist/commands/harness/account/add.js +100 -0
- package/dist/commands/harness/account/add.js.map +1 -0
- package/dist/commands/harness/account/clear-cooldown.d.ts +13 -0
- package/dist/commands/harness/account/clear-cooldown.d.ts.map +1 -0
- package/dist/commands/harness/account/clear-cooldown.js +32 -0
- package/dist/commands/harness/account/clear-cooldown.js.map +1 -0
- package/dist/commands/harness/account/disable.d.ts +13 -0
- package/dist/commands/harness/account/disable.d.ts.map +1 -0
- package/dist/commands/harness/account/disable.js +34 -0
- package/dist/commands/harness/account/disable.js.map +1 -0
- package/dist/commands/harness/account/enable.d.ts +13 -0
- package/dist/commands/harness/account/enable.d.ts.map +1 -0
- package/dist/commands/harness/account/enable.js +34 -0
- package/dist/commands/harness/account/enable.js.map +1 -0
- package/dist/commands/harness/account/index.d.ts +7 -0
- package/dist/commands/harness/account/index.d.ts.map +1 -0
- package/dist/commands/harness/account/index.js +23 -0
- package/dist/commands/harness/account/index.js.map +1 -0
- package/dist/commands/harness/account/list.d.ts +15 -0
- package/dist/commands/harness/account/list.d.ts.map +1 -0
- package/dist/commands/harness/account/list.js +58 -0
- package/dist/commands/harness/account/list.js.map +1 -0
- package/dist/commands/harness/account/login.d.ts +16 -0
- package/dist/commands/harness/account/login.d.ts.map +1 -0
- package/dist/commands/harness/account/login.js +50 -0
- package/dist/commands/harness/account/login.js.map +1 -0
- package/dist/commands/harness/account/remove.d.ts +14 -0
- package/dist/commands/harness/account/remove.d.ts.map +1 -0
- package/dist/commands/harness/account/remove.js +43 -0
- package/dist/commands/harness/account/remove.js.map +1 -0
- package/dist/commands/harness/account/set-strategy.d.ts +13 -0
- package/dist/commands/harness/account/set-strategy.d.ts.map +1 -0
- package/dist/commands/harness/account/set-strategy.js +38 -0
- package/dist/commands/harness/account/set-strategy.js.map +1 -0
- package/dist/commands/harness/index.d.ts +7 -0
- package/dist/commands/harness/index.d.ts.map +1 -0
- package/dist/commands/harness/index.js +22 -0
- package/dist/commands/harness/index.js.map +1 -0
- package/dist/commands/harness/usage.d.ts +7 -0
- package/dist/commands/harness/usage.d.ts.map +1 -0
- package/dist/commands/harness/usage.js +10 -0
- package/dist/commands/harness/usage.js.map +1 -0
- package/dist/commands/migrate/convert.d.ts +25 -1
- package/dist/commands/migrate/convert.d.ts.map +1 -1
- package/dist/commands/migrate/convert.js +156 -38
- package/dist/commands/migrate/convert.js.map +1 -1
- package/dist/commands/migrate/index.d.ts +8 -0
- package/dist/commands/migrate/index.d.ts.map +1 -1
- package/dist/commands/migrate/index.js +40 -1
- package/dist/commands/migrate/index.js.map +1 -1
- package/dist/commands/migrate/rebake.d.ts +13 -0
- package/dist/commands/migrate/rebake.d.ts.map +1 -1
- package/dist/commands/migrate/rebake.js +45 -6
- package/dist/commands/migrate/rebake.js.map +1 -1
- package/dist/commands/queue/export-topology.d.ts +2 -0
- package/dist/commands/queue/export-topology.d.ts.map +1 -1
- package/dist/commands/queue/export-topology.js +3 -1
- package/dist/commands/queue/export-topology.js.map +1 -1
- package/dist/commands/queue/import-bindings.d.ts +2 -0
- package/dist/commands/queue/import-bindings.d.ts.map +1 -1
- package/dist/commands/queue/import-bindings.js +3 -1
- package/dist/commands/queue/import-bindings.js.map +1 -1
- package/dist/commands/queue/index.js +1 -1
- package/dist/commands/queue/index.js.map +1 -1
- package/dist/commands/queue/sweep.d.ts +4 -6
- package/dist/commands/queue/sweep.d.ts.map +1 -1
- package/dist/commands/queue/sweep.js +15 -23
- package/dist/commands/queue/sweep.js.map +1 -1
- package/dist/commands/queue/validate-bindings.d.ts +2 -0
- package/dist/commands/queue/validate-bindings.d.ts.map +1 -1
- package/dist/commands/queue/validate-bindings.js +3 -1
- package/dist/commands/queue/validate-bindings.js.map +1 -1
- package/dist/commands/queue/work.d.ts +2 -19
- package/dist/commands/queue/work.d.ts.map +1 -1
- package/dist/commands/queue/work.js +9 -29
- package/dist/commands/queue/work.js.map +1 -1
- package/dist/commands/rubric/usage.d.ts +7 -0
- package/dist/commands/rubric/usage.d.ts.map +1 -0
- package/dist/commands/rubric/usage.js +10 -0
- package/dist/commands/rubric/usage.js.map +1 -0
- package/dist/commands/test/regression/index.d.ts.map +1 -1
- package/dist/commands/test/regression/index.js +2 -0
- package/dist/commands/test/regression/index.js.map +1 -1
- package/dist/commands/test/regression/new.d.ts +21 -0
- package/dist/commands/test/regression/new.d.ts.map +1 -0
- package/dist/commands/test/regression/new.js +82 -0
- package/dist/commands/test/regression/new.js.map +1 -0
- package/dist/commands/test/regression/up.d.ts +1 -0
- package/dist/commands/test/regression/up.d.ts.map +1 -1
- package/dist/commands/test/regression/up.js +17 -0
- package/dist/commands/test/regression/up.js.map +1 -1
- package/dist/commands/test/scripts.d.ts +6 -4
- package/dist/commands/test/scripts.d.ts.map +1 -1
- package/dist/commands/test/scripts.js +14 -0
- package/dist/commands/test/scripts.js.map +1 -1
- package/dist/commands/test/suite.d.ts +1 -0
- package/dist/commands/test/suite.d.ts.map +1 -1
- package/dist/commands/test/suite.js +6 -0
- package/dist/commands/test/suite.js.map +1 -1
- package/dist/commands/usage.js +2 -1
- package/dist/commands/usage.js.map +1 -1
- package/dist/commands/user/usage.d.ts +7 -0
- package/dist/commands/user/usage.d.ts.map +1 -0
- package/dist/commands/user/usage.js +10 -0
- package/dist/commands/user/usage.js.map +1 -0
- package/dist/config.d.ts +117 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +44 -0
- package/dist/config.js.map +1 -1
- package/dist/init-templates/citizen-builder/.agents/skills/package-agent/SKILL.md +12 -2
- package/dist/init-templates/citizen-builder/.agents/skills/test-agent/SKILL.md +1 -1
- package/dist/init-templates/citizen-builder/.claude/skills/package-agent/SKILL.md +12 -2
- package/dist/init-templates/citizen-builder/.claude/skills/test-agent/SKILL.md +1 -1
- package/dist/init-templates/citizen-builder/.env.example +14 -2
- package/dist/init-templates/citizen-builder/AGENTS.md +5 -2
- package/dist/init-templates/citizen-builder/CAPABILITIES.md +9 -0
- package/dist/init-templates/citizen-builder/README.md +29 -15
- package/dist/init-templates/citizen-builder/docker-compose.yml +13 -0
- package/dist/init-templates/citizen-builder/docs/PROMOTION_GUIDE.md +5 -2
- package/dist/init-templates/citizen-builder/scripts/docker-entrypoint.sh +290 -33
- package/dist/init-templates/citizen-builder/scripts/generate-capabilities.sh +148 -41
- package/dist/lib/db-preflight.d.ts.map +1 -1
- package/dist/lib/db-preflight.js +22 -0
- package/dist/lib/db-preflight.js.map +1 -1
- package/dist/lib/derived-usage.d.ts +8 -0
- package/dist/lib/derived-usage.d.ts.map +1 -1
- package/dist/lib/derived-usage.js +30 -20
- package/dist/lib/derived-usage.js.map +1 -1
- package/dist/lib/domain-profiles.d.ts.map +1 -1
- package/dist/lib/domain-profiles.js +24 -0
- package/dist/lib/domain-profiles.js.map +1 -1
- package/dist/lib/domain-usage-command.js +2 -1
- package/dist/lib/domain-usage-command.js.map +1 -1
- package/dist/lib/explorer-postbuild/public-page-html.d.ts +48 -0
- package/dist/lib/explorer-postbuild/public-page-html.d.ts.map +1 -0
- package/dist/lib/explorer-postbuild/public-page-html.js +284 -0
- package/dist/lib/explorer-postbuild/public-page-html.js.map +1 -0
- package/dist/lib/explorer-postbuild/service-worker-check.d.ts +13 -0
- package/dist/lib/explorer-postbuild/service-worker-check.d.ts.map +1 -0
- package/dist/lib/explorer-postbuild/service-worker-check.js +41 -0
- package/dist/lib/explorer-postbuild/service-worker-check.js.map +1 -0
- package/dist/lib/harness-account.d.ts +34 -0
- package/dist/lib/harness-account.d.ts.map +1 -0
- package/dist/lib/harness-account.js +105 -0
- package/dist/lib/harness-account.js.map +1 -0
- package/dist/lib/pg-preflight/checks.d.ts +28 -0
- package/dist/lib/pg-preflight/checks.d.ts.map +1 -0
- package/dist/lib/pg-preflight/checks.js +94 -0
- package/dist/lib/pg-preflight/checks.js.map +1 -0
- package/dist/lib/pg-preflight/extension-check.d.ts +28 -0
- package/dist/lib/pg-preflight/extension-check.d.ts.map +1 -0
- package/dist/lib/pg-preflight/extension-check.js +86 -0
- package/dist/lib/pg-preflight/extension-check.js.map +1 -0
- package/dist/lib/pg-preflight/extension-scan.d.ts +24 -0
- package/dist/lib/pg-preflight/extension-scan.d.ts.map +1 -0
- package/dist/lib/pg-preflight/extension-scan.js +58 -0
- package/dist/lib/pg-preflight/extension-scan.js.map +1 -0
- package/dist/lib/pg-preflight/pending-migrations.d.ts +28 -0
- package/dist/lib/pg-preflight/pending-migrations.d.ts.map +1 -0
- package/dist/lib/pg-preflight/pending-migrations.js +48 -0
- package/dist/lib/pg-preflight/pending-migrations.js.map +1 -0
- package/dist/lib/pg-preflight/preflight.d.ts +18 -0
- package/dist/lib/pg-preflight/preflight.d.ts.map +1 -0
- package/dist/lib/pg-preflight/preflight.js +43 -0
- package/dist/lib/pg-preflight/preflight.js.map +1 -0
- package/dist/lib/pg-preflight/remediation.d.ts +27 -0
- package/dist/lib/pg-preflight/remediation.d.ts.map +1 -0
- package/dist/lib/pg-preflight/remediation.js +82 -0
- package/dist/lib/pg-preflight/remediation.js.map +1 -0
- package/dist/lib/pg-preflight/render.d.ts +15 -0
- package/dist/lib/pg-preflight/render.d.ts.map +1 -0
- package/dist/lib/pg-preflight/render.js +48 -0
- package/dist/lib/pg-preflight/render.js.map +1 -0
- package/dist/lib/pg-preflight/run-for-config.d.ts +23 -0
- package/dist/lib/pg-preflight/run-for-config.d.ts.map +1 -0
- package/dist/lib/pg-preflight/run-for-config.js +45 -0
- package/dist/lib/pg-preflight/run-for-config.js.map +1 -0
- package/dist/lib/pg-preflight/types.d.ts +67 -0
- package/dist/lib/pg-preflight/types.d.ts.map +1 -0
- package/dist/lib/pg-preflight/types.js +8 -0
- package/dist/lib/pg-preflight/types.js.map +1 -0
- package/dist/lib/regression/test-scaffold.d.ts +52 -0
- package/dist/lib/regression/test-scaffold.d.ts.map +1 -0
- package/dist/lib/regression/test-scaffold.js +237 -0
- package/dist/lib/regression/test-scaffold.js.map +1 -0
- package/dist/lib/work-queue/queue-format.d.ts +4 -0
- package/dist/lib/work-queue/queue-format.d.ts.map +1 -1
- package/dist/lib/work-queue/queue-format.js +15 -0
- package/dist/lib/work-queue/queue-format.js.map +1 -1
- package/dist/lib/work-queue/queue-worker.d.ts +16 -1
- package/dist/lib/work-queue/queue-worker.d.ts.map +1 -1
- package/dist/lib/work-queue/queue-worker.js +18 -0
- package/dist/lib/work-queue/queue-worker.js.map +1 -1
- package/dist/light-commands.d.ts.map +1 -1
- package/dist/light-commands.js +34 -0
- package/dist/light-commands.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/dependencies-from-head.d.ts +4 -0
- package/dist/utils/dependencies-from-head.d.ts.map +1 -0
- package/dist/utils/dependencies-from-head.js +5 -0
- package/dist/utils/dependencies-from-head.js.map +1 -0
- package/dist/utils/open-app-context.d.ts +1 -0
- package/dist/utils/open-app-context.d.ts.map +1 -1
- package/dist/utils/open-app-context.js +6 -1
- package/dist/utils/open-app-context.js.map +1 -1
- package/oclif.manifest.json +2026 -1091
- package/package.json +34 -31
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
+
import { HarnessAccountPoolService } from '@memberjunction/ai-agent-harness';
|
|
3
|
+
import { BuildInteractiveLoginEnv, BuildPoolOptionsFromFlag, FormatSlotIsolationInstructions, RequireHarnessVendor, RunInteractiveCliLogin, } from '../../../lib/harness-account.js';
|
|
4
|
+
export default class HarnessAccountAdd extends Command {
|
|
5
|
+
static { this.description = 'Enroll a new isolated CLI subscription account slot and optionally run its interactive login flow'; }
|
|
6
|
+
static { this.examples = [
|
|
7
|
+
'<%= config.bin %> <%= command.id %> claude --label "Pro #2" --weight 2 --priority 50',
|
|
8
|
+
'<%= config.bin %> <%= command.id %> agy --label "Team Seat"',
|
|
9
|
+
'<%= config.bin %> <%= command.id %> codex --label "Codex #2" --no-login',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> gemini --label "Gemini Alt"',
|
|
11
|
+
]; }
|
|
12
|
+
static { this.args = {
|
|
13
|
+
vendor: Args.string({
|
|
14
|
+
description: 'CLI vendor (claude, agy, codex, gemini; aliases: claude-code, antigravity, openai-codex, gemini-cli)',
|
|
15
|
+
required: true,
|
|
16
|
+
}),
|
|
17
|
+
}; }
|
|
18
|
+
static { this.flags = {
|
|
19
|
+
label: Flags.string({
|
|
20
|
+
char: 'l',
|
|
21
|
+
description: 'Human-friendly label for this account slot',
|
|
22
|
+
}),
|
|
23
|
+
'slot-id': Flags.string({
|
|
24
|
+
description: 'Optional explicit slot ID (auto-generated from vendor + label when omitted)',
|
|
25
|
+
}),
|
|
26
|
+
weight: Flags.integer({
|
|
27
|
+
char: 'w',
|
|
28
|
+
description: 'Relative balancing weight (>= 1, default 1)',
|
|
29
|
+
default: 1,
|
|
30
|
+
}),
|
|
31
|
+
priority: Flags.integer({
|
|
32
|
+
char: 'p',
|
|
33
|
+
description: 'Failover priority (lower number = higher priority, default 100)',
|
|
34
|
+
default: 100,
|
|
35
|
+
}),
|
|
36
|
+
'no-login': Flags.boolean({
|
|
37
|
+
description: 'Create the isolated slot directory and register it without launching interactive login',
|
|
38
|
+
default: false,
|
|
39
|
+
}),
|
|
40
|
+
'oauth-token': Flags.string({
|
|
41
|
+
description: 'Optional OAuth setup token value (e.g. CLAUDE_CODE_OAUTH_TOKEN) stored on the slot',
|
|
42
|
+
}),
|
|
43
|
+
'pool-dir': Flags.string({
|
|
44
|
+
description: 'Override account pool storage directory',
|
|
45
|
+
}),
|
|
46
|
+
}; }
|
|
47
|
+
/** Overridable runner hook for deterministic unit tests. */
|
|
48
|
+
static { this.LoginRunner = RunInteractiveCliLogin; }
|
|
49
|
+
async run() {
|
|
50
|
+
const { args, flags } = await this.parse(HarnessAccountAdd);
|
|
51
|
+
const poolOpts = BuildPoolOptionsFromFlag(flags['pool-dir']);
|
|
52
|
+
const service = HarnessAccountPoolService.Instance;
|
|
53
|
+
let vendor;
|
|
54
|
+
try {
|
|
55
|
+
vendor = RequireHarnessVendor(args.vendor);
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
this.error(err instanceof Error ? err.message : String(err), { exit: 1 });
|
|
59
|
+
}
|
|
60
|
+
if (flags.weight < 1) {
|
|
61
|
+
this.error('--weight must be an integer >= 1.', { exit: 1 });
|
|
62
|
+
}
|
|
63
|
+
let slot;
|
|
64
|
+
try {
|
|
65
|
+
slot = service.AddSlot({
|
|
66
|
+
vendor,
|
|
67
|
+
label: flags.label,
|
|
68
|
+
slotId: flags['slot-id'],
|
|
69
|
+
weight: flags.weight,
|
|
70
|
+
priority: flags.priority,
|
|
71
|
+
oauthTokenEnvValue: flags['oauth-token'],
|
|
72
|
+
}, poolOpts);
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
this.error(err instanceof Error ? err.message : String(err), { exit: 1 });
|
|
76
|
+
}
|
|
77
|
+
const envOverrides = service.BuildSlotEnvOverrides(slot, poolOpts, true);
|
|
78
|
+
for (const line of FormatSlotIsolationInstructions(vendor, slot.slotId, slot.slotDir, envOverrides)) {
|
|
79
|
+
this.log(line);
|
|
80
|
+
}
|
|
81
|
+
if (!flags['no-login']) {
|
|
82
|
+
const loginSpec = service.GetInteractiveLoginCommand(vendor);
|
|
83
|
+
this.log(`\nLaunching interactive login: ${loginSpec.displayCommand}\n`);
|
|
84
|
+
const loginEnv = BuildInteractiveLoginEnv(envOverrides);
|
|
85
|
+
const outcome = HarnessAccountAdd.LoginRunner(loginSpec, loginEnv);
|
|
86
|
+
if (outcome.Error) {
|
|
87
|
+
this.warn(`Could not launch '${loginSpec.command}': ${outcome.Error.message}. ` +
|
|
88
|
+
`Run \`mj harness account login ${slot.slotId}\` once the CLI is installed.`);
|
|
89
|
+
}
|
|
90
|
+
else if (outcome.Status !== 0) {
|
|
91
|
+
this.warn(`Interactive login command exited with status ${outcome.Status ?? 'unknown'}. ` +
|
|
92
|
+
`You can retry with \`mj harness account login ${slot.slotId}\`.`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const auth = service.ProbeSlotAuthStatus(slot, poolOpts);
|
|
96
|
+
this.log(`\nSlot '${slot.slotId}' saved in ${service.GetPoolFilePath(poolOpts)} ` +
|
|
97
|
+
`(auth: ${auth.statusLabel}${auth.indicatorPath ? `, indicator: ${auth.indicatorPath}` : ''}).`);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=add.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../../src/commands/harness/account/add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,yBAA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AAO,CAAC,eAAe,CAAC,QAAQ,CAAC,GAAG;YACpE,UAAU,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,gBAAgB,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CACtG,CAAC;IACN,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class HarnessAccountClearCooldown extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
slotId: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
'pool-dir': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=clear-cooldown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clear-cooldown.d.ts","sourceRoot":"","sources":["../../../../src/commands/harness/account/clear-cooldown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAS,MAAM,aAAa,CAAC;AAInD,MAAM,CAAC,OAAO,OAAO,2BAA4B,SAAQ,OAAO;IAC5D,MAAM,CAAC,WAAW,SAAwE;IAE1F,MAAM,CAAC,QAAQ,WAGb;IAEF,MAAM,CAAC,IAAI;;MAKT;IAEF,MAAM,CAAC,KAAK;;MAIV;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAWpC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
+
import { HarnessAccountPoolService } from '@memberjunction/ai-agent-harness';
|
|
3
|
+
import { BuildPoolOptionsFromFlag } from '../../../lib/harness-account.js';
|
|
4
|
+
export default class HarnessAccountClearCooldown extends Command {
|
|
5
|
+
static { this.description = 'Clear active quota/rate-limit cooldown state on a CLI account slot'; }
|
|
6
|
+
static { this.examples = [
|
|
7
|
+
'<%= config.bin %> <%= command.id %> claude-pro-2',
|
|
8
|
+
'<%= config.bin %> <%= command.id %> os-default-claude',
|
|
9
|
+
]; }
|
|
10
|
+
static { this.args = {
|
|
11
|
+
slotId: Args.string({
|
|
12
|
+
description: 'Slot ID whose cooldown should be cleared',
|
|
13
|
+
required: true,
|
|
14
|
+
}),
|
|
15
|
+
}; }
|
|
16
|
+
static { this.flags = {
|
|
17
|
+
'pool-dir': Flags.string({
|
|
18
|
+
description: 'Override account pool storage directory',
|
|
19
|
+
}),
|
|
20
|
+
}; }
|
|
21
|
+
async run() {
|
|
22
|
+
const { args, flags } = await this.parse(HarnessAccountClearCooldown);
|
|
23
|
+
const poolOpts = BuildPoolOptionsFromFlag(flags['pool-dir']);
|
|
24
|
+
const service = HarnessAccountPoolService.Instance;
|
|
25
|
+
const updated = service.ClearSlotCooldown(args.slotId, poolOpts);
|
|
26
|
+
if (!updated) {
|
|
27
|
+
this.error(`Account slot '${args.slotId}' not found.`, { exit: 1 });
|
|
28
|
+
}
|
|
29
|
+
this.log(`Cleared cooldown on slot '${updated.slotId}' (${updated.vendor}).`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=clear-cooldown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clear-cooldown.js","sourceRoot":"","sources":["../../../../src/commands/harness/account/clear-cooldown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,MAAM,CAAC,OAAO,OAAO,2BAA4B,SAAQ,OAAO;aACrD,gBAAW,GAAG,oEAAoE,CAAC;aAEnF,aAAQ,GAAG;QACd,kDAAkD;QAClD,uDAAuD;KAC1D,CAAC;aAEK,SAAI,GAAG;QACV,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;YAChB,WAAW,EAAE,0CAA0C;YACvD,QAAQ,EAAE,IAAI;SACjB,CAAC;KACL,CAAC;aAEK,UAAK,GAAG;QACX,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC;YACrB,WAAW,EAAE,yCAAyC;SACzD,CAAC;KACL,CAAC;IAEK,KAAK,CAAC,GAAG;QACZ,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;QACtE,MAAM,QAAQ,GAAG,wBAAwB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;QAC7D,MAAM,OAAO,GAAG,yBAAyB,CAAC,QAAQ,CAAC;QAEnD,MAAM,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACjE,IAAI,CAAC,OAAO,EAAE,CAAC;YACX,IAAI,CAAC,KAAK,CAAC,iBAAiB,IAAI,CAAC,MAAM,cAAc,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;QACxE,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,6BAA6B,OAAO,CAAC,MAAM,MAAM,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC;IAClF,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class HarnessAccountDisable extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
slotId: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
'pool-dir': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=disable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disable.d.ts","sourceRoot":"","sources":["../../../../src/commands/harness/account/disable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAS,MAAM,aAAa,CAAC;AAInD,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,OAAO;IACtD,MAAM,CAAC,WAAW,SAA8E;IAEhG,MAAM,CAAC,QAAQ,WAGb;IAEF,MAAM,CAAC,IAAI;;MAKT;IAEF,MAAM,CAAC,KAAK;;MAIV;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAYpC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
+
import { HarnessAccountPoolService } from '@memberjunction/ai-agent-harness';
|
|
3
|
+
import { BuildPoolOptionsFromFlag } from '../../../lib/harness-account.js';
|
|
4
|
+
export default class HarnessAccountDisable extends Command {
|
|
5
|
+
static { this.description = 'Disable a CLI subscription account slot without deleting its credentials'; }
|
|
6
|
+
static { this.examples = [
|
|
7
|
+
'<%= config.bin %> <%= command.id %> claude-pro-2',
|
|
8
|
+
'<%= config.bin %> <%= command.id %> os-default-claude',
|
|
9
|
+
]; }
|
|
10
|
+
static { this.args = {
|
|
11
|
+
slotId: Args.string({
|
|
12
|
+
description: 'Slot ID to disable',
|
|
13
|
+
required: true,
|
|
14
|
+
}),
|
|
15
|
+
}; }
|
|
16
|
+
static { this.flags = {
|
|
17
|
+
'pool-dir': Flags.string({
|
|
18
|
+
description: 'Override account pool storage directory',
|
|
19
|
+
}),
|
|
20
|
+
}; }
|
|
21
|
+
async run() {
|
|
22
|
+
const { args, flags } = await this.parse(HarnessAccountDisable);
|
|
23
|
+
const poolOpts = BuildPoolOptionsFromFlag(flags['pool-dir']);
|
|
24
|
+
const service = HarnessAccountPoolService.Instance;
|
|
25
|
+
try {
|
|
26
|
+
const slot = service.SetSlotEnabled(args.slotId, false, poolOpts);
|
|
27
|
+
this.log(`Disabled slot '${slot.slotId}' (${slot.vendor}).`);
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
this.error(err instanceof Error ? err.message : String(err), { exit: 1 });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=disable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disable.js","sourceRoot":"","sources":["../../../../src/commands/harness/account/disable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,OAAO;aAC/C,gBAAW,GAAG,0EAA0E,CAAC;aAEzF,aAAQ,GAAG;QACd,kDAAkD;QAClD,uDAAuD;KAC1D,CAAC;aAEK,SAAI,GAAG;QACV,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;YAChB,WAAW,EAAE,oBAAoB;YACjC,QAAQ,EAAE,IAAI;SACjB,CAAC;KACL,CAAC;aAEK,UAAK,GAAG;QACX,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC;YACrB,WAAW,EAAE,yCAAyC;SACzD,CAAC;KACL,CAAC;IAEK,KAAK,CAAC,GAAG;QACZ,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;QAChE,MAAM,QAAQ,GAAG,wBAAwB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;QAC7D,MAAM,OAAO,GAAG,yBAAyB,CAAC,QAAQ,CAAC;QAEnD,IAAI,CAAC;YACD,MAAM,IAAI,GAAG,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;YAClE,IAAI,CAAC,GAAG,CAAC,kBAAkB,IAAI,CAAC,MAAM,MAAM,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;QACjE,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,IAAI,CAAC,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;QAC9E,CAAC;IACL,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class HarnessAccountEnable extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
slotId: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
'pool-dir': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=enable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enable.d.ts","sourceRoot":"","sources":["../../../../src/commands/harness/account/enable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAS,MAAM,aAAa,CAAC;AAInD,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,OAAO;IACrD,MAAM,CAAC,WAAW,SAAoE;IAEtF,MAAM,CAAC,QAAQ,WAGb;IAEF,MAAM,CAAC,IAAI;;MAKT;IAEF,MAAM,CAAC,KAAK;;MAIV;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAYpC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
+
import { HarnessAccountPoolService } from '@memberjunction/ai-agent-harness';
|
|
3
|
+
import { BuildPoolOptionsFromFlag } from '../../../lib/harness-account.js';
|
|
4
|
+
export default class HarnessAccountEnable extends Command {
|
|
5
|
+
static { this.description = 'Enable a CLI subscription account slot for automatic balancing'; }
|
|
6
|
+
static { this.examples = [
|
|
7
|
+
'<%= config.bin %> <%= command.id %> claude-pro-2',
|
|
8
|
+
'<%= config.bin %> <%= command.id %> os-default-claude',
|
|
9
|
+
]; }
|
|
10
|
+
static { this.args = {
|
|
11
|
+
slotId: Args.string({
|
|
12
|
+
description: 'Slot ID to enable',
|
|
13
|
+
required: true,
|
|
14
|
+
}),
|
|
15
|
+
}; }
|
|
16
|
+
static { this.flags = {
|
|
17
|
+
'pool-dir': Flags.string({
|
|
18
|
+
description: 'Override account pool storage directory',
|
|
19
|
+
}),
|
|
20
|
+
}; }
|
|
21
|
+
async run() {
|
|
22
|
+
const { args, flags } = await this.parse(HarnessAccountEnable);
|
|
23
|
+
const poolOpts = BuildPoolOptionsFromFlag(flags['pool-dir']);
|
|
24
|
+
const service = HarnessAccountPoolService.Instance;
|
|
25
|
+
try {
|
|
26
|
+
const slot = service.SetSlotEnabled(args.slotId, true, poolOpts);
|
|
27
|
+
this.log(`Enabled slot '${slot.slotId}' (${slot.vendor}).`);
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
this.error(err instanceof Error ? err.message : String(err), { exit: 1 });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=enable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enable.js","sourceRoot":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MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;QAC9E,CAAC;IACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/harness/account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,OAAO;IAC/C,MAAM,CAAC,WAAW,SAA6E;IAE/F,MAAM,CAAC,QAAQ,WAKb;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAYpC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class HarnessAccount extends Command {
|
|
3
|
+
static { this.description = 'Manage multi-account CLI subscription pool slots and balancing strategy'; }
|
|
4
|
+
static { this.examples = [
|
|
5
|
+
'<%= config.bin %> <%= command.id %> list',
|
|
6
|
+
'<%= config.bin %> <%= command.id %> add claude --label "Team Seat"',
|
|
7
|
+
'<%= config.bin %> <%= command.id %> login claude-team-seat',
|
|
8
|
+
'<%= config.bin %> <%= command.id %> set-strategy weighted',
|
|
9
|
+
]; }
|
|
10
|
+
async run() {
|
|
11
|
+
this.log('MemberJunction Harness Account Pool\n');
|
|
12
|
+
this.log(' mj harness account list - List enrolled and OS-default slots');
|
|
13
|
+
this.log(' mj harness account add <vendor> - Add a new isolated slot (claude, agy, codex, gemini)');
|
|
14
|
+
this.log(' mj harness account login <slotId> - Re-run interactive CLI login and clear cooldown');
|
|
15
|
+
this.log(' mj harness account remove <slotId> - Remove an enrolled slot (--purge-files to delete dir)');
|
|
16
|
+
this.log(' mj harness account set-strategy <strategy> - Set strategy (least-in-flight, round-robin, weighted, priority-failover)');
|
|
17
|
+
this.log(' mj harness account enable <slotId> - Enable a slot');
|
|
18
|
+
this.log(' mj harness account disable <slotId> - Disable a slot');
|
|
19
|
+
this.log(' mj harness account clear-cooldown <slotId> - Clear active quota cooldown on a slot');
|
|
20
|
+
this.log('\nRun "mj harness account COMMAND --help" for details.');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/harness/account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,OAAO;aACxC,gBAAW,GAAG,yEAAyE,CAAC;aAExF,aAAQ,GAAG;QACd,0CAA0C;QAC1C,oEAAoE;QACpE,4DAA4D;QAC5D,2DAA2D;KAC9D,CAAC;IAEK,KAAK,CAAC,GAAG;QACZ,IAAI,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC;QAClD,IAAI,CAAC,GAAG,CAAC,oFAAoF,CAAC,CAAC;QAC/F,IAAI,CAAC,GAAG,CAAC,sGAAsG,CAAC,CAAC;QACjH,IAAI,CAAC,GAAG,CAAC,iGAAiG,CAAC,CAAC;QAC5G,IAAI,CAAC,GAAG,CAAC,uGAAuG,CAAC,CAAC;QAClH,IAAI,CAAC,GAAG,CAAC,0HAA0H,CAAC,CAAC;QACrI,IAAI,CAAC,GAAG,CAAC,+DAA+D,CAAC,CAAC;QAC1E,IAAI,CAAC,GAAG,CAAC,gEAAgE,CAAC,CAAC;QAC3E,IAAI,CAAC,GAAG,CAAC,uFAAuF,CAAC,CAAC;QAClG,IAAI,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;IACvE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
import { type HarnessVendorBinaryProbe } from '@memberjunction/ai-agent-harness';
|
|
3
|
+
export default class HarnessAccountList extends Command {
|
|
4
|
+
/** Injectable binary health probe hook for hermetic unit tests. */
|
|
5
|
+
static BinaryProbe?: HarnessVendorBinaryProbe;
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
vendor: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
|
+
json: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
11
|
+
'pool-dir': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../src/commands/harness/account/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAC7C,OAAO,EAGH,KAAK,wBAAwB,EAChC,MAAM,kCAAkC,CAAC;AAQ1C,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,OAAO;IACnD,mEAAmE;IACnE,OAAc,WAAW,CAAC,EAAE,wBAAwB,CAAC;IAErD,MAAM,CAAC,WAAW,SAC+G;IAEjI,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,KAAK;;;;MAYV;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAsCpC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import { HarnessAccountPoolService, } from '@memberjunction/ai-agent-harness';
|
|
3
|
+
import { BuildPoolOptionsFromFlag, FormatHarnessAccountTable, RequireHarnessVendor, } from '../../../lib/harness-account.js';
|
|
4
|
+
export default class HarnessAccountList extends Command {
|
|
5
|
+
static { this.description = 'List enrolled and OS-default CLI subscription account slots, auth status, active leases, cooldowns, and balancing strategy'; }
|
|
6
|
+
static { this.examples = [
|
|
7
|
+
'<%= config.bin %> <%= command.id %>',
|
|
8
|
+
'<%= config.bin %> <%= command.id %> --vendor claude',
|
|
9
|
+
'<%= config.bin %> <%= command.id %> --json',
|
|
10
|
+
]; }
|
|
11
|
+
static { this.flags = {
|
|
12
|
+
vendor: Flags.string({
|
|
13
|
+
char: 'v',
|
|
14
|
+
description: 'Filter by vendor (claude, agy, codex, gemini)',
|
|
15
|
+
}),
|
|
16
|
+
json: Flags.boolean({
|
|
17
|
+
description: 'Print machine-readable JSON instead of a table',
|
|
18
|
+
default: false,
|
|
19
|
+
}),
|
|
20
|
+
'pool-dir': Flags.string({
|
|
21
|
+
description: 'Override account pool storage directory (default: MJ_HARNESS_ACCOUNT_POOL_DIR or ~/.mj/harness-accounts)',
|
|
22
|
+
}),
|
|
23
|
+
}; }
|
|
24
|
+
async run() {
|
|
25
|
+
const { flags } = await this.parse(HarnessAccountList);
|
|
26
|
+
const basePoolOpts = BuildPoolOptionsFromFlag(flags['pool-dir']);
|
|
27
|
+
const listOpts = {
|
|
28
|
+
...basePoolOpts,
|
|
29
|
+
VerifyBinaryExecutable: true,
|
|
30
|
+
...(HarnessAccountList.BinaryProbe ? { BinaryProbe: HarnessAccountList.BinaryProbe } : {}),
|
|
31
|
+
};
|
|
32
|
+
const service = HarnessAccountPoolService.Instance;
|
|
33
|
+
let vendorFilter;
|
|
34
|
+
if (flags.vendor) {
|
|
35
|
+
try {
|
|
36
|
+
vendorFilter = RequireHarnessVendor(flags.vendor);
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
this.error(err instanceof Error ? err.message : String(err), { exit: 1 });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const pool = service.LoadPool(basePoolOpts);
|
|
43
|
+
const slots = service.ListSlots({ vendor: vendorFilter }, listOpts);
|
|
44
|
+
const poolDir = service.GetPoolDir(basePoolOpts);
|
|
45
|
+
if (flags.json) {
|
|
46
|
+
const payload = {
|
|
47
|
+
PoolDir: poolDir,
|
|
48
|
+
Strategy: pool.strategy,
|
|
49
|
+
IncludeOsDefaultLogin: pool.includeOsDefaultLogin,
|
|
50
|
+
Slots: slots,
|
|
51
|
+
};
|
|
52
|
+
this.log(JSON.stringify(payload, null, 2));
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
this.log(FormatHarnessAccountTable(poolDir, pool.strategy, pool.includeOsDefaultLogin, slots));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/harness/account/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EACH,yBAAyB,GAG5B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACH,wBAAwB,EACxB,yBAAyB,EACzB,oBAAoB,GAEvB,MAAM,iCAAiC,CAAC;AAEzC,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,OAAO;aAI5C,gBAAW,GACd,4HAA4H,CAAC;aAE1H,aAAQ,GAAG;QACd,qCAAqC;QACrC,qDAAqD;QACrD,4CAA4C;KAC/C,CAAC;aAEK,UAAK,GAAG;QACX,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;YACjB,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,+CAA+C;SAC/D,CAAC;QACF,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC;YAChB,WAAW,EAAE,gDAAgD;YAC7D,OAAO,EAAE,KAAK;SACjB,CAAC;QACF,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC;YACrB,WAAW,EAAE,0GAA0G;SAC1H,CAAC;KACL,CAAC;IAEK,KAAK,CAAC,GAAG;QACZ,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;QACvD,MAAM,YAAY,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AAE,CAAC,CAAC,CAAC,CAAC;YAC3C,OAAO;QACX,CAAC;QAED,IAAI,CAAC,GAAG,CACJ,yBAAyB,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,qBAAqB,EAAE,KAAK,CAAC,CACvF,CAAC;IACN,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
import { type InteractiveLoginRunner } from '../../../lib/harness-account.js';
|
|
3
|
+
export default class HarnessAccountLogin extends Command {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static args: {
|
|
7
|
+
slotId: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
static flags: {
|
|
10
|
+
'pool-dir': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
11
|
+
};
|
|
12
|
+
/** Overridable runner hook for deterministic unit tests. */
|
|
13
|
+
static LoginRunner: InteractiveLoginRunner;
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=login.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../../src/commands/harness/account/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAS,MAAM,aAAa,CAAC;AAEnD,OAAO,EAKH,KAAK,sBAAsB,EAC9B,MAAM,iCAAiC,CAAC;AAEzC,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,OAAO;IACpD,MAAM,CAAC,WAAW,SACkF;IAEpG,MAAM,CAAC,QAAQ,WAGb;IAEF,MAAM,CAAC,IAAI;;MAKT;IAEF,MAAM,CAAC,KAAK;;MAIV;IAEF,4DAA4D;IAC5D,OAAc,WAAW,EAAE,sBAAsB,CAA0B;IAE9D,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAqCpC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
+
import { HarnessAccountPoolService } from '@memberjunction/ai-agent-harness';
|
|
3
|
+
import { BuildInteractiveLoginEnv, BuildPoolOptionsFromFlag, FormatSlotIsolationInstructions, RunInteractiveCliLogin, } from '../../../lib/harness-account.js';
|
|
4
|
+
export default class HarnessAccountLogin extends Command {
|
|
5
|
+
static { this.description = 'Re-run interactive CLI login for an existing account slot and clear any active quota cooldown'; }
|
|
6
|
+
static { this.examples = [
|
|
7
|
+
'<%= config.bin %> <%= command.id %> claude-pro-2',
|
|
8
|
+
'<%= config.bin %> <%= command.id %> os-default-agy',
|
|
9
|
+
]; }
|
|
10
|
+
static { this.args = {
|
|
11
|
+
slotId: Args.string({
|
|
12
|
+
description: 'Slot ID to authenticate (see `mj harness account list`)',
|
|
13
|
+
required: true,
|
|
14
|
+
}),
|
|
15
|
+
}; }
|
|
16
|
+
static { this.flags = {
|
|
17
|
+
'pool-dir': Flags.string({
|
|
18
|
+
description: 'Override account pool storage directory',
|
|
19
|
+
}),
|
|
20
|
+
}; }
|
|
21
|
+
/** Overridable runner hook for deterministic unit tests. */
|
|
22
|
+
static { this.LoginRunner = RunInteractiveCliLogin; }
|
|
23
|
+
async run() {
|
|
24
|
+
const { args, flags } = await this.parse(HarnessAccountLogin);
|
|
25
|
+
const poolOpts = BuildPoolOptionsFromFlag(flags['pool-dir']);
|
|
26
|
+
const service = HarnessAccountPoolService.Instance;
|
|
27
|
+
const slot = service.GetSlot(args.slotId, poolOpts);
|
|
28
|
+
if (!slot) {
|
|
29
|
+
this.error(`Account slot '${args.slotId}' not found. Run \`mj harness account list\` to inspect available slots.`, { exit: 1 });
|
|
30
|
+
}
|
|
31
|
+
const envOverrides = service.BuildSlotEnvOverrides(slot, poolOpts, true);
|
|
32
|
+
for (const line of FormatSlotIsolationInstructions(slot.vendor, slot.slotId, slot.slotDir, envOverrides)) {
|
|
33
|
+
this.log(line);
|
|
34
|
+
}
|
|
35
|
+
const loginSpec = service.GetInteractiveLoginCommand(slot.vendor);
|
|
36
|
+
this.log(`\nLaunching interactive login: ${loginSpec.displayCommand}\n`);
|
|
37
|
+
const loginEnv = BuildInteractiveLoginEnv(envOverrides);
|
|
38
|
+
const outcome = HarnessAccountLogin.LoginRunner(loginSpec, loginEnv);
|
|
39
|
+
if (outcome.Error) {
|
|
40
|
+
this.error(`Failed to launch '${loginSpec.command}': ${outcome.Error.message}`, { exit: 1 });
|
|
41
|
+
}
|
|
42
|
+
if (outcome.Status !== 0) {
|
|
43
|
+
this.error(`Interactive login exited with status ${outcome.Status ?? 'unknown'}.`, { exit: 1 });
|
|
44
|
+
}
|
|
45
|
+
service.ClearSlotCooldown(slot.slotId, poolOpts);
|
|
46
|
+
const auth = service.ProbeSlotAuthStatus(slot, poolOpts);
|
|
47
|
+
this.log(`Slot '${slot.slotId}' login completed (auth: ${auth.statusLabel}${auth.indicatorPath ? `, indicator: ${auth.indicatorPath}` : ''}); cooldown cleared.`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=login.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../../../src/commands/harness/account/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EACH,wBAAwB,EACxB,wBAAwB,EACxB,+BAA+B,EAC/B,sBAAsB,GAEzB,MAAM,iCAAiC,CAAC;AAEzC,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,OAAO;aAC7C,gBAAW,GACd,+FAA+F,CAAC;aAE7F,aAAQ,GAAG;QACd,kDAAkD;QAClD,oDAAoD;KACvD,CAAC;aAEK,SAAI,GAAG;QAC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M,QAAQ,GAAG,wBAAwB,CAAC,YAAY,CAAC,CAAC;QACxD,MAAM,OAAO,GAAG,mBAAmB,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QACrE,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,KAAK,CAAC,qBAAqB,SAAS,CAAC,OAAO,MAAM,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;QACjG,CAAC;QACD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,IAAI,CAAC,KAAK,CAAC,wCAAwC,OAAO,CAAC,MAAM,IAAI,SAAS,GAAG,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;QACpG,CAAC;QAED,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACjD,MAAM,IAAI,GAAG,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACzD,IAAI,CAAC,GAAG,CACJ,SAAS,IAAI,CAAC,MAAM,4BAA4B,IAAI,CAAC,WAAW,GAC5D,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,gBAAgB,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EAChE,sBAAsB,CACzB,CAAC;IACN,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class HarnessAccountRemove extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
slotId: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
'purge-files': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
10
|
+
'pool-dir': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=remove.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../../src/commands/harness/account/remove.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAS,MAAM,aAAa,CAAC;AAInD,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,OAAO;IACrD,MAAM,CAAC,WAAW,SAAoE;IAEtF,MAAM,CAAC,QAAQ,WAGb;IAEF,MAAM,CAAC,IAAI;;MAKT;IAEF,MAAM,CAAC,KAAK;;;MAQV;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAyBpC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
+
import { HarnessAccountPoolService } from '@memberjunction/ai-agent-harness';
|
|
3
|
+
import { BuildPoolOptionsFromFlag } from '../../../lib/harness-account.js';
|
|
4
|
+
export default class HarnessAccountRemove extends Command {
|
|
5
|
+
static { this.description = 'Remove an enrolled CLI subscription account slot from the pool'; }
|
|
6
|
+
static { this.examples = [
|
|
7
|
+
'<%= config.bin %> <%= command.id %> claude-pro-2',
|
|
8
|
+
'<%= config.bin %> <%= command.id %> claude-pro-2 --purge-files',
|
|
9
|
+
]; }
|
|
10
|
+
static { this.args = {
|
|
11
|
+
slotId: Args.string({
|
|
12
|
+
description: 'Enrolled slot ID to remove',
|
|
13
|
+
required: true,
|
|
14
|
+
}),
|
|
15
|
+
}; }
|
|
16
|
+
static { this.flags = {
|
|
17
|
+
'purge-files': Flags.boolean({
|
|
18
|
+
description: 'Also delete the isolated slot directory under the pool root',
|
|
19
|
+
default: false,
|
|
20
|
+
}),
|
|
21
|
+
'pool-dir': Flags.string({
|
|
22
|
+
description: 'Override account pool storage directory',
|
|
23
|
+
}),
|
|
24
|
+
}; }
|
|
25
|
+
async run() {
|
|
26
|
+
const { args, flags } = await this.parse(HarnessAccountRemove);
|
|
27
|
+
const poolOpts = BuildPoolOptionsFromFlag(flags['pool-dir']);
|
|
28
|
+
const service = HarnessAccountPoolService.Instance;
|
|
29
|
+
let removed;
|
|
30
|
+
try {
|
|
31
|
+
removed = service.RemoveSlot(args.slotId, { purgeFiles: flags['purge-files'] }, poolOpts);
|
|
32
|
+
}
|
|
33
|
+
catch (err) {
|
|
34
|
+
this.error(err instanceof Error ? err.message : String(err), { exit: 1 });
|
|
35
|
+
}
|
|
36
|
+
if (!removed) {
|
|
37
|
+
this.error(`Account slot '${args.slotId}' not found.`, { exit: 1 });
|
|
38
|
+
}
|
|
39
|
+
this.log(`Removed slot '${args.slotId}' from ${service.GetPoolFilePath(poolOpts)}` +
|
|
40
|
+
(flags['purge-files'] ? ' and purged its isolated slot directory.' : '.'));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=remove.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove.js","sourceRoot":"","sources":["../../../../src/commands/harness/account/remove.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,OAAO;aAC9C,gBAAW,GAAG,gEAAgE,CAAC;aAE/E,aAAQ,GAAG;QACd,kDAAkD;QAClD,gEAAgE;KACnE,CAAC;aAEK,SAAI,GAAG;QACV,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;YAChB,WAAW,EAAE,4BAA4B;YACzC,QAAQ,EAAE,IAAI;SACjB,CAAC;KACL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C,CAChF,CAAC;IACN,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class HarnessAccountSetStrategy extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
strategy: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
'pool-dir': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=set-strategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-strategy.d.ts","sourceRoot":"","sources":["../../../../src/commands/harness/account/set-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAS,MAAM,aAAa,CAAC;AAOnD,MAAM,CAAC,OAAO,OAAO,yBAA0B,SAAQ,OAAO;IAC1D,MAAM,CAAC,WAAW,SAA+D;IAEjF,MAAM,CAAC,QAAQ,WAKb;IAEF,MAAM,CAAC,IAAI;;MAKT;IAEF,MAAM,CAAC,KAAK;;MAIV;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAepC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
+
import { HARNESS_ACCOUNT_SELECTION_STRATEGIES, HarnessAccountPoolService, } from '@memberjunction/ai-agent-harness';
|
|
3
|
+
import { BuildPoolOptionsFromFlag, RequireHarnessStrategy } from '../../../lib/harness-account.js';
|
|
4
|
+
export default class HarnessAccountSetStrategy extends Command {
|
|
5
|
+
static { this.description = 'Set the default multi-account CLI pool balancing strategy'; }
|
|
6
|
+
static { this.examples = [
|
|
7
|
+
'<%= config.bin %> <%= command.id %> least-in-flight',
|
|
8
|
+
'<%= config.bin %> <%= command.id %> round-robin',
|
|
9
|
+
'<%= config.bin %> <%= command.id %> weighted',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> priority-failover',
|
|
11
|
+
]; }
|
|
12
|
+
static { this.args = {
|
|
13
|
+
strategy: Args.string({
|
|
14
|
+
description: `Selection strategy (${HARNESS_ACCOUNT_SELECTION_STRATEGIES.join(', ')})`,
|
|
15
|
+
required: true,
|
|
16
|
+
}),
|
|
17
|
+
}; }
|
|
18
|
+
static { this.flags = {
|
|
19
|
+
'pool-dir': Flags.string({
|
|
20
|
+
description: 'Override account pool storage directory',
|
|
21
|
+
}),
|
|
22
|
+
}; }
|
|
23
|
+
async run() {
|
|
24
|
+
const { args, flags } = await this.parse(HarnessAccountSetStrategy);
|
|
25
|
+
const poolOpts = BuildPoolOptionsFromFlag(flags['pool-dir']);
|
|
26
|
+
let strategy;
|
|
27
|
+
try {
|
|
28
|
+
strategy = RequireHarnessStrategy(args.strategy);
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
this.error(err instanceof Error ? err.message : String(err), { exit: 1 });
|
|
32
|
+
}
|
|
33
|
+
const service = HarnessAccountPoolService.Instance;
|
|
34
|
+
service.SetStrategy(strategy, poolOpts);
|
|
35
|
+
this.log(`Harness account pool default strategy set to '${strategy}'.`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=set-strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-strategy.js","sourceRoot":"","sources":["../../../../src/commands/harness/account/set-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EACH,oCAAoC,EACpC,yBAAyB,GAC5B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAE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