synomem 0.6.10 → 0.7.0
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 +139 -43
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts +22 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +164 -3
- package/dist/client.js.map +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +2 -0
- package/dist/errors.js.map +1 -1
- package/dist/import.d.ts +83 -0
- package/dist/import.d.ts.map +1 -1
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +110 -2
- package/dist/mcp/index.js.map +1 -1
- package/dist/ports/repository.d.ts +10 -1
- package/dist/ports/repository.d.ts.map +1 -1
- package/dist/projections.d.ts.map +1 -1
- package/dist/projections.js +6 -0
- package/dist/projections.js.map +1 -1
- package/dist/remote.d.ts +22 -1
- package/dist/remote.d.ts.map +1 -1
- package/dist/remote.js +18 -4
- package/dist/remote.js.map +1 -1
- package/dist/schemas.d.ts +130 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +77 -0
- package/dist/schemas.js.map +1 -1
- package/dist/service.d.ts +14 -1
- package/dist/service.d.ts.map +1 -1
- package/dist/storage.d.ts +12 -1
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +136 -19
- package/dist/storage.js.map +1 -1
- package/dist/types.d.ts +80 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/backend.ts +1 -0
- package/src/cli.ts +305 -91
- package/src/client.ts +184 -2
- package/src/errors.ts +2 -0
- package/src/mcp/index.ts +140 -1
- package/src/ports/repository.ts +8 -0
- package/src/projections.ts +6 -0
- package/src/remote.ts +65 -4
- package/src/schemas.ts +85 -0
- package/src/service.ts +18 -0
- package/src/storage.ts +167 -13
- package/src/types.ts +90 -2
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,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,6BAA6B,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAA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mBAAmB,EAAE,CAAA;KAAE,CAAC,CAAC;IAC7E,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IAC7D,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE;QACvB,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,aAAa,CAAC;QACrB,MAAM,EAAE,YAAY,CAAC;QACrB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,KAAK,OAAO,CAAC,aAAa,GAAG,YAAY,CAAC,CAAC;CAC7C;AAuRD,wBAAgB,SAAS,CACvB,EAAE,GAAE,KAAiB,EACrB,cAAc,GAAE,qBAAgD,EAChE,YAAY,GAAE,eAAoB,EAClC,IAAI,GAAE,MAAM,EAAiB,GAC5B,OAAO,CAkyFT;AAED,wBAAsB,MAAM,CAC1B,IAAI,WAAe,EACnB,EAAE,GAAE,KAAiB,EACrB,cAAc,GAAE,qBAAgD,EAChE,YAAY,GAAE,eAAoB,GACjC,OAAO,CAAC,MAAM,CAAC,CAqBjB"}
|
package/dist/cli.js
CHANGED
|
@@ -125,6 +125,7 @@ function itemListInput(options) {
|
|
|
125
125
|
...(typeof options.actor === 'string' ? { actorId: options.actor } : {}),
|
|
126
126
|
...(typeof options.status === 'string' ? { status: options.status } : {}),
|
|
127
127
|
...(typeof options.tag === 'string' ? { tag: options.tag } : {}),
|
|
128
|
+
...(typeof options.topic === 'string' ? { topicId: options.topic } : {}),
|
|
128
129
|
...(typeof options.visibility === 'string'
|
|
129
130
|
? { visibility: options.visibility }
|
|
130
131
|
: {}),
|
|
@@ -180,8 +181,12 @@ function commandPath(command) {
|
|
|
180
181
|
* rather than a local one to act in.
|
|
181
182
|
*/
|
|
182
183
|
const CONFIGURES_BACKEND = new Set(['config init', 'backend use', 'remote import']);
|
|
183
|
-
async function withService(serviceFactory, home, configuredActor, operation) {
|
|
184
|
-
const client = serviceFactory({
|
|
184
|
+
async function withService(serviceFactory, home, configuredActor, operation, assertActor) {
|
|
185
|
+
const client = serviceFactory({
|
|
186
|
+
...(home ? { home } : {}),
|
|
187
|
+
actor: configuredActor,
|
|
188
|
+
...(assertActor !== undefined ? { assertActor } : {}),
|
|
189
|
+
});
|
|
185
190
|
await client.init();
|
|
186
191
|
try {
|
|
187
192
|
return await operation(client);
|
|
@@ -196,6 +201,7 @@ function addListOptions(command) {
|
|
|
196
201
|
.option('--actor <id>')
|
|
197
202
|
.option('--actor-kind <kind>', 'human, agent, or system')
|
|
198
203
|
.option('--tag <tag>')
|
|
204
|
+
.option('--topic <id>', 'only records carrying this topic')
|
|
199
205
|
.option('--status <status>', 'acknowledged or unacknowledged')
|
|
200
206
|
.option('--visibility <visibility>', 'private, local, or public')
|
|
201
207
|
.addOption(new Option('--revoked <state>').choices(['include', 'only', 'exclude']).default('include'))
|
|
@@ -211,6 +217,7 @@ function listInput(options) {
|
|
|
211
217
|
...(options.actor ? { actorId: options.actor } : {}),
|
|
212
218
|
...(options.actorKind ? { actorKind: options.actorKind } : {}),
|
|
213
219
|
...(options.tag ? { tag: options.tag } : {}),
|
|
220
|
+
...(options.topic ? { topicId: options.topic } : {}),
|
|
214
221
|
...(options.status ? { status: options.status } : {}),
|
|
215
222
|
...(options.visibility
|
|
216
223
|
? { visibility: options.visibility }
|
|
@@ -315,7 +322,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
315
322
|
}
|
|
316
323
|
});
|
|
317
324
|
const program = new Command();
|
|
318
|
-
const withClient = (home, configuredActor, operation) => withService(serviceFactory, home, configuredActor, operation);
|
|
325
|
+
const withClient = (home, configuredActor, operation, assertActor) => withService(serviceFactory, home, configuredActor, operation, assertActor);
|
|
319
326
|
cliExitCodes.set(program, 0);
|
|
320
327
|
program
|
|
321
328
|
.name('synomem')
|
|
@@ -399,7 +406,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
399
406
|
writeSynomemBackend({ kind: 'local' }, home);
|
|
400
407
|
// Opening it once creates the database, so `list` does not report a
|
|
401
408
|
// workspace that exists in name only.
|
|
402
|
-
await withClient(home, defaultActor(env, 'system', 'cli'), async () => undefined);
|
|
409
|
+
await withClient(home, defaultActor(env, 'system', 'cli', global.actor), async () => undefined);
|
|
403
410
|
output(io, global.json, { name, home }, `Created workspace ${name} at ${home}.\nAct in it with --workspace ${name}.`);
|
|
404
411
|
});
|
|
405
412
|
const remoteCommand = program.command('remote').description('Administer a remote workspace');
|
|
@@ -501,7 +508,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
501
508
|
if (persisted?.backend.kind === 'remote') {
|
|
502
509
|
throw new SynomemError('INVALID_INPUT', 'The init command requires a local backend.');
|
|
503
510
|
}
|
|
504
|
-
await withClient(options.home, defaultActor(env, 'system', 'cli'), async (client) => {
|
|
511
|
+
await withClient(options.home, defaultActor(env, 'system', 'cli', options.actor), async (client) => {
|
|
505
512
|
const info = await client.info();
|
|
506
513
|
if (info.backend !== 'local') {
|
|
507
514
|
throw new SynomemError('INVALID_INPUT', 'The init command requires a local backend.');
|
|
@@ -868,7 +875,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
868
875
|
if (!config) {
|
|
869
876
|
throw new SynomemError('CONFIG_INVALID', 'No Synomem home here yet. Run `synomem config init` first.');
|
|
870
877
|
}
|
|
871
|
-
const result = await withClient(global.home, defaultActor(env, 'system', 'cli'), async (client) => ({
|
|
878
|
+
const result = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), async (client) => ({
|
|
872
879
|
info: await client.info(),
|
|
873
880
|
capabilities: await client.capabilities(),
|
|
874
881
|
diagnostics: (await client.doctor()).diagnostics.filter((item) => item.level === 'error' || item.level === 'warning'),
|
|
@@ -901,7 +908,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
901
908
|
.description('Report whether the generated files match the canonical events')
|
|
902
909
|
.action(async (_options, command) => {
|
|
903
910
|
const global = globals(command);
|
|
904
|
-
const status = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => {
|
|
911
|
+
const status = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => {
|
|
905
912
|
if (!client.projectionStatus) {
|
|
906
913
|
throw new SynomemError('INVALID_INPUT', 'The remote backend keeps no filesystem projections, so there is nothing to report.');
|
|
907
914
|
}
|
|
@@ -1024,7 +1031,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1024
1031
|
.option('--description <text>')
|
|
1025
1032
|
.action(async (handle, options, command) => {
|
|
1026
1033
|
const global = globals(command);
|
|
1027
|
-
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.agents.create({
|
|
1034
|
+
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.agents.create({
|
|
1028
1035
|
handle,
|
|
1029
1036
|
displayName: options.name,
|
|
1030
1037
|
...(options.alias.length ? { aliases: options.alias } : {}),
|
|
@@ -1042,7 +1049,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1042
1049
|
.description('Add aliases, keeping the ones already there')
|
|
1043
1050
|
.action(async (agent, aliases, _options, command) => {
|
|
1044
1051
|
const global = globals(command);
|
|
1045
|
-
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.agents.addAliases(agent, aliases));
|
|
1052
|
+
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.agents.addAliases(agent, aliases));
|
|
1046
1053
|
output(io, global.json, profile, `Aliases: ${(profile.aliases ?? []).join(', ') || 'none'}`);
|
|
1047
1054
|
});
|
|
1048
1055
|
aliasCommand
|
|
@@ -1050,7 +1057,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1050
1057
|
.description('Remove aliases, keeping the rest')
|
|
1051
1058
|
.action(async (agent, aliases, _options, command) => {
|
|
1052
1059
|
const global = globals(command);
|
|
1053
|
-
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.agents.removeAliases(agent, aliases));
|
|
1060
|
+
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.agents.removeAliases(agent, aliases));
|
|
1054
1061
|
output(io, global.json, profile, `Aliases: ${(profile.aliases ?? []).join(', ') || 'none'}`);
|
|
1055
1062
|
});
|
|
1056
1063
|
agentCommand
|
|
@@ -1058,7 +1065,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1058
1065
|
.description('Change an agent handle. Its canonical ID never changes.')
|
|
1059
1066
|
.action(async (agent, handle, _options, command) => {
|
|
1060
1067
|
const global = globals(command);
|
|
1061
|
-
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.agents.update(agent, { handle }));
|
|
1068
|
+
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.agents.update(agent, { handle }));
|
|
1062
1069
|
output(io, global.json, profile, `Handle: ${profile.handle}\nAgent ID: ${profile.id} (unchanged)`);
|
|
1063
1070
|
});
|
|
1064
1071
|
agentCommand
|
|
@@ -1066,7 +1073,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1066
1073
|
.description('Stop an agent acting, keeping its records and history')
|
|
1067
1074
|
.action(async (agent, _options, command) => {
|
|
1068
1075
|
const global = globals(command);
|
|
1069
|
-
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.agents.archive(agent));
|
|
1076
|
+
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.agents.archive(agent));
|
|
1070
1077
|
output(io, global.json, profile, `Archived ${profile.handle} (${profile.id})`);
|
|
1071
1078
|
});
|
|
1072
1079
|
agentCommand
|
|
@@ -1074,9 +1081,85 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1074
1081
|
.description('Let an archived agent act again')
|
|
1075
1082
|
.action(async (agent, _options, command) => {
|
|
1076
1083
|
const global = globals(command);
|
|
1077
|
-
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.agents.restore(agent));
|
|
1084
|
+
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.agents.restore(agent));
|
|
1078
1085
|
output(io, global.json, profile, `Restored ${profile.handle} (${profile.id})`);
|
|
1079
1086
|
});
|
|
1087
|
+
const topicCommand = program
|
|
1088
|
+
.command('topic')
|
|
1089
|
+
.description('Create and manage topics — a stable, reusable subject any record can carry');
|
|
1090
|
+
topicCommand
|
|
1091
|
+
.command('create <display-name>')
|
|
1092
|
+
.description('Create a topic. Any actor may create one.')
|
|
1093
|
+
.option('--alias <name>', 'alias (repeatable)', collect, [])
|
|
1094
|
+
.action(async (displayName, options, command) => {
|
|
1095
|
+
const global = globals(command);
|
|
1096
|
+
const topic = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.topics.create({
|
|
1097
|
+
displayName,
|
|
1098
|
+
...(options.alias.length ? { aliases: options.alias } : {}),
|
|
1099
|
+
}));
|
|
1100
|
+
output(io, global.json, topic, `Created ${topic.displayName}\n\nTopic ID: ${topic.id}`);
|
|
1101
|
+
});
|
|
1102
|
+
topicCommand
|
|
1103
|
+
.command('list')
|
|
1104
|
+
.description('List known topics')
|
|
1105
|
+
.option('--status <status>', 'active or archived')
|
|
1106
|
+
.action(async (options, command) => {
|
|
1107
|
+
const global = globals(command);
|
|
1108
|
+
const topics = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.topics.list(options.status ? { status: options.status } : {}));
|
|
1109
|
+
const human = topics.length
|
|
1110
|
+
? topics
|
|
1111
|
+
.map((topic) => `${topic.displayName}${topic.status === 'archived' ? ' [archived]' : ''}${topic.aliases?.length ? ` aliases: ${topic.aliases.join(', ')}` : ''}\n ${topic.id}`)
|
|
1112
|
+
.join('\n')
|
|
1113
|
+
: 'No topics yet.';
|
|
1114
|
+
output(io, global.json, { topics }, human);
|
|
1115
|
+
});
|
|
1116
|
+
topicCommand
|
|
1117
|
+
.command('show <id>')
|
|
1118
|
+
.description('Show one topic, resolving aliases')
|
|
1119
|
+
.action(async (id, _options, command) => {
|
|
1120
|
+
const global = globals(command);
|
|
1121
|
+
const topic = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.topics.get(id));
|
|
1122
|
+
output(io, global.json, topic, `${topic.displayName}\n\nTopic ID: ${topic.id}\nStatus: ${topic.status}\nAliases: ${topic.aliases?.join(', ') ?? 'none'}`);
|
|
1123
|
+
});
|
|
1124
|
+
topicCommand
|
|
1125
|
+
.command('resolve <name>')
|
|
1126
|
+
.description('Resolve a name or alias to one topic, or list the candidates')
|
|
1127
|
+
.action(async (name, _options, command) => {
|
|
1128
|
+
const global = globals(command);
|
|
1129
|
+
const resolution = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.topics.resolve(name));
|
|
1130
|
+
const human = resolution.match
|
|
1131
|
+
? `${resolution.match.displayName} (${resolution.match.id})`
|
|
1132
|
+
: resolution.candidates.length
|
|
1133
|
+
? `"${resolution.query}" is ambiguous. Candidates:\n${resolution.candidates
|
|
1134
|
+
.map((topic) => ` ${topic.id} ${topic.displayName}`)
|
|
1135
|
+
.join('\n')}`
|
|
1136
|
+
: `No topic answers to "${resolution.query}".`;
|
|
1137
|
+
output(io, global.json, resolution, human);
|
|
1138
|
+
});
|
|
1139
|
+
topicCommand
|
|
1140
|
+
.command('rename <id> <display-name>')
|
|
1141
|
+
.description("Change a topic's display name. Its ID never changes.")
|
|
1142
|
+
.action(async (id, displayName, _options, command) => {
|
|
1143
|
+
const global = globals(command);
|
|
1144
|
+
const topic = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.topics.update(id, { displayName }));
|
|
1145
|
+
output(io, global.json, topic, `Renamed to ${topic.displayName}\nTopic ID: ${topic.id} (unchanged)`);
|
|
1146
|
+
});
|
|
1147
|
+
topicCommand
|
|
1148
|
+
.command('archive <id>')
|
|
1149
|
+
.description('Stop a topic being attached to new records, keeping the ones it already has')
|
|
1150
|
+
.action(async (id, _options, command) => {
|
|
1151
|
+
const global = globals(command);
|
|
1152
|
+
const topic = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.topics.archive(id));
|
|
1153
|
+
output(io, global.json, topic, `Archived ${topic.displayName} (${topic.id})`);
|
|
1154
|
+
});
|
|
1155
|
+
topicCommand
|
|
1156
|
+
.command('restore <id>')
|
|
1157
|
+
.description('Let an archived topic be attached to new records again')
|
|
1158
|
+
.action(async (id, _options, command) => {
|
|
1159
|
+
const global = globals(command);
|
|
1160
|
+
const topic = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.topics.restore(id));
|
|
1161
|
+
output(io, global.json, topic, `Restored ${topic.displayName} (${topic.id})`);
|
|
1162
|
+
});
|
|
1080
1163
|
const skillCommand = program
|
|
1081
1164
|
.command('skill')
|
|
1082
1165
|
.description('Install and maintain the packaged agent skill');
|
|
@@ -1099,7 +1182,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1099
1182
|
*/
|
|
1100
1183
|
let agentId;
|
|
1101
1184
|
if (options.agent) {
|
|
1102
|
-
agentId = await withClient(global.home, defaultActor(env, 'system', 'cli'), async (client) => {
|
|
1185
|
+
agentId = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), async (client) => {
|
|
1103
1186
|
const resolution = await client.agents.resolve(options.agent);
|
|
1104
1187
|
if (!resolution.match) {
|
|
1105
1188
|
throw new SynomemError('AGENT_NOT_FOUND', resolution.candidates.length
|
|
@@ -1176,7 +1259,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1176
1259
|
.description('List known agent identities')
|
|
1177
1260
|
.action(async (_options, command) => {
|
|
1178
1261
|
const global = globals(command);
|
|
1179
|
-
const agents = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.agents.list());
|
|
1262
|
+
const agents = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.agents.list());
|
|
1180
1263
|
const human = agents.length
|
|
1181
1264
|
? agents
|
|
1182
1265
|
.map((profile) =>
|
|
@@ -1192,7 +1275,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1192
1275
|
.description('Show one agent profile, resolving aliases')
|
|
1193
1276
|
.action(async (id, _options, command) => {
|
|
1194
1277
|
const global = globals(command);
|
|
1195
|
-
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.agents.get(id));
|
|
1278
|
+
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.agents.get(id));
|
|
1196
1279
|
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
1280
|
});
|
|
1198
1281
|
agentCommand
|
|
@@ -1205,7 +1288,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1205
1288
|
.action(async (id, options, command) => {
|
|
1206
1289
|
const global = globals(command);
|
|
1207
1290
|
const hasAliases = options.clearAliases || options.alias.length > 0;
|
|
1208
|
-
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.agents.update(id, {
|
|
1291
|
+
const profile = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.agents.update(id, {
|
|
1209
1292
|
...(options.name ? { displayName: options.name } : {}),
|
|
1210
1293
|
...(hasAliases ? { aliases: options.clearAliases ? [] : options.alias } : {}),
|
|
1211
1294
|
...(options.description !== undefined ? { description: options.description } : {}),
|
|
@@ -1217,7 +1300,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1217
1300
|
.description('Resolve a name or alias to one agent, or list the candidates')
|
|
1218
1301
|
.action(async (name, _options, command) => {
|
|
1219
1302
|
const global = globals(command);
|
|
1220
|
-
const resolution = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.agents.resolve(name));
|
|
1303
|
+
const resolution = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.agents.resolve(name));
|
|
1221
1304
|
// An ambiguous name is a question, not a failure: exit zero and show the
|
|
1222
1305
|
// candidates so the caller can pick one.
|
|
1223
1306
|
const human = resolution.match
|
|
@@ -1234,7 +1317,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1234
1317
|
.description('List agents with their runtime bindings')
|
|
1235
1318
|
.action(async (_options, command) => {
|
|
1236
1319
|
const global = globals(command);
|
|
1237
|
-
const entries = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.agents.directory());
|
|
1320
|
+
const entries = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.agents.directory());
|
|
1238
1321
|
const human = entries.length
|
|
1239
1322
|
? entries
|
|
1240
1323
|
.map((entry) => {
|
|
@@ -1261,7 +1344,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1261
1344
|
.option('--installation <id>', 'hosted installation this binding belongs to')
|
|
1262
1345
|
.action(async (agent, options, command) => {
|
|
1263
1346
|
const global = globals(command);
|
|
1264
|
-
const binding = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.agents.bindRuntime({
|
|
1347
|
+
const binding = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.agents.bindRuntime({
|
|
1265
1348
|
agentId: agent,
|
|
1266
1349
|
runtime: options.runtime,
|
|
1267
1350
|
...(options.profile ? { profile: options.profile } : {}),
|
|
@@ -1280,7 +1363,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1280
1363
|
.description('List runtime bindings for one agent, or for every agent')
|
|
1281
1364
|
.action(async (agent, _options, command) => {
|
|
1282
1365
|
const global = globals(command);
|
|
1283
|
-
const result = await withClient(global.home, defaultActor(env, 'system', 'cli'), async (client) => {
|
|
1366
|
+
const result = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), async (client) => {
|
|
1284
1367
|
if (agent) {
|
|
1285
1368
|
const profile = await client.agents.get(agent);
|
|
1286
1369
|
return [{ profile, runtimeBindings: await client.agents.bindings(agent) }];
|
|
@@ -1305,7 +1388,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1305
1388
|
.description('Remove a runtime binding')
|
|
1306
1389
|
.action(async (bindingId, _options, command) => {
|
|
1307
1390
|
const global = globals(command);
|
|
1308
|
-
const removed = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.agents.unbindRuntime(bindingId));
|
|
1391
|
+
const removed = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.agents.unbindRuntime(bindingId));
|
|
1309
1392
|
output(io, global.json, { removed }, removed ? `Removed binding ${bindingId}.` : `No binding ${bindingId}.`);
|
|
1310
1393
|
});
|
|
1311
1394
|
const postCommand = program.command('post').description('Publish to everyone in the workspace');
|
|
@@ -1317,6 +1400,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1317
1400
|
.requiredOption('--title <title>')
|
|
1318
1401
|
.requiredOption('--body <body>')
|
|
1319
1402
|
.option('--tag <tag>', 'repeatable', collect, [])
|
|
1403
|
+
.option('--topic <id>', 'topic ID (repeatable)', collect, [])
|
|
1320
1404
|
.option('--reply-to <post-id>')
|
|
1321
1405
|
.action(async (options, command) => {
|
|
1322
1406
|
const global = globals(command);
|
|
@@ -1324,6 +1408,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1324
1408
|
title: options.title,
|
|
1325
1409
|
body: options.body,
|
|
1326
1410
|
...(options.tag.length ? { tags: options.tag } : {}),
|
|
1411
|
+
...(options.topic.length ? { topicIds: options.topic } : {}),
|
|
1327
1412
|
...(options.replyTo ? { replyTo: options.replyTo } : {}),
|
|
1328
1413
|
}));
|
|
1329
1414
|
output(io, global.json, result, `Published ${result.record.event.id}`);
|
|
@@ -1417,6 +1502,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1417
1502
|
.requiredOption('--title <title>')
|
|
1418
1503
|
.requiredOption('--reason <reason>')
|
|
1419
1504
|
.option('--tag <tag>', 'tag (repeatable)', collect, [])
|
|
1505
|
+
.option('--topic <id>', 'topic ID (repeatable)', collect, [])
|
|
1420
1506
|
.option('--evidence <kind:value>', 'sanitized evidence (repeatable)', collect, [])
|
|
1421
1507
|
.option('--visibility <visibility>', 'private, local, or public', 'workspace')
|
|
1422
1508
|
.option('--idempotency-key <key>')
|
|
@@ -1428,6 +1514,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1428
1514
|
reason: options.reason,
|
|
1429
1515
|
visibility: options.visibility,
|
|
1430
1516
|
...(options.tag.length ? { tags: options.tag } : {}),
|
|
1517
|
+
...(options.topic.length ? { topicIds: options.topic } : {}),
|
|
1431
1518
|
...(options.evidence.length ? { evidence: options.evidence.map(parseEvidence) } : {}),
|
|
1432
1519
|
...(options.idempotencyKey ? { idempotencyKey: options.idempotencyKey } : {}),
|
|
1433
1520
|
}));
|
|
@@ -1457,7 +1544,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1457
1544
|
});
|
|
1458
1545
|
addListOptions(kudosCommand.command('list').description('List and filter kudos')).action(async (options, command) => {
|
|
1459
1546
|
const global = globals(command);
|
|
1460
|
-
const page = await withClient(global.home, defaultActor(env, 'human', 'local-cli'), (client) => client.kudos.list(listInput(options)));
|
|
1547
|
+
const page = await withClient(global.home, defaultActor(env, 'human', 'local-cli', global.actor), (client) => client.kudos.list(listInput(options)), Boolean(global.actor));
|
|
1461
1548
|
output(io, global.json, page, page.items.length
|
|
1462
1549
|
? `${page.items.map(lineForSummary).join('\n')}${page.hasMore ? `\nNext cursor: ${page.nextCursor}` : ''}`
|
|
1463
1550
|
: 'No kudos found.');
|
|
@@ -1469,6 +1556,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1469
1556
|
.option('--participant <agent>')
|
|
1470
1557
|
.option('--actor <id>')
|
|
1471
1558
|
.option('--tag <tag>')
|
|
1559
|
+
.option('--topic <id>', 'only records carrying this topic')
|
|
1472
1560
|
.option('--status <status>')
|
|
1473
1561
|
.option('--visibility <visibility>', 'private, workspace, or public')
|
|
1474
1562
|
.option('--limit <number>', 'maximum results (default 10, maximum 50)', '10')
|
|
@@ -1476,7 +1564,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1476
1564
|
.option('--offset <number>', 'deprecated offset', '0')
|
|
1477
1565
|
.action(async (options, command) => {
|
|
1478
1566
|
const global = globals(command);
|
|
1479
|
-
const page = await withClient(global.home, defaultActor(env, 'human', 'local-cli'), (client) => client.items.list(itemListInput(options)));
|
|
1567
|
+
const page = await withClient(global.home, defaultActor(env, 'human', 'local-cli', global.actor), (client) => client.items.list(itemListInput(options)), Boolean(global.actor));
|
|
1480
1568
|
output(io, global.json, page, page.items.length
|
|
1481
1569
|
? `${page.items.map(lineForItem).join('\n')}${page.hasMore ? `\nNext cursor: ${page.nextCursor}` : ''}`
|
|
1482
1570
|
: 'No items found.');
|
|
@@ -1489,11 +1577,11 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1489
1577
|
.option('--limit <number>', 'maximum changes (default 20, maximum 100)', '20')
|
|
1490
1578
|
.action(async (options, command) => {
|
|
1491
1579
|
const global = globals(command);
|
|
1492
|
-
const page = await withClient(global.home, defaultActor(env, 'human', 'local-cli'), (client) => client.items.changes({
|
|
1580
|
+
const page = await withClient(global.home, defaultActor(env, 'human', 'local-cli', global.actor), (client) => client.items.changes({
|
|
1493
1581
|
limit: Number(options.limit),
|
|
1494
1582
|
...(options.kind.length ? { kinds: options.kind } : {}),
|
|
1495
1583
|
...(options.after ? { after: options.after } : {}),
|
|
1496
|
-
}));
|
|
1584
|
+
}), Boolean(global.actor));
|
|
1497
1585
|
const human = page.items.length
|
|
1498
1586
|
? `${page.items
|
|
1499
1587
|
.map((change) => `${change.sequence} ${change.createdAt} ${change.type} ${change.itemId ?? '-'}`)
|
|
@@ -1510,6 +1598,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1510
1598
|
.requiredOption('--subject <subject>')
|
|
1511
1599
|
.requiredOption('--body <body>')
|
|
1512
1600
|
.option('--tag <tag>', 'tag (repeatable)', collect, [])
|
|
1601
|
+
.option('--topic <id>', 'topic ID (repeatable)', collect, [])
|
|
1513
1602
|
.option('--visibility <visibility>', 'private, workspace, or public', 'workspace')
|
|
1514
1603
|
.option('--idempotency-key <key>')
|
|
1515
1604
|
.action(async (recipient, options, command) => {
|
|
@@ -1520,6 +1609,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1520
1609
|
body: options.body,
|
|
1521
1610
|
visibility: options.visibility,
|
|
1522
1611
|
...(options.tag.length ? { tags: options.tag } : {}),
|
|
1612
|
+
...(options.topic.length ? { topicIds: options.topic } : {}),
|
|
1523
1613
|
...(options.idempotencyKey ? { idempotencyKey: options.idempotencyKey } : {}),
|
|
1524
1614
|
}));
|
|
1525
1615
|
output(io, global.json, result, `${result.deduplicated ? 'Found existing' : 'Sent'} memo to ${result.record.event.recipientDisplayName}\nSubject: ${result.record.event.subject}\nID: ${result.record.event.id}`);
|
|
@@ -1532,17 +1622,17 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1532
1622
|
.option('--cursor <cursor>')
|
|
1533
1623
|
.action(async (options, command) => {
|
|
1534
1624
|
const global = globals(command);
|
|
1535
|
-
const page = await withClient(global.home, defaultActor(env, 'human', 'local-cli'), (client) => client.memos.list({
|
|
1625
|
+
const page = await withClient(global.home, defaultActor(env, 'human', 'local-cli', global.actor), (client) => client.memos.list({
|
|
1536
1626
|
...(options.participant ? { participantAgentId: options.participant } : {}),
|
|
1537
1627
|
...(options.status ? { status: options.status } : {}),
|
|
1538
1628
|
limit: Number(options.limit),
|
|
1539
1629
|
...(options.cursor ? { cursor: options.cursor } : {}),
|
|
1540
|
-
}));
|
|
1630
|
+
}), Boolean(global.actor));
|
|
1541
1631
|
output(io, global.json, page, page.items.map(lineForItem).join('\n') || 'No memos found.');
|
|
1542
1632
|
});
|
|
1543
1633
|
memoCommand.command('show <memo-id>').action(async (id, _options, command) => {
|
|
1544
1634
|
const global = globals(command);
|
|
1545
|
-
const record = await withClient(global.home, defaultActor(env, 'human', 'local-cli'), (client) => client.memos.get(id));
|
|
1635
|
+
const record = await withClient(global.home, defaultActor(env, 'human', 'local-cli', global.actor), (client) => client.memos.get(id), Boolean(global.actor));
|
|
1546
1636
|
output(io, global.json, record, `${record.event.subject}\nID: ${record.event.id}\nStatus: ${record.status}\n\n${record.event.body}`);
|
|
1547
1637
|
});
|
|
1548
1638
|
for (const operation of ['read', 'archive']) {
|
|
@@ -1571,6 +1661,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1571
1661
|
.requiredOption('--title <title>')
|
|
1572
1662
|
.requiredOption('--body <body>')
|
|
1573
1663
|
.option('--tag <tag>', 'tag (repeatable)', collect, [])
|
|
1664
|
+
.option('--topic <id>', 'topic ID (repeatable)', collect, [])
|
|
1574
1665
|
.option('--idempotency-key <key>')
|
|
1575
1666
|
.action(async (options, command) => {
|
|
1576
1667
|
const global = globals(command);
|
|
@@ -1579,6 +1670,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1579
1670
|
title: options.title,
|
|
1580
1671
|
body: options.body,
|
|
1581
1672
|
...(options.tag.length ? { tags: options.tag } : {}),
|
|
1673
|
+
...(options.topic.length ? { topicIds: options.topic } : {}),
|
|
1582
1674
|
...(options.idempotencyKey ? { idempotencyKey: options.idempotencyKey } : {}),
|
|
1583
1675
|
}));
|
|
1584
1676
|
output(io, global.json, result, `${result.deduplicated ? 'Found existing' : 'Created'} note\nTitle: ${result.record.current.title}\nID: ${result.record.event.id}`);
|
|
@@ -1590,16 +1682,16 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1590
1682
|
.option('--limit <number>', 'maximum results', '10')
|
|
1591
1683
|
.action(async (options, command) => {
|
|
1592
1684
|
const global = globals(command);
|
|
1593
|
-
const page = await withClient(global.home, defaultActor(env, 'human', 'local-cli'), (client) => client.notes.list({
|
|
1685
|
+
const page = await withClient(global.home, defaultActor(env, 'human', 'local-cli', global.actor), (client) => client.notes.list({
|
|
1594
1686
|
...(options.owner ? { participantAgentId: options.owner } : {}),
|
|
1595
1687
|
...(options.status ? { status: options.status } : {}),
|
|
1596
1688
|
limit: Number(options.limit),
|
|
1597
|
-
}));
|
|
1689
|
+
}), Boolean(global.actor));
|
|
1598
1690
|
output(io, global.json, page, page.items.map(lineForItem).join('\n') || 'No notes found.');
|
|
1599
1691
|
});
|
|
1600
1692
|
noteCommand.command('show <note-id>').action(async (id, _options, command) => {
|
|
1601
1693
|
const global = globals(command);
|
|
1602
|
-
const record = await withClient(global.home, defaultActor(env, 'human', 'local-cli'), (client) => client.notes.get(id));
|
|
1694
|
+
const record = await withClient(global.home, defaultActor(env, 'human', 'local-cli', global.actor), (client) => client.notes.get(id), Boolean(global.actor));
|
|
1603
1695
|
output(io, global.json, record, `${record.current.title}\nID: ${record.event.id}\nVersion: ${record.current.version}\n\n${record.current.body}`);
|
|
1604
1696
|
});
|
|
1605
1697
|
noteCommand
|
|
@@ -1650,6 +1742,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1650
1742
|
.option('--due-at <datetime>')
|
|
1651
1743
|
.option('--time-zone <iana-zone>')
|
|
1652
1744
|
.option('--tag <tag>', 'tag (repeatable)', collect, [])
|
|
1745
|
+
.option('--topic <id>', 'topic ID (repeatable)', collect, [])
|
|
1653
1746
|
.option('--idempotency-key <key>')
|
|
1654
1747
|
.action(async (options, command) => {
|
|
1655
1748
|
const global = globals(command);
|
|
@@ -1659,6 +1752,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1659
1752
|
priority: Number(options.priority),
|
|
1660
1753
|
...((due) => (due ? { due } : {}))(taskDue(options)),
|
|
1661
1754
|
...(options.tag.length ? { tags: options.tag } : {}),
|
|
1755
|
+
...(options.topic.length ? { topicIds: options.topic } : {}),
|
|
1662
1756
|
...(options.idempotencyKey ? { idempotencyKey: options.idempotencyKey } : {}),
|
|
1663
1757
|
}));
|
|
1664
1758
|
output(io, global.json, result, `${result.deduplicated ? 'Found existing' : 'Created'} private todo\nTitle: ${result.record.current.title}\nID: ${result.record.event.id}`);
|
|
@@ -1740,6 +1834,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1740
1834
|
.option('--due-at <datetime>')
|
|
1741
1835
|
.option('--time-zone <iana-zone>')
|
|
1742
1836
|
.option('--tag <tag>', 'tag (repeatable)', collect, [])
|
|
1837
|
+
.option('--topic <id>', 'topic ID (repeatable)', collect, [])
|
|
1743
1838
|
.option('--visibility <visibility>', 'private, workspace, or public', 'workspace')
|
|
1744
1839
|
.option('--idempotency-key <key>')
|
|
1745
1840
|
.action(async (assignee, options, command) => {
|
|
@@ -1751,6 +1846,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1751
1846
|
priority: Number(options.priority),
|
|
1752
1847
|
...((due) => (due ? { due } : {}))(taskDue(options)),
|
|
1753
1848
|
...(options.tag.length ? { tags: options.tag } : {}),
|
|
1849
|
+
...(options.topic.length ? { topicIds: options.topic } : {}),
|
|
1754
1850
|
visibility: options.visibility,
|
|
1755
1851
|
...(options.idempotencyKey ? { idempotencyKey: options.idempotencyKey } : {}),
|
|
1756
1852
|
}));
|
|
@@ -1763,16 +1859,16 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1763
1859
|
.option('--limit <number>', 'maximum results', '10')
|
|
1764
1860
|
.action(async (options, command) => {
|
|
1765
1861
|
const global = globals(command);
|
|
1766
|
-
const page = await withClient(global.home, defaultActor(env, 'human', 'local-cli'), (client) => client.tasks.list({
|
|
1862
|
+
const page = await withClient(global.home, defaultActor(env, 'human', 'local-cli', global.actor), (client) => client.tasks.list({
|
|
1767
1863
|
...(options.assignee ? { participantAgentId: options.assignee } : {}),
|
|
1768
1864
|
...(options.status ? { status: options.status } : {}),
|
|
1769
1865
|
limit: Number(options.limit),
|
|
1770
|
-
}));
|
|
1866
|
+
}), Boolean(global.actor));
|
|
1771
1867
|
output(io, global.json, page, page.items.map(lineForItem).join('\n') || 'No tasks found.');
|
|
1772
1868
|
});
|
|
1773
1869
|
taskCommand.command('show <task-id>').action(async (id, _options, command) => {
|
|
1774
1870
|
const global = globals(command);
|
|
1775
|
-
const record = await withClient(global.home, defaultActor(env, 'human', 'local-cli'), (client) => client.tasks.get(id));
|
|
1871
|
+
const record = await withClient(global.home, defaultActor(env, 'human', 'local-cli', global.actor), (client) => client.tasks.get(id), Boolean(global.actor));
|
|
1776
1872
|
output(io, global.json, record, `${record.current.title}\nID: ${record.event.id}\nStatus: ${record.status}\nVersion: ${record.current.version}`);
|
|
1777
1873
|
});
|
|
1778
1874
|
taskCommand
|
|
@@ -1862,7 +1958,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1862
1958
|
.description('Show one kudos item and its current state')
|
|
1863
1959
|
.action(async (id, _options, command) => {
|
|
1864
1960
|
const global = globals(command);
|
|
1865
|
-
const record = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.kudos.get(id));
|
|
1961
|
+
const record = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.kudos.get(id));
|
|
1866
1962
|
output(io, global.json, record, showRecord(record));
|
|
1867
1963
|
});
|
|
1868
1964
|
kudosCommand
|
|
@@ -1905,7 +2001,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1905
2001
|
const global = globals(command);
|
|
1906
2002
|
if (!agentId)
|
|
1907
2003
|
throw new SynomemError('INVALID_INPUT', 'Specify an agent.');
|
|
1908
|
-
const details = await withClient(global.home, defaultActor(env, 'system', 'cli'), async (client) => {
|
|
2004
|
+
const details = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), async (client) => {
|
|
1909
2005
|
const profile = await client.agents.get(agentId);
|
|
1910
2006
|
const info = await client.info();
|
|
1911
2007
|
if (info.backend !== 'local') {
|
|
@@ -1935,7 +2031,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1935
2031
|
});
|
|
1936
2032
|
addListOptions(kudosCommand.command('stats').description('Show aggregate kudos statistics')).action(async (options, command) => {
|
|
1937
2033
|
const global = globals(command);
|
|
1938
|
-
const stats = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.stats(listInput(options)));
|
|
2034
|
+
const stats = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.stats(listInput(options)));
|
|
1939
2035
|
output(io, global.json, stats, `Total: ${stats.total}\nActive: ${stats.active}\nAcknowledged: ${stats.acknowledged}\nRevoked: ${stats.revoked}`);
|
|
1940
2036
|
});
|
|
1941
2037
|
program
|
|
@@ -1943,7 +2039,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1943
2039
|
.description('Regenerate current-state and filesystem projections from canonical events')
|
|
1944
2040
|
.action(async (_options, command) => {
|
|
1945
2041
|
const global = globals(command);
|
|
1946
|
-
const result = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.rebuild());
|
|
2042
|
+
const result = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.rebuild());
|
|
1947
2043
|
output(io, global.json, result, `Rebuilt ${result.generated.length} file(s); removed ${result.removed.length} stale file(s).`);
|
|
1948
2044
|
});
|
|
1949
2045
|
program
|
|
@@ -1951,7 +2047,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1951
2047
|
.description('Create a transactionally consistent SQLite backup')
|
|
1952
2048
|
.action(async (destination, _options, command) => {
|
|
1953
2049
|
const global = globals(command);
|
|
1954
|
-
const path = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => {
|
|
2050
|
+
const path = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => {
|
|
1955
2051
|
if (!client.backup) {
|
|
1956
2052
|
throw new SynomemError('INVALID_INPUT', 'Filesystem backup is available only with the local backend.');
|
|
1957
2053
|
}
|
|
@@ -1966,7 +2062,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1966
2062
|
.option('--output <path>', 'write to an explicit destination instead of stdout')
|
|
1967
2063
|
.action(async (options, command) => {
|
|
1968
2064
|
const global = globals(command);
|
|
1969
|
-
const content = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.export(options.format));
|
|
2065
|
+
const content = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.export(options.format));
|
|
1970
2066
|
if (options.output) {
|
|
1971
2067
|
const destination = resolve(options.output);
|
|
1972
2068
|
atomicWriteFile(destination, content, 0o600);
|
|
@@ -1981,7 +2077,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
1981
2077
|
.description('Run safe diagnostics')
|
|
1982
2078
|
.action(async (_options, command) => {
|
|
1983
2079
|
const global = globals(command);
|
|
1984
|
-
const result = await withClient(global.home, defaultActor(env, 'system', 'cli'), (client) => client.doctor());
|
|
2080
|
+
const result = await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), (client) => client.doctor());
|
|
1985
2081
|
const human = result.diagnostics
|
|
1986
2082
|
.map((item) => `${item.level.toUpperCase().padEnd(7)} ${item.code}: ${item.message}`)
|
|
1987
2083
|
.join('\n');
|
|
@@ -2002,7 +2098,7 @@ export function createCli(io = defaultIo, serviceFactory = configuredServiceFact
|
|
|
2002
2098
|
// the name is written into every event the session appends, and a
|
|
2003
2099
|
// harness must not be able to sign another agent's name to work.
|
|
2004
2100
|
const bound = options.agentId
|
|
2005
|
-
? await withClient(global.home, defaultActor(env, 'system', 'cli'), async (client) => {
|
|
2101
|
+
? await withClient(global.home, defaultActor(env, 'system', 'cli', global.actor), async (client) => {
|
|
2006
2102
|
const resolution = await client.agents.resolve(options.agentId);
|
|
2007
2103
|
if (!resolution.match) {
|
|
2008
2104
|
throw new SynomemError('AGENT_NOT_FOUND', resolution.candidates.length
|