@h-rig/blocker-classifier-plugin 0.0.6-alpha.138 → 0.0.6-alpha.140

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/src/index.js CHANGED
@@ -1,12 +1,8 @@
1
1
  // @bun
2
+ var __require = import.meta.require;
3
+
2
4
  // packages/blocker-classifier-plugin/src/plugin.ts
3
5
  import { definePlugin } from "@rig/core";
4
- import {
5
- classifyBlocker,
6
- classifyWorkspaceBlockers,
7
- listRuns,
8
- listTasks
9
- } from "@rig/client";
10
6
  var BLOCKER_CLASSIFIER_PLUGIN_NAME = "@rig/blocker-classifier-plugin";
11
7
  var BLOCKERS_CLI_ID = "blocker-classifier.blockers";
12
8
  var DEFAULT_BLOCKER_CLASSIFIER_ID = "blocker-classifier.default";
@@ -17,6 +13,9 @@ function isRecord(value) {
17
13
  function panelProjectRoot(context) {
18
14
  return isRecord(context) && typeof context.projectRoot === "string" && context.projectRoot.length > 0 ? context.projectRoot : null;
19
15
  }
16
+ async function loadBlockerClient() {
17
+ return await import("@rig/client");
18
+ }
20
19
  function taskEpicKey(task) {
21
20
  const direct = typeof task?.epicKey === "string" ? task.epicKey : null;
22
21
  if (direct)
@@ -28,6 +27,7 @@ async function produceHumanBlockersPanel(context) {
28
27
  const projectRoot = panelProjectRoot(context);
29
28
  if (!projectRoot)
30
29
  return;
30
+ const { classifyWorkspaceBlockers, listRuns, listTasks } = await loadBlockerClient();
31
31
  const [tasks, blockers] = await Promise.all([
32
32
  listTasks(projectRoot),
33
33
  classifyWorkspaceBlockers(projectRoot, { listTasks, listRuns, humanOnly: true })
@@ -72,6 +72,7 @@ async function executeBlockers(context, args) {
72
72
  const json = takeFlag(args, "--json");
73
73
  const humanOnly = takeFlag(json.rest, "--human-only");
74
74
  requireNoExtraArgs(humanOnly.rest, "rig blockers [--human-only] [--json]");
75
+ const { classifyWorkspaceBlockers, listRuns, listTasks } = await loadBlockerClient();
75
76
  const result = await classifyWorkspaceBlockers(context.projectRoot, { listTasks, listRuns, humanOnly: humanOnly.value });
76
77
  const details = { classifications: result.classifications, human: result.human, machine: result.machine, generatedAt: result.generatedAt };
77
78
  if (context.outputMode === "text") {
@@ -121,9 +122,10 @@ var blockerClassifierPlugin = definePlugin({
121
122
  id: DEFAULT_BLOCKER_CLASSIFIER_ID,
122
123
  description: "Default deterministic Rig blocker classifier.",
123
124
  priority: 0,
124
- classify(input) {
125
+ async classify(input) {
125
126
  if (!isBlockerClassifierInput(input))
126
127
  throw new Error("blocker classifier input must include task, badges, and tasksById.");
128
+ const { classifyBlocker } = await loadBlockerClient();
127
129
  return classifyBlocker(input);
128
130
  }
129
131
  }
@@ -1,12 +1,8 @@
1
1
  // @bun
2
+ var __require = import.meta.require;
3
+
2
4
  // packages/blocker-classifier-plugin/src/plugin.ts
3
5
  import { definePlugin } from "@rig/core";
4
- import {
5
- classifyBlocker,
6
- classifyWorkspaceBlockers,
7
- listRuns,
8
- listTasks
9
- } from "@rig/client";
10
6
  var BLOCKER_CLASSIFIER_PLUGIN_NAME = "@rig/blocker-classifier-plugin";
11
7
  var BLOCKERS_CLI_ID = "blocker-classifier.blockers";
12
8
  var DEFAULT_BLOCKER_CLASSIFIER_ID = "blocker-classifier.default";
@@ -17,6 +13,9 @@ function isRecord(value) {
17
13
  function panelProjectRoot(context) {
18
14
  return isRecord(context) && typeof context.projectRoot === "string" && context.projectRoot.length > 0 ? context.projectRoot : null;
19
15
  }
16
+ async function loadBlockerClient() {
17
+ return await import("@rig/client");
18
+ }
20
19
  function taskEpicKey(task) {
21
20
  const direct = typeof task?.epicKey === "string" ? task.epicKey : null;
22
21
  if (direct)
@@ -28,6 +27,7 @@ async function produceHumanBlockersPanel(context) {
28
27
  const projectRoot = panelProjectRoot(context);
29
28
  if (!projectRoot)
30
29
  return;
30
+ const { classifyWorkspaceBlockers, listRuns, listTasks } = await loadBlockerClient();
31
31
  const [tasks, blockers] = await Promise.all([
32
32
  listTasks(projectRoot),
33
33
  classifyWorkspaceBlockers(projectRoot, { listTasks, listRuns, humanOnly: true })
@@ -72,6 +72,7 @@ async function executeBlockers(context, args) {
72
72
  const json = takeFlag(args, "--json");
73
73
  const humanOnly = takeFlag(json.rest, "--human-only");
74
74
  requireNoExtraArgs(humanOnly.rest, "rig blockers [--human-only] [--json]");
75
+ const { classifyWorkspaceBlockers, listRuns, listTasks } = await loadBlockerClient();
75
76
  const result = await classifyWorkspaceBlockers(context.projectRoot, { listTasks, listRuns, humanOnly: humanOnly.value });
76
77
  const details = { classifications: result.classifications, human: result.human, machine: result.machine, generatedAt: result.generatedAt };
77
78
  if (context.outputMode === "text") {
@@ -121,9 +122,10 @@ var blockerClassifierPlugin = definePlugin({
121
122
  id: DEFAULT_BLOCKER_CLASSIFIER_ID,
122
123
  description: "Default deterministic Rig blocker classifier.",
123
124
  priority: 0,
124
- classify(input) {
125
+ async classify(input) {
125
126
  if (!isBlockerClassifierInput(input))
126
127
  throw new Error("blocker classifier input must include task, badges, and tasksById.");
128
+ const { classifyBlocker } = await loadBlockerClient();
127
129
  return classifyBlocker(input);
128
130
  }
129
131
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@h-rig/blocker-classifier-plugin",
3
- "version": "0.0.6-alpha.138",
3
+ "version": "0.0.6-alpha.140",
4
4
  "type": "module",
5
5
  "description": "First-party blocker classifier capability plugin for Rig.",
6
6
  "license": "UNLICENSED",
@@ -25,8 +25,8 @@
25
25
  "module": "./dist/src/index.js",
26
26
  "types": "./dist/src/index.d.ts",
27
27
  "dependencies": {
28
- "@rig/client": "npm:@h-rig/client@0.0.6-alpha.138",
29
- "@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.138",
30
- "@rig/core": "npm:@h-rig/core@0.0.6-alpha.138"
28
+ "@rig/client": "npm:@h-rig/client@0.0.6-alpha.140",
29
+ "@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.140",
30
+ "@rig/core": "npm:@h-rig/core@0.0.6-alpha.140"
31
31
  }
32
32
  }