@easysociable/cli 0.1.27 → 0.1.29
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/easysociable.js +29 -9
- package/dist/easysociable.js.map +1 -1
- package/package.json +1 -1
package/dist/easysociable.js
CHANGED
|
@@ -20573,11 +20573,20 @@ function withAuthoringStudioUrl(draft, studioBaseUrl) {
|
|
|
20573
20573
|
};
|
|
20574
20574
|
}
|
|
20575
20575
|
function parseDataEnvelope(payload, dataSchema) {
|
|
20576
|
-
const
|
|
20577
|
-
|
|
20578
|
-
|
|
20579
|
-
|
|
20580
|
-
|
|
20576
|
+
const schema = external_exports.object({ ok: external_exports.boolean().optional(), data: dataSchema });
|
|
20577
|
+
const at = (root, path) => path.reduce((node2, key) => node2?.[key], root);
|
|
20578
|
+
let value = payload;
|
|
20579
|
+
for (let pass = 0; ; pass += 1) {
|
|
20580
|
+
const result = schema.safeParse(value);
|
|
20581
|
+
if (result.success) return result.data.data;
|
|
20582
|
+
const fixable = pass < 8 && result.error.issues.every((issue2) => issue2.code === "unrecognized_keys" || issue2.code === "invalid_type" && issue2.path.length > 0 && at(value, issue2.path) === null);
|
|
20583
|
+
if (!fixable) throw result.error;
|
|
20584
|
+
if (pass === 0) value = structuredClone(payload);
|
|
20585
|
+
for (const issue2 of result.error.issues) {
|
|
20586
|
+
if (issue2.code === "unrecognized_keys") for (const key of issue2.keys) delete at(value, issue2.path)[key];
|
|
20587
|
+
else delete at(value, issue2.path.slice(0, -1))[issue2.path.at(-1)];
|
|
20588
|
+
}
|
|
20589
|
+
}
|
|
20581
20590
|
}
|
|
20582
20591
|
function parseTemplateSummaryList(payload) {
|
|
20583
20592
|
assertNoPrivateTemplateFields(payload);
|
|
@@ -22178,7 +22187,7 @@ var init_client = __esm({
|
|
|
22178
22187
|
suggestedAction: "Run `easysociable auth login` (browser approval) or set EASYSOCIABLE_ALLOW_ENV_CREDENTIALS=true for local tests"
|
|
22179
22188
|
});
|
|
22180
22189
|
}
|
|
22181
|
-
const maxRetries = this.options.maxRetries ??
|
|
22190
|
+
const maxRetries = this.options.maxRetries ?? 3;
|
|
22182
22191
|
const baseDelay = this.options.retryBaseDelayMs ?? 250;
|
|
22183
22192
|
let attempt = 0;
|
|
22184
22193
|
while (true) {
|
|
@@ -22190,7 +22199,15 @@ var init_client = __esm({
|
|
|
22190
22199
|
const idempotency = extras?.idempotencyKey ?? this.options.idempotencyKey;
|
|
22191
22200
|
if (idempotency)
|
|
22192
22201
|
headers["idempotency-key"] = idempotency;
|
|
22193
|
-
|
|
22202
|
+
let response;
|
|
22203
|
+
try {
|
|
22204
|
+
response = await this.options.transport.request({ method, path, headers, body });
|
|
22205
|
+
} catch (error62) {
|
|
22206
|
+
if (attempt >= maxRetries || method !== "GET" && !idempotency) throw error62;
|
|
22207
|
+
attempt += 1;
|
|
22208
|
+
await sleep(baseDelay * 2 ** (attempt - 1));
|
|
22209
|
+
continue;
|
|
22210
|
+
}
|
|
22194
22211
|
try {
|
|
22195
22212
|
assertNoPrivateTemplateFields(response.json);
|
|
22196
22213
|
} catch {
|
|
@@ -35608,8 +35625,11 @@ async function applyInstallation(options) {
|
|
|
35608
35625
|
}
|
|
35609
35626
|
await installHostConfig({ host: host.host, dataDir: "", configPath: host.configPath });
|
|
35610
35627
|
await mkdir(host.skillsPath, { recursive: true, mode: 448 });
|
|
35611
|
-
for (const skill of resolveInstallSkillIds(options))
|
|
35612
|
-
|
|
35628
|
+
for (const skill of resolveInstallSkillIds(options)) {
|
|
35629
|
+
const target = join4(host.skillsPath, skill);
|
|
35630
|
+
await rm(target, { recursive: true, force: true });
|
|
35631
|
+
await cp(join4(String(plan.source), skill), target, { recursive: true });
|
|
35632
|
+
}
|
|
35613
35633
|
}
|
|
35614
35634
|
if (options.json !== true) {
|
|
35615
35635
|
process.stdout.write(`Installed skills your Agent will use:
|