@commercelayer/agent-cli 1.0.0-dev.17 → 1.0.0-dev.18
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/builtins/loops.js +6 -6
- package/dist/engine.js +2 -1
- package/package.json +1 -1
package/dist/builtins/loops.js
CHANGED
|
@@ -33,12 +33,12 @@ export const loops = {
|
|
|
33
33
|
description: 'Loops: a skill on a schedule, under a policy written in advance. Definitions are in loops.yml in the project folder; each pass is one c11r loops run.',
|
|
34
34
|
id: { accepts: ['name'], example: 'orders-15m' },
|
|
35
35
|
verbs: [
|
|
36
|
-
{ verb: 'list', method: 'GET', state: 'none', effect: 'Lists the loops of loops.yml.' },
|
|
37
|
-
{ verb: 'get', method: 'GET', path: '/v1/loops/{id}', state: 'none', effect: 'Returns a loop from loops.yml, with its last pass when the organization has run it.' },
|
|
38
|
-
{ verb: 'create', method: 'POST', path: '/v1/loops/{id}', state: 'none', body: policyFlags(true), effect: 'Adds a loop to loops.yml, after checking its policy against the skill noun\'s schema. Nothing runs until a pass.' },
|
|
39
|
-
{ verb: 'update', method: 'PATCH', path: '/v1/loops/{id}', state: 'none', body: policyFlags(false), effect: 'Changes a loop in loops.yml. A flag given replaces what is there: --allow replaces the whole list.' },
|
|
40
|
-
{ verb: 'delete', method: 'DELETE', path: '/v1/loops/{id}', state: 'none', destructive: true, deletes: true, effect: 'Removes a loop from loops.yml, and its cursor from the organization.' },
|
|
41
|
-
{ verb: 'run', method: 'POST', path: '/v1/loops/{id}/run', effect: 'One pass: what is waiting since the last pass, and the actions the policy allows. Answers done, waiting (new: true for what appeared since the last pass) and failed. With --dry-run nothing changes and the last pass time stays.' },
|
|
36
|
+
{ verb: 'list', live: false, method: 'GET', state: 'none', effect: 'Lists the loops of loops.yml.' },
|
|
37
|
+
{ verb: 'get', live: false, method: 'GET', path: '/v1/loops/{id}', state: 'none', effect: 'Returns a loop from loops.yml, with its last pass when the organization has run it.' },
|
|
38
|
+
{ verb: 'create', live: false, method: 'POST', path: '/v1/loops/{id}', state: 'none', body: policyFlags(true), effect: 'Adds a loop to loops.yml, after checking its policy against the skill noun\'s schema. Nothing runs until a pass.' },
|
|
39
|
+
{ verb: 'update', live: false, method: 'PATCH', path: '/v1/loops/{id}', state: 'none', body: policyFlags(false), effect: 'Changes a loop in loops.yml. A flag given replaces what is there: --allow replaces the whole list.' },
|
|
40
|
+
{ verb: 'delete', live: false, method: 'DELETE', path: '/v1/loops/{id}', state: 'none', destructive: true, deletes: true, effect: 'Removes a loop from loops.yml, and its cursor from the organization.' },
|
|
41
|
+
{ verb: 'run', live: false, method: 'POST', path: '/v1/loops/{id}/run', effect: 'One pass: what is waiting since the last pass, and the actions the policy allows. Answers done, waiting (new: true for what appeared since the last pass) and failed. With --dry-run nothing changes and the last pass time stays.' },
|
|
42
42
|
],
|
|
43
43
|
}),
|
|
44
44
|
async run(run) {
|
package/dist/engine.js
CHANGED
|
@@ -169,8 +169,9 @@ async function executeOnce(argv, opts) {
|
|
|
169
169
|
// The API's own confirmation, in live: as it is with no terminal; asked with its words in one.
|
|
170
170
|
if (apiAsks && !confirmed && e instanceof CliError && e.code === 'confirmation_required') {
|
|
171
171
|
const p = opts.prompter ?? terminal;
|
|
172
|
+
// Without a command of the API's, the next step is this one again, without --yes.
|
|
172
173
|
if (!p.interactive)
|
|
173
|
-
throw e;
|
|
174
|
+
throw e.body.next_step?.command ? e : new CliError({ ...e.body, next_step: { action: 'fix_request', command: line, url: null } }, e.kind, e.state);
|
|
174
175
|
await confirm(e.body.message, line, { yes: false, prompter: p, sentence: e.body.message });
|
|
175
176
|
confirmed = true;
|
|
176
177
|
return sendOnce(req);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercelayer/agent-cli",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
3
|
+
"version": "1.0.0-dev.18",
|
|
4
4
|
"description": "c11r: the Commerce Layer CLI for coding agents. One grammar, c11r <noun> <verb>, from a sandbox to a running organization.",
|
|
5
5
|
"homepage": "https://commercelayer.ai",
|
|
6
6
|
"keywords": [
|