esim-cli 2026.1201.201 → 2026.1201.203

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/dist/esim.js CHANGED
@@ -15249,7 +15249,7 @@ Each submission of the built-in gold code awards 50 gold. For other codes, a ret
15249
15249
  { operationId: "ListMyShareOrders", name: "list-my-share-orders", method: "GET", path: "/api/me/shares/orders", spec: "shares.yaml", write: false, retry: "unsafe", description: "Citizen session required. List the citizen's open and terminal orders by order ID descending.", parameters: [{ name: "cursor", in: "query", description: "Opaque cursor scoped to the current list and its filters.", schema: { type: "string" } }, { name: "limit", in: "query", schema: { type: "integer", minimum: 1, maximum: 100, default: 20 } }], requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["items", "nextCursor"], properties: { items: { type: "array", items: { type: "object", additionalProperties: false, required: ["id", "companyId", "ownerPid", "side", "asset", "unitPrice", "quantity", "remainingQuantity", "filledQuantity", "status", "createdAt"], properties: { ownerName: { type: "string" }, ownerNationId: { type: "integer", minimum: 0 }, id: { type: "integer", format: "int64", minimum: 1 }, companyId: { type: "integer", format: "int64", minimum: 1 }, ownerPid: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, side: { type: "string", enum: ["buy", "sell"] }, asset: { type: "string", enum: ["gold"] }, unitPrice: { type: "integer", format: "int64", minimum: 1, maximum: 1000000000000 }, quantity: { type: "integer", format: "int64", minimum: 1 }, remainingQuantity: { type: "integer", format: "int64", minimum: 0, description: "Quantity still on the book. Zero for filled and cancelled orders." }, filledQuantity: { type: "integer", format: "int64", minimum: 0, description: "Cumulative quantity traded. Remains available after cancellation." }, status: { type: "string", enum: ["open", "filled", "cancelled"] }, createdAt: { type: "string", format: "date-time" } } } }, nextCursor: { type: ["string", "null"] } } } } }, responseFields: ["items", "nextCursor"] },
15250
15250
  { operationId: "ListMyShareRoles", name: "list-my-share-roles", method: "GET", path: "/api/me/shares/roles", spec: "shares.yaml", write: false, retry: "unsafe", description: "Citizen session required. List the citizen's roles by stock company ID, then role.", parameters: [{ name: "cursor", in: "query", description: "Opaque cursor scoped to the current list and its filters.", schema: { type: "string" } }, { name: "limit", in: "query", schema: { type: "integer", minimum: 1, maximum: 100, default: 20 } }], requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["items", "nextCursor"], properties: { items: { type: "array", items: { type: "object", additionalProperties: false, required: ["id", "companyId", "pid", "role"], properties: { name: { type: "string" }, nationId: { type: "integer", minimum: 0 }, companyName: { type: "string" }, id: { type: "integer", format: "int64", minimum: 1 }, companyId: { type: "integer", format: "int64", minimum: 1 }, pid: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, role: { type: "string", enum: ["ceo", "company_manager", "supply_manager", "accountant"] } } } }, nextCursor: { type: ["string", "null"] } } } } }, responseFields: ["items", "nextCursor"] },
15251
15251
  { operationId: "ListStockCompanyRankings", name: "list-stock-company-rankings", method: "GET", path: "/api/stock-companies/rankings", spec: "shares.yaml", write: false, retry: "unsafe", description: "Public. Rank by issued shares (default) or current game-day share turnover. Newly committed trades appear after projection.", parameters: [{ name: "metric", in: "query", schema: { type: "string", enum: ["shares", "turnover"] } }, { name: "nation", in: "query", schema: { type: "integer", minimum: 0, maximum: 2147483647 } }, { name: "page", in: "query", schema: { type: "integer", minimum: 1, maximum: 1e5 } }, { name: "order", in: "query", description: "Ranking direction (default desc). asc returns the exact reverse; rank stays the descending rank.", schema: { type: "string", enum: ["asc", "desc"], description: "Direction of a list sort." } }], requiresCredentials: false, responses: { "200": { kind: "json", schema: { type: "object", required: ["items", "total"], properties: { items: { type: "array", items: { type: "object", required: ["id", "name", "nation", "rank", "totalShares"], properties: { id: { type: "integer", format: "int64" }, name: { type: "string" }, nation: { type: "integer" }, rank: { type: "integer" }, totalShares: { type: "integer", format: "int64" }, turnover: { type: "string", pattern: "^[0-9]+$", description: "Game-day turnover in minor gold units, present for turnover rankings." } } } }, total: { type: "integer" } } } } }, responseFields: ["items", "total"] },
