@syntropic137/cli 0.20.1 → 0.20.2
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/syn.js +17 -10
- package/package.json +1 -1
package/dist/syn.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// src/config.ts
|
|
4
4
|
var CLI_NAME = "syn";
|
|
5
5
|
var CLI_DESCRIPTION = "Syntropic137 - Event-sourced workflow engine for AI agents";
|
|
6
|
-
var CLI_VERSION = true ? "0.20.
|
|
6
|
+
var CLI_VERSION = true ? "0.20.2" : "0.0.0-dev";
|
|
7
7
|
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
8
8
|
var SSE_CONNECT_TIMEOUT_MS = 5e3;
|
|
9
9
|
function getApiUrl() {
|
|
@@ -219,7 +219,7 @@ async function apiPost(path8, options) {
|
|
|
219
219
|
const { status, data } = await safeRequest(
|
|
220
220
|
() => client.post(path8, options?.body, options?.params)
|
|
221
221
|
);
|
|
222
|
-
checkResponse(status, data, options?.expected ?? [200]);
|
|
222
|
+
checkResponse(status, data, options?.expected ?? [200, 201]);
|
|
223
223
|
return data;
|
|
224
224
|
}
|
|
225
225
|
async function apiPut(path8, options) {
|
|
@@ -2491,7 +2491,7 @@ var createCommand2 = {
|
|
|
2491
2491
|
description: "Create a new artifact",
|
|
2492
2492
|
options: {
|
|
2493
2493
|
workflow: { type: "string", short: "w", description: "Workflow ID" },
|
|
2494
|
-
type: { type: "string", short: "t", description: "Artifact type (code,
|
|
2494
|
+
type: { type: "string", short: "t", description: "Artifact type (code, markdown, text, json, yaml, research_summary, plan, other)" },
|
|
2495
2495
|
title: { type: "string", description: "Artifact title" },
|
|
2496
2496
|
content: { type: "string", short: "c", description: "Artifact content" },
|
|
2497
2497
|
phase: { type: "string", short: "p", description: "Phase ID" }
|
|
@@ -2755,6 +2755,10 @@ var metadataCommand = {
|
|
|
2755
2755
|
throw new CLIError("Missing argument", 1);
|
|
2756
2756
|
}
|
|
2757
2757
|
const m = await apiGet(`/conversations/${sessionId}/metadata`);
|
|
2758
|
+
if (!m || !m.session_id) {
|
|
2759
|
+
printError("Session not found or no metadata available.");
|
|
2760
|
+
throw new CLIError("Not found", 1);
|
|
2761
|
+
}
|
|
2758
2762
|
print(`${style("Metadata:", BOLD)} ${m.session_id}`);
|
|
2759
2763
|
if (m.model != null) print(` Model: ${m.model}`);
|
|
2760
2764
|
if (m.event_count != null) print(` Events: ${m.event_count.toLocaleString()}`);
|
|
@@ -3545,11 +3549,14 @@ var registerCommand = {
|
|
|
3545
3549
|
printError("Missing --url");
|
|
3546
3550
|
throw new CLIError("Missing option", 1);
|
|
3547
3551
|
}
|
|
3548
|
-
const body = { repo_url: url };
|
|
3549
|
-
const system = parsed.values["system"];
|
|
3550
3552
|
const org = parsed.values["org"];
|
|
3553
|
+
if (!org) {
|
|
3554
|
+
printError("Missing --org");
|
|
3555
|
+
throw new CLIError("Missing option", 1);
|
|
3556
|
+
}
|
|
3557
|
+
const body = { full_name: url, organization_id: org };
|
|
3558
|
+
const system = parsed.values["system"];
|
|
3551
3559
|
if (system) body["system_id"] = system;
|
|
3552
|
-
if (org) body["organization_id"] = org;
|
|
3553
3560
|
const d = await apiPost("/repos", { body, expected: [200, 201] });
|
|
3554
3561
|
printSuccess(`Repository registered: ${d["repo_id"] ?? ""}`);
|
|
3555
3562
|
print(` Name: ${d["full_name"] ?? url}`);
|
|
@@ -4187,8 +4194,8 @@ function reqId4(parsed) {
|
|
|
4187
4194
|
function parseConditions(condStrs) {
|
|
4188
4195
|
return condStrs.map((c) => {
|
|
4189
4196
|
const eqIdx = c.indexOf("=");
|
|
4190
|
-
if (eqIdx < 1) throw new CLIError(`Invalid condition format: ${c} (expected
|
|
4191
|
-
return {
|
|
4197
|
+
if (eqIdx < 1) throw new CLIError(`Invalid condition format: ${c} (expected field=value)`, 1);
|
|
4198
|
+
return { field: c.slice(0, eqIdx), operator: "eq", value: c.slice(eqIdx + 1) };
|
|
4192
4199
|
});
|
|
4193
4200
|
}
|
|
4194
4201
|
var registerCommand2 = {
|
|
@@ -4198,7 +4205,7 @@ var registerCommand2 = {
|
|
|
4198
4205
|
repo: { type: "string", short: "r", description: "Repository ID" },
|
|
4199
4206
|
workflow: { type: "string", short: "w", description: "Workflow ID to execute" },
|
|
4200
4207
|
event: { type: "string", short: "e", description: "GitHub event type (e.g. check_run.completed)" },
|
|
4201
|
-
condition: { type: "string", short: "c", multiple: true, description: "Condition as
|
|
4208
|
+
condition: { type: "string", short: "c", multiple: true, description: "Condition as field=value (repeatable, uses 'eq' operator)" },
|
|
4202
4209
|
"max-fires": { type: "string", description: "Maximum fires per period", default: "5" },
|
|
4203
4210
|
cooldown: { type: "string", description: "Cooldown in seconds", default: "300" },
|
|
4204
4211
|
budget: { type: "string", description: "Budget limit in USD" }
|
|
@@ -4315,7 +4322,7 @@ var showCommand11 = {
|
|
|
4315
4322
|
if (conditions.length > 0) {
|
|
4316
4323
|
print(style(" Conditions:", BOLD));
|
|
4317
4324
|
for (const c of conditions) {
|
|
4318
|
-
print(` ${c["
|
|
4325
|
+
print(` ${c["field"] ?? ""} = ${c["value"] ?? ""}`);
|
|
4319
4326
|
}
|
|
4320
4327
|
}
|
|
4321
4328
|
}
|