synomem 0.6.9 → 0.6.11
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/backend.d.ts.map +1 -1
- package/dist/backend.js +1 -0
- package/dist/backend.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +47 -43
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +4 -0
- package/dist/client.js.map +1 -1
- package/dist/remote.d.ts +12 -0
- package/dist/remote.d.ts.map +1 -1
- package/dist/remote.js +9 -4
- package/dist/remote.js.map +1 -1
- package/dist/types.d.ts +9 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/backend.ts +1 -0
- package/src/cli.ts +152 -91
- package/src/client.ts +2 -0
- package/src/remote.ts +20 -4
- package/src/types.ts +10 -1
package/dist/backend.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAS5C,OAAO,EAAiC,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGlF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAEV,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACd,MAAM,YAAY,CAAC;AAkBpB,wBAAgB,iBAAiB,CAC/B,YAAY,CAAC,EAAE,MAAM,EACrB,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,aAAa,GAAG,SAAS,CAQ3B;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,oBAAoB,EAC7B,YAAY,CAAC,EAAE,MAAM,GACpB,aAAa,CAef;AAED,wBAAgB,uBAAuB,CACrC,OAAO,GAAE,oBAAyB,EAClC,GAAG,GAAE,MAAM,CAAC,UAAwB,
|
|
1
|
+
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAS5C,OAAO,EAAiC,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGlF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAEV,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACd,MAAM,YAAY,CAAC;AAkBpB,wBAAgB,iBAAiB,CAC/B,YAAY,CAAC,EAAE,MAAM,EACrB,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,aAAa,GAAG,SAAS,CAQ3B;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,oBAAoB,EAC7B,YAAY,CAAC,EAAE,MAAM,GACpB,aAAa,CAef;AAED,wBAAgB,uBAAuB,CACrC,OAAO,GAAE,oBAAyB,EAClC,GAAG,GAAE,MAAM,CAAC,UAAwB,wCAsBrC;AAED,eAAO,MAAM,wBAAwB,EAAE,qBACL,CAAC"}
|
package/dist/backend.js
CHANGED
|
@@ -60,6 +60,7 @@ export function createConfiguredService(options = {}, env = process.env) {
|
|
|
60
60
|
? environmentCredentialProvider(env)
|
|
61
61
|
: new StoredCredentialProvider(credentialReference(backend.baseUrl, backend.workspaceId, expectedActor), new OsCredentialStore(), env, fetch, resolveHome(options.home)),
|
|
62
62
|
...(options.signal ? { signal: options.signal } : {}),
|
|
63
|
+
...(options.assertActor !== undefined ? { assertActor: options.assertActor } : {}),
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
66
|
export const configuredServiceFactory = (options) => createConfiguredService(options);
|
package/dist/backend.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend.js","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACtE,O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,8 +180,12 @@ function commandPath(command) {
|
|
|
180
180
|
* rather than a local one to act in.
|
|
181
181
|
*/
|
|
182
182
|
const CONFIGURES_BACKEND = new Set(['config init', 'backend use', 'remote import']);
|
|
183
|
-
async function withService(serviceFactory, home, configuredActor, operation) {
|
|
184
|
-
const client = serviceFactory({
|
|
183
|
+
async function withService(serviceFactory, home, configuredActor, operation, assertActor) {
|
|
184
|
+
const client = serviceFactory({
|
|
185
|
+
...(home ? { home } : {}),
|
|
186
|
+
actor: configuredActor,
|
|
187
|
+
...(assertActor !== undefined ? { assertActor } : {}),
|
|
188
|
+
});
|
|
185
189
|
await client.init();
|
|
186
190
|
try {
|
|
187
191
|
return await operation(client);
|
|
@@ -315,7 +319,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
315
319
|
}
|
|
316
320
|
});
|
|
317
321
|
const program = new Command();
|
|
318
|
-
const withClient = (home, configuredActor, operation) => withService(serviceFactory, home, configuredActor, operation);
|
|
322
|
+
const withClient = (home, configuredActor, operation, assertActor) => withService(serviceFactory, home, configuredActor, operation, assertActor);
|
|
319
323
|
cliExitCodes.set(program, 0);
|
|
320
324
|
program
|
|
321
325
|
.name('synomem')
|
|
@@ -399,7 +403,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
399
403
|
writeSynomemBackend({ kind: 'local' }, home);
|
|
400
404
|
// Opening it once creates the database, so `list` does not report a
|
|
401
405
|
// workspace that exists in name only.
|
|
402
|
-
await withClient(home, defaultActor(env, 'system', 'cli'), async () => undefined);
|
|
406
|
+
await withClient(home, defaultActor(env, 'system', 'cli', global.actor), async () => undefined);
|
|
403
407
|
output(io, global.json, { name, home }, `Created workspace ${name} at ${home}.\nAct in it with --workspace ${name}.`);
|
|
404
408
|
});
|
|
405
409
|
const remoteCommand = program.command('remote').description('Administer a remote workspace');
|
|
@@ -501,7 +505,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
501
505
|
if (persisted?.backend.kind === 'remote') {
|
|
502
506
|
throw new SynomemError('INVALID_INPUT', 'The init command requires a local backend.');
|
|
503
507
|
}
|
|
504
|
-
await withClient(options.home, defaultActor(env, 'system', 'cli'), async (client) => {
|
|
508
|
+
await withClient(options.home, defaultActor(env, 'system', 'cli', options.actor), async (client) => {
|
|
505
509
|
const info = await client.info();
|
|
506
510
|
if (info.backend !== 'local') {
|
|
507
511
|
throw new SynomemError('INVALID_INPUT', 'The init command requires a local backend.');
|
|
@@ -868,7 +872,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
868
872
|
if (!config) {
|
|
869
873
|
throw new SynomemError('CONFIG_INVALID', 'No Synomem home here yet. Run `synomem config init` first.');
|
|
870
874
|
}
|
|
871
|
-
const result = await withClient(global.home, defaultActor(env, 'system', 'cli'), async (client) => ({
|
|
875
|
+
const result = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), async (client) => ({
|
|
872
876
|
info: await client.info(),
|
|
873
877
|
capabilities: await client.capabilities(),
|
|
874
878
|
diagnostics: (await client.doctor()).diagnostics.filter((item) => item.level === 'error' || item.level === 'warning'),
|
|
@@ -901,7 +905,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
901
905
|
.description('Report whether the generated files match the canonical events')
|
|
902
906
|
.action(async (_options, command) => {
|
|
903
907
|
const global = globals(command);
|
|
904
|
-
const status = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => {
|
|
908
|
+
const status = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => {
|
|
905
909
|
if (!client.projectionStatus) {
|
|
906
910
|
throw new SynomemError('INVALID_INPUT', 'The remote backend keeps no filesystem projections, so there is nothing to report.');
|
|
907
911
|
}
|
|
@@ -1024,7 +1028,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1024
1028
|
.option('--description <text>')
|
|
1025
1029
|
.action(async (handle, options, command) => {
|
|
1026
1030
|
const global = globals(command);
|
|
1027
|
-
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.agents.create({
|
|
1031
|
+
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.agents.create({
|
|
1028
1032
|
handle,
|
|
1029
1033
|
displayName: options.name,
|
|
1030
1034
|
...(options.alias.length ? { aliases: options.alias } : {}),
|
|
@@ -1042,7 +1046,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1042
1046
|
.description('Add aliases, keeping the ones already there')
|
|
1043
1047
|
.action(async (agent, aliases, _options, command) => {
|
|
1044
1048
|
const global = globals(command);
|
|
1045
|
-
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.agents.addAliases(agent, aliases));
|
|
1049
|
+
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.agents.addAliases(agent, aliases));
|
|
1046
1050
|
output(io, global.json, profile, `Aliases: ${(profile.aliases ?? []).join(', ') || 'none'}`);
|
|
1047
1051
|
});
|
|
1048
1052
|
aliasCommand
|
|
@@ -1050,7 +1054,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1050
1054
|
.description('Remove aliases, keeping the rest')
|
|
1051
1055
|
.action(async (agent, aliases, _options, command) => {
|
|
1052
1056
|
const global = globals(command);
|
|
1053
|
-
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.agents.removeAliases(agent, aliases));
|
|
1057
|
+
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.agents.removeAliases(agent, aliases));
|
|
1054
1058
|
output(io, global.json, profile, `Aliases: ${(profile.aliases ?? []).join(', ') || 'none'}`);
|
|
1055
1059
|
});
|
|
1056
1060
|
agentCommand
|
|
@@ -1058,7 +1062,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1058
1062
|
.description('Change an agent handle. Its canonical ID never changes.')
|
|
1059
1063
|
.action(async (agent, handle, _options, command) => {
|
|
1060
1064
|
const global = globals(command);
|
|
1061
|
-
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.agents.update(agent, { handle }));
|
|
1065
|
+
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.agents.update(agent, { handle }));
|
|
1062
1066
|
output(io, global.json, profile, `Handle: ${profile.handle}\nAgent ID: ${profile.id} (unchanged)`);
|
|
1063
1067
|
});
|
|
1064
1068
|
agentCommand
|
|
@@ -1066,7 +1070,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1066
1070
|
.description('Stop an agent acting, keeping its records and history')
|
|
1067
1071
|
.action(async (agent, _options, command) => {
|
|
1068
1072
|
const global = globals(command);
|
|
1069
|
-
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.agents.archive(agent));
|
|
1073
|
+
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.agents.archive(agent));
|
|
1070
1074
|
output(io, global.json, profile, `Archived ${profile.handle} (${profile.id})`);
|
|
1071
1075
|
});
|
|
1072
1076
|
agentCommand
|
|
@@ -1074,7 +1078,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1074
1078
|
.description('Let an archived agent act again')
|
|
1075
1079
|
.action(async (agent, _options, command) => {
|
|
1076
1080
|
const global = globals(command);
|
|
1077
|
-
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.agents.restore(agent));
|
|
1081
|
+
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.agents.restore(agent));
|
|
1078
1082
|
output(io, global.json, profile, `Restored ${profile.handle} (${profile.id})`);
|
|
1079
1083
|
});
|
|
1080
1084
|
const skillCommand = program
|
|
@@ -1099,7 +1103,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1099
1103
|
*/
|
|
1100
1104
|
let agentId;
|
|
1101
1105
|
if (options.agent) {
|
|
1102
|
-
agentId = await withClient(global.home, defaultActor(env, 'system', 'cli'), async (client) => {
|
|
1106
|
+
agentId = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), async (client) => {
|
|
1103
1107
|
const resolution = await client.agents.resolve(options.agent);
|
|
1104
1108
|
if (!resolution.match) {
|
|
1105
1109
|
throw new SynomemError('AGENT_NOT_FOUND', resolution.candidates.length
|
|
@@ -1176,7 +1180,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1176
1180
|
.description('List known agent identities')
|
|
1177
1181
|
.action(async (_options, command) => {
|
|
1178
1182
|
const global = globals(command);
|
|
1179
|
-
const agents = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.agents.list());
|
|
1183
|
+
const agents = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.agents.list());
|
|
1180
1184
|
const human = agents.length
|
|
1181
1185
|
? agents
|
|
1182
1186
|
.map((profile) =>
|
|
@@ -1192,7 +1196,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1192
1196
|
.description('Show one agent profile, resolving aliases')
|
|
1193
1197
|
.action(async (id, _options, command) => {
|
|
1194
1198
|
const global = globals(command);
|
|
1195
|
-
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.agents.get(id));
|
|
1199
|
+
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.agents.get(id));
|
|
1196
1200
|
output(io, global.json, profile, `${profile.displayName}\n\nHandle: ${profile.handle}\nAgent ID: ${profile.id}\nStatus: ${profile.status}\n\n${profile.description ?? 'No description.'}`);
|
|
1197
1201
|
});
|
|
1198
1202
|
agentCommand
|
|
@@ -1205,7 +1209,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1205
1209
|
.action(async (id, options, command) => {
|
|
1206
1210
|
const global = globals(command);
|
|
1207
1211
|
const hasAliases = options.clearAliases || options.alias.length > 0;
|
|
1208
|
-
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.agents.update(id, {
|
|
1212
|
+
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.agents.update(id, {
|
|
1209
1213
|
...(options.name ? { displayName: options.name } : {}),
|
|
1210
1214
|
...(hasAliases ? { aliases: options.clearAliases ? [] : options.alias } : {}),
|
|
1211
1215
|
...(options.description !== undefined ? { description: options.description } : {}),
|
|
@@ -1217,7 +1221,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1217
1221
|
.description('Resolve a name or alias to one agent, or list the candidates')
|
|
1218
1222
|
.action(async (name, _options, command) => {
|
|
1219
1223
|
const global = globals(command);
|
|
1220
|
-
const resolution = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.agents.resolve(name));
|
|
1224
|
+
const resolution = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.agents.resolve(name));
|
|
1221
1225
|
// An ambiguous name is a question, not a failure: exit zero and show the
|
|
1222
1226
|
// candidates so the caller can pick one.
|
|
1223
1227
|
const human = resolution.match
|
|
@@ -1234,7 +1238,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1234
1238
|
.description('List agents with their runtime bindings')
|
|
1235
1239
|
.action(async (_options, command) => {
|
|
1236
1240
|
const global = globals(command);
|
|
1237
|
-
const entries = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.agents.directory());
|
|
1241
|
+
const entries = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.agents.directory());
|
|
1238
1242
|
const human = entries.length
|
|
1239
1243
|
? entries
|
|
1240
1244
|
.map((entry) => {
|
|
@@ -1261,7 +1265,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1261
1265
|
.option('--installation <id>', 'hosted installation this binding belongs to')
|
|
1262
1266
|
.action(async (agent, options, command) => {
|
|
1263
1267
|
const global = globals(command);
|
|
1264
|
-
const binding = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.agents.bindRuntime({
|
|
1268
|
+
const binding = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.agents.bindRuntime({
|
|
1265
1269
|
agentId: agent,
|
|
1266
1270
|
runtime: options.runtime,
|
|
1267
1271
|
...(options.profile ? { profile: options.profile } : {}),
|
|
@@ -1280,7 +1284,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1280
1284
|
.description('List runtime bindings for one agent, or for every agent')
|
|
1281
1285
|
.action(async (agent, _options, command) => {
|
|
1282
1286
|
const global = globals(command);
|
|
1283
|
-
const result = await withClient(global.home, defaultActor(env, 'system', 'cli'), async (client) => {
|
|
1287
|
+
const result = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), async (client) => {
|
|
1284
1288
|
if (agent) {
|
|
1285
1289
|
const profile = await client.agents.get(agent);
|
|
1286
1290
|
return [{ profile, runtimeBindings: await client.agents.bindings(agent) }];
|
|
@@ -1305,7 +1309,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1305
1309
|
.description('Remove a runtime binding')
|
|
1306
1310
|
.action(async (bindingId, _options, command) => {
|
|
1307
1311
|
const global = globals(command);
|
|
1308
|
-
const removed = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.agents.unbindRuntime(bindingId));
|
|
1312
|
+
const removed = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.agents.unbindRuntime(bindingId));
|
|
1309
1313
|
output(io, global.json, { removed }, removed ? `Removed binding ${bindingId}.` : `No binding ${bindingId}.`);
|
|
1310
1314
|
});
|
|
1311
1315
|
const postCommand = program.command('post').description('Publish to everyone in the workspace');
|
|
@@ -1457,7 +1461,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1457
1461
|
});
|
|
1458
1462
|
addListOptions(kudosCommand.command('list').description('List and filter kudos')).action(async (options, command) => {
|
|
1459
1463
|
const global = globals(command);
|
|
1460
|
-
const page = await withClient(global.home, defaultActor(env, 'human', 'local-cli'), (client) => client.kudos.list(listInput(options)));
|
|
1464
|
+
const page = await withClient(global.home, defaultActor(env, 'human', 'local-cli', global.actor), (client) => client.kudos.list(listInput(options)), Boolean(global.actor));
|
|
1461
1465
|
output(io, global.json, page, page.items.length
|
|
1462
1466
|
? `${page.items.map(lineForSummary).join('\n')}${page.hasMore ? `\nNext cursor: ${page.nextCursor}` : ''}`
|
|
1463
1467
|
: 'No kudos found.');
|
|
@@ -1476,7 +1480,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1476
1480
|
.option('--offset <number>', 'deprecated offset', '0')
|
|
1477
1481
|
.action(async (options, command) => {
|
|
1478
1482
|
const global = globals(command);
|
|
1479
|
-
const page = await withClient(global.home, defaultActor(env, 'human', 'local-cli'), (client) => client.items.list(itemListInput(options)));
|
|
1483
|
+
const page = await withClient(global.home, defaultActor(env, 'human', 'local-cli', global.actor), (client) => client.items.list(itemListInput(options)), Boolean(global.actor));
|
|
1480
1484
|
output(io, global.json, page, page.items.length
|
|
1481
1485
|
? `${page.items.map(lineForItem).join('\n')}${page.hasMore ? `\nNext cursor: ${page.nextCursor}` : ''}`
|
|
1482
1486
|
: 'No items found.');
|
|
@@ -1489,11 +1493,11 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1489
1493
|
.option('--limit <number>', 'maximum changes (default 20, maximum 100)', '20')
|
|
1490
1494
|
.action(async (options, command) => {
|
|
1491
1495
|
const global = globals(command);
|
|
1492
|
-
const page = await withClient(global.home, defaultActor(env, 'human', 'local-cli'), (client) => client.items.changes({
|
|
1496
|
+
const page = await withClient(global.home, defaultActor(env, 'human', 'local-cli', global.actor), (client) => client.items.changes({
|
|
1493
1497
|
limit: Number(options.limit),
|
|
1494
1498
|
...(options.kind.length ? { kinds: options.kind } : {}),
|
|
1495
1499
|
...(options.after ? { after: options.after } : {}),
|
|
1496
|
-
}));
|
|
1500
|
+
}), Boolean(global.actor));
|
|
1497
1501
|
const human = page.items.length
|
|
1498
1502
|
? `${page.items
|
|
1499
1503
|
.map((change) => `${change.sequence} ${change.createdAt} ${change.type} ${change.itemId ?? '-'}`)
|
|
@@ -1532,17 +1536,17 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1532
1536
|
.option('--cursor <cursor>')
|
|
1533
1537
|
.action(async (options, command) => {
|
|
1534
1538
|
const global = globals(command);
|
|
1535
|
-
const page = await withClient(global.home, defaultActor(env, 'human', 'local-cli'), (client) => client.memos.list({
|
|
1539
|
+
const page = await withClient(global.home, defaultActor(env, 'human', 'local-cli', global.actor), (client) => client.memos.list({
|
|
1536
1540
|
...(options.participant ? { participantAgentId: options.participant } : {}),
|
|
1537
1541
|
...(options.status ? { status: options.status } : {}),
|
|
1538
1542
|
limit: Number(options.limit),
|
|
1539
1543
|
...(options.cursor ? { cursor: options.cursor } : {}),
|
|
1540
|
-
}));
|
|
1544
|
+
}), Boolean(global.actor));
|
|
1541
1545
|
output(io, global.json, page, page.items.map(lineForItem).join('\n') || 'No memos found.');
|
|
1542
1546
|
});
|
|
1543
1547
|
memoCommand.command('show <memo-id>').action(async (id, _options, command) => {
|
|
1544
1548
|
const global = globals(command);
|
|
1545
|
-
const record = await withClient(global.home, defaultActor(env, 'human', 'local-cli'), (client) => client.memos.get(id));
|
|
1549
|
+
const record = await withClient(global.home, defaultActor(env, 'human', 'local-cli', global.actor), (client) => client.memos.get(id), Boolean(global.actor));
|
|
1546
1550
|
output(io, global.json, record, `${record.event.subject}\nID: ${record.event.id}\nStatus: ${record.status}\n\n${record.event.body}`);
|
|
1547
1551
|
});
|
|
1548
1552
|
for (const operation of ['read', 'archive']) {
|
|
@@ -1590,16 +1594,16 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1590
1594
|
.option('--limit <number>', 'maximum results', '10')
|
|
1591
1595
|
.action(async (options, command) => {
|
|
1592
1596
|
const global = globals(command);
|
|
1593
|
-
const page = await withClient(global.home, defaultActor(env, 'human', 'local-cli'), (client) => client.notes.list({
|
|
1597
|
+
const page = await withClient(global.home, defaultActor(env, 'human', 'local-cli', global.actor), (client) => client.notes.list({
|
|
1594
1598
|
...(options.owner ? { participantAgentId: options.owner } : {}),
|
|
1595
1599
|
...(options.status ? { status: options.status } : {}),
|
|
1596
1600
|
limit: Number(options.limit),
|
|
1597
|
-
}));
|
|
1601
|
+
}), Boolean(global.actor));
|
|
1598
1602
|
output(io, global.json, page, page.items.map(lineForItem).join('\n') || 'No notes found.');
|
|
1599
1603
|
});
|
|
1600
1604
|
noteCommand.command('show <note-id>').action(async (id, _options, command) => {
|
|
1601
1605
|
const global = globals(command);
|
|
1602
|
-
const record = await withClient(global.home, defaultActor(env, 'human', 'local-cli'), (client) => client.notes.get(id));
|
|
1606
|
+
const record = await withClient(global.home, defaultActor(env, 'human', 'local-cli', global.actor), (client) => client.notes.get(id), Boolean(global.actor));
|
|
1603
1607
|
output(io, global.json, record, `${record.current.title}\nID: ${record.event.id}\nVersion: ${record.current.version}\n\n${record.current.body}`);
|
|
1604
1608
|
});
|
|
1605
1609
|
noteCommand
|
|
@@ -1763,16 +1767,16 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1763
1767
|
.option('--limit <number>', 'maximum results', '10')
|
|
1764
1768
|
.action(async (options, command) => {
|
|
1765
1769
|
const global = globals(command);
|
|
1766
|
-
const page = await withClient(global.home, defaultActor(env, 'human', 'local-cli'), (client) => client.tasks.list({
|
|
1770
|
+
const page = await withClient(global.home, defaultActor(env, 'human', 'local-cli', global.actor), (client) => client.tasks.list({
|
|
1767
1771
|
...(options.assignee ? { participantAgentId: options.assignee } : {}),
|
|
1768
1772
|
...(options.status ? { status: options.status } : {}),
|
|
1769
1773
|
limit: Number(options.limit),
|
|
1770
|
-
}));
|
|
1774
|
+
}), Boolean(global.actor));
|
|
1771
1775
|
output(io, global.json, page, page.items.map(lineForItem).join('\n') || 'No tasks found.');
|
|
1772
1776
|
});
|
|
1773
1777
|
taskCommand.command('show <task-id>').action(async (id, _options, command) => {
|
|
1774
1778
|
const global = globals(command);
|
|
1775
|
-
const record = await withClient(global.home, defaultActor(env, 'human', 'local-cli'), (client) => client.tasks.get(id));
|
|
1779
|
+
const record = await withClient(global.home, defaultActor(env, 'human', 'local-cli', global.actor), (client) => client.tasks.get(id), Boolean(global.actor));
|
|
1776
1780
|
output(io, global.json, record, `${record.current.title}\nID: ${record.event.id}\nStatus: ${record.status}\nVersion: ${record.current.version}`);
|
|
1777
1781
|
});
|
|
1778
1782
|
taskCommand
|
|
@@ -1862,7 +1866,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1862
1866
|
.description('Show one kudos item and its current state')
|
|
1863
1867
|
.action(async (id, _options, command) => {
|
|
1864
1868
|
const global = globals(command);
|
|
1865
|
-
const record = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.kudos.get(id));
|
|
1869
|
+
const record = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.kudos.get(id));
|
|
1866
1870
|
output(io, global.json, record, showRecord(record));
|
|
1867
1871
|
});
|
|
1868
1872
|
kudosCommand
|
|
@@ -1905,7 +1909,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1905
1909
|
const global = globals(command);
|
|
1906
1910
|
if (!agentId)
|
|
1907
1911
|
throw new SynomemError('INVALID_INPUT', 'Specify an agent.');
|
|
1908
|
-
const details = await withClient(global.home, defaultActor(env, 'system', 'cli'), async (client) => {
|
|
1912
|
+
const details = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), async (client) => {
|
|
1909
1913
|
const profile = await client.agents.get(agentId);
|
|
1910
1914
|
const info = await client.info();
|
|
1911
1915
|
if (info.backend !== 'local') {
|
|
@@ -1935,7 +1939,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1935
1939
|
});
|
|
1936
1940
|
addListOptions(kudosCommand.command('stats').description('Show aggregate kudos statistics')).action(async (options, command) => {
|
|
1937
1941
|
const global = globals(command);
|
|
1938
|
-
const stats = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.stats(listInput(options)));
|
|
1942
|
+
const stats = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.stats(listInput(options)));
|
|
1939
1943
|
output(io, global.json, stats, `Total: ${stats.total}\nActive: ${stats.active}\nAcknowledged: ${stats.acknowledged}\nRevoked: ${stats.revoked}`);
|
|
1940
1944
|
});
|
|
1941
1945
|
program
|
|
@@ -1943,7 +1947,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1943
1947
|
.description('Regenerate current-state and filesystem projections from canonical events')
|
|
1944
1948
|
.action(async (_options, command) => {
|
|
1945
1949
|
const global = globals(command);
|
|
1946
|
-
const result = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.rebuild());
|
|
1950
|
+
const result = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.rebuild());
|
|
1947
1951
|
output(io, global.json, result, `Rebuilt ${result.generated.length} file(s); removed ${result.removed.length} stale file(s).`);
|
|
1948
1952
|
});
|
|
1949
1953
|
program
|
|
@@ -1951,7 +1955,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1951
1955
|
.description('Create a transactionally consistent SQLite backup')
|
|
1952
1956
|
.action(async (destination, _options, command) => {
|
|
1953
1957
|
const global = globals(command);
|
|
1954
|
-
const path = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => {
|
|
1958
|
+
const path = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => {
|
|
1955
1959
|
if (!client.backup) {
|
|
1956
1960
|
throw new SynomemError('INVALID_INPUT', 'Filesystem backup is available only with the local backend.');
|
|
1957
1961
|
}
|
|
@@ -1966,7 +1970,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1966
1970
|
.option('--output <path>', 'write to an explicit destination instead of stdout')
|
|
1967
1971
|
.action(async (options, command) => {
|
|
1968
1972
|
const global = globals(command);
|
|
1969
|
-
const content = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.export(options.format));
|
|
1973
|
+
const content = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.export(options.format));
|
|
1970
1974
|
if (options.output) {
|
|
1971
1975
|
const destination = resolve(options.output);
|
|
1972
1976
|
atomicWriteFile(destination, content, 0o600);
|
|
@@ -1981,7 +1985,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1981
1985
|
.description('Run safe diagnostics')
|
|
1982
1986
|
.action(async (_options, command) => {
|
|
1983
1987
|
const global = globals(command);
|
|
1984
|
-
const result = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.doctor());
|
|
1988
|
+
const result = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.doctor());
|
|
1985
1989
|
const human = result.diagnostics
|
|
1986
1990
|
.map((item) => `${item.level.toUpperCase().padEnd(7)} ${item.code}: ${item.message}`)
|
|
1987
1991
|
.join('\n');
|
|
@@ -2002,7 +2006,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
2002
2006
|
// the name is written into every event the session appends, and a
|
|
2003
2007
|
// harness must not be able to sign another agent's name to work.
|
|
2004
2008
|
const bound = options.agentId
|
|
2005
|
-
? await withClient(global.home, defaultActor(env, 'system', 'cli'), async (client) => {
|
|
2009
|
+
? await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), async (client) => {
|
|
2006
2010
|
const resolution = await client.agents.resolve(options.agentId);
|
|
2007
2011
|
if (!resolution.match) {
|
|
2008
2012
|
throw new SynomemError('AGENT_NOT_FOUND', resolution.candidates.length
|