15252
- { operationId: "ListStockCompanies", name: "list-stock-companies", method: "GET", path: "/api/stock-companies", spec: "shares.yaml", write: false, retry: "unsafe", description: "Public. List stock companies by ID descending.", parameters: [{ name: "cursor", in: "query", description: "Opaque cursor scoped to the current list and its filters.", schema: { type: "string" } }, { name: "limit", in: "query", schema: { type: "integer", minimum: 1, maximum: 100, default: 20 } }], requiresCredentials: false, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["items", "nextCursor"], properties: { items: { type: "array", items: { type: "object", additionalProperties: false, required: ["id", "name", "land", "country", "totalShares", "statute", "issuanceRemaining", "issuancePrice", "splitEligible", "shareholderCount", "createdAt"], properties: { inventory: { type: "array", description: "Positive stock balances owned directly by this stock company, returned on detail reads.", items: { type: "object", additionalProperties: false, required: ["item", "quality", "quantity"], properties: { item: { type: "string" }, quality: { type: "integer", minimum: 0 }, quantity: { type: "integer", format: "int64", minimum: 1 } } } }, walletBalances: { type: "array", description: "Company-owned wallet amounts in minor units, including pending credits, returned on detail reads.", items: { type: "object", additionalProperties: false, required: ["asset", "amount"], properties: { asset: { type: "integer", minimum: 0, description: "Gold is zero. A national currency is its country ID plus one." }, amount: { type: "string", pattern: "^[0-9]+$" } } } }, fxOffersGoldValue: { type: "string", pattern: "^[0-9]+$", description: "Remaining company FX offers valued in minor Gold units when every offer sells Gold." }, dailyTurnover: { type: "string", pattern: "^[0-9]+$", description: "Current game-day share turnover in minor gold units, included in the detail response. Newly committed trades appear after projection." }, factoryAssets: { type: "array", description: "Factories and their asset values in Gold minor units, included on detail reads.", items: { type: "object", additionalProperties: false, required: ["id", "name", "level", "value"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, name: { type: "string" }, level: { type: "integer", minimum: 0 }, value: { type: "integer", format: "int64", minimum: 0 } } } }, factoryIds: { type: "array", items: { type: "integer", format: "int64", minimum: 1 } }, donationFactoryIds: { type: "array", items: { type: "integer", format: "int64", minimum: 1 } }, id: { type: "integer", format: "int64", minimum: 1 }, name: { type: "string", minLength: 1, maxLength: 64 }, land: { type: "integer", minimum: 0 }, country: { type: "integer", minimum: 0 }, ceoPid: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, totalShares: { type: "integer", format: "int64", minimum: 1 }, statute: { type: "string" }, issuanceRemaining: { type: "integer", format: "int64", minimum: 0 }, issuancePrice: { type: "integer", format: "int64", minimum: 0 }, splitEligible: { type: "boolean" }, shareholderCount: { type: "integer", format: "int64", minimum: 1 }, createdAt: { type: "string", format: "date-time" } } } }, nextCursor: { type: ["string", "null"] } } } } }, responseFields: ["items", "nextCursor"] },
15252
+ { operationId: "ListStockCompanies", name: "list-stock-companies", method: "GET", path: "/api/stock-companies", spec: "shares.yaml", write: false, retry: "unsafe", description: "Public. List stock companies by ID descending, optionally filtered by name before pagination.", parameters: [{ name: "cursor", in: "query", description: "Opaque cursor scoped to the current list and its filters.", schema: { type: "string" } }, { name: "limit", in: "query", schema: { type: "integer", minimum: 1, maximum: 100, default: 20 } }, { name: "q", in: "query", description: "Case-insensitive literal substring of the stock company name. Use a cursor issued for the same query.", schema: { type: "string", minLength: 1, maxLength: 100 } }], requiresCredentials: false, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["items", "nextCursor"], properties: { items: { type: "array", items: { type: "object", additionalProperties: false, required: ["id", "name", "land", "country", "totalShares", "statute", "issuanceRemaining", "issuancePrice", "splitEligible", "shareholderCount", "createdAt"], properties: { inventory: { type: "array", description: "Positive stock balances owned directly by this stock company, returned on detail reads.", items: { type: "object", additionalProperties: false, required: ["item", "quality", "quantity"], properties: { item: { type: "string" }, quality: { type: "integer", minimum: 0 }, quantity: { type: "integer", format: "int64", minimum: 1 } } } }, walletBalances: { type: "array", description: "Company-owned wallet amounts in minor units, including pending credits, returned on detail reads.", items: { type: "object", additionalProperties: false, required: ["asset", "amount"], properties: { asset: { type: "integer", minimum: 0, description: "Gold is zero. A national currency is its country ID plus one." }, amount: { type: "string", pattern: "^[0-9]+$" } } } }, fxOffersGoldValue: { type: "string", pattern: "^[0-9]+$", description: "Remaining company FX offers valued in minor Gold units when every offer sells Gold." }, dailyTurnover: { type: "string", pattern: "^[0-9]+$", description: "Current game-day share turnover in minor gold units, included in the detail response. Newly committed trades appear after projection." }, factoryAssets: { type: "array", description: "Factories and their asset values in Gold minor units, included on detail reads.", items: { type: "object", additionalProperties: false, required: ["id", "name", "level", "value"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, name: { type: "string" }, level: { type: "integer", minimum: 0 }, value: { type: "integer", format: "int64", minimum: 0 } } } }, factoryIds: { type: "array", items: { type: "integer", format: "int64", minimum: 1 } }, donationFactoryIds: { type: "array", items: { type: "integer", format: "int64", minimum: 1 } }, id: { type: "integer", format: "int64", minimum: 1 }, name: { type: "string", minLength: 1, maxLength: 64 }, land: { type: "integer", minimum: 0 }, country: { type: "integer", minimum: 0 }, ceoPid: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, totalShares: { type: "integer", format: "int64", minimum: 1 }, statute: { type: "string" }, issuanceRemaining: { type: "integer", format: "int64", minimum: 0 }, issuancePrice: { type: "integer", format: "int64", minimum: 0 }, splitEligible: { type: "boolean" }, shareholderCount: { type: "integer", format: "int64", minimum: 1 }, createdAt: { type: "string", format: "date-time" } } } }, nextCursor: { type: ["string", "null"] } } } } }, responseFields: ["items", "nextCursor"] },
15253
15253
  { operationId: "CreateStockCompany", name: "create-stock-company", method: "POST", path: "/api/stock-companies", spec: "shares.yaml", write: true, retry: "unsafe", description: "Citizen session required. Create a stock company in the citizen's current region. Charge 5000 units (50 Gold) plus initial capital of at least 100 units (1 Gold). Issue 50 shares to the founder. Insufficient funds returns insufficient_funds.", parameters: [{ name: "Origin", in: "header", required: true, description: "Same origin as the application.", schema: { type: "string" } }], body: { required: true, schema: { type: "object", additionalProperties: false, required: ["name", "initialCapital"], properties: { name: { type: "string", minLength: 3, maxLength: 32 }, initialCapital: { type: "integer", format: "int64", minimum: 5000, maximum: 500000, description: "Starting capital in 0.01 Gold units." } } } }, requiresCredentials: true, responses: { "201": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["id", "name", "land", "country", "totalShares", "statute", "issuanceRemaining", "issuancePrice", "splitEligible", "shareholderCount", "createdAt"], properties: { inventory: { type: "array", description: "Positive stock balances owned directly by this stock company, returned on detail reads.", items: { type: "object", additionalProperties: false, required: ["item", "quality", "quantity"], properties: { item: { type: "string" }, quality: { type: "integer", minimum: 0 }, quantity: { type: "integer", format: "int64", minimum: 1 } } } }, walletBalances: { type: "array", description: "Company-owned wallet amounts in minor units, including pending credits, returned on detail reads.", items: { type: "object", additionalProperties: false, required: ["asset", "amount"], properties: { asset: { type: "integer", minimum: 0, description: "Gold is zero. A national currency is its country ID plus one." }, amount: { type: "string", pattern: "^[0-9]+$" } } } }, fxOffersGoldValue: { type: "string", pattern: "^[0-9]+$", description: "Remaining company FX offers valued in minor Gold units when every offer sells Gold." }, dailyTurnover: { type: "string", pattern: "^[0-9]+$", description: "Current game-day share turnover in minor gold units, included in the detail response. Newly committed trades appear after projection." }, factoryAssets: { type: "array", description: "Factories and their asset values in Gold minor units, included on detail reads.", items: { type: "object", additionalProperties: false, required: ["id", "name", "level", "value"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, name: { type: "string" }, level: { type: "integer", minimum: 0 }, value: { type: "integer", format: "int64", minimum: 0 } } } }, factoryIds: { type: "array", items: { type: "integer", format: "int64", minimum: 1 } }, donationFactoryIds: { type: "array", items: { type: "integer", format: "int64", minimum: 1 } }, id: { type: "integer", format: "int64", minimum: 1 }, name: { type: "string", minLength: 1, maxLength: 64 }, land: { type: "integer", minimum: 0 }, country: { type: "integer", minimum: 0 }, ceoPid: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, totalShares: { type: "integer", format: "int64", minimum: 1 }, statute: { type: "string" }, issuanceRemaining: { type: "integer", format: "int64", minimum: 0 }, issuancePrice: { type: "integer", format: "int64", minimum: 0 }, splitEligible: { type: "boolean" }, shareholderCount: { type: "integer", format: "int64", minimum: 1 }, createdAt: { type: "string", format: "date-time" } } } } }, responseFields: ["inventory", "walletBalances", "fxOffersGoldValue", "dailyTurnover", "factoryAssets", "factoryIds", "donationFactoryIds", "id", "name", "land", "country", "ceoPid", "totalShares", "statute", "issuanceRemaining", "issuancePrice", "splitEligible", "shareholderCount", "createdAt"] },
