@convilyn/sdk-author 0.8.0 → 0.9.0

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/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { VERSION, allChecksPassed, serve, runComplianceChecks, ConvilynClient, ConvilynApiError, WorkflowSpec } from './chunk-RUBSAKX7.js';
2
+ import { VERSION, allChecksPassed, serve, runComplianceChecks, ConvilynClient, ConvilynApiError, WorkflowSpec } from './chunk-3TXBARBR.js';
3
3
  import { Command } from 'commander';
4
4
  import { mkdir, writeFile, stat, readdir } from 'fs/promises';
5
5
  import { resolve, join, extname } from 'path';
package/dist/index.cjs CHANGED
@@ -6,7 +6,7 @@ var zodToJsonSchema = require('zod-to-json-schema');
6
6
  var http = require('http');
7
7
 
8
8
  // src/version.ts
9
- var VERSION = "0.8.0";
9
+ var VERSION = "0.9.0";
10
10
  var MANIFEST_SDK_VERSION = "1.0.0";
11
11
 
12
12
  // src/errors.ts
@@ -1458,14 +1458,30 @@ var ConvilynClient = class {
1458
1458
  * key. No auth required. The returned key is captured on this client for
1459
1459
  * subsequent calls (and returned so the caller can persist it — it is shown
1460
1460
  * only once).
1461
+ *
1462
+ * A 503 with code `REGISTRATION_STORE_UNAVAILABLE` means the platform's
1463
+ * registration store is temporarily unreachable — it is NOT a problem with
1464
+ * your request; retry in a few minutes. The error message spells this out.
1461
1465
  */
1462
1466
  async register(request) {
1463
- const result = await this.#request(
1464
- "POST",
1465
- "/developers/register",
1466
- request,
1467
- false
1468
- );
1467
+ let result;
1468
+ try {
1469
+ result = await this.#request(
1470
+ "POST",
1471
+ "/developers/register",
1472
+ request,
1473
+ false
1474
+ );
1475
+ } catch (error) {
1476
+ if (error instanceof ConvilynApiError && error.status === 503 && extractErrorCode(error.body) === "REGISTRATION_STORE_UNAVAILABLE") {
1477
+ throw new ConvilynApiError(
1478
+ 503,
1479
+ "Developer registration is temporarily unavailable (registration store unreachable). This is not a problem with your request \u2014 retry in a few minutes. [REGISTRATION_STORE_UNAVAILABLE]",
1480
+ error.body
1481
+ );
1482
+ }
1483
+ throw error;
1484
+ }
1469
1485
  if (result.api_key && !this.#apiKey) {
1470
1486
  this.#apiKey = result.api_key;
1471
1487
  }
@@ -1500,9 +1516,17 @@ var ConvilynClient = class {
1500
1516
  await this.#request("DELETE", `/developers/servers/${encodeURIComponent(serverId)}`);
1501
1517
  }
1502
1518
  // ── Workflow operations ─────────────────────────────────────────
1503
- /** `POST /developers/workflows` — submit a compiled workflow spec + its server ids. */
1519
+ /**
1520
+ * `POST /developers/workflows` — submit a compiled workflow spec + its
1521
+ * server ids. `server_ids` may be omitted for a server-less spec that uses
1522
+ * only platform built-in tools; the wire always carries an explicit array
1523
+ * (parity with the Python SDK's `list(server_ids)`).
1524
+ */
1504
1525
  async submitWorkflow(request) {
1505
- return this.#request("POST", "/developers/workflows", request);
1526
+ return this.#request("POST", "/developers/workflows", {
1527
+ workflow_spec: request.workflow_spec,
1528
+ server_ids: request.server_ids ?? []
1529
+ });
1506
1530
  }
1507
1531
  /** `GET /developers/workflows` — list this developer's workflows. */
1508
1532
  async listWorkflows() {
@@ -1579,6 +1603,23 @@ var ConvilynClient = class {
1579
1603
  return [];
1580
1604
  }
1581
1605
  };
1606
+ function extractErrorCode(body) {
1607
+ if (typeof body !== "object" || body === null) {
1608
+ return null;
1609
+ }
1610
+ const record = body;
1611
+ if (typeof record.code === "string") {
1612
+ return record.code;
1613
+ }
1614
+ const detail = record.detail;
1615
+ if (typeof detail === "object" && detail !== null) {
1616
+ const code = detail.code;
1617
+ if (typeof code === "string") {
1618
+ return code;
1619
+ }
1620
+ }
1621
+ return null;
1622
+ }
1582
1623
 
1583
1624
  // src/harness.ts
1584
1625
  async function invokeTool(server, toolName, args = {}, options = {}) {