@formant/formant-cli 0.1.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.
Files changed (147) hide show
  1. package/LICENSE +24 -0
  2. package/README.md +322 -0
  3. package/bin/dev.js +5 -0
  4. package/bin/run.js +5 -0
  5. package/dist/base-command.d.ts +38 -0
  6. package/dist/base-command.js +66 -0
  7. package/dist/base-command.js.map +1 -0
  8. package/dist/commands/analytics/query.d.ts +12 -0
  9. package/dist/commands/analytics/query.js +82 -0
  10. package/dist/commands/analytics/query.js.map +1 -0
  11. package/dist/commands/analytics/tables.d.ts +9 -0
  12. package/dist/commands/analytics/tables.js +34 -0
  13. package/dist/commands/analytics/tables.js.map +1 -0
  14. package/dist/commands/commands/for-device.d.ts +12 -0
  15. package/dist/commands/commands/for-device.js +33 -0
  16. package/dist/commands/commands/for-device.js.map +1 -0
  17. package/dist/commands/commands/get.d.ts +11 -0
  18. package/dist/commands/commands/get.js +133 -0
  19. package/dist/commands/commands/get.js.map +1 -0
  20. package/dist/commands/commands/history.d.ts +13 -0
  21. package/dist/commands/commands/history.js +49 -0
  22. package/dist/commands/commands/history.js.map +1 -0
  23. package/dist/commands/commands/list.d.ts +9 -0
  24. package/dist/commands/commands/list.js +31 -0
  25. package/dist/commands/commands/list.js.map +1 -0
  26. package/dist/commands/commands/send.d.ts +37 -0
  27. package/dist/commands/commands/send.js +260 -0
  28. package/dist/commands/commands/send.js.map +1 -0
  29. package/dist/commands/devices/config.d.ts +10 -0
  30. package/dist/commands/devices/config.js +38 -0
  31. package/dist/commands/devices/config.js.map +1 -0
  32. package/dist/commands/devices/get.d.ts +10 -0
  33. package/dist/commands/devices/get.js +35 -0
  34. package/dist/commands/devices/get.js.map +1 -0
  35. package/dist/commands/devices/last-seen.d.ts +10 -0
  36. package/dist/commands/devices/last-seen.js +25 -0
  37. package/dist/commands/devices/last-seen.js.map +1 -0
  38. package/dist/commands/devices/list.d.ts +20 -0
  39. package/dist/commands/devices/list.js +133 -0
  40. package/dist/commands/devices/list.js.map +1 -0
  41. package/dist/commands/devices/streams.d.ts +12 -0
  42. package/dist/commands/devices/streams.js +56 -0
  43. package/dist/commands/devices/streams.js.map +1 -0
  44. package/dist/commands/event-triggers/get.d.ts +10 -0
  45. package/dist/commands/event-triggers/get.js +29 -0
  46. package/dist/commands/event-triggers/get.js.map +1 -0
  47. package/dist/commands/event-triggers/list.d.ts +9 -0
  48. package/dist/commands/event-triggers/list.js +30 -0
  49. package/dist/commands/event-triggers/list.js.map +1 -0
  50. package/dist/commands/events/get.d.ts +10 -0
  51. package/dist/commands/events/get.js +35 -0
  52. package/dist/commands/events/get.js.map +1 -0
  53. package/dist/commands/events/list.d.ts +17 -0
  54. package/dist/commands/events/list.js +81 -0
  55. package/dist/commands/events/list.js.map +1 -0
  56. package/dist/commands/fleets/get.d.ts +10 -0
  57. package/dist/commands/fleets/get.js +28 -0
  58. package/dist/commands/fleets/get.js.map +1 -0
  59. package/dist/commands/fleets/list.d.ts +9 -0
  60. package/dist/commands/fleets/list.js +27 -0
  61. package/dist/commands/fleets/list.js.map +1 -0
  62. package/dist/commands/investigations/analytics.d.ts +15 -0
  63. package/dist/commands/investigations/analytics.js +69 -0
  64. package/dist/commands/investigations/analytics.js.map +1 -0
  65. package/dist/commands/investigations/get.d.ts +10 -0
  66. package/dist/commands/investigations/get.js +38 -0
  67. package/dist/commands/investigations/get.js.map +1 -0
  68. package/dist/commands/investigations/list.d.ts +12 -0
  69. package/dist/commands/investigations/list.js +41 -0
  70. package/dist/commands/investigations/list.js.map +1 -0
  71. package/dist/commands/investigations/run.d.ts +15 -0
  72. package/dist/commands/investigations/run.js +96 -0
  73. package/dist/commands/investigations/run.js.map +1 -0
  74. package/dist/commands/investigations/runs-list.d.ts +18 -0
  75. package/dist/commands/investigations/runs-list.js +57 -0
  76. package/dist/commands/investigations/runs-list.js.map +1 -0
  77. package/dist/commands/investigations/runs.d.ts +12 -0
  78. package/dist/commands/investigations/runs.js +30 -0
  79. package/dist/commands/investigations/runs.js.map +1 -0
  80. package/dist/commands/investigations/stats.d.ts +11 -0
  81. package/dist/commands/investigations/stats.js +40 -0
  82. package/dist/commands/investigations/stats.js.map +1 -0
  83. package/dist/commands/investigations/trigger.d.ts +14 -0
  84. package/dist/commands/investigations/trigger.js +43 -0
  85. package/dist/commands/investigations/trigger.js.map +1 -0
  86. package/dist/commands/kv/get.d.ts +10 -0
  87. package/dist/commands/kv/get.js +28 -0
  88. package/dist/commands/kv/get.js.map +1 -0
  89. package/dist/commands/kv/list.d.ts +13 -0
  90. package/dist/commands/kv/list.js +73 -0
  91. package/dist/commands/kv/list.js.map +1 -0
  92. package/dist/commands/kv/set.d.ts +11 -0
  93. package/dist/commands/kv/set.js +40 -0
  94. package/dist/commands/kv/set.js.map +1 -0
  95. package/dist/commands/query/index.d.ts +19 -0
  96. package/dist/commands/query/index.js +105 -0
  97. package/dist/commands/query/index.js.map +1 -0
  98. package/dist/commands/query/latest-values.d.ts +14 -0
  99. package/dist/commands/query/latest-values.js +102 -0
  100. package/dist/commands/query/latest-values.js.map +1 -0
  101. package/dist/commands/schedules/get.d.ts +10 -0
  102. package/dist/commands/schedules/get.js +29 -0
  103. package/dist/commands/schedules/get.js.map +1 -0
  104. package/dist/commands/schedules/list.d.ts +9 -0
  105. package/dist/commands/schedules/list.js +29 -0
  106. package/dist/commands/schedules/list.js.map +1 -0
  107. package/dist/commands/signals/count.d.ts +13 -0
  108. package/dist/commands/signals/count.js +43 -0
  109. package/dist/commands/signals/count.js.map +1 -0
  110. package/dist/commands/signals/get.d.ts +13 -0
  111. package/dist/commands/signals/get.js +80 -0
  112. package/dist/commands/signals/get.js.map +1 -0
  113. package/dist/commands/signals/list.d.ts +9 -0
  114. package/dist/commands/signals/list.js +30 -0
  115. package/dist/commands/signals/list.js.map +1 -0
  116. package/dist/commands/signals/query.d.ts +14 -0
  117. package/dist/commands/signals/query.js +52 -0
  118. package/dist/commands/signals/query.js.map +1 -0
  119. package/dist/commands/users/get.d.ts +10 -0
  120. package/dist/commands/users/get.js +28 -0
  121. package/dist/commands/users/get.js.map +1 -0
  122. package/dist/commands/users/list.d.ts +9 -0
  123. package/dist/commands/users/list.js +28 -0
  124. package/dist/commands/users/list.js.map +1 -0
  125. package/dist/help.d.ts +4 -0
  126. package/dist/help.js +91 -0
  127. package/dist/help.js.map +1 -0
  128. package/dist/hooks/init.d.ts +3 -0
  129. package/dist/hooks/init.js +7 -0
  130. package/dist/hooks/init.js.map +1 -0
  131. package/dist/index.d.ts +1 -0
  132. package/dist/index.js +2 -0
  133. package/dist/index.js.map +1 -0
  134. package/dist/lib/api.d.ts +12 -0
  135. package/dist/lib/api.js +46 -0
  136. package/dist/lib/api.js.map +1 -0
  137. package/dist/lib/auth.d.ts +17 -0
  138. package/dist/lib/auth.js +41 -0
  139. package/dist/lib/auth.js.map +1 -0
  140. package/dist/lib/config.d.ts +7 -0
  141. package/dist/lib/config.js +21 -0
  142. package/dist/lib/config.js.map +1 -0
  143. package/dist/lib/formatters.d.ts +17 -0
  144. package/dist/lib/formatters.js +53 -0
  145. package/dist/lib/formatters.js.map +1 -0
  146. package/oclif.manifest.json +2683 -0
  147. package/package.json +117 -0
