@memberjunction/cli 6.2.0-edge.2 → 6.2.0-edge.3

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 (81) hide show
  1. package/dist/commands/queue/backlog.d.ts +11 -0
  2. package/dist/commands/queue/backlog.d.ts.map +1 -0
  3. package/dist/commands/queue/backlog.js +32 -0
  4. package/dist/commands/queue/backlog.js.map +1 -0
  5. package/dist/commands/queue/dead-letters.d.ts +13 -0
  6. package/dist/commands/queue/dead-letters.d.ts.map +1 -0
  7. package/dist/commands/queue/dead-letters.js +35 -0
  8. package/dist/commands/queue/dead-letters.js.map +1 -0
  9. package/dist/commands/queue/discard.d.ts +12 -0
  10. package/dist/commands/queue/discard.d.ts.map +1 -0
  11. package/dist/commands/queue/discard.js +45 -0
  12. package/dist/commands/queue/discard.js.map +1 -0
  13. package/dist/commands/queue/export-topology.d.ts +12 -0
  14. package/dist/commands/queue/export-topology.d.ts.map +1 -0
  15. package/dist/commands/queue/export-topology.js +40 -0
  16. package/dist/commands/queue/export-topology.js.map +1 -0
  17. package/dist/commands/queue/import-bindings.d.ts +14 -0
  18. package/dist/commands/queue/import-bindings.d.ts.map +1 -0
  19. package/dist/commands/queue/import-bindings.js +41 -0
  20. package/dist/commands/queue/import-bindings.js.map +1 -0
  21. package/dist/commands/queue/index.d.ts +7 -0
  22. package/dist/commands/queue/index.d.ts.map +1 -0
  23. package/dist/commands/queue/index.js +25 -0
  24. package/dist/commands/queue/index.js.map +1 -0
  25. package/dist/commands/queue/partitions.d.ts +14 -0
  26. package/dist/commands/queue/partitions.d.ts.map +1 -0
  27. package/dist/commands/queue/partitions.js +36 -0
  28. package/dist/commands/queue/partitions.js.map +1 -0
  29. package/dist/commands/queue/publish.d.ts +35 -0
  30. package/dist/commands/queue/publish.d.ts.map +1 -0
  31. package/dist/commands/queue/publish.js +94 -0
  32. package/dist/commands/queue/publish.js.map +1 -0
  33. package/dist/commands/queue/replay.d.ts +12 -0
  34. package/dist/commands/queue/replay.d.ts.map +1 -0
  35. package/dist/commands/queue/replay.js +42 -0
  36. package/dist/commands/queue/replay.js.map +1 -0
  37. package/dist/commands/queue/stats.d.ts +11 -0
  38. package/dist/commands/queue/stats.d.ts.map +1 -0
  39. package/dist/commands/queue/stats.js +35 -0
  40. package/dist/commands/queue/stats.js.map +1 -0
  41. package/dist/commands/queue/usage.d.ts +7 -0
  42. package/dist/commands/queue/usage.d.ts.map +1 -0
  43. package/dist/commands/queue/usage.js +10 -0
  44. package/dist/commands/queue/usage.js.map +1 -0
  45. package/dist/commands/queue/validate-bindings.d.ts +12 -0
  46. package/dist/commands/queue/validate-bindings.d.ts.map +1 -0
  47. package/dist/commands/queue/validate-bindings.js +37 -0
  48. package/dist/commands/queue/validate-bindings.js.map +1 -0
  49. package/dist/commands/queue/work.d.ts +20 -0
  50. package/dist/commands/queue/work.d.ts.map +1 -0
  51. package/dist/commands/queue/work.js +77 -0
  52. package/dist/commands/queue/work.js.map +1 -0
  53. package/dist/commands/rubric/evaluate.d.ts +3 -0
  54. package/dist/commands/rubric/evaluate.d.ts.map +1 -1
  55. package/dist/commands/rubric/evaluate.js +9 -2
  56. package/dist/commands/rubric/evaluate.js.map +1 -1
  57. package/dist/hooks/postrun.d.ts +1 -1
  58. package/dist/lib/domain-profiles.d.ts.map +1 -1
  59. package/dist/lib/domain-profiles.js +4 -0
  60. package/dist/lib/domain-profiles.js.map +1 -1
  61. package/dist/lib/work-queue/queue-format.d.ts +17 -0
  62. package/dist/lib/work-queue/queue-format.d.ts.map +1 -0
  63. package/dist/lib/work-queue/queue-format.js +125 -0
  64. package/dist/lib/work-queue/queue-format.js.map +1 -0
  65. package/dist/lib/work-queue/queue-session.d.ts +9 -0
  66. package/dist/lib/work-queue/queue-session.d.ts.map +1 -0
  67. package/dist/lib/work-queue/queue-session.js +8 -0
  68. package/dist/lib/work-queue/queue-session.js.map +1 -0
  69. package/dist/lib/work-queue/queue-worker.d.ts +24 -0
  70. package/dist/lib/work-queue/queue-worker.d.ts.map +1 -0
  71. package/dist/lib/work-queue/queue-worker.js +50 -0
  72. package/dist/lib/work-queue/queue-worker.js.map +1 -0
  73. package/dist/light-commands.d.ts.map +1 -1
  74. package/dist/light-commands.js +3 -0
  75. package/dist/light-commands.js.map +1 -1
  76. package/dist/utils/open-app-context.d.ts +6 -0
  77. package/dist/utils/open-app-context.d.ts.map +1 -1
  78. package/dist/utils/open-app-context.js +3 -3
  79. package/dist/utils/open-app-context.js.map +1 -1
  80. package/oclif.manifest.json +1862 -1180
  81. package/package.json +24 -22