15254
15254
  { operationId: "GetStockCompany", name: "get-stock-company", method: "GET", path: "/api/stock-companies/{companyId}", spec: "shares.yaml", write: false, retry: "unsafe", description: "Public. Read the stock company profile.", parameters: [{ name: "companyId", in: "path", required: true, schema: { type: "integer", format: "int64", minimum: 1 } }], requiresCredentials: false, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["id", "name", "land", "country", "totalShares", "statute", "issuanceRemaining", "issuancePrice", "splitEligible", "shareholderCount", "createdAt"], properties: { inventory: { type: "array", description: "Positive stock balances owned directly by this stock company, returned on detail reads.", items: { type: "object", additionalProperties: false, required: ["item", "quality", "quantity"], properties: { item: { type: "string" }, quality: { type: "integer", minimum: 0 }, quantity: { type: "integer", format: "int64", minimum: 1 } } } }, walletBalances: { type: "array", description: "Company-owned wallet amounts in minor units, including pending credits, returned on detail reads.", items: { type: "object", additionalProperties: false, required: ["asset", "amount"], properties: { asset: { type: "integer", minimum: 0, description: "Gold is zero. A national currency is its country ID plus one." }, amount: { type: "string", pattern: "^[0-9]+$" } } } }, fxOffersGoldValue: { type: "string", pattern: "^[0-9]+$", description: "Remaining company FX offers valued in minor Gold units when every offer sells Gold." }, dailyTurnover: { type: "string", pattern: "^[0-9]+$", description: "Current game-day share turnover in minor gold units, included in the detail response. Newly committed trades appear after projection." }, factoryAssets: { type: "array", description: "Factories and their asset values in Gold minor units, included on detail reads.", items: { type: "object", additionalProperties: false, required: ["id", "name", "level", "value"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, name: { type: "string" }, level: { type: "integer", minimum: 0 }, value: { type: "integer", format: "int64", minimum: 0 } } } }, factoryIds: { type: "array", items: { type: "integer", format: "int64", minimum: 1 } }, donationFactoryIds: { type: "array", items: { type: "integer", format: "int64", minimum: 1 } }, id: { type: "integer", format: "int64", minimum: 1 }, name: { type: "string", minLength: 1, maxLength: 64 }, land: { type: "integer", minimum: 0 }, country: { type: "integer", minimum: 0 }, ceoPid: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, totalShares: { type: "integer", format: "int64", minimum: 1 }, statute: { type: "string" }, issuanceRemaining: { type: "integer", format: "int64", minimum: 0 }, issuancePrice: { type: "integer", format: "int64", minimum: 0 }, splitEligible: { type: "boolean" }, shareholderCount: { type: "integer", format: "int64", minimum: 1 }, createdAt: { type: "string", format: "date-time" } } } } }, responseFields: ["inventory", "walletBalances", "fxOffersGoldValue", "dailyTurnover", "factoryAssets", "factoryIds", "donationFactoryIds", "id", "name", "land", "country", "ceoPid", "totalShares", "statute", "issuanceRemaining", "issuancePrice", "splitEligible", "shareholderCount", "createdAt"] },
