@preplabsai/rovara-code 0.5.15 → 0.5.16
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/bin/agentx-cli.mjs +143 -13
- package/package.json +1 -1
package/bin/agentx-cli.mjs
CHANGED
|
@@ -25808,6 +25808,8 @@ var init_routes = __esm({
|
|
|
25808
25808
|
{ method: "POST", path: "/v1/dev/tasks/{taskId}/workflow/feedback-decision", requires: "decisions:decide" },
|
|
25809
25809
|
// T3: invite administration is full-access only; live company admin/owner membership is still required.
|
|
25810
25810
|
{ method: "POST", path: "/v1/dev/company/preapprovals", requires: "full" },
|
|
25811
|
+
// #1647: the company's invites (a live owner or admin), for `rovara company invites`.
|
|
25812
|
+
{ method: "GET", path: "/v1/dev/company/preapprovals", requires: "full" },
|
|
25811
25813
|
// INVITE-RESEND (DEC 254zzz184): the website-only resend remains behind full access and the route's live company role check.
|
|
25812
25814
|
{ method: "POST", path: "/v1/dev/company/preapprovals/{inviteId}/resend", requires: "full" },
|
|
25813
25815
|
{ method: "DELETE", path: "/v1/dev/company/preapprovals/{emailHash}", requires: "full" },
|
|
@@ -43285,7 +43287,7 @@ var init_intake = __esm({
|
|
|
43285
43287
|
/** A `tracker` names its system; `jira` and `github_issue` are fixed and may leave it out. */
|
|
43286
43288
|
system: IntakeSystemSchema.optional(),
|
|
43287
43289
|
connection: external_exports.string().regex(/^[A-Za-z0-9][A-Za-z0-9 ._-]{0,63}$/, "a connection is a name or id, never an address").optional(),
|
|
43288
|
-
when: external_exports.object({ label: LabelSchema2.optional(), assignedToRovara: external_exports.literal(true).optional() }).strict().refine((
|
|
43290
|
+
when: external_exports.object({ label: LabelSchema2.optional(), assignedToRovara: external_exports.literal(true).optional() }).strict().refine((when3) => when3.label !== void 0 || when3.assignedToRovara === true, "name the label, or assignment to Rovara, that asks for work"),
|
|
43289
43291
|
poll: IntakePollSettingsSchema.optional()
|
|
43290
43292
|
}).strict().superRefine((ref, context) => {
|
|
43291
43293
|
if (ref.channel === "tracker" && ref.system === void 0)
|
|
@@ -61939,7 +61941,10 @@ function newCompanyInviteCode() {
|
|
|
61939
61941
|
const codeHash = companyInviteCodeHash(code2);
|
|
61940
61942
|
return { code: code2, codeHash, codeId: companyInviteCodeId(codeHash) };
|
|
61941
61943
|
}
|
|
61942
|
-
|
|
61944
|
+
function companyInviteEmailHash(email4) {
|
|
61945
|
+
return createHash12("sha256").update(email4.trim().toLowerCase(), "utf8").digest("hex");
|
|
61946
|
+
}
|
|
61947
|
+
var COMPANY_INVITE_CODE_PREFIX, CODE_BYTES, CompanyInviteCodeHashSchema, CompanyInviteCodeIdSchema, CompanyInviteExpiryHoursSchema, companyInviteCodeId, CompanyInviteViewSchema, CompanyInviteListSchema, CompanySelfServeNameSchema, CompanySelfCreateBodySchema, CompanySelfCreateResponseSchema, COMPANY_INVITE_LINK_PREFIX, COMPANY_INVITE_LINK_MAX, CompanyPreapprovalCreatedSchema, COMPANY_PREAPPROVALS_PATH, CompanyInviteEmailHashSchema, CompanyPreapprovalViewSchema, CompanyPreapprovalListSchema;
|
|
61943
61948
|
var init_company_invites = __esm({
|
|
61944
61949
|
"packages/contracts/dist/company-invites.js"() {
|
|
61945
61950
|
"use strict";
|
|
@@ -61963,7 +61968,20 @@ var init_company_invites = __esm({
|
|
|
61963
61968
|
CompanySelfCreateBodySchema = external_exports.object({ name: CompanySelfServeNameSchema, inviteCode: external_exports.unknown().optional() }).strict();
|
|
61964
61969
|
CompanySelfCreateResponseSchema = external_exports.object({ companyId: external_exports.string(), companyName: external_exports.string().min(1).max(80), companyRole: external_exports.literal("owner") }).strict();
|
|
61965
61970
|
COMPANY_INVITE_LINK_PREFIX = "rvlink_";
|
|
61971
|
+
COMPANY_INVITE_LINK_MAX = 256;
|
|
61966
61972
|
CompanyPreapprovalCreatedSchema = external_exports.object({ ok: external_exports.literal(true), invite: external_exports.object({ secret: external_exports.string().startsWith(COMPANY_INVITE_LINK_PREFIX), expiresAt: external_exports.iso.datetime() }).strict() }).strict();
|
|
61973
|
+
COMPANY_PREAPPROVALS_PATH = "/v1/dev/company/preapprovals";
|
|
61974
|
+
CompanyInviteEmailHashSchema = external_exports.string().regex(/^[a-f0-9]{64}$/);
|
|
61975
|
+
CompanyPreapprovalViewSchema = external_exports.object({
|
|
61976
|
+
emailHash: CompanyInviteEmailHashSchema,
|
|
61977
|
+
role: external_exports.enum(["admin", "member"]),
|
|
61978
|
+
/** pending: the link still works; used: someone joined with it; withdrawn: an owner or admin ended it (or it was replaced); expired: its time ran out unused. */
|
|
61979
|
+
status: external_exports.enum(["pending", "used", "withdrawn", "expired"]),
|
|
61980
|
+
expiresAt: external_exports.iso.datetime(),
|
|
61981
|
+
createdAt: external_exports.iso.datetime(),
|
|
61982
|
+
usedAt: external_exports.iso.datetime().optional()
|
|
61983
|
+
}).strict();
|
|
61984
|
+
CompanyPreapprovalListSchema = external_exports.object({ invites: external_exports.array(CompanyPreapprovalViewSchema).max(100), more: external_exports.boolean() }).strict();
|
|
61967
61985
|
}
|
|
61968
61986
|
});
|
|
61969
61987
|
|
|
@@ -377081,6 +377099,17 @@ function chatGptDisconnectText(result4) {
|
|
|
377081
377099
|
|
|
377082
377100
|
// packages/cli/src/developer/login.ts
|
|
377083
377101
|
init_dist2();
|
|
377102
|
+
function loginInvite(companyId, secret) {
|
|
377103
|
+
if (companyId === void 0 && secret === void 0) return void 0;
|
|
377104
|
+
if (companyId === void 0 || secret === void 0) throw agentXError("CONFIG_INVALID", "an invite needs both --company and --invite; copy the whole command the person who invited you sent");
|
|
377105
|
+
if (!OrgIdSchema.safeParse(companyId).success) throw agentXError("CONFIG_INVALID", "--company is not a company ID (org_ and 20 letters or digits); copy the whole command the person who invited you sent");
|
|
377106
|
+
if (!secret.startsWith(COMPANY_INVITE_LINK_PREFIX) || secret.length > COMPANY_INVITE_LINK_MAX) throw agentXError("CONFIG_INVALID", `--invite is not an invite (it starts with ${COMPANY_INVITE_LINK_PREFIX}); copy the whole command the person who invited you sent`);
|
|
377107
|
+
return { companyId, secret };
|
|
377108
|
+
}
|
|
377109
|
+
var INVITE_REFUSED = "this invite did not work: it may have expired, been used already or been withdrawn. Ask the person who invited you for a new one";
|
|
377110
|
+
function inviteRefusal(error64) {
|
|
377111
|
+
return error64 instanceof AgentXError && error64.code === "AUTH_REQUIRED" && /: not invited$/u.test(error64.message) ? agentXError("AUTH_REQUIRED", `sign-in refused: ${INVITE_REFUSED}`) : error64;
|
|
377112
|
+
}
|
|
377084
377113
|
var LOOPBACK_HOSTS = /* @__PURE__ */ new Set(["127.0.0.1", "localhost", "[::1]"]);
|
|
377085
377114
|
async function readConfiguration(options, base3, url2) {
|
|
377086
377115
|
let configuration;
|
|
@@ -377129,7 +377158,8 @@ async function developerLogin(options) {
|
|
|
377129
377158
|
redirect_uri: listener.redirectUri,
|
|
377130
377159
|
state: pkce.state,
|
|
377131
377160
|
code_challenge: pkce.challenge,
|
|
377132
|
-
code_challenge_method: "S256"
|
|
377161
|
+
code_challenge_method: "S256",
|
|
377162
|
+
...options.invite === void 0 ? {} : { company: options.invite.companyId, invite: options.invite.secret }
|
|
377133
377163
|
})) authorize.searchParams.set(key2, value);
|
|
377134
377164
|
if (options.browser) {
|
|
377135
377165
|
options.write(`Opening your browser to sign in to AgentX environment ${configuration.env}. If it does not open, open this link: ${authorize.toString()}`);
|
|
@@ -377137,7 +377167,9 @@ async function developerLogin(options) {
|
|
|
377137
377167
|
} else {
|
|
377138
377168
|
options.write(`Open this link in a browser on this computer to sign in to AgentX environment ${configuration.env}: ${authorize.toString()}`);
|
|
377139
377169
|
}
|
|
377140
|
-
const code2 = await listener.code
|
|
377170
|
+
const code2 = await listener.code.catch((error64) => {
|
|
377171
|
+
throw options.invite === void 0 ? error64 : inviteRefusal(error64);
|
|
377172
|
+
});
|
|
377141
377173
|
let response;
|
|
377142
377174
|
try {
|
|
377143
377175
|
response = await options.fetch(configuration.tokenEndpoint, {
|
|
@@ -378737,6 +378769,98 @@ function registerSessionCommands(program2, context) {
|
|
|
378737
378769
|
|
|
378738
378770
|
// packages/cli/src/company/commands.ts
|
|
378739
378771
|
init_dist2();
|
|
378772
|
+
|
|
378773
|
+
// packages/cli/src/company/invites.ts
|
|
378774
|
+
init_dist2();
|
|
378775
|
+
init_zod();
|
|
378776
|
+
var DEFAULT_INVITE_HOURS = 168;
|
|
378777
|
+
var Email = external_exports.string().trim().min(3).max(320).email();
|
|
378778
|
+
var ADMIN_ONLY = "Only a company owner or admin can invite people or see the company's invites.";
|
|
378779
|
+
var UNEXPECTED2 = `AgentX answered with something unexpected; try again, or upgrade: npx ${CLI_PACKAGE_NAME}@latest whoami`;
|
|
378780
|
+
function inviteEmail(email4) {
|
|
378781
|
+
const parsed = Email.safeParse(email4);
|
|
378782
|
+
if (!parsed.success) throw agentXError("CONFIG_INVALID", "give the teammate's email address, for example dev@example.com");
|
|
378783
|
+
return parsed.data;
|
|
378784
|
+
}
|
|
378785
|
+
function inviteHours(value) {
|
|
378786
|
+
if (value === void 0) return DEFAULT_INVITE_HOURS;
|
|
378787
|
+
const hours = /^\d{1,3}$/u.test(value) ? Number(value) : Number.NaN;
|
|
378788
|
+
if (!Number.isInteger(hours) || hours < 1 || hours > 720) throw agentXError("CONFIG_INVALID", "--expires-in-hours takes a whole number of hours from 1 to 720 (30 days)");
|
|
378789
|
+
return hours;
|
|
378790
|
+
}
|
|
378791
|
+
function emailHashOf(value) {
|
|
378792
|
+
const trimmed = value.trim().toLowerCase();
|
|
378793
|
+
if (CompanyInviteEmailHashSchema.safeParse(trimmed).success) return trimmed;
|
|
378794
|
+
return companyInviteEmailHash(inviteEmail(value));
|
|
378795
|
+
}
|
|
378796
|
+
function routeFields(body) {
|
|
378797
|
+
return Object.fromEntries(Object.entries(body).filter(([key2]) => key2 !== "requestId"));
|
|
378798
|
+
}
|
|
378799
|
+
var when2 = (iso8) => `${iso8.slice(0, 10)} ${iso8.slice(11, 16)} UTC`;
|
|
378800
|
+
var STATUS_WORDS2 = { pending: "pending", used: "joined", withdrawn: "withdrawn", expired: "expired" };
|
|
378801
|
+
function inviteLine(invite) {
|
|
378802
|
+
const times = invite.status === "used" && invite.usedAt !== void 0 ? `joined ${when2(invite.usedAt)}` : invite.status === "pending" ? `made ${when2(invite.createdAt)}, ends ${when2(invite.expiresAt)}` : invite.status === "expired" ? `ended ${when2(invite.expiresAt)}` : `made ${when2(invite.createdAt)}`;
|
|
378803
|
+
return ` ${STATUS_WORDS2[invite.status].padEnd(9)} ${invite.emailHash.slice(0, 12)} ${invite.role.padEnd(6)} ${times}`;
|
|
378804
|
+
}
|
|
378805
|
+
async function companyOf(deps, env3) {
|
|
378806
|
+
const answer2 = await appRequest(deps, env3, COMPANY_DETAILS_PATH);
|
|
378807
|
+
const details2 = CompanyDetailsViewSchema.safeParse(routeFields(answer2.body));
|
|
378808
|
+
if (!details2.success) throw agentXError("RUNTIME_UNAVAILABLE", UNEXPECTED2);
|
|
378809
|
+
if (details2.data.role === "member") throw new ReportedFailure("FORBIDDEN", ADMIN_ONLY, 1);
|
|
378810
|
+
return { companyId: details2.data.companyId, name: details2.data.name };
|
|
378811
|
+
}
|
|
378812
|
+
async function inviteList(deps, env3) {
|
|
378813
|
+
const answer2 = await appRequest(deps, env3, COMPANY_PREAPPROVALS_PATH);
|
|
378814
|
+
const list4 = CompanyPreapprovalListSchema.safeParse(routeFields(answer2.body));
|
|
378815
|
+
if (!list4.success) throw agentXError("RUNTIME_UNAVAILABLE", UNEXPECTED2);
|
|
378816
|
+
return { env: answer2.env, url: answer2.url, list: list4.data };
|
|
378817
|
+
}
|
|
378818
|
+
async function companyInvite(deps, env3, email4, hours) {
|
|
378819
|
+
const address = inviteEmail(email4);
|
|
378820
|
+
const company = await companyOf(deps, env3);
|
|
378821
|
+
const hash9 = companyInviteEmailHash(address);
|
|
378822
|
+
const pending = (await inviteList(deps, env3)).list.invites.find((invite) => invite.emailHash === hash9 && invite.status === "pending");
|
|
378823
|
+
if (pending !== void 0) {
|
|
378824
|
+
throw agentXError("CONFIG_INVALID", `${address} already has an invite that ends ${when2(pending.expiresAt)}. To send a new one, withdraw it first: ${CLI_COMMAND_NAME} company invites withdraw ${address}`);
|
|
378825
|
+
}
|
|
378826
|
+
const answer2 = await appRequest(deps, env3, COMPANY_PREAPPROVALS_PATH, { method: "POST", body: { email: address, role: "member", expiresInHours: hours } });
|
|
378827
|
+
const created = CompanyPreapprovalCreatedSchema.safeParse(routeFields(answer2.body));
|
|
378828
|
+
if (!created.success) throw agentXError("RUNTIME_UNAVAILABLE", UNEXPECTED2);
|
|
378829
|
+
const { secret, expiresAt } = created.data.invite;
|
|
378830
|
+
const command5 = `npx ${CLI_PACKAGE_NAME}@latest login ${answer2.url} --company ${company.companyId} --invite ${secret}`;
|
|
378831
|
+
const companyName2 = company.name === null ? "your company" : terminalSafe(company.name);
|
|
378832
|
+
const text16 = [
|
|
378833
|
+
`Invited ${address} to ${companyName2} as a member. The invite works once and ends ${when2(expiresAt)}.`,
|
|
378834
|
+
"Send them this command to run on their computer. It is shown only now, so copy it:",
|
|
378835
|
+
"",
|
|
378836
|
+
` ${command5}`,
|
|
378837
|
+
"",
|
|
378838
|
+
`They sign in with GitHub or your company login, using the email ${address}. Slack works for an invite only from this Rovara's own Slack workspace.`,
|
|
378839
|
+
`To see your invites: ${CLI_COMMAND_NAME} company invites. To withdraw this one: ${CLI_COMMAND_NAME} company invites withdraw ${address}`
|
|
378840
|
+
].join("\n") + "\n";
|
|
378841
|
+
return result(answer2, { companyId: company.companyId, email: address, emailHash: hash9, role: "member", expiresAt, invite: secret, command: command5 }, text16);
|
|
378842
|
+
}
|
|
378843
|
+
async function companyInvites(deps, env3, email4) {
|
|
378844
|
+
const hash9 = email4 === void 0 ? void 0 : emailHashOf(email4);
|
|
378845
|
+
const answer2 = await inviteList(deps, env3);
|
|
378846
|
+
const invites = hash9 === void 0 ? answer2.list.invites : answer2.list.invites.filter((invite) => invite.emailHash === hash9);
|
|
378847
|
+
const lines = invites.length === 0 ? [hash9 === void 0 ? "Your company has no invites." : "No invites for that email."] : [`Invites (Rovara keeps only a hash of each email; find one with --email <email>):`, ...invites.map(inviteLine)];
|
|
378848
|
+
if (answer2.list.more && hash9 === void 0) lines.push("More invites are not shown.");
|
|
378849
|
+
return result(answer2, { invites, more: answer2.list.more }, lines.join("\n") + "\n");
|
|
378850
|
+
}
|
|
378851
|
+
async function companyInviteWithdraw(deps, env3, emailOrHash) {
|
|
378852
|
+
const hash9 = emailHashOf(emailOrHash);
|
|
378853
|
+
let answer2;
|
|
378854
|
+
try {
|
|
378855
|
+
answer2 = await appRequest(deps, env3, `${COMPANY_PREAPPROVALS_PATH}/${hash9}`, { method: "DELETE" });
|
|
378856
|
+
} catch (error64) {
|
|
378857
|
+
if (error64 instanceof ReportedFailure && error64.failureCode === "NOT_FOUND") throw new ReportedFailure("NOT_FOUND", "No invite to withdraw for that email in your company (only a company owner or admin can withdraw one).", error64.exitCode);
|
|
378858
|
+
throw error64;
|
|
378859
|
+
}
|
|
378860
|
+
return result(answer2, { emailHash: hash9, withdrawn: true }, "Withdrew the invite. Its command no longer works.\n");
|
|
378861
|
+
}
|
|
378862
|
+
|
|
378863
|
+
// packages/cli/src/company/commands.ts
|
|
378740
378864
|
var ROLE_WORDS = { owner: "owner", admin: "administrator", member: "member" };
|
|
378741
378865
|
function detailsText(body, renamed) {
|
|
378742
378866
|
const members2 = typeof body.members === "number" ? body.members : 0;
|
|
@@ -378762,9 +378886,12 @@ async function companyRename(deps, env3, name3) {
|
|
|
378762
378886
|
}
|
|
378763
378887
|
function registerCompanyCommands(program2, context) {
|
|
378764
378888
|
const print = (command5, answer2) => context.write(context.globalOptions(command5).json ? formatSuccess({ env: answer2.env, url: answer2.url, ...answer2.data }, true) : answer2.text);
|
|
378765
|
-
const company = program2.command("company").description("your company on this Rovara: its name, ID, your role
|
|
378889
|
+
const company = program2.command("company").description("your company on this Rovara: its name, ID, your role, how many members it has, and inviting teammates");
|
|
378766
378890
|
company.command("show").description("show your company's name, ID, your role in it and how many members it has").action(async (_options, command5) => print(command5, await companyShow(context.developerSession(), context.developerEnv(command5))));
|
|
378767
378891
|
company.command("rename").description("give your company a new name (a company owner or administrator only)").argument("<name>", "the new name, 1 to 80 characters").action(async (name3, _options, command5) => print(command5, await companyRename(context.developerSession(), context.developerEnv(command5), name3)));
|
|
378892
|
+
company.command("invite").description("invite a teammate to your company as a member, by email; prints the one-time command they run to join (a company owner or administrator only)").argument("<email>", "the email the teammate signs in with").option("--expires-in-hours <hours>", "how long the invite works, 1 to 720 hours (default 168, one week)").action(async (email4, options, command5) => print(command5, await companyInvite(context.developerSession(), context.developerEnv(command5), email4, inviteHours(options.expiresInHours))));
|
|
378893
|
+
const invites = company.command("invites").description("list your company's invites: pending, joined, withdrawn and expired (a company owner or administrator only)").option("--email <email>", "only the invites for this email").action(async (options, command5) => print(command5, await companyInvites(context.developerSession(), context.developerEnv(command5), options.email)));
|
|
378894
|
+
invites.command("withdraw").description("withdraw an invite, so its command no longer works (a company owner or administrator only)").argument("<email>", "the invited email (or the invite's full hash)").action(async (email4, _options, command5) => print(command5, await companyInviteWithdraw(context.developerSession(), context.developerEnv(command5), email4)));
|
|
378768
378895
|
}
|
|
378769
378896
|
|
|
378770
378897
|
// packages/cli/src/admin/workspaces.ts
|
|
@@ -385024,7 +385151,7 @@ init_dist2();
|
|
|
385024
385151
|
import { realpathSync } from "node:fs";
|
|
385025
385152
|
|
|
385026
385153
|
// packages/cli/src/version.ts
|
|
385027
|
-
var RELEASE_VERSION = true ? "0.5.
|
|
385154
|
+
var RELEASE_VERSION = true ? "0.5.16" : void 0;
|
|
385028
385155
|
var CLI_VERSION = RELEASE_VERSION ?? "0.1.0";
|
|
385029
385156
|
function isPrereleaseVersion(version3) {
|
|
385030
385157
|
return /^\d+\.\d+\.\d+-/.test(version3);
|
|
@@ -390174,7 +390301,7 @@ var PHASE_TITLES = {
|
|
|
390174
390301
|
connect: "Connect GitHub and Slack",
|
|
390175
390302
|
finish: "Finish"
|
|
390176
390303
|
};
|
|
390177
|
-
var
|
|
390304
|
+
var STATUS_WORDS3 = {
|
|
390178
390305
|
done: "Done",
|
|
390179
390306
|
now: "Now",
|
|
390180
390307
|
waiting: "Waiting for you",
|
|
@@ -390299,7 +390426,7 @@ function journeyOf(input2) {
|
|
|
390299
390426
|
id: id12,
|
|
390300
390427
|
title: PHASE_TITLES[id12],
|
|
390301
390428
|
status,
|
|
390302
|
-
statusWord:
|
|
390429
|
+
statusWord: STATUS_WORDS3[status],
|
|
390303
390430
|
timeText: minutesText(toMinutes(phaseSeconds(id12))),
|
|
390304
390431
|
needsYou: id12 === "get-started" || id12 === "your-choices" || stepsIn(id12).some((step3) => STEP_PLAN[step3].needsYou)
|
|
390305
390432
|
};
|
|
@@ -396911,7 +397038,7 @@ function createSlackWorkspaceBindings(deps) {
|
|
|
396911
397038
|
await send3(indexTransaction(deps.tableName, winner, false));
|
|
396912
397039
|
}
|
|
396913
397040
|
};
|
|
396914
|
-
const
|
|
397041
|
+
const companyOf2 = (team) => operation2(async (send3) => {
|
|
396915
397042
|
if (!slackWorkspaceTeam(team))
|
|
396916
397043
|
throw new SlackWorkspaceRefused();
|
|
396917
397044
|
const company = (await storedBinding(send3, team))?.companyId;
|
|
@@ -396920,14 +397047,14 @@ function createSlackWorkspaceBindings(deps) {
|
|
|
396920
397047
|
return !await complete(send3) && team === legacy ? IMPLICIT_COMPANY_ID : void 0;
|
|
396921
397048
|
});
|
|
396922
397049
|
return {
|
|
396923
|
-
companyOf,
|
|
397050
|
+
companyOf: companyOf2,
|
|
396924
397051
|
async requireCompany(team) {
|
|
396925
|
-
const company = await
|
|
397052
|
+
const company = await companyOf2(team);
|
|
396926
397053
|
if (company === void 0)
|
|
396927
397054
|
throw new SlackWorkspaceRefused();
|
|
396928
397055
|
return company;
|
|
396929
397056
|
},
|
|
396930
|
-
channelCompanyOf: (where) => where !== null && typeof where === "object" && where.channel === "slack" ?
|
|
397057
|
+
channelCompanyOf: (where) => where !== null && typeof where === "object" && where.channel === "slack" ? companyOf2(where.tenant) : void 0,
|
|
396931
397058
|
bind: (company, team, by) => operation2(async (send3) => {
|
|
396932
397059
|
if (!OrgIdSchema.safeParse(company).success || !slackWorkspaceTeam(team) || !operator.safeParse(by).success)
|
|
396933
397060
|
throw new SlackWorkspaceRefused();
|
|
@@ -412466,13 +412593,16 @@ ${ROOT_HELP_DOCS_LINES.join("\n")}`);
|
|
|
412466
412593
|
throw agentXError("CONFIG_INVALID", `--env ${JSON.stringify(env3)} is reserved for published templates and cannot be used as a real environment`);
|
|
412467
412594
|
}
|
|
412468
412595
|
});
|
|
412469
|
-
program2.command("login").description("sign in: agentx login <url> for developers; agentx login --admin (or no URL) for administrators").argument("[url]", "your AgentX URL, for developer sign-in").option("--admin", "sign in as an administrator with the admin identity provider (the default when no URL is given)", false).option("--no-browser", "developer sign-in: print the sign-in link instead of opening a browser").option("--callback-port <port>", "fixed loopback callback port registered with the OIDC client", parsePort, DEFAULT_CALLBACK_PORT).action(async (url2, options, command5) => {
|
|
412596
|
+
program2.command("login").description("sign in: agentx login <url> for developers; agentx login --admin (or no URL) for administrators").argument("[url]", "your AgentX URL, for developer sign-in").option("--admin", "sign in as an administrator with the admin identity provider (the default when no URL is given)", false).option("--no-browser", "developer sign-in: print the sign-in link instead of opening a browser").option("--callback-port <port>", "fixed loopback callback port registered with the OIDC client", parsePort, DEFAULT_CALLBACK_PORT).option("--company <id>", "developer sign-in with an invite: the company's ID, from the invite").option("--invite <secret>", "developer sign-in with an invite: the invite itself (rvlink_...), which works once").action(async (url2, options, command5) => {
|
|
412470
412597
|
const globals = globalOptions2(command5);
|
|
412471
412598
|
if (url2 !== void 0 && options.admin) {
|
|
412472
412599
|
throw agentXError("CONFIG_INVALID", "use either agentx login <url> (developer sign-in) or agentx login --admin, not both");
|
|
412473
412600
|
}
|
|
412601
|
+
const invite = loginInvite(options.company, options.invite);
|
|
412602
|
+
if (invite !== void 0 && url2 === void 0) throw agentXError("CONFIG_INVALID", "an invite is for developer sign-in: agentx login <url> --company <id> --invite <invite>");
|
|
412474
412603
|
if (url2 !== void 0) {
|
|
412475
412604
|
const result4 = await developerLogin({
|
|
412605
|
+
...invite === void 0 ? {} : { invite },
|
|
412476
412606
|
url: url2,
|
|
412477
412607
|
allowLoopback: globals.allowLoopback,
|
|
412478
412608
|
browser: options.browser,
|