@@ -0,0 +1,42 @@
1
+ import { Command, Flags } from '@oclif/core';
2
+ import { WorkQueueReplayDeadLetterOperation } from '@memberjunction/core-entities';
3
+ import { RequireOperationOutput } from '../../lib/work-queue/queue-format.js';
4
+ import { OpenWorkQueueSession } from '../../lib/work-queue/queue-session.js';
5
+ export default class QueueReplay extends Command {
6
+ static { this.description = 'Replay one dead-lettered work-queue delivery'; }
7
+ static { this.examples = ['<%= config.bin %> <%= command.id %> --subscription integration.apply --delivery <id> --note "mapping fixed"']; }
8
+ static { this.flags = {
9
+ subscription: Flags.string({ char: 's', description: 'Subscription name', required: true }),
10
+ delivery: Flags.string({ char: 'd', description: 'DeliveryID from `mj queue dead-letters`', required: true }),
11
+ note: Flags.string({ description: 'Operator note stored with the resolution' }),
12
+ }; }
13
+ async run() {
14
+ const { flags } = await this.parse(QueueReplay);
15
+ const session = await OpenWorkQueueSession();
16
+ let failure = null;
17
+ try {
18
+ const input = { subscriptionName: flags.subscription, deliveryID: flags.delivery, note: flags.note };
19
+ const result = await new WorkQueueReplayDeadLetterOperation().Execute(input, { provider: session.Provider, user: session.User });
20
+ const output = RequireOperationOutput(result, 'WorkQueue.ReplayDeadLetter');
21
+ if (!output.supported) {
22
+ failure = "This subscription's transport cannot replay a single dead letter.";
23
+ }
24
+ else if (!output.replayed) {
25
+ failure = 'Nothing replayed: the delivery does not exist or is not dead-lettered.';
26
+ }
27
+ else {
28
+ this.log(`Replayed ${flags.delivery}.`);
29
+ }
30
+ }
31
+ catch (error) {
32
+ failure = error instanceof Error ? error.message : String(error);
33
+ }
34
+ finally {
35
+ await session.Close();
36
+ }
37
+ if (failure) {
38
+ this.error(failure, { exit: 1 });
39
+ }
40
+ }
41
+ }
42
+ //# sourceMappingURL=replay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replay.js","sourceRoot":"","sources":["../../../src/commands/queue/replay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,kCAAkC,EAAE,MAAM,+BAA+B,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,OAAO;aACvC,gBAAW,GAAG,8CAA8C,CAAC;aAE7D,aAAQ,GAAG,CAAC,6GAA6G,CAAC,CAAC;aAE3H,UAAK,GAAG;QACb,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,mBAAmB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC3F,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,yCAAyC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC7G,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,0CAA0C,EAAE,CAAC;KAChF,CAAC;IAEF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAChD,MAAM,OAAO,GAAG,MAAM,oBAAoB,EAAE,CAAC;QAC7C,IAAI,OAAO,GAAkB,IAAI,CAAC;QAClC,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,EAAE,gBAAgB,EAAE,KAAK,CAAC,YAAY,EAAE,UAAU,EAAE,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;YACrG,MAAM,MAAM,GAAG,MAAM,IAAI,kCAAkC,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;YACjI,MAAM,MAAM,GAAG,sBAAsB,CAAC,MAAM,EAAE,4BAA4B,CAAC,CAAC;YAC5E,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;gBACtB,OAAO,GAAG,mEAAmE,CAAC;YAChF,CAAC;iBAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;gBAC5B,OAAO,GAAG,wEAAwE,CAAC;YACrF,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,GAAG,CAAC,YAAY,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC;YAC1C,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACnE,CAAC;gBAAS,CAAC;YACT,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;QACxB,CAAC;QACD,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;QACnC,CAAC;IACH,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class QueueStats extends Command {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ subscription: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
7
+ json: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
8
+ };
9
+ run(): Promise<void>;
10
+ }
11
+ //# sourceMappingURL=stats.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../src/commands/queue/stats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAK7C,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,OAAO;IAC7C,MAAM,CAAC,WAAW,SAAmF;IAErG,MAAM,CAAC,QAAQ,WAGb;IAEF,MAAM,CAAC,KAAK;;;MAGV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAiB3B"}
@@ -0,0 +1,35 @@
1
+ import { Command, Flags } from '@oclif/core';
2
+ import { WorkQueueGetSubscriptionStatsOperation } from '@memberjunction/core-entities';
3
+ import { FormatStatsTable, RequireOperationOutput } from '../../lib/work-queue/queue-format.js';
4
+ import { OpenWorkQueueSession } from '../../lib/work-queue/queue-session.js';
5
+ export default class QueueStats extends Command {
6
+ static { this.description = 'Show pending, in-flight and dead-lettered counts for work-queue subscriptions'; }
7
+ static { this.examples = [
8
+ '<%= config.bin %> <%= command.id %>',
9
+ '<%= config.bin %> <%= command.id %> --subscription email.unsubscribe --json',
10
+ ]; }
11
+ static { this.flags = {
12
+ subscription: Flags.string({ char: 's', description: 'Subscription name; omit for every subscription' }),
13
+ json: Flags.boolean({ description: 'Print JSON instead of a table', default: false }),
14
+ }; }
15
+ async run() {
16
+ const { flags } = await this.parse(QueueStats);
17
+ const session = await OpenWorkQueueSession();
18
+ let failure = null;
19
+ try {
20
+ const result = await new WorkQueueGetSubscriptionStatsOperation().Execute({ subscriptionName: flags.subscription }, { provider: session.Provider, user: session.User });
21
+ const output = RequireOperationOutput(result, 'WorkQueue.GetSubscriptionStats');
22
+ this.log(flags.json ? JSON.stringify(output, null, 2) : FormatStatsTable(output.subscriptions, output.failures));
23
+ }
24
+ catch (error) {
25
+ failure = error instanceof Error ? error.message : String(error);
26
+ }
27
+ finally {
28
+ await session.Close();
29
+ }
30
+ if (failure) {
31
+ this.error(failure, { exit: 1 });
32
+ }
33
+ }
34
+ }
35
+ //# sourceMappingURL=stats.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stats.js","sourceRoot":"","sources":["../../../src/commands/queue/stats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,sCAAsC,EAAE,MAAM,+BAA+B,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,OAAO;aACtC,gBAAW,GAAG,+EAA+E,CAAC;aAE9F,aAAQ,GAAG;QAChB,qCAAqC;QACrC,6EAA6E;KAC9E,CAAC;aAEK,UAAK,GAAG;QACb,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,gDAAgD,EAAE,CAAC;QACxG,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,+BAA+B,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;KACtF,CAAC;IAEF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAC/C,MAAM,OAAO,GAAG,MAAM,oBAAoB,EAAE,CAAC;QAC7C,IAAI,OAAO,GAAkB,IAAI,CAAC;QAClC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,sCAAsC,EAAE,CAAC,OAAO,CAAC,EAAE,gBAAgB,EAAE,KAAK,CAAC,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;YACxK,MAAM,MAAM,GAAG,sBAAsB,CAAC,MAAM,EAAE,gCAAgC,CAAC,CAAC;YAChF,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QACnH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACnE,CAAC;gBAAS,CAAC;YACT,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;QACxB,CAAC;QACD,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;QACnC,CAAC;IACH,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { DomainUsageCommand } from '../../lib/domain-usage-command.js';
2
+ /** Tier-2 usage for the `queue` domain (`mj queue usage`). */
3
+ export default class QueueUsage extends DomainUsageCommand {
4
+ static description: string;
5
+ protected Domain: string;
6
+ }
7
+ //# sourceMappingURL=usage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../src/commands/queue/usage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,8DAA8D;AAC9D,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,kBAAkB;IACxD,MAAM,CAAC,WAAW,SAAkF;IACpG,SAAS,CAAC,MAAM,SAAW;CAC5B"}
@@ -0,0 +1,10 @@
1
+ import { DomainUsageCommand } from '../../lib/domain-usage-command.js';
2
+ /** Tier-2 usage for the `queue` domain (`mj queue usage`). */
3
+ export default class QueueUsage extends DomainUsageCommand {
4
+ constructor() {
5
+ super(...arguments);
6
+ this.Domain = 'queue';
7
+ }
8
+ static { this.description = 'Show usage, flags, examples, and runtime hints for every `mj queue` command.'; }
9
+ }
10
+ //# sourceMappingURL=usage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage.js","sourceRoot":"","sources":["../../../src/commands/queue/usage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,8DAA8D;AAC9D,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,kBAAkB;IAA1D;;QAEY,WAAM,GAAG,OAAO,CAAC;IAC7B,CAAC;aAFQ,gBAAW,GAAG,8EAA8E,AAAjF,CAAkF"}
@@ -0,0 +1,12 @@
1
+ import { Command } from '@oclif/core';
2
+ import '@memberjunction/work-queue-engine/aws';
3
+ export default class QueueValidateBindings extends Command {
4
+ static description: string;
5
+ static examples: string[];
6
+ static flags: {
7
+ transport: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
8
+ json: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
9
+ };
10
+ run(): Promise<void>;
11
+ }
12
+ //# sourceMappingURL=validate-bindings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-bindings.d.ts","sourceRoot":"","sources":["../../../src/commands/queue/validate-bindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAK7C,OAAO,uCAAuC,CAAC;AAE/C,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,OAAO;IACxD,MAAM,CAAC,WAAW,SAA2E;IAE7F,MAAM,CAAC,QAAQ,WAAuG;IAEtH,MAAM,CAAC,KAAK;;;MAGV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAoB3B"}
@@ -0,0 +1,37 @@
1
+ import { Command, Flags } from '@oclif/core';
2
+ import { WorkQueueValidateBindingsOperation } from '@memberjunction/core-entities';
3
+ import { FormatBindingIssues, HasBindingErrors, RequireOperationOutput } from '../../lib/work-queue/queue-format.js';
4
+ import { OpenWorkQueueSession } from '../../lib/work-queue/queue-session.js';
5
+ // Registers the 'AWS' transport driver factory and manifest enricher for this command only (work-queue 03 §0).
6
+ import '@memberjunction/work-queue-engine/aws';
7
+ export default class QueueValidateBindings extends Command {
8
+ static { this.description = 'Validate work-queue topology and cloud bindings; exits 1 on any error'; }
9
+ static { this.examples = ['<%= config.bin %> <%= command.id %>', '<%= config.bin %> <%= command.id %> --transport AWS-prod']; }
10
+ static { this.flags = {
11
+ transport: Flags.string({ char: 't', description: "Validate one transport's bindings against its resources" }),
12
+ json: Flags.boolean({ description: 'Print issues as JSON', default: false }),
13
+ }; }
14
+ async run() {
15
+ const { flags } = await this.parse(QueueValidateBindings);
16
+ const session = await OpenWorkQueueSession();
17
+ let failure = null;
18
+ try {
19
+ const result = await new WorkQueueValidateBindingsOperation().Execute({ transportName: flags.transport }, { provider: session.Provider, user: session.User });
20
+ const output = RequireOperationOutput(result, 'WorkQueue.ValidateBindings');
21
+ this.log(flags.json ? JSON.stringify(output.issues, null, 2) : FormatBindingIssues(output.issues));
22
+ if (HasBindingErrors(output.issues)) {
23
+ failure = 'Binding validation reported errors.';
24
+ }
25
+ }
26
+ catch (error) {
27
+ failure = error instanceof Error ? error.message : String(error);
28
+ }
29
+ finally {
30
+ await session.Close();
31
+ }
32
+ if (failure) {
33
+ this.error(failure, { exit: 1 });
34
+ }
35
+ }
36
+ }
37
+ //# sourceMappingURL=validate-bindings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-bindings.js","sourceRoot":"","sources":["../../../src/commands/queue/validate-bindings.ts"],"names":[],"m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I,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;YACnG,IAAI,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;gBACpC,OAAO,GAAG,qCAAqC,CAAC;YAClD,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACnE,CAAC;gBAAS,CAAC;YACT,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;QACxB,CAAC;QACD,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;QACnC,CAAC;IACH,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { Command } from '@oclif/core';
2
+ import '@memberjunction/work-queue-engine/aws';
3
+ export default class QueueWork extends Command {
4
+ static description: string;
5
+ static examples: string[];
6
+ static flags: {
7
+ subscription: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
8
+ once: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
9
+ max: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
10
+ 'idle-exit-ms': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
11
+ 'max-duration-ms': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
12
+ concurrency: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
13
+ 'shutdown-drain-ms': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
14
+ };
15
+ run(): Promise<void>;
16
+ /** One-shot mode. Exit 0 for an empty queue, a spent budget, MaxDuration or a signal; non-zero when nothing could run. */
17
+ private runOnce;
18
+ private runUntilSignal;
19
+ }
20
+ //# sourceMappingURL=work.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"work.d.ts","sourceRoot":"","sources":["../../../src/commands/queue/work.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAM7C,OAAO,uCAAuC,CAAC;AAK/C,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,OAAO;IAC5C,MAAM,CAAC,WAAW,SAA8F;IAEhH,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,KAAK;;;;;;;;MAQV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IA2B1B,0HAA0H;YAC5G,OAAO;YAgBP,cAAc;CAW7B"}
@@ -0,0 +1,77 @@
1
+ import { Command, Flags } from '@oclif/core';
2
+ import { MJWorkLogger, SharedProviderSource, WorkQueueEngine, WorkQueueHost } from '@memberjunction/work-queue-engine';
3
+ import { OpenWorkQueueSession } from '../../lib/work-queue/queue-session.js';
4
+ import { RunUntilStopped, WorkerStartFailure } from '../../lib/work-queue/queue-worker.js';
5
+ // Registers the 'AWS' transport driver factory and manifest enricher for this command only (work-queue 03 §0).
6
+ import '@memberjunction/work-queue-engine/aws';
7
+ const DEFAULT_IDLE_EXIT_MS = 5000;
8
+ const DEFAULT_SHUTDOWN_DRAIN_MS = 30000;
9
+ export default class QueueWork extends Command {
10
+ static { this.description = 'Run work-queue subscriptions in this process: once for a container job, or until stopped'; }
11
+ static { this.examples = [
12
+ '<%= config.bin %> <%= command.id %> --subscription venue-import --once',
13
+ '<%= config.bin %> <%= command.id %> --subscription venue-import --once --max 5 --concurrency 2 --max-duration-ms 3300000',
14
+ '<%= config.bin %> <%= command.id %> --subscription "*"',
15
+ ]; }
16
+ static { this.flags = {
17
+ subscription: Flags.string({ char: 's', description: "Subscription name, or '*' for every MJWorker subscription", required: true }),
18
+ once: Flags.boolean({ description: 'Receive up to --max deliveries, drain and exit (container-job mode)', default: false }),
19
+ max: Flags.integer({ description: 'With --once: how many deliveries to receive', default: 1, min: 1, dependsOn: ['once'] }),
20
+ 'idle-exit-ms': Flags.integer({ description: 'With --once: exit after this long with an empty queue', default: DEFAULT_IDLE_EXIT_MS, min: 0, dependsOn: ['once'] }),
21
+ 'max-duration-ms': Flags.integer({ description: "With --once: stop claiming after this long and drain (keep it below the scheduler's job deadline)", min: 1000, dependsOn: ['once'] }),
22
+ concurrency: Flags.integer({ description: 'Handlers in flight per subscription', default: 1, min: 1 }),
23
+ 'shutdown-drain-ms': Flags.integer({ description: 'How long in-flight handlers get to finish on exit; the drain can take twice this', default: DEFAULT_SHUTDOWN_DRAIN_MS, min: 0 }),
24
+ }; }
25
+ async run() {
26
+ const { flags } = await this.parse(QueueWork);
27
+ const session = await OpenWorkQueueSession();
28
+ let failure = null;
29
+ try {
30
+ await WorkQueueEngine.Instance.Config(false, session.User, session.Provider);
31
+ const host = new WorkQueueHost({
32
+ InstanceID: `mj-queue-work-${process.pid}`,
33
+ Subscriptions: [{ Name: flags.subscription, Concurrency: flags.concurrency }],
34
+ IdlePollMinMs: 250, IdlePollMaxMs: 2000, ShutdownDrainMs: flags['shutdown-drain-ms'],
35
+ SweeperIntervalMs: 0, ReconcileIntervalMs: 0, // a short-lived job neither sweeps nor re-plans
36
+ }, WorkQueueEngine.Instance, session.User, session.Provider, new MJWorkLogger('[mj queue work]'), { ProviderSource: new SharedProviderSource(session.Provider) });
37
+ failure = flags.once ? await this.runOnce(host, flags) : await this.runUntilSignal(host, flags.subscription);
38
+ }
39
+ catch (error) {
40
+ failure = error instanceof Error ? error.message : String(error);
41
+ }
42
+ finally {
43
+ await session.Close(); // only after the drain: RunUntilStopped awaits host.Shutdown() first
44
+ }
45
+ if (failure) {
46
+ this.error(failure, { exit: 1 });
47
+ }
48
+ }
49
+ /** One-shot mode. Exit 0 for an empty queue, a spent budget, MaxDuration or a signal; non-zero when nothing could run. */
50
+ async runOnce(host, flags) {
51
+ let result = { Processed: 0, Reason: 'Shutdown' };
52
+ const work = host
53
+ .RunOnce({ MaxDeliveries: flags.max, IdleExitMs: flags['idle-exit-ms'], MaxDurationMs: flags['max-duration-ms'] })
54
+ .then(r => { result = r; });
55
+ await RunUntilStopped(host, work);
56
+ // RunOnce returns at once when nothing could run (Task 3b); the health says why. The host is shut down by now,
57
+ // so a subscription that did run reports HOST_SHUT_DOWN_REASON.
58
+ const startFailure = WorkerStartFailure(host.GetHealth(), flags.subscription);
59
+ if (startFailure) {
60
+ return startFailure;
61
+ }
62
+ this.log(`Processed ${result.Processed} deliver${result.Processed === 1 ? 'y' : 'ies'} (${result.Reason}).`);
63
+ return null;
64
+ }
65
+ async runUntilSignal(host, requested) {
66
+ await host.Start();
67
+ const startFailure = WorkerStartFailure(host.GetHealth(), requested);
68
+ if (startFailure) {
69
+ await host.Shutdown();
70
+ return startFailure;
71
+ }
72
+ this.log(`Running ${requested}; send SIGINT or SIGTERM to stop.`);
73
+ await RunUntilStopped(host, new Promise(() => undefined));
74
+ return null;
75
+ }
76
+ }
77
+ //# sourceMappingURL=work.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"work.js","sourceRoot":"","sources":["../../../src/commands/queue/work.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAEvH,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,kBAAk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C;IAEO,KAAK,CAAC,cAAc,CAAC,IAAmB,EAAE,SAAiB;QACjE,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QACnB,MAAM,YAAY,GAAG,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,SAAS,CAAC,CAAC;QACrE,IAAI,YAAY,EAAE,CAAC;YACjB,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;YACtB,OAAO,YAAY,CAAC;QACtB,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,WAAW,SAAS,mCAAmC,CAAC,CAAC;QAClE,MAAM,eAAe,CAAC,IAAI,EAAE,IAAI,OAAO,CAAO,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;QAChE,OAAO,IAAI,CAAC;IACd,CAAC"}
@@ -6,6 +6,9 @@ export default class RubricEvaluate extends Command {
6
6
  entity: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
7
7
  record: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
8
8
  evaluator: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ prompt: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ model: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ mode: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
9
12
  };
