@awak-app/simy-cli 0.5.50 → 0.5.52
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/package.json +1 -1
- package/src/agent.js +4 -1
- package/src/cli-contract.js +1 -1
package/package.json
CHANGED
package/src/agent.js
CHANGED
|
@@ -445,6 +445,7 @@ export async function startAgent({
|
|
|
445
445
|
if (session !== requestedSession) return;
|
|
446
446
|
organizationItems = payload.organizations.filter(org => typeof org.id === "string" && typeof org.name === "string")
|
|
447
447
|
.slice(0, 100).map(org => ({ id: org.id, name: org.name.slice(0, 120),
|
|
448
|
+
...(["ready", "sqm_required", "developer_required", "unavailable"].includes(org.desktopAccess) ? { desktopAccess: org.desktopAccess } : {}),
|
|
448
449
|
...(typeof org.slug === 'string' && org.slug && org.slug.length <= 160 && !/[\/\\?#\x00-\x1f]/.test(org.slug) ? { slug: org.slug } : {}) }));
|
|
449
450
|
organizationState = "ready";
|
|
450
451
|
} catch {
|
|
@@ -458,7 +459,9 @@ export async function startAgent({
|
|
|
458
459
|
if (organizationId) {
|
|
459
460
|
if (!isSessionValid(session, Date.now(), apiOrigin)) throw new Error("Sign in before switching organizations.");
|
|
460
461
|
if (organizationState !== "ready" || !organizationItems.some(org => org.id === organizationId)) throw new Error("Refresh the organization list before selecting an organization.");
|
|
461
|
-
|
|
462
|
+
const choice = organizationItems.find(org => org.id === organizationId);
|
|
463
|
+
if (choice.desktopAccess && choice.desktopAccess !== "ready") throw new Error("This organization does not have SIMY Developer access.");
|
|
464
|
+
organizationSlug = choice.slug;
|
|
462
465
|
if (!organizationSlug) throw new Error('Refresh organizations before switching; its verified slug is unavailable.');
|
|
463
466
|
if (organizationBusy()) throw Object.assign(new Error("Wait for running tasks to finish before switching organizations."), { code: "desktop_organization_busy" });
|
|
464
467
|
authNonce = randomBytes(16).toString("base64url");
|
package/src/cli-contract.js
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "./durable-local-task-steps-contract.js";
|
|
14
14
|
import { buildExecutionCapabilityContract } from "./execution-capability-contract.js";
|
|
15
15
|
|
|
16
|
-
export const CLI_VERSION = "0.5.
|
|
16
|
+
export const CLI_VERSION = "0.5.52";
|
|
17
17
|
export const CLI_API_CONTRACT_VERSION = 10;
|
|
18
18
|
|
|
19
19
|
export function withCliContract(
|