@skrr-ai/cli 0.1.132 → 0.1.133
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/commands/agenda/plan.d.ts +4 -4
- package/dist/commands/agenda/plan.js +121 -9
- package/dist/commands/agent/message/send.js +4 -0
- package/dist/commands/agents/intuitions/generate.js +25 -6
- package/dist/commands/agents/intuitions/list.js +7 -2
- package/dist/commands/agents/spawn.js +6 -0
- package/dist/commands/agents/todos/edit.d.ts +14 -0
- package/dist/commands/agents/todos/edit.js +43 -0
- package/dist/commands/agents/triggers/fire.d.ts +2 -2
- package/dist/commands/agents/triggers/fire.js +20 -3
- package/dist/commands/agents/triggers/policy.d.ts +6 -0
- package/dist/commands/agents/triggers/policy.js +22 -0
- package/dist/commands/goals/briefing/enable.js +1 -2
- package/dist/commands/goals/briefing/status.d.ts +8 -0
- package/dist/commands/goals/briefing/status.js +35 -0
- package/dist/commands/memory/list.js +9 -3
- package/dist/lib/schedule.d.ts +6 -0
- package/dist/lib/schedule.js +1 -0
- package/dist/lib/scoped-memory-command.d.ts +10 -0
- package/dist/lib/scoped-memory-command.js +21 -2
- package/dist/node_modules/@skrr-ai/data-provider/index.js +774 -774
- package/oclif.manifest.json +179 -2
- package/package.json +1 -1
|
@@ -7,6 +7,7 @@ exports.memoryNotMountedDiagnostic = memoryNotMountedDiagnostic;
|
|
|
7
7
|
exports.parseMemoryMount = parseMemoryMount;
|
|
8
8
|
exports.parseMountedMemoryStore = parseMountedMemoryStore;
|
|
9
9
|
exports.parseMemoryApiError = parseMemoryApiError;
|
|
10
|
+
exports.uncertainMemoryMutationRecovery = uncertainMemoryMutationRecovery;
|
|
10
11
|
const core_1 = require("@oclif/core");
|
|
11
12
|
const node_crypto_1 = require("node:crypto");
|
|
12
13
|
const base_command_1 = require("../base-command");
|
|
@@ -191,6 +192,23 @@ function parseMemoryApiError(error) {
|
|
|
191
192
|
};
|
|
192
193
|
}
|
|
193
194
|
}
|
|
195
|
+
/** A gateway timeout can arrive after the canonical mutation committed. */
|
|
196
|
+
function uncertainMemoryMutationRecovery(path, options, status) {
|
|
197
|
+
if (status !== 504 || options.method !== 'POST' || !/\/mutations\/[^/?]+$/.test(path))
|
|
198
|
+
return null;
|
|
199
|
+
const body = options.body;
|
|
200
|
+
if (!body || body.dryRun === true || typeof body.idempotencyKey !== 'string' || typeof body.targetStoreId !== 'string')
|
|
201
|
+
return null;
|
|
202
|
+
return {
|
|
203
|
+
message: `The write may have been saved. Inspect the canonical Store with skrr memory topics list using the same --agent and --store ${body.targetStoreId}${body.spaceId ? ' and --space ' + body.spaceId : ''}. If retrying the identical operation, use --idempotency-key ${body.idempotencyKey}.`,
|
|
204
|
+
details: {
|
|
205
|
+
outcome: 'unknown',
|
|
206
|
+
targetStoreId: body.targetStoreId,
|
|
207
|
+
idempotencyKey: body.idempotencyKey,
|
|
208
|
+
...(typeof body.spaceId === 'string' ? { spaceId: body.spaceId } : {}),
|
|
209
|
+
},
|
|
210
|
+
};
|
|
211
|
+
}
|
|
194
212
|
class ScopedMemoryCommand extends base_command_1.BaseCommand {
|
|
195
213
|
endpoint(agentId, suffix = '') {
|
|
196
214
|
return `/api/agents/${encodeURIComponent(agentId)}/memories/workspace${suffix}`;
|
|
@@ -229,13 +247,14 @@ class ScopedMemoryCommand extends base_command_1.BaseCommand {
|
|
|
229
247
|
catch (error) {
|
|
230
248
|
if (error instanceof api_fetch_1.ApiFetchError) {
|
|
231
249
|
const parsed = parseMemoryApiError(error);
|
|
250
|
+
const recovery = uncertainMemoryMutationRecovery(path, options, error.status);
|
|
232
251
|
this.failWithCliError({
|
|
233
|
-
message: `${parsed.code}: ${parsed.message}`,
|
|
252
|
+
message: `${parsed.code}: ${parsed.message}${recovery ? ` ${recovery.message}` : ''}`,
|
|
234
253
|
code: parsed.code,
|
|
235
254
|
status: error.status,
|
|
236
255
|
exit: ERROR_EXITS[parsed.code] || (error.status === 404 ? 4 : error.status === 403 ? 5 : 2),
|
|
237
256
|
retryable: parsed.retryable,
|
|
238
|
-
details: parsed.details,
|
|
257
|
+
details: recovery ? { ...parsed.details, ...recovery.details } : parsed.details,
|
|
239
258
|
});
|
|
240
259
|
}
|
|
241
260
|
this.handleApiError(error);
|