10
13
  run(): Promise<void>;
11
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"evaluate.d.ts","sourceRoot":"","sources":["../../../src/commands/rubric/evaluate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,OAAO;IACjD,MAAM,CAAC,WAAW,SAA6D;IAC/E,MAAM,CAAC,KAAK;;;;;MAKV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAS3B"}
1
+ {"version":3,"file":"evaluate.d.ts","sourceRoot":"","sources":["../../../src/commands/rubric/evaluate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,OAAO;IACjD,MAAM,CAAC,WAAW,SAA6D;IAC/E,MAAM,CAAC,KAAK;;;;;;;;MAQV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAa3B"}
@@ -5,13 +5,20 @@ export default class RubricEvaluate extends Command {
5
5
  rubric: Flags.string({ required: true, description: 'Rubric name or id, optionally @version' }),
6
6
  entity: Flags.string({ required: true, description: 'Subject entity name' }),
7
7
  record: Flags.string({ required: true, description: 'Subject record id' }),
8
- evaluator: Flags.string({ description: 'LLM or Deterministic', default: 'LLM' }),
8
+ evaluator: Flags.string({ description: 'A registered evaluator: LLM, Decision, Agent, Deterministic, or a custom one', default: 'LLM' }),
9
+ prompt: Flags.string({ description: 'LLM: the judge prompt composed into Rubric Evaluator (default Rubric Evaluator - Default Judge). Decision: the decision prompt (default Default Decision)' }),
10
+ model: Flags.string({ description: 'AI Model ID to pin. Otherwise the prompt\'s bindings choose' }),
11
+ mode: Flags.string({ description: 'LLM only: SinglePass or PerCriterion', options: ['SinglePass', 'PerCriterion'] }),
9
12
  }; }