15255
15255
  { operationId: "ContributeStockCompanyGold", name: "contribute-stock-company-gold", method: "POST", path: "/api/stock-companies/{companyId}/contributions", spec: "shares.yaml", write: true, retry: "unsafe", description: "Citizen session required. Transfer Gold or a national currency from the citizen to the company wallet. Insufficient funds returns insufficient_funds.", parameters: [{ name: "companyId", in: "path", required: true, schema: { type: "integer", format: "int64", minimum: 1 } }, { name: "Origin", in: "header", required: true, description: "Same origin as the application.", schema: { type: "string" } }], body: { required: true, schema: { type: "object", additionalProperties: false, required: ["asset", "amount"], properties: { asset: { type: "string", pattern: "^(gold|cur:(0|[1-9][0-9]*))$" }, reason: { type: "string", maxLength: 100 }, amount: { type: "integer", format: "int64", minimum: 1, maximum: 1000000000000 } } } }, requiresCredentials: true, responses: { "201": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["companyId", "asset", "amount", "occurredAt"], properties: { companyId: { type: "integer", format: "int64", minimum: 1 }, asset: { type: "string", pattern: "^(gold|cur:(0|[1-9][0-9]*))$" }, reason: { type: "string", maxLength: 100 }, amount: { type: "integer", format: "int64", minimum: 1, maximum: 1000000000000 }, occurredAt: { type: "string", format: "date-time" } } } } }, responseFields: ["companyId", "asset", "reason", "amount", "occurredAt"] },
@@ -15527,7 +15527,10 @@ async function read(operation, input, options) {
15527
15527
  const secret = credentials?.token ?? credentials?.cookie?.slice("citizen=".length);
15528
15528
  const code = problem.success && !(secret && (secret.includes(problem.data.code) || problem.data.code.includes(secret))) ? problem.data.code : `http_${response.status}`;
15529
15529
  const clientError = response.status >= 400 && response.status < 500;
15530
- const message = problem.success ? [problem.data.detail, problem.data.title].find((text) => text?.trim() && text.length <= 240 && !/[\r\n]/.test(text) && !(secret && text.includes(secret))) : undefined;
15530
+ const context = problem.success ? problem.data.context : undefined;
15531
+ const { minLength, maxLength } = context ?? {};
15532
+ const searchMessage = code === "invalid_stock_company_search" && typeof minLength === "number" && typeof maxLength === "number" ? `Enter ${minLength}–${maxLength} characters to search for a stock company.` : undefined;
15533
+ const message = searchMessage ?? (problem.success ? [problem.data.detail, problem.data.title].find((text) => text?.trim() && text.length <= 240 && !/[\r\n]/.test(text) && !(secret && text.includes(secret))) : undefined);
15531
15534
  const retry = response.headers.get("Retry-After");
15532
15535
  const retryInSec = problem.success && problem.data.retryInSec !== undefined ? problem.data.retryInSec : retry && /^\d{1,8}$/.test(retry) ? Number(retry) : undefined;
15533
15536
  const hint = response.status === 401 || response.status === 403 ? "Check the credentials and their access, then retry." : response.status === 404 ? "Check the identifier and try again." : response.status === 429 ? "Wait before retrying." : clientError ? "Check the command arguments with --help." : operation.write && operation.retry === "unsafe" ? "Confirm the result before attempting the write again." : "Check the API and retry shortly.";
@@ -38072,7 +38075,7 @@ function saveCredentials(store, credentials) {
38072
38075
  }
38073
38076
 
38074
38077
  // version.ts
38075
- var version2 = "2026.1201.201";
38078
+ var version2 = "2026.1201.203";
38076
38079
  var installKind = version2 === "dev" ? "source" : typeof ESIM_CLI_EXECUTABLE === "boolean" && ESIM_CLI_EXECUTABLE ? "executable" : "npm";
38077
38080
  var npmLatestUrl = "https://registry.npmjs.org/esim-cli/latest";
38078
38081
  var releaseUrl = (release) => `https://github.com/CorrectRoadH/open-esim/releases/download/cli-v${release}`;
package/dist/index.js CHANGED
@@ -15245,7 +15245,7 @@ Each submission of the built-in gold code awards 50 gold. For other codes, a ret
15245
15245
  { operationId: "ListMyShareOrders", name: "list-my-share-orders", method: "GET", path: "/api/me/shares/orders", spec: "shares.yaml", write: false, retry: "unsafe", description: "Citizen session required. List the citizen's open and terminal orders by order ID descending.", parameters: [{ name: "cursor", in: "query", description: "Opaque cursor scoped to the current list and its filters.", schema: { type: "string" } }, { name: "limit", in: "query", schema: { type: "integer", minimum: 1, maximum: 100, default: 20 } }], requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["items", "nextCursor"], properties: { items: { type: "array", items: { type: "object", additionalProperties: false, required: ["id", "companyId", "ownerPid", "side", "asset", "unitPrice", "quantity", "remainingQuantity", "filledQuantity", "status", "createdAt"], properties: { ownerName: { type: "string" }, ownerNationId: { type: "integer", minimum: 0 }, id: { type: "integer", format: "int64", minimum: 1 }, companyId: { type: "integer", format: "int64", minimum: 1 }, ownerPid: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, side: { type: "string", enum: ["buy", "sell"] }, asset: { type: "string", enum: ["gold"] }, unitPrice: { type: "integer", format: "int64", minimum: 1, maximum: 1000000000000 }, quantity: { type: "integer", format: "int64", minimum: 1 }, remainingQuantity: { type: "integer", format: "int64", minimum: 0, description: "Quantity still on the book. Zero for filled and cancelled orders." }, filledQuantity: { type: "integer", format: "int64", minimum: 0, description: "Cumulative quantity traded. Remains available after cancellation." }, status: { type: "string", enum: ["open", "filled", "cancelled"] }, createdAt: { type: "string", format: "date-time" } } } }, nextCursor: { type: ["string", "null"] } } } } }, responseFields: ["items", "nextCursor"] },
