@skrr-ai/cli 0.1.36 → 0.1.37
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/README.md +17 -4
- package/dist/commands/agents/actions/create.d.ts +5 -0
- package/dist/commands/agents/actions/create.js +26 -0
- package/dist/commands/agents/actions/update.d.ts +5 -0
- package/dist/commands/agents/actions/update.js +24 -0
- package/dist/commands/agents/api-actions/add.d.ts +41 -0
- package/dist/commands/agents/api-actions/add.js +202 -0
- package/dist/commands/agents/api-actions/index.d.ts +28 -0
- package/dist/commands/agents/api-actions/index.js +77 -0
- package/dist/commands/agents/api-actions/remove.d.ts +14 -0
- package/dist/commands/agents/api-actions/remove.js +36 -0
- package/dist/commands/agents/avatar/default/apply.d.ts +25 -0
- package/dist/commands/agents/avatar/default/apply.js +56 -0
- package/dist/commands/agents/avatar/default/index.d.ts +18 -0
- package/dist/commands/agents/avatar/default/index.js +44 -0
- package/dist/commands/agents/avatar/default/set.d.ts +23 -0
- package/dist/commands/agents/avatar/default/set.js +95 -0
- package/dist/commands/agents/avatar/library/delete.d.ts +20 -0
- package/dist/commands/agents/avatar/library/delete.js +47 -0
- package/dist/commands/agents/avatar/library/index.d.ts +16 -0
- package/dist/commands/agents/avatar/library/index.js +56 -0
- package/dist/commands/agents/avatar/presets.d.ts +19 -0
- package/dist/commands/agents/avatar/presets.js +56 -0
- package/dist/commands/agents/categories/create.d.ts +14 -0
- package/dist/commands/agents/categories/create.js +46 -0
- package/dist/commands/agents/categories/delete.d.ts +13 -0
- package/dist/commands/agents/categories/delete.js +33 -0
- package/dist/commands/agents/categories/index.d.ts +20 -0
- package/dist/commands/agents/categories/index.js +82 -0
- package/dist/commands/agents/categories/update.d.ts +22 -0
- package/dist/commands/agents/categories/update.js +59 -0
- package/dist/commands/agents/create.d.ts +10 -0
- package/dist/commands/agents/create.js +57 -3
- package/dist/commands/agents/ensure-default.d.ts +27 -0
- package/dist/commands/agents/ensure-default.js +65 -0
- package/dist/commands/agents/mute.d.ts +16 -0
- package/dist/commands/agents/mute.js +38 -0
- package/dist/commands/agents/pin.d.ts +16 -0
- package/dist/commands/agents/pin.js +38 -0
- package/dist/commands/agents/tools/auth.d.ts +19 -0
- package/dist/commands/agents/tools/auth.js +41 -0
- package/dist/commands/agents/tools/calls.d.ts +18 -0
- package/dist/commands/agents/tools/calls.js +54 -0
- package/dist/commands/agents/tools/index.d.ts +20 -0
- package/dist/commands/agents/tools/index.js +77 -0
- package/dist/commands/agents/unmute.d.ts +16 -0
- package/dist/commands/agents/unmute.js +38 -0
- package/dist/commands/agents/unpin.d.ts +16 -0
- package/dist/commands/agents/unpin.js +38 -0
- package/dist/commands/agents/update.d.ts +12 -0
- package/dist/commands/agents/update.js +64 -3
- package/dist/commands/followups/act.d.ts +22 -0
- package/dist/commands/followups/act.js +102 -0
- package/dist/commands/followups/cancel.d.ts +17 -0
- package/dist/commands/followups/cancel.js +40 -0
- package/dist/commands/followups/checkin.d.ts +27 -0
- package/dist/commands/followups/checkin.js +107 -0
- package/dist/commands/followups/list.d.ts +24 -0
- package/dist/commands/followups/list.js +90 -0
- package/dist/commands/followups/remind.d.ts +26 -0
- package/dist/commands/followups/remind.js +106 -0
- package/dist/commands/followups/reschedule.d.ts +15 -0
- package/dist/commands/followups/reschedule.js +48 -0
- package/dist/commands/followups/resolve.d.ts +23 -0
- package/dist/commands/followups/resolve.js +54 -0
- package/dist/commands/followups/show.d.ts +12 -0
- package/dist/commands/followups/show.js +45 -0
- package/dist/commands/followups/watch.d.ts +51 -0
- package/dist/commands/followups/watch.js +207 -0
- package/dist/commands/goals/labels/add.js +19 -2
- package/dist/commands/goals/labels/remove.js +22 -2
- package/dist/commands/labels/list.d.ts +24 -1
- package/dist/commands/labels/list.js +62 -19
- package/dist/commands/memory/governance/index.d.ts +21 -0
- package/dist/commands/memory/governance/index.js +64 -0
- package/dist/commands/memory/governance/set.d.ts +24 -0
- package/dist/commands/memory/governance/set.js +95 -0
- package/dist/commands/memory/provenance.d.ts +18 -0
- package/dist/commands/memory/provenance.js +66 -0
- package/dist/commands/spaces/create.d.ts +3 -0
- package/dist/commands/spaces/create.js +32 -2
- package/dist/commands/spaces/labels/add.js +19 -2
- package/dist/commands/spaces/labels/remove.js +22 -2
- package/dist/commands/spaces/show.js +2 -0
- package/dist/commands/spaces/update.d.ts +5 -0
- package/dist/commands/spaces/update.js +41 -4
- package/dist/commands/spaces/workflows/lifecycle-diagnostics.d.ts +11 -0
- package/dist/commands/spaces/workflows/lifecycle-diagnostics.js +45 -0
- package/dist/commands/tasks/complete.d.ts +1 -0
- package/dist/commands/tasks/complete.js +8 -1
- package/dist/commands/tasks/create.d.ts +3 -0
- package/dist/commands/tasks/create.js +34 -2
- package/dist/commands/tasks/expectations/assess.d.ts +11 -0
- package/dist/commands/tasks/expectations/assess.js +85 -14
- package/dist/commands/tasks/expectations.js +19 -2
- package/dist/commands/tasks/labels/attach.js +20 -3
- package/dist/commands/tasks/labels/detach.js +21 -3
- package/dist/commands/tasks/lifecycle/attach.d.ts +14 -0
- package/dist/commands/tasks/lifecycle/attach.js +47 -0
- package/dist/commands/tasks/lifecycle/definitions.d.ts +11 -0
- package/dist/commands/tasks/lifecycle/definitions.js +40 -0
- package/dist/commands/tasks/lifecycle/detach.d.ts +12 -0
- package/dist/commands/tasks/lifecycle/detach.js +32 -0
- package/dist/commands/tasks/lifecycle/history.d.ts +13 -0
- package/dist/commands/tasks/lifecycle/history.js +38 -0
- package/dist/commands/tasks/lifecycle/migrate.d.ts +12 -0
- package/dist/commands/tasks/lifecycle/migrate.js +29 -0
- package/dist/commands/tasks/lifecycle/reconcile.d.ts +11 -0
- package/dist/commands/tasks/lifecycle/reconcile.js +27 -0
- package/dist/commands/tasks/lifecycle/reopen.d.ts +13 -0
- package/dist/commands/tasks/lifecycle/reopen.js +34 -0
- package/dist/commands/tasks/lifecycle/show.d.ts +11 -0
- package/dist/commands/tasks/lifecycle/show.js +27 -0
- package/dist/commands/tasks/lifecycle/start.d.ts +12 -0
- package/dist/commands/tasks/lifecycle/start.js +30 -0
- package/dist/commands/tasks/lifecycle/transition.d.ts +15 -0
- package/dist/commands/tasks/lifecycle/transition.js +78 -0
- package/dist/commands/tasks/move.d.ts +1 -0
- package/dist/commands/tasks/move.js +31 -0
- package/dist/commands/tasks/result/submit.js +11 -1
- package/dist/commands/tasks/review-queue.d.ts +29 -0
- package/dist/commands/tasks/review-queue.js +165 -0
- package/dist/commands/tasks/show.js +42 -0
- package/dist/commands/tasks/update.d.ts +1 -0
- package/dist/commands/tasks/update.js +47 -0
- package/dist/lib/agent-actions.d.ts +36 -10
- package/dist/lib/agent-actions.js +63 -9
- package/dist/lib/agent-config.d.ts +11 -0
- package/dist/lib/agent-config.js +85 -3
- package/dist/lib/agent-pin-mute.d.ts +24 -0
- package/dist/lib/agent-pin-mute.js +17 -0
- package/dist/lib/agent-visual-refs.d.ts +6 -0
- package/dist/lib/agent-visual-refs.js +142 -0
- package/dist/lib/first-party-harness-agent.js +7 -0
- package/dist/lib/followups.d.ts +107 -0
- package/dist/lib/followups.js +102 -0
- package/dist/lib/label-ref.d.ts +95 -0
- package/dist/lib/label-ref.js +163 -0
- package/dist/lib/label-scope.d.ts +2 -2
- package/dist/lib/label-scope.js +3 -3
- package/dist/lib/task-closure.d.ts +32 -0
- package/dist/lib/task-closure.js +106 -0
- package/dist/lib/task-lifecycle-output.d.ts +14 -0
- package/dist/lib/task-lifecycle-output.js +101 -0
- package/dist/lib/tasks.d.ts +3 -0
- package/dist/lib/tasks.js +31 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessTrust.js +4 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessTrust.js +4 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +5079 -4546
- package/oclif.manifest.json +20216 -16002
- package/package.json +16 -4
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_command_1 = require("../../base-command");
|
|
5
|
+
const agent_pin_mute_1 = require("../../lib/agent-pin-mute");
|
|
6
|
+
/**
|
|
7
|
+
* Per-USER preference, not agent config: it changes your view of the agent and
|
|
8
|
+
* nobody else's. Idempotent over a toggle endpoint — see `lib/agent-pin-mute.ts`.
|
|
9
|
+
*/
|
|
10
|
+
class AgentsUnmute extends base_command_1.BaseCommand {
|
|
11
|
+
static description = "Un-silence an agent's notifications for you";
|
|
12
|
+
static examples = ['<%= config.bin %> agents unmute <agent-id>'];
|
|
13
|
+
static args = {
|
|
14
|
+
id: core_1.Args.string({ description: 'Agent ID', required: true, ignoreStdin: true }),
|
|
15
|
+
};
|
|
16
|
+
static flags = {
|
|
17
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
18
|
+
};
|
|
19
|
+
async run() {
|
|
20
|
+
this.requireAuth();
|
|
21
|
+
const { args, flags } = await this.parse(AgentsUnmute);
|
|
22
|
+
let result;
|
|
23
|
+
try {
|
|
24
|
+
result = await (0, agent_pin_mute_1.setAgentFlag)(args.id, 'mute', false);
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
this.handleApiError(err);
|
|
28
|
+
}
|
|
29
|
+
if (flags.json) {
|
|
30
|
+
this.log(this.agentJson(args.id, { mute: result.value, changed: result.changed }));
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
this.log(result.changed
|
|
34
|
+
? `Agent ${args.id}: mute is now ${result.value}`
|
|
35
|
+
: `Agent ${args.id}: mute was already ${result.value} — nothing to do`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.default = AgentsUnmute;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* Per-USER preference, not agent config: it changes your view of the agent and
|
|
4
|
+
* nobody else's. Idempotent over a toggle endpoint — see `lib/agent-pin-mute.ts`.
|
|
5
|
+
*/
|
|
6
|
+
export default class AgentsUnpin extends BaseCommand {
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: string[];
|
|
9
|
+
static args: {
|
|
10
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
11
|
+
};
|
|
12
|
+
static flags: {
|
|
13
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
};
|
|
15
|
+
run(): Promise<void>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_command_1 = require("../../base-command");
|
|
5
|
+
const agent_pin_mute_1 = require("../../lib/agent-pin-mute");
|
|
6
|
+
/**
|
|
7
|
+
* Per-USER preference, not agent config: it changes your view of the agent and
|
|
8
|
+
* nobody else's. Idempotent over a toggle endpoint — see `lib/agent-pin-mute.ts`.
|
|
9
|
+
*/
|
|
10
|
+
class AgentsUnpin extends base_command_1.BaseCommand {
|
|
11
|
+
static description = 'Remove an agent from your pinned list';
|
|
12
|
+
static examples = ['<%= config.bin %> agents unpin <agent-id>'];
|
|
13
|
+
static args = {
|
|
14
|
+
id: core_1.Args.string({ description: 'Agent ID', required: true, ignoreStdin: true }),
|
|
15
|
+
};
|
|
16
|
+
static flags = {
|
|
17
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
18
|
+
};
|
|
19
|
+
async run() {
|
|
20
|
+
this.requireAuth();
|
|
21
|
+
const { args, flags } = await this.parse(AgentsUnpin);
|
|
22
|
+
let result;
|
|
23
|
+
try {
|
|
24
|
+
result = await (0, agent_pin_mute_1.setAgentFlag)(args.id, 'pin', false);
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
this.handleApiError(err);
|
|
28
|
+
}
|
|
29
|
+
if (flags.json) {
|
|
30
|
+
this.log(this.agentJson(args.id, { pin: result.value, changed: result.changed }));
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
this.log(result.changed
|
|
34
|
+
? `Agent ${args.id}: pin is now ${result.value}`
|
|
35
|
+
: `Agent ${args.id}: pin was already ${result.value} — nothing to do`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.default = AgentsUnpin;
|
|
@@ -40,6 +40,18 @@ export default class AgentsUpdate extends BaseCommand {
|
|
|
40
40
|
'hide-sequential-outputs': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
41
41
|
'is-collaborative': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
42
42
|
'recursion-limit': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
43
|
+
avatar: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
44
|
+
'conversation-starter': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
45
|
+
'todo-working-hours': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
46
|
+
'reasoning-tool-escape': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
47
|
+
'commitment-responsibility': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
48
|
+
'commitment-responsibility-ceiling': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
49
|
+
'max-turns': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
50
|
+
'tool-resources': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
51
|
+
'install-channel': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
52
|
+
'auto-minor-updates': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
53
|
+
'project-id': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
54
|
+
'remove-project-id': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
43
55
|
};
|
|
44
56
|
run(): Promise<void>;
|
|
45
57
|
}
|
|
@@ -32,7 +32,9 @@ class AgentsUpdate extends base_command_1.BaseCommand {
|
|
|
32
32
|
}),
|
|
33
33
|
provider: core_1.Flags.string({ description: 'New provider' }),
|
|
34
34
|
model: core_1.Flags.string({ description: 'New model' }),
|
|
35
|
-
category: core_1.Flags.string({
|
|
35
|
+
category: core_1.Flags.string({
|
|
36
|
+
description: 'New category. `skrr agents categories` lists what this account accepts.',
|
|
37
|
+
}),
|
|
36
38
|
target: core_1.Flags.string({
|
|
37
39
|
description: 'Execution target. Use a Harness id, Hosted Machine session, or Agent Worker. Use hosted-machine, sbs_..., agent-worker, or a connected Harness id.',
|
|
38
40
|
}),
|
|
@@ -54,7 +56,10 @@ class AgentsUpdate extends base_command_1.BaseCommand {
|
|
|
54
56
|
'network-agent-ids': core_1.Flags.string({ description: 'Network agent IDs JSON array' }),
|
|
55
57
|
'network-include-public': core_1.Flags.boolean({ description: 'Include public agents in network' }),
|
|
56
58
|
'character-3d-id': core_1.Flags.string({ description: '3D character ID' }),
|
|
57
|
-
'scene-background': core_1.Flags.string({
|
|
59
|
+
'scene-background': core_1.Flags.string({
|
|
60
|
+
description: 'Backdrop for the 3D view: default, preset:<id>, or image:<filepath>@<source>. ' +
|
|
61
|
+
'A bare string is refused — the stored field is a typed reference, not a name.',
|
|
62
|
+
}),
|
|
58
63
|
'tone-mode': core_1.Flags.string({ description: 'Tone mode' }),
|
|
59
64
|
'tone-id': core_1.Flags.string({ description: 'Tone ID' }),
|
|
60
65
|
'tone-notes': core_1.Flags.string({ description: 'Per-agent tone notes' }),
|
|
@@ -72,6 +77,53 @@ class AgentsUpdate extends base_command_1.BaseCommand {
|
|
|
72
77
|
'hide-sequential-outputs': core_1.Flags.boolean({ description: 'Hide sequential outputs' }),
|
|
73
78
|
'is-collaborative': core_1.Flags.boolean({ description: 'Enable collaboration' }),
|
|
74
79
|
'recursion-limit': core_1.Flags.integer({ description: 'Agent recursion limit' }),
|
|
80
|
+
avatar: core_1.Flags.string({
|
|
81
|
+
description: "The agent's face, as a reference rather than a file: default, preset:<id> " +
|
|
82
|
+
'(`skrr agents avatar presets`), asset:<id> (`skrr agents avatar library`), or ' +
|
|
83
|
+
'image:<filepath>@<source>. To upload a new image use `skrr agents avatar upload`.',
|
|
84
|
+
}),
|
|
85
|
+
'conversation-starter': core_1.Flags.string({
|
|
86
|
+
description: 'Suggested opening prompt shown on the agent (repeatable; replaces the list)',
|
|
87
|
+
multiple: true,
|
|
88
|
+
}),
|
|
89
|
+
'todo-working-hours': core_1.Flags.string({
|
|
90
|
+
description: 'When this agent schedules its own work: HH:MM-HH:MM[@<IANA timezone>], e.g. ' +
|
|
91
|
+
'09:00-18:00@America/Los_Angeles',
|
|
92
|
+
}),
|
|
93
|
+
'reasoning-tool-escape': core_1.Flags.string({
|
|
94
|
+
description: 'Tool a reasoning-only turn may still use (repeatable; replaces the list). ' +
|
|
95
|
+
'These are ESCAPES, not a fenced tool surface.',
|
|
96
|
+
options: [...agent_config_1.REASONING_TOOL_ESCAPES],
|
|
97
|
+
multiple: true,
|
|
98
|
+
}),
|
|
99
|
+
'commitment-responsibility': core_1.Flags.string({
|
|
100
|
+
description: "Default work authority for this agent's commitments",
|
|
101
|
+
options: [...agent_config_1.COMMITMENT_RESPONSIBILITY_LEVELS],
|
|
102
|
+
}),
|
|
103
|
+
'commitment-responsibility-ceiling': core_1.Flags.string({
|
|
104
|
+
description: 'Ceiling a commitment may not exceed, whatever it asks for',
|
|
105
|
+
options: [...agent_config_1.COMMITMENT_RESPONSIBILITY_LEVELS],
|
|
106
|
+
}),
|
|
107
|
+
'max-turns': core_1.Flags.integer({ description: 'Maximum turns in one agent run (1-500)' }),
|
|
108
|
+
'tool-resources': core_1.Flags.string({
|
|
109
|
+
description: 'Tool resources JSON object (file_search / context / image_edit bindings)',
|
|
110
|
+
}),
|
|
111
|
+
'install-channel': core_1.Flags.string({
|
|
112
|
+
description: 'Release policy: which channel installs of this agent follow',
|
|
113
|
+
options: [...agent_config_1.RELEASE_INSTALL_CHANNELS],
|
|
114
|
+
}),
|
|
115
|
+
'auto-minor-updates': core_1.Flags.boolean({
|
|
116
|
+
description: 'Release policy: allow installs to take minor updates automatically',
|
|
117
|
+
allowNo: true,
|
|
118
|
+
}),
|
|
119
|
+
'project-id': core_1.Flags.string({
|
|
120
|
+
description: 'Prompt-store project this agent belongs to (repeatable)',
|
|
121
|
+
multiple: true,
|
|
122
|
+
}),
|
|
123
|
+
'remove-project-id': core_1.Flags.string({
|
|
124
|
+
description: 'Prompt-store project to detach this agent from (repeatable)',
|
|
125
|
+
multiple: true,
|
|
126
|
+
}),
|
|
75
127
|
};
|
|
76
128
|
async run() {
|
|
77
129
|
this.requireAuth();
|
|
@@ -107,7 +159,16 @@ class AgentsUpdate extends base_command_1.BaseCommand {
|
|
|
107
159
|
workingDirectory: flags['working-directory'],
|
|
108
160
|
defaultPermissionMode: flags['default-permission-mode'],
|
|
109
161
|
});
|
|
110
|
-
|
|
162
|
+
// `mergeAgentConfigFlags` parses the typed flags (avatar, scene background,
|
|
163
|
+
// working hours, every JSON flag). A parse failure is the caller's input, so
|
|
164
|
+
// it is reported as a CLI error with the accepted forms — not as an unhandled
|
|
165
|
+
// throw, and not as a 400 from the server naming a zod path.
|
|
166
|
+
try {
|
|
167
|
+
payload = (0, agent_config_1.mergeAgentConfigFlags)(payload, flags);
|
|
168
|
+
}
|
|
169
|
+
catch (err) {
|
|
170
|
+
this.error(err.message, { exit: 1 });
|
|
171
|
+
}
|
|
111
172
|
if (Object.keys(payload).length === 0) {
|
|
112
173
|
this.error('Nothing to update. Pass at least one flag (e.g. --name) or --from-json.', {
|
|
113
174
|
exit: 1,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* `skrr followups act` — an `act` follow-up: a typed built-in action at a
|
|
4
|
+
* time, for an action already exactly known and already agreed to.
|
|
5
|
+
*/
|
|
6
|
+
export default class FollowupsAct extends BaseCommand {
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: string[];
|
|
9
|
+
static flags: {
|
|
10
|
+
subject: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
why: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
action: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
at: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
in: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
|
+
agent: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
16
|
+
endpoint: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
17
|
+
'endpoint-target': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
18
|
+
pin: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
19
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
20
|
+
};
|
|
21
|
+
run(): Promise<void>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_command_1 = require("../../base-command");
|
|
5
|
+
const followups_1 = require("../../lib/followups");
|
|
6
|
+
const agent_resolver_1 = require("../../lib/agent-resolver");
|
|
7
|
+
const triggers_1 = require("../../lib/triggers");
|
|
8
|
+
/**
|
|
9
|
+
* `skrr followups act` — an `act` follow-up: a typed built-in action at a
|
|
10
|
+
* time, for an action already exactly known and already agreed to.
|
|
11
|
+
*/
|
|
12
|
+
class FollowupsAct extends base_command_1.BaseCommand {
|
|
13
|
+
static description = 'Run an agreed action at a time — the act follow-up';
|
|
14
|
+
static examples = [
|
|
15
|
+
'<%= config.bin %> followups act --subject task:OSK-42 --why "user approved the merge" --action \'{"builtinType":"task_merge","config":{"taskId":"OSK-42"}}\' --at 2026-09-20T09:00:00Z',
|
|
16
|
+
];
|
|
17
|
+
static flags = {
|
|
18
|
+
subject: core_1.Flags.string({ description: 'Subject ref: type:externalKey', required: true }),
|
|
19
|
+
why: core_1.Flags.string({ description: 'Why this wake exists, in one line', required: true }),
|
|
20
|
+
action: core_1.Flags.string({
|
|
21
|
+
description: 'Action payload JSON: {"builtinType": "...", "config": {...}, "refId?": "..."}',
|
|
22
|
+
required: true,
|
|
23
|
+
}),
|
|
24
|
+
at: core_1.Flags.string({ description: 'ISO-8601 instant to act at', exclusive: ['in'] }),
|
|
25
|
+
in: core_1.Flags.string({ description: 'Duration from now (2h, 3d)', exclusive: ['at'] }),
|
|
26
|
+
agent: core_1.Flags.string({ description: 'Agent ID (default: bound session agent)' }),
|
|
27
|
+
endpoint: core_1.Flags.string({ description: 'Delivery endpoint id (EndpointRegistry)' }),
|
|
28
|
+
'endpoint-target': core_1.Flags.string({ description: 'Channel target for channel endpoints' }),
|
|
29
|
+
pin: core_1.Flags.string({ description: 'Conversation id the act was authored in' }),
|
|
30
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
31
|
+
};
|
|
32
|
+
async run() {
|
|
33
|
+
this.requireAuth();
|
|
34
|
+
const { flags } = await this.parse(FollowupsAct);
|
|
35
|
+
const at = flags.at ?? flags.in;
|
|
36
|
+
if (!at) {
|
|
37
|
+
this.failWithCliError({
|
|
38
|
+
message: 'Either --at <iso> or --in <duration> is required.',
|
|
39
|
+
code: 'FOLLOWUP_KIND_FIELD_MISSING',
|
|
40
|
+
exit: 2,
|
|
41
|
+
retryable: false,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
const action = (0, triggers_1.parseJsonObject)(flags.action, '--action');
|
|
45
|
+
if (typeof action?.builtinType !== 'string' || !action.builtinType) {
|
|
46
|
+
this.failWithCliError({
|
|
47
|
+
message: '--action needs a builtinType: {"builtinType": "...", "config": {...}}.',
|
|
48
|
+
code: 'FOLLOWUP_KIND_FIELD_MISSING',
|
|
49
|
+
exit: 2,
|
|
50
|
+
retryable: false,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
let agent;
|
|
54
|
+
try {
|
|
55
|
+
agent = (0, followups_1.resolveFollowUpAgent)(flags.agent);
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
const failure = (0, agent_resolver_1.agentResolutionFailure)(err);
|
|
59
|
+
this.failWithCliError({
|
|
60
|
+
message: failure.message,
|
|
61
|
+
code: failure.code,
|
|
62
|
+
exit: 2,
|
|
63
|
+
retryable: false,
|
|
64
|
+
details: { suggestion: failure.suggestion, context: failure.details },
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
let response;
|
|
68
|
+
try {
|
|
69
|
+
response = await followups_1.followupsApi.create({
|
|
70
|
+
kind: 'act',
|
|
71
|
+
producer: agent.boundToSession ? 'agent_in_turn' : 'user_explicit',
|
|
72
|
+
agentId: agent.id,
|
|
73
|
+
subject: (0, followups_1.parseSubjectRef)(flags.subject),
|
|
74
|
+
why: flags.why,
|
|
75
|
+
action,
|
|
76
|
+
at,
|
|
77
|
+
...(flags.endpoint ? { endpointId: flags.endpoint } : {}),
|
|
78
|
+
...(flags['endpoint-target'] ? { endpointTarget: flags['endpoint-target'] } : {}),
|
|
79
|
+
...(flags.pin ? { pinnedConversationId: flags.pin } : {}),
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
this.handleApiError(err);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (flags.json) {
|
|
87
|
+
this.log(JSON.stringify(response, null, 2));
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const row = response.followup;
|
|
91
|
+
if (response.reused) {
|
|
92
|
+
this.log(`Already armed: ${row?.id} — the same act exists and was not duplicated.`);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (response.dropped) {
|
|
96
|
+
this.log('Dropped by the daily act budget — no act was armed.');
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
this.log(`Act armed: ${row?.id} at ${row?.nextRunAt ?? at}.`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
exports.default = FollowupsAct;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* `skrr followups cancel <id>` — abandon a follow-up. If the wait already
|
|
4
|
+
* paid off, say so instead (`resolve --outcome resolved`): the audit keeps
|
|
5
|
+
* the difference.
|
|
6
|
+
*/
|
|
7
|
+
export default class FollowupsCancel extends BaseCommand {
|
|
8
|
+
static description: string;
|
|
9
|
+
static args: {
|
|
10
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
11
|
+
};
|
|
12
|
+
static flags: {
|
|
13
|
+
reason: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_command_1 = require("../../base-command");
|
|
5
|
+
const followups_1 = require("../../lib/followups");
|
|
6
|
+
/**
|
|
7
|
+
* `skrr followups cancel <id>` — abandon a follow-up. If the wait already
|
|
8
|
+
* paid off, say so instead (`resolve --outcome resolved`): the audit keeps
|
|
9
|
+
* the difference.
|
|
10
|
+
*/
|
|
11
|
+
class FollowupsCancel extends base_command_1.BaseCommand {
|
|
12
|
+
static description = 'Abandon a follow-up';
|
|
13
|
+
static args = {
|
|
14
|
+
id: core_1.Args.string({ description: 'Follow-up (trigger) id', required: true, ignoreStdin: true }),
|
|
15
|
+
};
|
|
16
|
+
static flags = {
|
|
17
|
+
reason: core_1.Flags.string({ description: 'Why it is being cancelled' }),
|
|
18
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
19
|
+
};
|
|
20
|
+
async run() {
|
|
21
|
+
this.requireAuth();
|
|
22
|
+
const { args, flags } = await this.parse(FollowupsCancel);
|
|
23
|
+
let result;
|
|
24
|
+
try {
|
|
25
|
+
result = (await followups_1.followupsApi.cancel(args.id, {
|
|
26
|
+
...(flags.reason ? { reason: flags.reason } : {}),
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
this.handleApiError(err);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (flags.json) {
|
|
34
|
+
this.log(JSON.stringify(result, null, 2));
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
this.log(`Follow-up ${args.id} cancelled.`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.default = FollowupsCancel;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* `skrr followups checkin` — a `checkin` follow-up: the agent decides to come
|
|
4
|
+
* back later. `--in` arms the `once` form (the agent's pick); `--frequency`
|
|
5
|
+
* arms `recurring` (a cadence the user picked).
|
|
6
|
+
*
|
|
7
|
+
* This is permission AND restraint: a check-in may stay silent on wake when
|
|
8
|
+
* there is nothing worth saying — silence is the designed outcome, not a
|
|
9
|
+
* failure.
|
|
10
|
+
*/
|
|
11
|
+
export default class FollowupsCheckin extends BaseCommand {
|
|
12
|
+
static description: string;
|
|
13
|
+
static examples: string[];
|
|
14
|
+
static flags: {
|
|
15
|
+
subject: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
16
|
+
why: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
17
|
+
in: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
18
|
+
frequency: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
19
|
+
timezone: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
20
|
+
agent: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
21
|
+
endpoint: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
22
|
+
'endpoint-target': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
23
|
+
pin: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
24
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
25
|
+
};
|
|
26
|
+
run(): Promise<void>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_command_1 = require("../../base-command");
|
|
5
|
+
const followups_1 = require("../../lib/followups");
|
|
6
|
+
const agent_resolver_1 = require("../../lib/agent-resolver");
|
|
7
|
+
/**
|
|
8
|
+
* `skrr followups checkin` — a `checkin` follow-up: the agent decides to come
|
|
9
|
+
* back later. `--in` arms the `once` form (the agent's pick); `--frequency`
|
|
10
|
+
* arms `recurring` (a cadence the user picked).
|
|
11
|
+
*
|
|
12
|
+
* This is permission AND restraint: a check-in may stay silent on wake when
|
|
13
|
+
* there is nothing worth saying — silence is the designed outcome, not a
|
|
14
|
+
* failure.
|
|
15
|
+
*/
|
|
16
|
+
class FollowupsCheckin extends base_command_1.BaseCommand {
|
|
17
|
+
static description = 'Come back to this later — the check-in follow-up';
|
|
18
|
+
static examples = [
|
|
19
|
+
'<%= config.bin %> followups checkin --subject conversation:conv_9 --why "waiting on their answer about the move" --in 90m',
|
|
20
|
+
'<%= config.bin %> followups checkin --subject task:OSK-42 --why "weekly touch-base" --frequency "0 9 * * MON" --timezone America/New_York',
|
|
21
|
+
];
|
|
22
|
+
static flags = {
|
|
23
|
+
subject: core_1.Flags.string({ description: 'Subject ref: type:externalKey', required: true }),
|
|
24
|
+
why: core_1.Flags.string({ description: 'Why this wake exists, in one line', required: true }),
|
|
25
|
+
in: core_1.Flags.string({
|
|
26
|
+
description: 'Duration from now (90m, 2h) — the once form',
|
|
27
|
+
exclusive: ['frequency'],
|
|
28
|
+
}),
|
|
29
|
+
frequency: core_1.Flags.string({
|
|
30
|
+
description: 'Cron cadence — the recurring form (user-picked)',
|
|
31
|
+
exclusive: ['in'],
|
|
32
|
+
}),
|
|
33
|
+
timezone: core_1.Flags.string({
|
|
34
|
+
description: 'IANA timezone for --frequency',
|
|
35
|
+
dependsOn: ['frequency'],
|
|
36
|
+
}),
|
|
37
|
+
agent: core_1.Flags.string({ description: 'Agent ID (default: bound session agent)' }),
|
|
38
|
+
endpoint: core_1.Flags.string({ description: 'Delivery endpoint id (EndpointRegistry)' }),
|
|
39
|
+
'endpoint-target': core_1.Flags.string({ description: 'Channel target for channel endpoints' }),
|
|
40
|
+
pin: core_1.Flags.string({ description: 'Conversation id the check-in was authored in' }),
|
|
41
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
42
|
+
};
|
|
43
|
+
async run() {
|
|
44
|
+
this.requireAuth();
|
|
45
|
+
const { flags } = await this.parse(FollowupsCheckin);
|
|
46
|
+
if (!flags.in && !flags.frequency) {
|
|
47
|
+
this.failWithCliError({
|
|
48
|
+
message: 'Either --in <duration> or --frequency <cron> is required.',
|
|
49
|
+
code: 'FOLLOWUP_KIND_FIELD_MISSING',
|
|
50
|
+
exit: 2,
|
|
51
|
+
retryable: false,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
let agent;
|
|
55
|
+
try {
|
|
56
|
+
agent = (0, followups_1.resolveFollowUpAgent)(flags.agent);
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
const failure = (0, agent_resolver_1.agentResolutionFailure)(err);
|
|
60
|
+
this.failWithCliError({
|
|
61
|
+
message: failure.message,
|
|
62
|
+
code: failure.code,
|
|
63
|
+
exit: 2,
|
|
64
|
+
retryable: false,
|
|
65
|
+
details: { suggestion: failure.suggestion, context: failure.details },
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
let response;
|
|
69
|
+
try {
|
|
70
|
+
response = await followups_1.followupsApi.create({
|
|
71
|
+
kind: 'checkin',
|
|
72
|
+
producer: agent.boundToSession ? 'agent_in_turn' : 'user_explicit',
|
|
73
|
+
agentId: agent.id,
|
|
74
|
+
subject: (0, followups_1.parseSubjectRef)(flags.subject),
|
|
75
|
+
why: flags.why,
|
|
76
|
+
...(flags.in ? { form: 'once', in: flags.in } : {}),
|
|
77
|
+
...(flags.frequency
|
|
78
|
+
? { form: 'recurring', frequency: flags.frequency, timezone: flags.timezone }
|
|
79
|
+
: {}),
|
|
80
|
+
...(flags.endpoint ? { endpointId: flags.endpoint } : {}),
|
|
81
|
+
...(flags['endpoint-target'] ? { endpointTarget: flags['endpoint-target'] } : {}),
|
|
82
|
+
...(flags.pin ? { pinnedConversationId: flags.pin } : {}),
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
this.handleApiError(err);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (flags.json) {
|
|
90
|
+
this.log(JSON.stringify(response, null, 2));
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const row = response.followup;
|
|
94
|
+
if (response.reused) {
|
|
95
|
+
this.log(`Already armed: ${row?.id} — one pending check-in per conversation, and this is it.`);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (response.dropped) {
|
|
99
|
+
// silent_drop is the check-in budget's contract: the answer to "one
|
|
100
|
+
// greeting too many" is quiet, not an error the caller can retry.
|
|
101
|
+
this.log('Dropped by the daily check-in budget — staying quiet is the correct outcome.');
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
this.log(`Check-in armed: ${row?.id} at ${row?.nextRunAt ?? flags.in ?? flags.frequency}.`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
exports.default = FollowupsCheckin;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BaseCommand } from '../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* `skrr followups list` — what is still owed, one row per follow-up across
|
|
4
|
+
* all four kinds.
|
|
5
|
+
*
|
|
6
|
+
* Default scope is ONE agent (the session's, or `--agent`) — "what do I still
|
|
7
|
+
* owe" is the question an agent asks. `--all-agents` is the human's view and
|
|
8
|
+
* is opt-in, so an agent cannot accidentally read another agent's
|
|
9
|
+
* obligations and start reasoning about them.
|
|
10
|
+
*/
|
|
11
|
+
export default class FollowupsList extends BaseCommand {
|
|
12
|
+
static description: string;
|
|
13
|
+
static examples: string[];
|
|
14
|
+
static flags: {
|
|
15
|
+
agent: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
16
|
+
'all-agents': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
kind: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
18
|
+
subject: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
19
|
+
state: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
20
|
+
limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
21
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
22
|
+
};
|
|
23
|
+
run(): Promise<void>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_command_1 = require("../../base-command");
|
|
5
|
+
const followups_1 = require("../../lib/followups");
|
|
6
|
+
const agent_resolver_1 = require("../../lib/agent-resolver");
|
|
7
|
+
/**
|
|
8
|
+
* `skrr followups list` — what is still owed, one row per follow-up across
|
|
9
|
+
* all four kinds.
|
|
10
|
+
*
|
|
11
|
+
* Default scope is ONE agent (the session's, or `--agent`) — "what do I still
|
|
12
|
+
* owe" is the question an agent asks. `--all-agents` is the human's view and
|
|
13
|
+
* is opt-in, so an agent cannot accidentally read another agent's
|
|
14
|
+
* obligations and start reasoning about them.
|
|
15
|
+
*/
|
|
16
|
+
class FollowupsList extends base_command_1.BaseCommand {
|
|
17
|
+
static description = 'List follow-ups — armed, proposed, paused, or settled';
|
|
18
|
+
static examples = [
|
|
19
|
+
'<%= config.bin %> followups list',
|
|
20
|
+
'<%= config.bin %> followups list --agent agent_1 --kind watch --state armed',
|
|
21
|
+
'<%= config.bin %> followups list --all-agents --kind checkin',
|
|
22
|
+
'<%= config.bin %> followups list --subject task:OSK-42 --json',
|
|
23
|
+
];
|
|
24
|
+
static flags = {
|
|
25
|
+
agent: core_1.Flags.string({
|
|
26
|
+
description: 'Agent ID (default: bound session agent)',
|
|
27
|
+
exclusive: ['all-agents'],
|
|
28
|
+
}),
|
|
29
|
+
'all-agents': core_1.Flags.boolean({
|
|
30
|
+
description: 'List across every agent — the human view',
|
|
31
|
+
exclusive: ['agent'],
|
|
32
|
+
default: false,
|
|
33
|
+
}),
|
|
34
|
+
kind: core_1.Flags.string({ description: 'Filter by kind', options: [...followups_1.FOLLOWUP_KINDS] }),
|
|
35
|
+
subject: core_1.Flags.string({ description: 'Filter by subject ref: type:externalKey' }),
|
|
36
|
+
state: core_1.Flags.string({ description: 'Filter by state', options: [...followups_1.FOLLOWUP_STATES] }),
|
|
37
|
+
limit: core_1.Flags.integer({ description: 'Max results (1..500)', min: 1, max: 500 }),
|
|
38
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
39
|
+
};
|
|
40
|
+
async run() {
|
|
41
|
+
this.requireAuth();
|
|
42
|
+
const { flags } = await this.parse(FollowupsList);
|
|
43
|
+
let agentId;
|
|
44
|
+
if (!flags['all-agents']) {
|
|
45
|
+
try {
|
|
46
|
+
agentId = (0, followups_1.resolveFollowUpAgent)(flags.agent).id;
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
const failure = (0, agent_resolver_1.agentResolutionFailure)(err);
|
|
50
|
+
this.failWithCliError({
|
|
51
|
+
message: failure.message,
|
|
52
|
+
code: failure.code,
|
|
53
|
+
exit: 2,
|
|
54
|
+
retryable: false,
|
|
55
|
+
details: { suggestion: failure.suggestion, context: failure.details },
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
let response;
|
|
60
|
+
try {
|
|
61
|
+
response = await followups_1.followupsApi.list({
|
|
62
|
+
...(agentId ? { agentId } : {}),
|
|
63
|
+
...(flags['all-agents'] ? { allAgents: true } : {}),
|
|
64
|
+
...(flags.kind ? { kind: flags.kind } : {}),
|
|
65
|
+
...(flags.subject ? { subject: flags.subject } : {}),
|
|
66
|
+
...(flags.state ? { state: flags.state } : {}),
|
|
67
|
+
...(flags.limit ? { limit: flags.limit } : {}),
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
this.handleApiError(err);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (flags.json) {
|
|
75
|
+
this.log(JSON.stringify(response, null, 2));
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const rows = response.followups ?? [];
|
|
79
|
+
if (rows.length === 0) {
|
|
80
|
+
this.log('No follow-ups.');
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
for (const row of rows) {
|
|
84
|
+
this.log((0, followups_1.followupSummaryLine)(row));
|
|
85
|
+
if (row.why)
|
|
86
|
+
this.log(` why: ${row.why}`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.default = FollowupsList;
|