@@ -0,0 +1,9 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class FleetsList extends BaseCommand<typeof FleetsList> {
3
+ static description: string;
4
+ static examples: string[];
5
+ static summary: string;
6
+ run(): Promise<{
7
+ items: unknown[];
8
+ }>;
9
+ }
@@ -0,0 +1,27 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ import { formatTable } from '../../lib/formatters.js';
3
+ export default class FleetsList extends BaseCommand {
4
+ static description = `List all device groups (fleets) in your organization.
5
+
6
+ Device groups allow you to organize and manage sets of devices together.`;
7
+ static examples = [
8
+ '<%= config.bin %> fleets list',
9
+ '<%= config.bin %> fleets list --json',
10
+ ];
11
+ static summary = 'List device groups';
12
+ async run() {
13
+ const result = await this.api('admin', 'groups', { method: 'GET' });
14
+ if (!this.jsonEnabled()) {
15
+ const columns = [
16
+ { key: 'name', label: 'NAME', width: 30 },
17
+ { key: 'id', label: 'ID', width: 40 },
18
+ { key: 'description', label: 'DESCRIPTION', width: 40 },
19
+ ];
20
+ this.log(`\nFleets (Device Groups) (${this.env}):\n`);
21
+ this.log(formatTable(result.items ?? [], columns));
22
+ this.log('');
23
+ }
24
+ return result;
25
+ }
26
+ }
27
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/fleets/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAc,WAAW,EAAC,MAAM,yBAAyB,CAAA;AAEhE,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAA8B;IACpE,MAAM,CAAU,WAAW,GAAG;;yEAEyC,CAAA;IAEvE,MAAM,CAAU,QAAQ,GAAG;QACzB,+BAA+B;QAC/B,sCAAsC;KACvC,CAAA;IAED,MAAM,CAAU,OAAO,GAAG,oBAAoB,CAAA;IAEvC,KAAK,CAAC,GAAG;QACd,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAC3B,OAAO,EACP,QAAQ,EACR,EAAC,MAAM,EAAE,KAAK,EAAC,CAChB,CAAA;QAED,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,MAAM,OAAO,GAAa;gBACxB,EAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAC;gBACvC,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAC;gBACnC,EAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,EAAE,EAAC;aACtD,CAAA;YAED,IAAI,CAAC,GAAG,CAAC,6BAA6B,IAAI,CAAC,GAAG,MAAM,CAAC,CAAA;YACrD,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC,CAAA;YAClD,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACd,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class InvestigationsAnalytics extends BaseCommand<typeof InvestigationsAnalytics> {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ end: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
7
+ 'group-by': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ interval: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
+ start: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
+ };
11
+ static summary: string;
12
+ run(): Promise<{
13
+ data: unknown[];
14
+ }>;
15
+ }
@@ -0,0 +1,69 @@
1
+ import { Flags } from '@oclif/core';
2
+ import { BaseCommand } from '../../base-command.js';
3
+ import { formatTable } from '../../lib/formatters.js';
4
+ export default class InvestigationsAnalytics extends BaseCommand {
5
+ static description = `Get investigation analytics with time-series data.
6
+
7
+ Returns aggregated analytics about investigation runs over a time range,
8
+ optionally grouped by result type or signal type.`;
9
+ static examples = [
10
+ '<%= config.bin %> investigations analytics --start 2026-01-01 --end 2026-02-01',
11
+ '<%= config.bin %> investigations analytics --start 2026-01-01 --end 2026-02-01 --interval hourly',
12
+ '<%= config.bin %> investigations analytics --start 2026-01-01 --end 2026-02-01 --group-by resultType --json',
13
+ ];
14
+ static flags = {
15
+ end: Flags.string({
16
+ description: 'End time (ISO 8601)',
17
+ required: true,
18
+ }),
19
+ 'group-by': Flags.string({
20
+ description: 'Group results by',
21
+ options: ['resultType', 'signalType'],
22
+ }),
23
+ interval: Flags.string({
24
+ default: 'daily',
25
+ description: 'Time interval for aggregation',
26
+ options: ['daily', 'hourly'],
27
+ }),
28
+ start: Flags.string({
29
+ description: 'Start time (ISO 8601)',
30
+ required: true,
31
+ }),
32
+ };
33
+ static summary = 'Get investigation analytics';
34
+ async run() {
35
+ // Normalize dates to ISO 8601 datetime format
36
+ const startTime = this.normalizeDateTime(this.flags.start);
37
+ const endTime = this.normalizeDateTime(this.flags.end);
38
+ const body = {
39
+ endTime,
40
+ interval: this.flags.interval,
41
+ startTime,
42
+ };
43
+ if (this.flags['group-by'])
44
+ body.groupBy = this.flags['group-by'];
45
+ const result = await this.api('theopolis', 'investigations/analytics', { body });
46
+ if (!this.jsonEnabled()) {
47
+ const data = result.data ?? [];
48
+ this.log(`\nInvestigation Analytics (${this.env}):\n`);
49
+ this.log(` Time range: ${this.flags.start} → ${this.flags.end}`);
50
+ this.log(` Interval: ${this.flags.interval}\n`);
51
+ if (data.length > 0) {
52
+ // Derive columns from data keys
53
+ const keys = Object.keys(data[0]);
54
+ const columns = keys.map((key) => ({
55
+ key,
56
+ label: key.toUpperCase(),
57
+ width: Math.max(key.length + 2, 16),
58
+ }));
59
+ this.log(formatTable(data, columns));
60
+ }
61
+ else {
62
+ this.log(' No analytics data for this time range.');
63
+ }
64
+ this.log('');
65
+ }
66
+ return result;
67
+ }
68
+ }
69
+ //# sourceMappingURL=analytics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../../src/commands/investigations/analytics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAEjC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAc,WAAW,EAAC,MAAM,yBAAyB,CAAA;AAEhE,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,WAA2C;IAC9F,MAAM,CAAU,WAAW,GAAG;;;kDAGkB,CAAA;IAEhD,MAA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I,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,EAAE,CAAA;YAE9B,IAAI,CAAC,GAAG,CAAC,8BAA8B,IAAI,CAAC,GAAG,MAAM,CAAC,CAAA;YACtD,IAAI,CAAC,GAAG,CAAC,iBAAiB,IAAI,CAAC,KAAK,CAAC,KAAK,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAA;YACjE,IAAI,CAAC,GAAG,CAAC,eAAe,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,CAAC,CAAA;YAEhD,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACpB,gCAAgC;gBAChC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;gBACjC,MAAM,OAAO,GAAa,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;oBAC3C,GAAG;oBACH,KAAK,EAAE,GAAG,CAAC,WAAW,EAAE;oBACxB,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,EAAE,CAAC;iBACpC,CAAC,CAAC,CAAA;gBAEH,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAA;YACtC,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAA;YACtD,CAAC;YAED,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACd,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class InvestigationsGet extends BaseCommand<typeof InvestigationsGet> {
3
+ static args: {
4
+ id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static summary: string;
9
+ run(): Promise<Record<string, unknown>>;
10
+ }
@@ -0,0 +1,38 @@
1
+ import { Args } from '@oclif/core';
2
+ import { BaseCommand } from '../../base-command.js';
3
+ import { formatDetail } from '../../lib/formatters.js';
4
+ export default class InvestigationsGet extends BaseCommand {
5
+ static args = {
6
+ id: Args.string({ description: 'Investigation (taskflow) ID', required: true }),
7
+ };
8
+ static description = 'Get detailed information about a specific investigation by ID.';
9
+ static examples = [
10
+ '<%= config.bin %> investigations get <id>',
11
+ '<%= config.bin %> investigations get <id> --json',
12
+ ];
13
+ static summary = 'Get an investigation by ID';
14
+ async run() {
15
+ // List all and filter — theopolis doesn't have a direct GET by ID for taskflows
16
+ const result = await this.api('theopolis', 'taskflows', { method: 'GET' });
17
+ const investigation = (result.items ?? []).find((i) => i.id === this.args.id);
18
+ if (!investigation) {
19
+ this.error(`Investigation not found: ${this.args.id}`);
20
+ }
21
+ if (!this.jsonEnabled()) {
22
+ this.log(`\nInvestigation Details (${this.env}):\n`);
23
+ this.log(formatDetail(investigation, {
24
+ createdAt: 'Created',
25
+ description: 'Description',
26
+ graph: 'Graph',
27
+ id: 'ID',
28
+ isSignalHandler: 'Signal Handler',
29
+ name: 'Name',
30
+ tags: 'Tags',
31
+ updatedAt: 'Updated',
32
+ }));
33
+ this.log('');
34
+ }
35
+ return investigation;
36
+ }
37
+ }
38
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/investigations/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAA;AAEpD,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,WAAqC;IAClF,MAAM,CAAU,IAAI,GAAG;QACrB,EAAE,EAAE,I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AC"}
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class InvestigationsList extends BaseCommand<typeof InvestigationsList> {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ 'signal-handler': import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
+ };
8
+ static summary: string;
9
+ run(): Promise<{
10
+ items: unknown[];
11
+ }>;
12
+ }
@@ -0,0 +1,41 @@
1
+ import { Flags } from '@oclif/core';
2
+ import { BaseCommand } from '../../base-command.js';
3
+ import { formatTable } from '../../lib/formatters.js';
4
+ export default class InvestigationsList extends BaseCommand {
5
+ static description = `List investigations (AI-powered analysis workflows) in your organization.
6
+
7
+ Investigations are automated AI workflows that analyze signals, diagnose problems,
8
+ and produce reports. Use --signal-handler to filter for investigations that are
9
+ triggered automatically by signals.`;
10
+ static examples = [
11
+ '<%= config.bin %> investigations list',
12
+ '<%= config.bin %> investigations list --signal-handler',
13
+ '<%= config.bin %> investigations list --json',
14
+ ];
15
+ static flags = {
16
+ 'signal-handler': Flags.boolean({
17
+ description: 'Only show investigations that handle signals',
18
+ }),
19
+ };
20
+ static summary = 'List investigations';
21
+ async run() {
22
+ const query = {};
23
+ if (this.flags['signal-handler']) {
24
+ query.isSignalHandler = 'true';
25
+ }
26
+ const result = await this.api('theopolis', 'taskflows', { method: 'GET', query });
27
+ if (!this.jsonEnabled()) {
28
+ const columns = [
29
+ { key: 'name', label: 'NAME', width: 35 },
30
+ { key: 'id', label: 'ID', width: 40 },
31
+ { key: 'isSignalHandler', label: 'SIGNAL HANDLER', width: 16 },
32
+ { key: 'description', label: 'DESCRIPTION', width: 40 },
33
+ ];
34
+ this.log(`\nInvestigations (${this.env} environment):\n`);
35
+ this.log(formatTable(result.items ?? [], columns));
36
+ this.log('');
37
+ }
38
+ return result;
39
+ }
40
+ }
41
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/investigations/list.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KAAK,EAAE,EAAE,EAAC;aACtD,CAAA;YAED,IAAI,CAAC,GAAG,CAAC,qBAAqB,IAAI,CAAC,GAAG,kBAAkB,CAAC,CAAA;YACzD,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC,CAAA;YAClD,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACd,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class InvestigationsRun extends BaseCommand<typeof InvestigationsRun> {
3
+ static args: {
4
+ investigationId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ runId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static description: string;
8
+ static examples: string[];
9
+ static flags: {
10
+ 'log-only': import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ 'trace-signal': import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
+ };
13
+ static summary: string;
14
+ run(): Promise<Record<string, unknown>>;
15
+ }
@@ -0,0 +1,96 @@
1
+ import { Args, Flags } from '@oclif/core';
2
+ import { BaseCommand } from '../../base-command.js';
3
+ import { formatDetail } from '../../lib/formatters.js';
4
+ export default class InvestigationsRun extends BaseCommand {
5
+ static args = {
6
+ investigationId: Args.string({ description: 'Investigation (taskflow) ID', required: true }),
7
+ runId: Args.string({ description: 'Run ID', required: true }),
8
+ };
9
+ static description = `Get detailed information about a specific investigation run.
10
+
11
+ Shows run details including status, signal information, events, and the complete execution
12
+ log with node inputs/outputs, task messages, tool usage, and results.
13
+
14
+ Use this to trace the investigation run back to its signal and triggering event.`;
15
+ static examples = [
16
+ '<%= config.bin %> investigations run <investigation-id> <run-id>',
17
+ '<%= config.bin %> investigations run <investigation-id> <run-id> --log-only',
18
+ '<%= config.bin %> investigations run <investigation-id> <run-id> --json',
19
+ ];
20
+ static flags = {
21
+ 'log-only': Flags.boolean({
22
+ description: 'Only show the execution log (skip run details)',
23
+ }),
24
+ 'trace-signal': Flags.boolean({
25
+ description: 'Fetch and display the signal and event information for this run',
26
+ }),
27
+ };
28
+ static summary = 'Get investigation run details and execution log';
29
+ async run() {
30
+ const { investigationId, runId } = this.args;
31
+ // Fetch both run details and execution log in parallel
32
+ const [runData, logData] = await Promise.all([
33
+ this.api('theopolis', `taskflows/${investigationId}/runs/${runId}`, { method: 'GET' }),
34
+ this.api('theopolis', `taskflows/${investigationId}/runs/${runId}/execution-log`, { method: 'GET' }),
35
+ ]);
36
+ const result = {
37
+ run: runData.run,
38
+ events: runData.events,
39
+ executionLog: logData.executionLog,
40
+ };
41
+ // If trace-signal is enabled and we have a signalId, fetch signal and event info
42
+ if (this.flags['trace-signal'] && runData.run.signalId) {
43
+ try {
44
+ const signal = await this.api('theopolis', `signals/${runData.run.signalId}`, { method: 'GET' });
45
+ result.signal = signal;
46
+ // If signal has an eventId, fetch the event
47
+ if (signal.eventId) {
48
+ try {
49
+ const event = await this.api('admin', `events/${signal.eventId}`, {
50
+ method: 'GET',
51
+ });
52
+ result.triggerEvent = event;
53
+ }
54
+ catch {
55
+ // Event might not exist or be accessible
56
+ }
57
+ }
58
+ }
59
+ catch {
60
+ // Signal might not exist
61
+ }
62
+ }
63
+ if (!this.jsonEnabled()) {
64
+ if (!this.flags['log-only']) {
65
+ this.log(`\nInvestigation Run Details (${this.env}):\n`);
66
+ this.log(formatDetail(runData.run));
67
+ this.log('');
68
+ // Show signal trace if requested
69
+ if (this.flags['trace-signal'] && result.signal) {
70
+ this.log(`Signal Details:\n`);
71
+ this.log(formatDetail(result.signal));
72
+ this.log('');
73
+ if (result.triggerEvent) {
74
+ this.log(`Triggering Event:\n`);
75
+ this.log(formatDetail(result.triggerEvent));
76
+ this.log('');
77
+ }
78
+ }
79
+ if (runData.events && Array.isArray(runData.events) && runData.events.length > 0) {
80
+ this.log(`Run Events (${runData.events.length}):\n`);
81
+ for (const event of runData.events) {
82
+ this.log(formatDetail(event));
83
+ this.log('');
84
+ }
85
+ }
86
+ }
87
+ this.log(`Execution Log:\n`);
88
+ this.log('─'.repeat(80));
89
+ this.log(logData.executionLog);
90
+ this.log('─'.repeat(80));
91
+ this.log('');
92
+ }
93
+ return result;
94
+ }
95
+ }
96
+ //# sourceMappingURL=run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/commands/investigations/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAE,KAAK,EAAC,MAAM,aAAa,CAAA;AAEvC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAA;AAEpD,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,WAAqC;IAClF,MAAM,CAAU,IAAI,GAAG;QACrB,eAAe,EAAE,IAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,6BAA6B,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;QAC1F,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;KAC5D,CAAA;IAED,MAAM,CAAU,WAAW,GAAG;;;;;iFAKiD,CAAA;IAE/E,MAAM,CAAU,QAAQ,GAAG;QACzB,kEAAkE;QAClE,6EAA6E;QAC7E,yEAAyE;KAC1E,CAAA;IAED,MAAM,CAAU,KAAK,GAAG;QACtB,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC;YACxB,WAAW,EAAE,gDAAgD;SAC9D,CAAC;QACF,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC;YAC5B,WAAW,EAAE,iEAAiE;SAC/E,CAAC;KACH,CAAA;IAED,MAAM,CAAU,OAAO,GAAG,iDAAiD,CAAA;IAEpE,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,eAAe,EAAE,KAAK,EAA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C,CAAC,CAAA;wBACxD,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;oBACd,CAAC;gBACH,CAAC;YACH,CAAC;YAED,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;YAC5B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAA;YACxB,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC,CAAA;YAC9B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAA;YACxB,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACd,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class InvestigationsRunsList extends BaseCommand<typeof InvestigationsRunsList> {
3
+ static args: {
4
+ id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static flags: {
9
+ details: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
+ limit: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
11
+ offset: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
12
+ };
13
+ static summary: string;
14
+ run(): Promise<{
15
+ runs: unknown[];
16
+ total: number;
17
+ }>;
18
+ }
@@ -0,0 +1,57 @@
1
+ import { Args, Flags } from '@oclif/core';
2
+ import { BaseCommand } from '../../base-command.js';
3
+ import { formatTable } from '../../lib/formatters.js';
4
+ export default class InvestigationsRunsList extends BaseCommand {
5
+ static args = {
6
+ id: Args.string({ description: 'Investigation (taskflow) ID', required: true }),
7
+ };
8
+ static description = `List actual investigation runs (not evaluation runs) for a specific investigation.
9
+
10
+ Shows runs with their status, signal IDs, and timestamps. Use 'investigations run' to see
11
+ detailed execution logs for a specific run.`;
12
+ static examples = [
13
+ '<%= config.bin %> investigations runs-list <id>',
14
+ '<%= config.bin %> investigations runs-list <id> --limit 50',
15
+ '<%= config.bin %> investigations runs-list <id> --details --json',
16
+ ];
17
+ static flags = {
18
+ details: Flags.boolean({
19
+ description: 'Include detailed information about each run',
20
+ }),
21
+ limit: Flags.integer({
22
+ char: 'l',
23
+ default: 20,
24
+ description: 'Maximum number of runs to return',
25
+ }),
26
+ offset: Flags.integer({
27
+ char: 'o',
28
+ default: 0,
29
+ description: 'Offset for pagination',
30
+ }),
31
+ };
32
+ static summary = 'List actual investigation runs';
33
+ async run() {
34
+ const query = {
35
+ limit: this.flags.limit.toString(),
36
+ offset: this.flags.offset.toString(),
37
+ };
38
+ if (this.flags.details) {
39
+ query.details = 'true';
40
+ }
41
+ const result = await this.api('theopolis', `taskflows/${this.args.id}/runs/paginated`, { method: 'GET', query });
42
+ if (!this.jsonEnabled()) {
43
+ const columns = [
44
+ { key: 'id', label: 'RUN ID', width: 40 },
45
+ { key: 'signalId', label: 'SIGNAL ID', width: 40 },
46
+ { key: 'status', label: 'STATUS', width: 14 },
47
+ { key: 'createdAt', label: 'CREATED', width: 26 },
48
+ ];
49
+ this.log(`\nInvestigation Runs (${this.env}):\n`);
50
+ this.log(` Total: ${result.total} Showing: ${result.runs.length} Offset: ${this.flags.offset}\n`);
51
+ this.log(formatTable(result.runs ?? [], columns));
52
+ this.log('');
53
+ }
54
+ return result;
55
+ }
56
+ }
57
+ //# sourceMappingURL=runs-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runs-list.js","sourceRoot":"","sources":["../../../src/commands/investigations/runs-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAE,KAAK,EAAC,MAAM,aAAa,CAAA;AAEvC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAc,WAAW,EAAC,MAAM,yBAAyB,CAAA;AAEhE,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,WAA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xB,MAAM,OAAO,GAAa;gBACxB,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAC;gBACvC,EAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,EAAC;gBAChD,EAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAC;gBAC3C,EAAC,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAC;aAChD,CAAA;YAED,IAAI,CAAC,GAAG,CAAC,yBAAyB,IAAI,CAAC,GAAG,MAAM,CAAC,CAAA;YACjD,IAAI,CAAC,GAAG,CAAC,YAAY,MAAM,CAAC,KAAK,cAAc,MAAM,CAAC,IAAI,CAAC,MAAM,aAAa,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,CAAA;YACpG,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC,CAAA;YACjD,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACd,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class InvestigationsRuns extends BaseCommand<typeof InvestigationsRuns> {
3
+ static args: {
4
+ id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static summary: string;
9
+ run(): Promise<{
10
+ runs: unknown[];
11
+ }>;
12
+ }
@@ -0,0 +1,30 @@
1
+ import { Args } from '@oclif/core';
2
+ import { BaseCommand } from '../../base-command.js';
3
+ import { formatTable } from '../../lib/formatters.js';
4
+ export default class InvestigationsRuns extends BaseCommand {
5
+ static args = {
6
+ id: Args.string({ description: 'Investigation (taskflow) ID', required: true }),
7
+ };
8
+ static description = 'List evaluation runs for a specific investigation.';
9
+ static examples = [
10
+ '<%= config.bin %> investigations runs <id>',
11
+ '<%= config.bin %> investigations runs <id> --json',
12
+ ];
13
+ static summary = 'List runs for an investigation';
14
+ async run() {
15
+ const result = await this.api('theopolis', `taskflows/${this.args.id}/eval/runs`, { method: 'GET' });
16
+ if (!this.jsonEnabled()) {
17
+ const columns = [
18
+ { key: 'id', label: 'RUN ID', width: 40 },
19
+ { key: 'status', label: 'STATUS', width: 14 },
20
+ { key: 'createdAt', label: 'CREATED', width: 26 },
21
+ { key: 'taskFlowVersionId', label: 'VERSION ID', width: 40 },
22
+ ];
23
+ this.log(`\nInvestigation Runs (${this.env}):\n`);
24
+ this.log(formatTable(result.runs ?? [], columns));
25
+ this.log('');
26
+ }
27
+ return result;
28
+ }
29
+ }
30
+ //# sourceMappingURL=runs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runs.js","sourceRoot":"","sources":["../../../src/commands/investigations/runs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAc,WAAW,EAAC,MAAM,yBAAyB,CAAA;AAEhE,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,WAAsC;IACpF,MAAM,CAAU,IAAI,GAAG;QACrB,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,6BAA6B,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;KAC9E,CAAA;IAED,MAAM,CAAU,WAAW,GAAG,oDAAoD,CAAA;IAElF,MAAM,CAAU,QAAQ,GAAG;QACzB,4CAA4C;QAC5C,mDAAmD;KACpD,CAAA;IAED,MAAM,CAAU,OAAO,GAAG,gCAAgC,CAAA;IAEnD,KAAK,CAAC,GAAG;QACd,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAC3B,WAAW,EACX,aAAa,IAAI,CAAC,IAAI,CAAC,EAAE,YAAY,EACrC,EAAC,MAAM,EAAE,KAAK,EAAC,CAChB,CAAA;QAED,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,MAAM,OAAO,GAAa;gBACxB,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAC;gBACvC,EAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAC;gBAC3C,EAAC,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAC;gBAC/C,EAAC,GAAG,EAAE,mBAAmB,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,EAAC;aAC3D,CAAA;YAED,IAAI,CAAC,GAAG,CAAC,yBAAyB,IAAI,CAAC,GAAG,MAAM,CAAC,CAAA;YACjD,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC,CAAA;YACjD,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACd,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class InvestigationsStats extends BaseCommand<typeof InvestigationsStats> {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ end: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
7
+ start: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
+ };
9
+ static summary: string;
10
+ run(): Promise<Record<string, unknown>>;
11
+ }
@@ -0,0 +1,40 @@
1
+ import { Flags } from '@oclif/core';
2
+ import { BaseCommand } from '../../base-command.js';
3
+ import { formatDetail } from '../../lib/formatters.js';
4
+ export default class InvestigationsStats extends BaseCommand {
5
+ static description = 'Get investigation statistics for a time range.';
6
+ static examples = [
7
+ '<%= config.bin %> investigations stats --start 2026-01-01 --end 2026-02-01',
8
+ '<%= config.bin %> investigations stats --start 2026-01-01 --end 2026-02-01 --json',
9
+ ];
10
+ static flags = {
11
+ end: Flags.string({
12
+ description: 'End time (ISO 8601)',
13
+ required: true,
14
+ }),
15
+ start: Flags.string({
16
+ description: 'Start time (ISO 8601)',
17
+ required: true,
18
+ }),
19
+ };
20
+ static summary = 'Get investigation stats';
21
+ async run() {
22
+ // Normalize dates to ISO 8601 datetime format
23
+ const startTime = this.normalizeDateTime(this.flags.start);
24
+ const endTime = this.normalizeDateTime(this.flags.end);
25
+ const result = await this.api('theopolis', 'investigations/stats', {
26
+ body: {
27
+ endTime,
28
+ startTime,
29
+ },
30
+ });
31
+ if (!this.jsonEnabled()) {
32
+ this.log(`\nInvestigation Stats (${this.env}):\n`);
33
+ this.log(` Time range: ${this.flags.start} → ${this.flags.end}\n`);
34
+ this.log(formatDetail(result));
35
+ this.log('');
36
+ }
37
+ return result;
38
+ }
39
+ }
40
+ //# sourceMappingURL=stats.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stats.js","sourceRoot":"","sources":["../../../src/commands/investigations/stats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAEjC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAA;AAEpD,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,WAAuC;IACtF,MAAM,CAAU,WAAW,GAAG,gDAAgD,CAAA;IAE9E,MAAM,CAAU,QAAQ,GAAG;QACzB,4EAA4E;QAC5E,mFAAmF;KACpF,CAAA;IAED,MAAM,CAAU,KAAK,GAAG;QACtB,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC;YAChB,WAAW,EAAE,qBAAqB;YAClC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC;YAClB,WAAW,EAAE,uBAAuB;YACpC,QAAQ,EAAE,IAAI;SACf,CAAC;KACH,CAAA;IAED,MAAM,CAAU,OAAO,GAAG,yBAAyB,CAAA;IAE5C,KAAK,CAAC,GAAG;QACd,8CAA8C;QAC9C,MAAM,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QAC1D,MAAM,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QAEtD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAC3B,WAAW,EACX,sBAAsB,EACtB;YACE,IAAI,EAAE;gBACJ,OAAO;gBACP,SAAS;aACV;SACF,CACF,CAAA;QAED,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,IAAI,CAAC,GAAG,CAAC,0BAA0B,IAAI,CAAC,GAAG,MAAM,CAAC,CAAA;YAClD,IAAI,CAAC,GAAG,CAAC,iBAAiB,IAAI,CAAC,KAAK,CAAC,KAAK,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAA;YACnE,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAA;YAC9B,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACd,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { BaseCommand } from '../../base-command.js';
2
+ export default class InvestigationsTrigger extends BaseCommand<typeof InvestigationsTrigger> {
3
+ static args: {
4
+ id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static flags: {
9
+ input: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
+ 'signal-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ };
12
+ static summary: string;
13
+ run(): Promise<Record<string, unknown>>;
14
+ }
@@ -0,0 +1,43 @@
1
+ import { Args, Flags } from '@oclif/core';
2
+ import { BaseCommand } from '../../base-command.js';
3
+ export default class InvestigationsTrigger extends BaseCommand {
4
+ static args = {
5
+ id: Args.string({ description: 'Investigation (taskflow) ID', required: true }),
6
+ };
7
+ static description = `Trigger an investigation to run. Provide input text describing the problem
8
+ or context for the investigation. The investigation runs asynchronously and
9
+ returns a run ID you can use to check results.`;
10
+ static examples = [
11
+ '<%= config.bin %> investigations trigger <id> --input "Robot stopped responding"',
12
+ '<%= config.bin %> investigations trigger <id> --input "Battery draining fast on device X" --json',
13
+ ];
14
+ static flags = {
15
+ input: Flags.string({
16
+ char: 'i',
17
+ description: 'Input text / problem description for the investigation',
18
+ required: true,
19
+ }),
20
+ 'signal-id': Flags.string({
21
+ description: 'Optional signal ID to associate with this run',
22
+ }),
23
+ };
24
+ static summary = 'Trigger an investigation';
25
+ async run() {
26
+ const body = {
27
+ input: this.flags.input,
28
+ };
29
+ if (this.flags['signal-id']) {
30
+ body.signalId = this.flags['signal-id'];
31
+ }
32
+ const result = await this.api('theopolis', `taskflows/${this.args.id}/trigger`, { body });
33
+ if (!this.jsonEnabled()) {
34
+ this.log(`\nInvestigation triggered successfully (${this.env}).`);
35
+ this.log(` Run ID: ${result.taskFlowRunId ?? result.id ?? '—'}`);
36
+ if (result.signalId)
37
+ this.log(` Signal ID: ${result.signalId}`);
38
+ this.log('');
39
+ }
40
+ return result;
41
+ }
42
+ }
43
+ //# sourceMappingURL=trigger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trigger.js","sourceRoot":"","sources":["../../../src/commands/investigations/trigger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAE,KAAK,EAAC,MAAM,aAAa,CAAA;AAEvC,OAAO,EAAC,W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