15246
15246
  { operationId: "ListMyShareRoles", name: "list-my-share-roles", method: "GET", path: "/api/me/shares/roles", spec: "shares.yaml", write: false, retry: "unsafe", description: "Citizen session required. List the citizen's roles by stock company ID, then role.", parameters: [{ name: "cursor", in: "query", description: "Opaque cursor scoped to the current list and its filters.", schema: { type: "string" } }, { name: "limit", in: "query", schema: { type: "integer", minimum: 1, maximum: 100, default: 20 } }], requiresCredentials: true, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["items", "nextCursor"], properties: { items: { type: "array", items: { type: "object", additionalProperties: false, required: ["id", "companyId", "pid", "role"], properties: { name: { type: "string" }, nationId: { type: "integer", minimum: 0 }, companyName: { type: "string" }, id: { type: "integer", format: "int64", minimum: 1 }, companyId: { type: "integer", format: "int64", minimum: 1 }, pid: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, role: { type: "string", enum: ["ceo", "company_manager", "supply_manager", "accountant"] } } } }, nextCursor: { type: ["string", "null"] } } } } }, responseFields: ["items", "nextCursor"] },
15247
15247
  { operationId: "ListStockCompanyRankings", name: "list-stock-company-rankings", method: "GET", path: "/api/stock-companies/rankings", spec: "shares.yaml", write: false, retry: "unsafe", description: "Public. Rank by issued shares (default) or current game-day share turnover. Newly committed trades appear after projection.", parameters: [{ name: "metric", in: "query", schema: { type: "string", enum: ["shares", "turnover"] } }, { name: "nation", in: "query", schema: { type: "integer", minimum: 0, maximum: 2147483647 } }, { name: "page", in: "query", schema: { type: "integer", minimum: 1, maximum: 1e5 } }, { name: "order", in: "query", description: "Ranking direction (default desc). asc returns the exact reverse; rank stays the descending rank.", schema: { type: "string", enum: ["asc", "desc"], description: "Direction of a list sort." } }], requiresCredentials: false, responses: { "200": { kind: "json", schema: { type: "object", required: ["items", "total"], properties: { items: { type: "array", items: { type: "object", required: ["id", "name", "nation", "rank", "totalShares"], properties: { id: { type: "integer", format: "int64" }, name: { type: "string" }, nation: { type: "integer" }, rank: { type: "integer" }, totalShares: { type: "integer", format: "int64" }, turnover: { type: "string", pattern: "^[0-9]+$", description: "Game-day turnover in minor gold units, present for turnover rankings." } } } }, total: { type: "integer" } } } } }, responseFields: ["items", "total"] },