10
13
  async run() {
11
14
  const { CloseMJProvider, RubricCommands } = await import('@memberjunction/testing-cli');
12
15
  const { flags } = await this.parse(RubricEvaluate);
13
16
  try {
14
- await new RubricCommands().Evaluate(flags.rubric, flags.entity, flags.record, flags.evaluator);
17
+ await new RubricCommands().Evaluate(flags.rubric, flags.entity, flags.record, flags.evaluator, {
18
+ ...(flags.prompt ? { PromptName: flags.prompt } : {}),
19
+ ...(flags.model ? { ModelID: flags.model } : {}),
20
+ ...(flags.mode === 'SinglePass' || flags.mode === 'PerCriterion' ? { Mode: flags.mode } : {}),
21
+ });
15
22
  }
16
23
  finally {
17
24
  await CloseMJProvider();
@@ -1 +1 @@
1
- {"version":3,"file":"evaluate.js","sourceRoot":"","sources":["../../../src/commands/rubric/evaluate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,OAAO;aAC1C,gBAAW,GAAG,yDAAyD,CAAC;aACxE,UAAK,GAAG;QACb,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,wCAAwC,EAAE,CAAC;QAC/F,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;QAC5E,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;QAC1E,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,sBAAsB,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;KACjF,CAAC;IAEF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,GAAG,MAAM,MAAM,CAAC,6BAA6B,CAAC,CAAC;QACxF,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QACnD,IAAI,CAAC;YACH,MAAM,IAAI,cAAc,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;QACjG,CAAC;gBAAS,CAAC;YACT,MAAM,eAAe,EAAE,CAAC;QAC1B,CAAC;IACH,CAAC"}
1
+ {"version":3,"file":"evaluate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KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,EAAE;gBAC7F,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACrD,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAChD,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,YAAY,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC9F,CAAC,CAAC;QACL,CAAC;gBAAS,CAAC;YACT,MAAM,eAAe,EAAE,CAAC;QAC1B,CAAC;IACH,CAAC"}
@@ -2,7 +2,7 @@
2
2
  * Cleanup hook that runs after any command completes.
3
3
  *
4
4
  * Only `mj app *` commands open an mssql connection pool (through
5
- * `ensureProviderInitialized` in utils/open-app-context.ts). The pool keeps
5
+ * `EnsureProviderInitialized` in utils/open-app-context.ts). The pool keeps
6
6
  * sockets alive, which pins the Node event loop open and makes the CLI appear
7
7
  * to hang after the command finishes printing its output — so for those
8
8
  * commands we close it here.
@@ -1 +1 @@
1
- {"version":3,"file":"domain-profiles.d.ts","sourceRoot":"","sources":["../../src/lib/domain-profiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,aAAa;IAC5B,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,OAAO,EAAE,WAAW,CAAC;CACtB;AAED;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,aAGpC,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CA6FnE,CAAC;AAEF,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAE9D;AAED,gDAAgD;AAChD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAE9D"}
1
+ {"version":3,"file":"domain-profiles.d.ts","sourceRoot":"","sources":["../../src/lib/domain-profiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,aAAa;IAC5B,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,OAAO,EAAE,WAAW,CAAC;CACtB;AAED;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,aAGpC,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAiGnE,CAAC;AAEF,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAE9D;AAED,gDAAgD;AAChD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAE9D"}
@@ -34,6 +34,10 @@ export const DOMAIN_PROFILES = {
34
34
  Summary: 'Run and inspect AI agents, prompts, and actions from the terminal.',
35
35
  Runtime: { class: 'variable', note: 'a listing is instant; an agent run is bounded only by the agent itself' },
36
36
  },
37
+ queue: {
38
+ Summary: 'Operate the durable work queue — stats, backlog, dead letters, replay and discard, container-job workers, cloud bindings.',
39
+ Runtime: { class: 'moderate', typicalSeconds: 15, note: 'dominated by MJ bootstrap; each operation is a few queries or cloud API calls' },
40
+ },
37
41
  app: {
38
42
  Summary: 'Install, upgrade, enable, and remove Open Apps.',
39
43
  Runtime: { class: 'slow', typicalSeconds: 180, note: 'installs run migrations and package installs' },
@@ -1 +1 @@
1
- {"version":3,"file":"domain-profiles.js","sourceRoot":"","sources":["../../src/lib/domain-profiles.ts"],"names":[],"mappings":"AAwBA;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAkB;IACnD,OAAO,EAAE,qDAAqD;IAC9D,OAAO,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,6CAA6C,EAAE;CACpF,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,eAAe,GAA4C;IACtE,OAAO,EAAE;QACP,OAAO,EAAE,uEAAuE;QAChF,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,IAAI,EAAE,+DAA+D,EAAE;KACvH;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,mFAAmF;QAC5F,OAAO,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,iEAAiE,EAAE;KACxG;IACD,GAAG,EAAE;QACH,OAAO,EAAE,+EAA+E;QACxF,OAAO,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,gDAAgD,EAAE;KACvF;IACD,EAAE,EAAE;QACF,OAAO,EAAE,oEAAoE;QAC7E,OAAO,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,wEAAwE,EAAE;KAC/G;IACD,GAAG,EAAE;QACH,OAAO,EAAE,iDAAiD;QAC1D,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,IAAI,EAAE,8CAA8C,EAAE;KACtG;IACD,SAAS,EAAE;QACT,OAAO,EAAE,4DAA4D;QACrE,OAAO,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,EAAE,EAAE,IAAI,EAAE,4BAA4B,EAAE;KACvF;IACD,QAAQ,EAAE;QACR,O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import type { WorkQueueBindingIssueRow, WorkQueueGetBacklogOutput, WorkQueueListDeadLettersOutput, WorkQueueListPartitionsInput, WorkQueueListPartitionsOutput, WorkQueueStatsFailureRow, WorkQueueSubscriptionStatsRow } from '@memberjunction/core-entities';
3
+ import type { BindingImport } from '@memberjunction/work-queue-core';
4
+ type PartitionConditionOption = NonNullable<WorkQueueListPartitionsInput['condition']>;
5
+ export declare const PARTITION_CONDITION_OPTIONS: readonly PartitionConditionOption[];
6
+ export declare function FormatTable(headers: string[], rows: string[][]): string;
7
+ export declare function FormatStatsTable(rows: WorkQueueSubscriptionStatsRow[], failures: WorkQueueStatsFailureRow[]): string;
8
+ export declare function FormatDeadLetters(output: WorkQueueListDeadLettersOutput): string;
9
+ export declare function FormatPartitions(output: WorkQueueListPartitionsOutput): string;
10
+ export declare function FormatBacklog(output: WorkQueueGetBacklogOutput): string;
11
+ export declare function FormatBindingIssues(issues: WorkQueueBindingIssueRow[]): string;
12
+ export declare function HasBindingErrors(issues: WorkQueueBindingIssueRow[]): boolean;
13
+ export declare function ParseBindingImport(json: string): BindingImport;
14
+ export declare function RequireOperationOutput<T>(result: RemoteOpResult<T>, operationKey: string): T;
15
+ export declare function ToPartitionCondition(value: string | undefined): PartitionConditionOption | undefined;
16
+ export {};
17
+ //# sourceMappingURL=queue-format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue-format.d.ts","sourceRoot":"","sources":["../../../src/lib/work-queue/queue-format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EACR,wBAAwB,EAAE,yBAAyB,EAAE,8BAA8B,EAAE,4BAA4B,EACjH,6BAA6B,EAAE,wBAAwB,EAAE,6BAA6B,EACzF,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAY,MAAM,iCAAiC,CAAC;AAE/E,KAAK,wBAAwB,GAAG,WAAW,CAAC,4BAA4B,CAAC,WAAW,CAAC,CAAC,CAAC;AAEvF,eAAO,MAAM,2BAA2B,EAAE,SAAS,wBAAwB,EAAoC,CAAC;AAKhH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,CAIvE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,6BAA6B,EAAE,EAAE,QAAQ,EAAE,wBAAwB,EAAE,GAAG,MAAM,CAapH;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,8BAA8B,GAAG,MAAM,CAehF;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,6BAA6B,GAAG,MAAM,CAY9E;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,yBAAyB,GAAG,MAAM,CAMvE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,wBAAwB,EAAE,GAAG,MAAM,CAK9E;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,wBAAwB,EAAE,GAAG,OAAO,CAE5E;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAe9D;AAED,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,MAAM,GAAG,CAAC,CAK5F;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,wBAAwB,GAAG,SAAS,CASpG"}
@@ -0,0 +1,125 @@
1
+ export const PARTITION_CONDITION_OPTIONS = ['Idle', 'InFlight', 'Blocked'];
2
+ const UNKNOWN = '—';
3
+ const MAX_ERROR_WIDTH = 60;
4
+ export function FormatTable(headers, rows) {
5
+ const widths = headers.map((header, index) => Math.max(header.length, ...rows.map(row => (row[index] ?? '').length)));
6
+ const line = (cells) => cells.map((cell, index) => cell.padEnd(widths[index])).join(' ').trimEnd();
7
+ return [line(headers), line(widths.map(width => '-'.repeat(width))), ...rows.map(line)].join('\n');
8
+ }
9
+ export function FormatStatsTable(rows, failures) {
10
+ if (rows.length === 0 && failures.length === 0) {
11
+ return 'No subscriptions.';
12
+ }
13
+ const table = rows.length === 0 ? '' : FormatTable(['Subscription', 'Pending', 'In flight', 'Dead', 'Blocked keys', 'Oldest pending (s)', 'Done/hour'], rows.map(row => [
14
+ row.SubscriptionName, String(row.Pending), String(row.InFlight), String(row.DeadLettered), Optional(row.BlockedKeys),
15
+ Optional(row.OldestPendingAgeSeconds), Optional(row.CompletedLastHour),
16
+ ]));
17
+ const failed = failures.map(failure => `! ${failure.subscriptionName}: ${failure.error}`);
18
+ return [table, ...failed].filter(part => part !== '').join('\n');
19
+ }
20
+ export function FormatDeadLetters(output) {
21
+ if (!output.supported) {
22
+ return "This subscription's transport cannot list dead letters.";
23
+ }
24
+ if (output.items.length === 0) {
25
+ return 'No dead letters.';
26
+ }
27
+ const table = FormatTable(['Delivery', 'Partition key', 'Attempts', 'Reason', 'Blocks key', 'Dead-lettered at', 'Last error'], output.items.map(item => [
28
+ item.DeliveryID, item.PartitionKey ?? UNKNOWN, String(item.Attempts), item.Reason, item.BlocksKey ? 'yes' : 'no',
29
+ item.DeadLetteredAt ?? UNKNOWN, Truncate(item.LastError ?? '', MAX_ERROR_WIDTH),
30
+ ]));
31
+ return WithCursor(table, output.nextCursor);
32
+ }
33
+ export function FormatPartitions(output) {
34
+ if (!output.supported) {
35
+ return "This subscription's transport cannot list partitions.";
36
+ }
37
+ if (output.items.length === 0) {
38
+ return 'No partitions match.';
39
+ }
40
+ const table = FormatTable(['Partition key', 'Condition', 'Head delivery', 'Waiting'], output.items.map(item => [item.PartitionKey, item.Condition, item.HeadDeliveryID ?? UNKNOWN, String(item.WaitingItems)]));
41
+ return WithCursor(table, output.nextCursor);
42
+ }
43
+ export function FormatBacklog(output) {
44
+ if (!output.supported) {
45
+ return "This subscription's transport reports no backlog; scale from the transport's own metrics.";
46
+ }
47
+ const line = `claimable ${output.claimable} · in flight ${output.inFlight} · total ${output.total}`;
48
+ return output.capped ? `${line} (capped at 1000 — the real backlog is at least this large)` : line;
49
+ }
50
+ export function FormatBindingIssues(issues) {
51
+ if (issues.length === 0) {
52
+ return 'No binding issues.';
53
+ }
54
+ return issues.map(issue => `${issue.Severity === 'Error' ? '✖' : '⚠'} ${issue.Severity} ${issue.Subject}: ${issue.Message}`).join('\n');
55
+ }
56
+ export function HasBindingErrors(issues) {
57
+ return issues.some(issue => issue.Severity === 'Error');
58
+ }
59
+ export function ParseBindingImport(json) {
60
+ let parsed;
61
+ try {
62
+ parsed = JSON.parse(json);
63
+ }
64
+ catch {
65
+ throw new Error('Binding import file is not valid JSON');
66
+ }
67
+ if (!IsRecord(parsed) || parsed.ManifestVersion !== 1 || !Array.isArray(parsed.Topics) || !Array.isArray(parsed.Subscriptions)) {
68
+ throw new Error('Binding import must be { "ManifestVersion": 1, "Topics": [...], "Subscriptions": [...] }');
69
+ }
70
+ return {
71
+ ManifestVersion: 1,
72
+ Topics: parsed.Topics.map((entry, index) => BindingEntry(entry, `Topics[${index}]`)),
73
+ Subscriptions: parsed.Subscriptions.map((entry, index) => BindingEntry(entry, `Subscriptions[${index}]`)),
74
+ };
75
+ }
76
+ export function RequireOperationOutput(result, operationKey) {
77
+ if (!result.Success || result.Output === undefined) {
78
+ throw new Error(`${operationKey} failed (${result.ResultCode ?? 'UNKNOWN'}): ${result.ErrorMessage ?? 'no output'}`);
79
+ }
80
+ return result.Output;
81
+ }
82
+ export function ToPartitionCondition(value) {
83
+ if (value === undefined) {
84
+ return undefined;
85
+ }
86
+ const condition = PARTITION_CONDITION_OPTIONS.find(option => option === value);
87
+ if (!condition) {
88
+ throw new Error(`--condition must be one of ${PARTITION_CONDITION_OPTIONS.join(', ')}`);
89
+ }
90
+ return condition;
91
+ }
92
+ function BindingEntry(value, at) {
93
+ if (!IsRecord(value) || typeof value.Name !== 'string' || !IsJsonObject(value.BindingConfig)) {
94
+ throw new Error(`${at} must have a string Name and an object BindingConfig`);
95
+ }
96
+ return { Name: value.Name, BindingConfig: value.BindingConfig };
97
+ }
98
+ function IsJsonObject(value) {
99
+ return IsRecord(value) && Object.values(value).every(IsWorkJsonValue);
100
+ }
101
+ function IsWorkJsonValue(value) {
102
+ if (value === null || typeof value === 'string' || typeof value === 'boolean') {
103
+ return true;
104
+ }
105
+ if (typeof value === 'number') {
106
+ return Number.isFinite(value);
107
+ }
108
+ if (Array.isArray(value)) {
109
+ return value.every(IsWorkJsonValue);
110
+ }
111
+ return IsJsonObject(value);
112
+ }
113
+ function IsRecord(value) {
114
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
115
+ }
116
+ function Optional(value) {
117
+ return value === null ? UNKNOWN : String(value);
118
+ }
119
+ function Truncate(text, width) {
120
+ return text.length > width ? `${text.slice(0, width - 1)}…` : text;
121
+ }
122
+ function WithCursor(table, nextCursor) {
123
+ return nextCursor ? `${table}\nMore: --cursor ${nextCursor}` : table;
124
+ }
125
+ //# sourceMappingURL=queue-format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue-format.js","sourceRoot":"","sources":["../../../src/lib/work-queue/queue-format.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,MAAM,2BAA2B,GAAwC,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;AAEhH,MAAM,OAAO,GAAG,GAAG,CAAC;AACpB,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B,MAAM,UAAU,WAAW,CAAC,OAAiB,EAAE,IAAgB;IAC3D,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACtH,MAAM,IAAI,GAAG,CA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;IAChB,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,KAAK,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC5B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAChF,CAAC;AAED,SAAS,QAAQ,CAAC,KAAoB;IAClC,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACpD,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY,EAAE,KAAa;IACzC,OAAO,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AACvE,CAAC;AAED,SAAS,UAAU,CAAC,KAAa,EAAE,UAAyB;IACxD,OAAO,UAAU,CAAC,CAAC,CAAC,GAAG,KAAK,oBAAoB,UAAU,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;AACzE,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { DatabaseProviderBase, UserInfo } from '@memberjunction/core';
2
+ export interface WorkQueueCliSession {
3
+ Provider: DatabaseProviderBase;
4
+ User: UserInfo;
5
+ Close(): Promise<void>;
6
+ }
7
+ /** The CLI's shared provider (SQL Server or PostgreSQL per config) and the system user. */
8
+ export declare function OpenWorkQueueSession(): Promise<WorkQueueCliSession>;
9
+ //# sourceMappingURL=queue-session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue-session.d.ts","sourceRoot":"","sources":["../../../src/lib/work-queue/queue-session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAG3E,MAAM,WAAW,mBAAmB;IAChC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAED,2FAA2F;AAC3F,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAIzE"}
@@ -0,0 +1,8 @@
1
+ import { BuildContextUser, CloseConnectionPool, EnsureProviderInitialized } from '../../utils/open-app-context.js';
2
+ /** The CLI's shared provider (SQL Server or PostgreSQL per config) and the system user. */
3
+ export async function OpenWorkQueueSession() {
4
+ const provider = await EnsureProviderInitialized();
5
+ const user = await BuildContextUser();
6
+ return { Provider: provider, User: user, Close: CloseConnectionPool };
7
+ }
8
+ //# sourceMappingURL=queue-session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue-session.js","sourceRoot":"","sources":["../../../src/lib/work-queue/queue-session.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAQnH,2FAA2F;AAC3F,MAAM,CAAC,KAAK,UAAU,oBAAoB;IACtC,MAAM,QAAQ,GAAG,MAAM,yBAAyB,EAAE,CAAC;IACnD,MAAM,IAAI,GAAG,MAAM,gBAAgB,EAAE,CAAC;IACtC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,mBAAmB,EAAE,CAAC;AAC1E,CAAC"}