@withgauge/cli 0.25.0 → 0.25.1
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 +35 -3
- package/dist/batchWorker.js +1 -1
- package/dist/{chatApi-KHPW7ED5.js → chatApi-W6HW3HKD.js} +1 -1
- package/dist/chunk-E24F53BZ.js +1 -0
- package/dist/{chunk-XHPA33OA.js → chunk-RRLAI72I.js} +1 -1
- package/dist/{chunk-EVT234WT.js → chunk-UANK5LHE.js} +1 -1
- package/dist/{chunk-KRHTXL5O.js → chunk-WJTCHKG6.js} +1 -1
- package/dist/index.js +9 -7
- package/dist/{orgDirectory-V3RCKGLA.js → orgDirectory-BZW2ZAD3.js} +1 -1
- package/package.json +1 -1
- package/dist/chunk-DEX43SUK.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createdOrganization,credentialKind,fetchDirectory,findOrganization,isUuid,keyOrganization,legacySelection,missingAgentsOrg,productsLabel,resolveOrgValue,resolveSelection}from"./chunk-
|
|
1
|
+
import{createdOrganization,credentialKind,fetchDirectory,findOrganization,isUuid,keyOrganization,legacySelection,missingAgentsOrg,productsLabel,resolveOrgValue,resolveSelection}from"./chunk-E24F53BZ.js";import"./chunk-RRLAI72I.js";import"./chunk-OIGVDK3F.js";import"./chunk-PSBF4TEK.js";export{createdOrganization,credentialKind,fetchDirectory,findOrganization,isUuid,keyOrganization,legacySelection,missingAgentsOrg,productsLabel,resolveOrgValue,resolveSelection};
|
package/package.json
CHANGED
package/dist/chunk-DEX43SUK.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{CliError,createClient,resolveToken}from"./chunk-XHPA33OA.js";var UUID_RE=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;var isUuid=value=>UUID_RE.test(value);function credentialKind(token=resolveToken()){if(!token)return"none";if(token.startsWith("gauge_cli_"))return"session";if(token.startsWith("gauge_sk_")||!token.startsWith("gauge_"))return"api_key";return"legacy"}async function fetchDirectory(){if(credentialKind()==="legacy")throw new CliError("usage","This Agents token cannot list or select organizations in this version of the CLI.",{hint:"If GAUGE_API_TOKEN is set, unset it first. Then run `gauge auth login` and `gauge orgs`."});const{chatPath,createChatApiClient}=await import("./chatApi-KHPW7ED5.js");const{data}=await createChatApiClient().get(chatPath("orgs"));if(!Array.isArray(data))throw new CliError("internal","Gauge returned an organization list the CLI could not read.",{hint:"Try `gauge orgs` again. If this continues, contact Gauge support."});return data}async function findOrganization(value){const org=(await fetchDirectory()).find(org2=>org2.id===value||org2.slug===value);if(!org)throw new CliError("not_found",`You don't have access to an organization named "${value}".`,{hint:"Run `gauge orgs` to see your organizations, then use a value from the slug column."});return org}async function resolveOrgValue(value){return isUuid(value)?{id:value}:findOrganization(value)}function legacySelection(source){const message=source==="config"?"Your saved organization needs to be selected again after this CLI update.":source==="project"?"This project's organization needs to be selected again after this CLI update.":"The organization in this run file needs to be selected again after this CLI update.";const hint=source==="config"?"Run `gauge orgs` to see your organizations, then `gauge orgs use <slug>` to choose one. If you have only one organization, `gauge auth login` updates your saved choice automatically.":source==="project"?"Run `gauge orgs`, then `gauge orgs use <slug> --project` to update gauge.json.":"Run `gauge orgs`, then rerun your command with --org <slug>. Or remove org from the run file to use your saved organization.";throw new CliError("usage",message,{hint})}async function resolveSelection(value,source){if(source!=="flag"&&!isUuid(value))legacySelection(source);return resolveOrgValue(value)}async function keyOrganization(){const{createChatApiClient}=await import("./chatApi-KHPW7ED5.js");const org=(await createChatApiClient().me()).apiKey?.organization;if(!org)throw new CliError("internal","Gauge could not identify which organization this API key belongs to.",{hint:"Check the key in Settings \u2192 API Keys and try again."});return org}async function createdOrganization(agentsSlug){const{orgs}=await createClient().get("/api/v1/me");const id=orgs.find(org=>org.slug===agentsSlug)?.canonicalGaugeOrganizationId;if(!id)throw new CliError("internal","Your workspace was created, but it is not ready to select in the CLI yet.",{hint:"Run `gauge orgs` to check for it, then `gauge orgs use <slug>`. If it is missing, contact Gauge support; you don't need to create it again."});return findOrganization(id)}async function missingAgentsOrg(org){const match=(await fetchDirectory()).find(o=>o.id===org);if(match?.products?.agents!==false)return void 0;return new CliError("not_found",`${match.name} doesn't use Gauge Agents.`,{hint:"Run `gauge orgs` to see which products each organization uses."})}function productsLabel(products){if(!products)return"unknown";return[products.chat?"Chat":void 0,products.agents?"Agents":void 0].filter(Boolean).join(", ")||"-"}export{isUuid,credentialKind,fetchDirectory,findOrganization,resolveOrgValue,legacySelection,resolveSelection,keyOrganization,createdOrganization,missingAgentsOrg,productsLabel};
|