15248
- { operationId: "ListStockCompanies", name: "list-stock-companies", method: "GET", path: "/api/stock-companies", spec: "shares.yaml", write: false, retry: "unsafe", description: "Public. List stock companies by ID descending.", parameters: [{ name: "cursor", in: "query", description: "Opaque cursor scoped to the current list and its filters.", schema: { type: "string" } }, { name: "limit", in: "query", schema: { type: "integer", minimum: 1, maximum: 100, default: 20 } }], requiresCredentials: false, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["items", "nextCursor"], properties: { items: { type: "array", items: { type: "object", additionalProperties: false, required: ["id", "name", "land", "country", "totalShares", "statute", "issuanceRemaining", "issuancePrice", "splitEligible", "shareholderCount", "createdAt"], properties: { inventory: { type: "array", description: "Positive stock balances owned directly by this stock company, returned on detail reads.", items: { type: "object", additionalProperties: false, required: ["item", "quality", "quantity"], properties: { item: { type: "string" }, quality: { type: "integer", minimum: 0 }, quantity: { type: "integer", format: "int64", minimum: 1 } } } }, walletBalances: { type: "array", description: "Company-owned wallet amounts in minor units, including pending credits, returned on detail reads.", items: { type: "object", additionalProperties: false, required: ["asset", "amount"], properties: { asset: { type: "integer", minimum: 0, description: "Gold is zero. A national currency is its country ID plus one." }, amount: { type: "string", pattern: "^[0-9]+$" } } } }, fxOffersGoldValue: { type: "string", pattern: "^[0-9]+$", description: "Remaining company FX offers valued in minor Gold units when every offer sells Gold." }, dailyTurnover: { type: "string", pattern: "^[0-9]+$", description: "Current game-day share turnover in minor gold units, included in the detail response. Newly committed trades appear after projection." }, factoryAssets: { type: "array", description: "Factories and their asset values in Gold minor units, included on detail reads.", items: { type: "object", additionalProperties: false, required: ["id", "name", "level", "value"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, name: { type: "string" }, level: { type: "integer", minimum: 0 }, value: { type: "integer", format: "int64", minimum: 0 } } } }, factoryIds: { type: "array", items: { type: "integer", format: "int64", minimum: 1 } }, donationFactoryIds: { type: "array", items: { type: "integer", format: "int64", minimum: 1 } }, id: { type: "integer", format: "int64", minimum: 1 }, name: { type: "string", minLength: 1, maxLength: 64 }, land: { type: "integer", minimum: 0 }, country: { type: "integer", minimum: 0 }, ceoPid: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, totalShares: { type: "integer", format: "int64", minimum: 1 }, statute: { type: "string" }, issuanceRemaining: { type: "integer", format: "int64", minimum: 0 }, issuancePrice: { type: "integer", format: "int64", minimum: 0 }, splitEligible: { type: "boolean" }, shareholderCount: { type: "integer", format: "int64", minimum: 1 }, createdAt: { type: "string", format: "date-time" } } } }, nextCursor: { type: ["string", "null"] } } } } }, responseFields: ["items", "nextCursor"] },
15248
+ { operationId: "ListStockCompanies", name: "list-stock-companies", method: "GET", path: "/api/stock-companies", spec: "shares.yaml", write: false, retry: "unsafe", description: "Public. List stock companies by ID descending, optionally filtered by name before pagination.", parameters: [{ name: "cursor", in: "query", description: "Opaque cursor scoped to the current list and its filters.", schema: { type: "string" } }, { name: "limit", in: "query", schema: { type: "integer", minimum: 1, maximum: 100, default: 20 } }, { name: "q", in: "query", description: "Case-insensitive literal substring of the stock company name. Use a cursor issued for the same query.", schema: { type: "string", minLength: 1, maxLength: 100 } }], requiresCredentials: false, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["items", "nextCursor"], properties: { items: { type: "array", items: { type: "object", additionalProperties: false, required: ["id", "name", "land", "country", "totalShares", "statute", "issuanceRemaining", "issuancePrice", "splitEligible", "shareholderCount", "createdAt"], properties: { inventory: { type: "array", description: "Positive stock balances owned directly by this stock company, returned on detail reads.", items: { type: "object", additionalProperties: false, required: ["item", "quality", "quantity"], properties: { item: { type: "string" }, quality: { type: "integer", minimum: 0 }, quantity: { type: "integer", format: "int64", minimum: 1 } } } }, walletBalances: { type: "array", description: "Company-owned wallet amounts in minor units, including pending credits, returned on detail reads.", items: { type: "object", additionalProperties: false, required: ["asset", "amount"], properties: { asset: { type: "integer", minimum: 0, description: "Gold is zero. A national currency is its country ID plus one." }, amount: { type: "string", pattern: "^[0-9]+$" } } } }, fxOffersGoldValue: { type: "string", pattern: "^[0-9]+$", description: "Remaining company FX offers valued in minor Gold units when every offer sells Gold." }, dailyTurnover: { type: "string", pattern: "^[0-9]+$", description: "Current game-day share turnover in minor gold units, included in the detail response. Newly committed trades appear after projection." }, factoryAssets: { type: "array", description: "Factories and their asset values in Gold minor units, included on detail reads.", items: { type: "object", additionalProperties: false, required: ["id", "name", "level", "value"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, name: { type: "string" }, level: { type: "integer", minimum: 0 }, value: { type: "integer", format: "int64", minimum: 0 } } } }, factoryIds: { type: "array", items: { type: "integer", format: "int64", minimum: 1 } }, donationFactoryIds: { type: "array", items: { type: "integer", format: "int64", minimum: 1 } }, id: { type: "integer", format: "int64", minimum: 1 }, name: { type: "string", minLength: 1, maxLength: 64 }, land: { type: "integer", minimum: 0 }, country: { type: "integer", minimum: 0 }, ceoPid: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, totalShares: { type: "integer", format: "int64", minimum: 1 }, statute: { type: "string" }, issuanceRemaining: { type: "integer", format: "int64", minimum: 0 }, issuancePrice: { type: "integer", format: "int64", minimum: 0 }, splitEligible: { type: "boolean" }, shareholderCount: { type: "integer", format: "int64", minimum: 1 }, createdAt: { type: "string", format: "date-time" } } } }, nextCursor: { type: ["string", "null"] } } } } }, responseFields: ["items", "nextCursor"] },
15249
15249
  { operationId: "CreateStockCompany", name: "create-stock-company", method: "POST", path: "/api/stock-companies", spec: "shares.yaml", write: true, retry: "unsafe", description: "Citizen session required. Create a stock company in the citizen's current region. Charge 5000 units (50 Gold) plus initial capital of at least 100 units (1 Gold). Issue 50 shares to the founder. Insufficient funds returns insufficient_funds.", parameters: [{ name: "Origin", in: "header", required: true, description: "Same origin as the application.", schema: { type: "string" } }], body: { required: true, schema: { type: "object", additionalProperties: false, required: ["name", "initialCapital"], properties: { name: { type: "string", minLength: 3, maxLength: 32 }, initialCapital: { type: "integer", format: "int64", minimum: 5000, maximum: 500000, description: "Starting capital in 0.01 Gold units." } } } }, requiresCredentials: true, responses: { "201": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["id", "name", "land", "country", "totalShares", "statute", "issuanceRemaining", "issuancePrice", "splitEligible", "shareholderCount", "createdAt"], properties: { inventory: { type: "array", description: "Positive stock balances owned directly by this stock company, returned on detail reads.", items: { type: "object", additionalProperties: false, required: ["item", "quality", "quantity"], properties: { item: { type: "string" }, quality: { type: "integer", minimum: 0 }, quantity: { type: "integer", format: "int64", minimum: 1 } } } }, walletBalances: { type: "array", description: "Company-owned wallet amounts in minor units, including pending credits, returned on detail reads.", items: { type: "object", additionalProperties: false, required: ["asset", "amount"], properties: { asset: { type: "integer", minimum: 0, description: "Gold is zero. A national currency is its country ID plus one." }, amount: { type: "string", pattern: "^[0-9]+$" } } } }, fxOffersGoldValue: { type: "string", pattern: "^[0-9]+$", description: "Remaining company FX offers valued in minor Gold units when every offer sells Gold." }, dailyTurnover: { type: "string", pattern: "^[0-9]+$", description: "Current game-day share turnover in minor gold units, included in the detail response. Newly committed trades appear after projection." }, factoryAssets: { type: "array", description: "Factories and their asset values in Gold minor units, included on detail reads.", items: { type: "object", additionalProperties: false, required: ["id", "name", "level", "value"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, name: { type: "string" }, level: { type: "integer", minimum: 0 }, value: { type: "integer", format: "int64", minimum: 0 } } } }, factoryIds: { type: "array", items: { type: "integer", format: "int64", minimum: 1 } }, donationFactoryIds: { type: "array", items: { type: "integer", format: "int64", minimum: 1 } }, id: { type: "integer", format: "int64", minimum: 1 }, name: { type: "string", minLength: 1, maxLength: 64 }, land: { type: "integer", minimum: 0 }, country: { type: "integer", minimum: 0 }, ceoPid: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, totalShares: { type: "integer", format: "int64", minimum: 1 }, statute: { type: "string" }, issuanceRemaining: { type: "integer", format: "int64", minimum: 0 }, issuancePrice: { type: "integer", format: "int64", minimum: 0 }, splitEligible: { type: "boolean" }, shareholderCount: { type: "integer", format: "int64", minimum: 1 }, createdAt: { type: "string", format: "date-time" } } } } }, responseFields: ["inventory", "walletBalances", "fxOffersGoldValue", "dailyTurnover", "factoryAssets", "factoryIds", "donationFactoryIds", "id", "name", "land", "country", "ceoPid", "totalShares", "statute", "issuanceRemaining", "issuancePrice", "splitEligible", "shareholderCount", "createdAt"] },
15250
15250
  { operationId: "GetStockCompany", name: "get-stock-company", method: "GET", path: "/api/stock-companies/{companyId}", spec: "shares.yaml", write: false, retry: "unsafe", description: "Public. Read the stock company profile.", parameters: [{ name: "companyId", in: "path", required: true, schema: { type: "integer", format: "int64", minimum: 1 } }], requiresCredentials: false, responses: { "200": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["id", "name", "land", "country", "totalShares", "statute", "issuanceRemaining", "issuancePrice", "splitEligible", "shareholderCount", "createdAt"], properties: { inventory: { type: "array", description: "Positive stock balances owned directly by this stock company, returned on detail reads.", items: { type: "object", additionalProperties: false, required: ["item", "quality", "quantity"], properties: { item: { type: "string" }, quality: { type: "integer", minimum: 0 }, quantity: { type: "integer", format: "int64", minimum: 1 } } } }, walletBalances: { type: "array", description: "Company-owned wallet amounts in minor units, including pending credits, returned on detail reads.", items: { type: "object", additionalProperties: false, required: ["asset", "amount"], properties: { asset: { type: "integer", minimum: 0, description: "Gold is zero. A national currency is its country ID plus one." }, amount: { type: "string", pattern: "^[0-9]+$" } } } }, fxOffersGoldValue: { type: "string", pattern: "^[0-9]+$", description: "Remaining company FX offers valued in minor Gold units when every offer sells Gold." }, dailyTurnover: { type: "string", pattern: "^[0-9]+$", description: "Current game-day share turnover in minor gold units, included in the detail response. Newly committed trades appear after projection." }, factoryAssets: { type: "array", description: "Factories and their asset values in Gold minor units, included on detail reads.", items: { type: "object", additionalProperties: false, required: ["id", "name", "level", "value"], properties: { id: { type: "integer", format: "int64", minimum: 1 }, name: { type: "string" }, level: { type: "integer", minimum: 0 }, value: { type: "integer", format: "int64", minimum: 0 } } } }, factoryIds: { type: "array", items: { type: "integer", format: "int64", minimum: 1 } }, donationFactoryIds: { type: "array", items: { type: "integer", format: "int64", minimum: 1 } }, id: { type: "integer", format: "int64", minimum: 1 }, name: { type: "string", minLength: 1, maxLength: 64 }, land: { type: "integer", minimum: 0 }, country: { type: "integer", minimum: 0 }, ceoPid: { type: "string", pattern: "^[1-9][0-9]*$", description: "Decimal encoding of the citizen ID." }, totalShares: { type: "integer", format: "int64", minimum: 1 }, statute: { type: "string" }, issuanceRemaining: { type: "integer", format: "int64", minimum: 0 }, issuancePrice: { type: "integer", format: "int64", minimum: 0 }, splitEligible: { type: "boolean" }, shareholderCount: { type: "integer", format: "int64", minimum: 1 }, createdAt: { type: "string", format: "date-time" } } } } }, responseFields: ["inventory", "walletBalances", "fxOffersGoldValue", "dailyTurnover", "factoryAssets", "factoryIds", "donationFactoryIds", "id", "name", "land", "country", "ceoPid", "totalShares", "statute", "issuanceRemaining", "issuancePrice", "splitEligible", "shareholderCount", "createdAt"] },
15251
15251
  { operationId: "ContributeStockCompanyGold", name: "contribute-stock-company-gold", method: "POST", path: "/api/stock-companies/{companyId}/contributions", spec: "shares.yaml", write: true, retry: "unsafe", description: "Citizen session required. Transfer Gold or a national currency from the citizen to the company wallet. Insufficient funds returns insufficient_funds.", parameters: [{ name: "companyId", in: "path", required: true, schema: { type: "integer", format: "int64", minimum: 1 } }, { name: "Origin", in: "header", required: true, description: "Same origin as the application.", schema: { type: "string" } }], body: { required: true, schema: { type: "object", additionalProperties: false, required: ["asset", "amount"], properties: { asset: { type: "string", pattern: "^(gold|cur:(0|[1-9][0-9]*))$" }, reason: { type: "string", maxLength: 100 }, amount: { type: "integer", format: "int64", minimum: 1, maximum: 1000000000000 } } } }, requiresCredentials: true, responses: { "201": { kind: "json", schema: { type: "object", additionalProperties: false, required: ["companyId", "asset", "amount", "occurredAt"], properties: { companyId: { type: "integer", format: "int64", minimum: 1 }, asset: { type: "string", pattern: "^(gold|cur:(0|[1-9][0-9]*))$" }, reason: { type: "string", maxLength: 100 }, amount: { type: "integer", format: "int64", minimum: 1, maximum: 1000000000000 }, occurredAt: { type: "string", format: "date-time" } } } } }, responseFields: ["companyId", "asset", "reason", "amount", "occurredAt"] },
@@ -15523,7 +15523,10 @@ async function read(operation, input, options) {
15523
15523
  const secret = credentials?.token ?? credentials?.cookie?.slice("citizen=".length);
15524
15524
  const code = problem.success && !(secret && (secret.includes(problem.data.code) || problem.data.code.includes(secret))) ? problem.data.code : `http_${response.status}`;
15525
15525
  const clientError = response.status >= 400 && response.status < 500;
15526
- const message = problem.success ? [problem.data.detail, problem.data.title].find((text) => text?.trim() && text.length <= 240 && !/[\r\n]/.test(text) && !(secret && text.includes(secret))) : undefined;
15526
+ const context = problem.success ? problem.data.context : undefined;
15527
+ const { minLength, maxLength } = context ?? {};
15528
+ const searchMessage = code === "invalid_stock_company_search" && typeof minLength === "number" && typeof maxLength === "number" ? `Enter ${minLength}–${maxLength} characters to search for a stock company.` : undefined;
15529
+ const message = searchMessage ?? (problem.success ? [problem.data.detail, problem.data.title].find((text) => text?.trim() && text.length <= 240 && !/[\r\n]/.test(text) && !(secret && text.includes(secret))) : undefined);
15527
15530
  const retry = response.headers.get("Retry-After");
15528
15531
  const retryInSec = problem.success && problem.data.retryInSec !== undefined ? problem.data.retryInSec : retry && /^\d{1,8}$/.test(retry) ? Number(retry) : undefined;
15529
15532
  const hint = response.status === 401 || response.status === 403 ? "Check the credentials and their access, then retry." : response.status === 404 ? "Check the identifier and try again." : response.status === 429 ? "Wait before retrying." : clientError ? "Check the command arguments with --help." : operation.write && operation.retry === "unsafe" ? "Confirm the result before attempting the write again." : "Check the API and retry shortly.";
@@ -38078,7 +38081,7 @@ function saveCredentials(store, credentials) {
38078
38081
  }
38079
38082
 
38080
38083
  // version.ts
38081
- var version2 = "2026.1201.201";
38084
+ var version2 = "2026.1201.203";
38082
38085
  var installKind = version2 === "dev" ? "source" : typeof ESIM_CLI_EXECUTABLE === "boolean" && ESIM_CLI_EXECUTABLE ? "executable" : "npm";
38083
38086
  var npmLatestUrl = "https://registry.npmjs.org/esim-cli/latest";
38084
38087
  var releaseVersion = /^\d+\.\d+\.\d+$/;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esim-cli",
3
- "version": "2026.1201.201",
3
+ "version": "2026.1201.203",
4
4
  "description": "Command-line client and agent project for Open E-Sim",
5
5
  "type": "module",
6
6
  "license": "MIT",