pi-harness-runtime 1.1.403 → 1.1.405
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/CHANGELOG.md +7 -0
- package/index.ts +275 -1
- package/package.json +1 -1
- package/packages/a2a-adapter/package.json +1 -1
- package/packages/agent-policy/package.json +1 -1
- package/packages/architecture-generator/package.json +1 -1
- package/packages/auth/package.json +1 -1
- package/packages/autonomous-refactor/package.json +1 -1
- package/packages/autonomous-runtime/package.json +1 -1
- package/packages/cache-strategy/package.json +1 -1
- package/packages/capability-registry/package.json +1 -1
- package/packages/checkpoint/package.json +1 -1
- package/packages/cli-plugin-sdk/package.json +1 -1
- package/packages/clipboard/package.json +1 -1
- package/packages/clipboard-plugin/package.json +1 -1
- package/packages/code-generation/package.json +1 -1
- package/packages/code-review/package.json +1 -1
- package/packages/codex-adapter/package.json +1 -1
- package/packages/codex-watcher/package.json +1 -1
- package/packages/config-capture/package.json +1 -1
- package/packages/connection-runtime/package.json +1 -1
- package/packages/context-compiler/package.json +1 -1
- package/packages/context-discovery/package.json +1 -1
- package/packages/context-manager/package.json +1 -1
- package/packages/contracts/package.json +1 -1
- package/packages/cookie-sanitizer/package.json +1 -1
- package/packages/cost-optimizer/package.json +1 -1
- package/packages/dependency-analyzer/package.json +1 -1
- package/packages/django-plugin/package.json +1 -1
- package/packages/doc-generator/package.json +1 -1
- package/packages/durable-review/package.json +1 -1
- package/packages/e2e-tester/package.json +1 -1
- package/packages/evaluation-engine/package.json +1 -1
- package/packages/evaluation-runner/package.json +1 -1
- package/packages/event-bus/package.json +1 -1
- package/packages/event-sink/package.json +1 -1
- package/packages/event-store/package.json +1 -1
- package/packages/experience-replay/package.json +1 -1
- package/packages/feedback-collector/package.json +1 -1
- package/packages/file-copy-helper/package.json +1 -1
- package/packages/framework-detector/package.json +1 -1
- package/packages/framework-plugin-sdk/package.json +1 -1
- package/packages/frappe-plugin/package.json +1 -1
- package/packages/generic-web-plugin/package.json +1 -1
- package/packages/health-monitor/package.json +1 -1
- package/packages/intent-analyzer/package.json +1 -1
- package/packages/jev-judge/dist/auto-continue.d.ts +6 -0
- package/packages/jev-judge/dist/auto-continue.d.ts.map +1 -1
- package/packages/jev-judge/dist/auto-continue.js +13 -3
- package/packages/jev-judge/dist/auto-continue.js.map +1 -1
- package/packages/jev-judge/package.json +1 -1
- package/packages/jev-judge/src/auto-continue.ts +17 -3
- package/packages/jev-judge/tests/auto-continue-context.test.ts +37 -0
- package/packages/knowledge-graph/package.json +1 -1
- package/packages/knowledge-retrieval/package.json +1 -1
- package/packages/laravel-plugin/package.json +1 -1
- package/packages/learning-engine/package.json +1 -1
- package/packages/logging/package.json +1 -1
- package/packages/mcp-adapter/package.json +1 -1
- package/packages/memory-engine/package.json +1 -1
- package/packages/milestone-manager/package.json +1 -1
- package/packages/model-registry/package.json +1 -1
- package/packages/nextjs-plugin/package.json +1 -1
- package/packages/notification/dist/adapters/line-adapter.d.ts.map +1 -1
- package/packages/notification/dist/adapters/line-adapter.js +6 -1
- package/packages/notification/dist/adapters/line-adapter.js.map +1 -1
- package/packages/notification/dist/notification-center.d.ts.map +1 -1
- package/packages/notification/dist/notification-center.js +32 -0
- package/packages/notification/dist/notification-center.js.map +1 -1
- package/packages/notification/dist/telegram-webhook-handler.d.ts +7 -0
- package/packages/notification/dist/telegram-webhook-handler.d.ts.map +1 -1
- package/packages/notification/dist/telegram-webhook-handler.js +7 -0
- package/packages/notification/dist/telegram-webhook-handler.js.map +1 -1
- package/packages/notification/dist/types.d.ts +1 -1
- package/packages/notification/dist/types.d.ts.map +1 -1
- package/packages/notification/package.json +1 -1
- package/packages/notification/src/adapters/line-adapter.ts +7 -1
- package/packages/notification/src/notification-center.ts +30 -0
- package/packages/notification/src/telegram-webhook-handler.ts +7 -0
- package/packages/notification/src/types.ts +1 -0
- package/packages/notification/test/notification.test.ts +31 -28
- package/packages/notification/test/tooling-proposal-payload.test.ts +212 -0
- package/packages/observability/package.json +1 -1
- package/packages/okf-indexer/package.json +1 -1
- package/packages/paperclip-integration/package.json +1 -1
- package/packages/performance-optimizer/package.json +1 -1
- package/packages/permission-mode/package.json +1 -1
- package/packages/privilege-broker/package.json +1 -1
- package/packages/project-analyzer/package.json +1 -1
- package/packages/project-bootstrap/package.json +1 -1
- package/packages/projection-engine/package.json +1 -1
- package/packages/prompt-compiler/package.json +1 -1
- package/packages/prompt-versioning/package.json +1 -1
- package/packages/provider-adapter-sdk/package.json +1 -1
- package/packages/provider-router/package.json +1 -1
- package/packages/provider-selector/package.json +1 -1
- package/packages/providers/package.json +1 -1
- package/packages/qdrant-skills/package.json +1 -1
- package/packages/quota-manager/package.json +1 -1
- package/packages/rate-limiter/package.json +1 -1
- package/packages/react-vite-plugin/package.json +1 -1
- package/packages/relay/package.json +1 -1
- package/packages/release-manager/package.json +1 -1
- package/packages/requirement-compiler/package.json +1 -1
- package/packages/runtime/package.json +1 -1
- package/packages/scheduler/package.json +1 -1
- package/packages/scheduler-adapter/package.json +1 -1
- package/packages/session/package.json +1 -1
- package/packages/session-api/package.json +1 -1
- package/packages/session-export/package.json +1 -1
- package/packages/shared-context/package.json +1 -1
- package/packages/skill-mcp-client/package.json +1 -1
- package/packages/skill-registry/package.json +1 -1
- package/packages/skills/package.json +1 -1
- package/packages/sprint-planner/package.json +1 -1
- package/packages/subscription-engine/package.json +1 -1
- package/packages/task-compiler/package.json +1 -1
- package/packages/telegram/package.json +1 -1
- package/packages/tencentdb-memory/package.json +1 -1
- package/packages/tencentdb-sync/package.json +1 -1
- package/packages/test-data-generator/package.json +1 -1
- package/packages/test-generator/package.json +1 -1
- package/packages/todo-bd-sync/package.json +1 -1
- package/packages/token-estimation/package.json +1 -1
- package/packages/token-optimizer/package.json +1 -1
- package/packages/tooling-preference/dist/detect.d.ts +62 -0
- package/packages/tooling-preference/dist/detect.d.ts.map +1 -0
- package/packages/tooling-preference/dist/detect.js +209 -0
- package/packages/tooling-preference/dist/detect.js.map +1 -0
- package/packages/tooling-preference/dist/index.d.ts +13 -0
- package/packages/tooling-preference/dist/index.d.ts.map +1 -0
- package/packages/tooling-preference/dist/index.js +13 -0
- package/packages/tooling-preference/dist/index.js.map +1 -0
- package/packages/tooling-preference/dist/proposal.d.ts +70 -0
- package/packages/tooling-preference/dist/proposal.d.ts.map +1 -0
- package/packages/tooling-preference/dist/proposal.js +137 -0
- package/packages/tooling-preference/dist/proposal.js.map +1 -0
- package/packages/tooling-preference/dist/registry.d.ts +50 -0
- package/packages/tooling-preference/dist/registry.d.ts.map +1 -0
- package/packages/tooling-preference/dist/registry.js +53 -0
- package/packages/tooling-preference/dist/registry.js.map +1 -0
- package/packages/tooling-preference/dist/store.d.ts +61 -0
- package/packages/tooling-preference/dist/store.d.ts.map +1 -0
- package/packages/tooling-preference/dist/store.js +129 -0
- package/packages/tooling-preference/dist/store.js.map +1 -0
- package/packages/tooling-preference/package.json +21 -0
- package/packages/tooling-preference/src/detect.ts +251 -0
- package/packages/tooling-preference/src/index.ts +44 -0
- package/packages/tooling-preference/src/proposal.ts +173 -0
- package/packages/tooling-preference/src/registry.ts +79 -0
- package/packages/tooling-preference/src/store.ts +162 -0
- package/packages/tooling-preference/tests/detect.test.ts +188 -0
- package/packages/tooling-preference/tests/proposal.test.ts +107 -0
- package/packages/tooling-preference/tests/registry.test.ts +51 -0
- package/packages/tooling-preference/tests/store.test.ts +99 -0
- package/packages/trajectory/package.json +1 -1
- package/packages/tui/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/voice-api/package.json +1 -1
- package/packages/webmcp-tester/package.json +1 -1
- package/packages/wiki/package.json +1 -1
- package/packages/workflow-events/package.json +1 -1
- package/packages/workspace-scanner/package.json +1 -1
- package/packages/worktree/package.json +1 -1
- package/packages/write-review/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-harness/provider-router",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.405",
|
|
4
4
|
"description": "Enhanced Provider Router for pi-harness-runtime — intelligent routing with capabilities, costs, and quotas",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/provider-router.js",
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tooling detection for a workspace.
|
|
3
|
+
*
|
|
4
|
+
* The proposal ("use Biome.js instead of ESLint + Prettier") is only made
|
|
5
|
+
* for a JavaScript/TypeScript workspace that still uses ESLint or Prettier
|
|
6
|
+
* and does not use Biome yet. The detection reads the workspace itself -
|
|
7
|
+
* it never guesses from the harness.
|
|
8
|
+
*/
|
|
9
|
+
export interface ToolingContext {
|
|
10
|
+
/** Absolute workspace root. */
|
|
11
|
+
root: string;
|
|
12
|
+
/** The workspace has a package.json. */
|
|
13
|
+
hasPackageJson: boolean;
|
|
14
|
+
/** The workspace is a JavaScript/TypeScript project. */
|
|
15
|
+
isJavaScriptTypeScript: boolean;
|
|
16
|
+
/** Next.js is in use. */
|
|
17
|
+
isNextJs: boolean;
|
|
18
|
+
/** React is in use. */
|
|
19
|
+
isReact: boolean;
|
|
20
|
+
/** Biome is configured or installed. */
|
|
21
|
+
usesBiome: boolean;
|
|
22
|
+
/** ESLint is configured or installed. */
|
|
23
|
+
usesEslint: boolean;
|
|
24
|
+
/** Prettier is configured or installed. */
|
|
25
|
+
usesPrettier: boolean;
|
|
26
|
+
/** The package manager the workspace uses, if it can be told. */
|
|
27
|
+
packageManager: string | null;
|
|
28
|
+
/** The frameworks that were detected. */
|
|
29
|
+
frameworks: string[];
|
|
30
|
+
}
|
|
31
|
+
interface PackageJson {
|
|
32
|
+
name?: string;
|
|
33
|
+
dependencies?: Record<string, string>;
|
|
34
|
+
devDependencies?: Record<string, string>;
|
|
35
|
+
peerDependencies?: Record<string, string>;
|
|
36
|
+
packageManager?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Which package manager does the workspace use?
|
|
40
|
+
*
|
|
41
|
+
* The `packageManager` field wins; a lockfile decides otherwise.
|
|
42
|
+
*/
|
|
43
|
+
export declare function detectPackageManager(root: string, pkg: PackageJson | null): string | null;
|
|
44
|
+
/**
|
|
45
|
+
* Read the tooling facts of a workspace.
|
|
46
|
+
*/
|
|
47
|
+
export declare function detectToolingContext(root: string): ToolingContext;
|
|
48
|
+
export interface ProposalEligibility {
|
|
49
|
+
/** May the proposal be sent? */
|
|
50
|
+
eligible: boolean;
|
|
51
|
+
/** Why the proposal is (not) sent - a human wording. */
|
|
52
|
+
reason: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* May the Biome proposal be sent for this workspace?
|
|
56
|
+
*
|
|
57
|
+
* A workspace that already uses Biome is never asked about Biome, and a
|
|
58
|
+
* workspace without ESLint and Prettier has nothing to replace.
|
|
59
|
+
*/
|
|
60
|
+
export declare function evaluateBiomeProposalEligibility(context: ToolingContext): ProposalEligibility;
|
|
61
|
+
export {};
|
|
62
|
+
//# sourceMappingURL=detect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../src/detect.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,MAAM,WAAW,cAAc;IAC9B,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,cAAc,EAAE,OAAO,CAAC;IACxB,wDAAwD;IACxD,sBAAsB,EAAE,OAAO,CAAC;IAChC,yBAAyB;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,uBAAuB;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,wCAAwC;IACxC,SAAS,EAAE,OAAO,CAAC;IACnB,yCAAyC;IACzC,UAAU,EAAE,OAAO,CAAC;IACpB,2CAA2C;IAC3C,YAAY,EAAE,OAAO,CAAC;IACtB,iEAAiE;IACjE,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,yCAAyC;IACzC,UAAU,EAAE,MAAM,EAAE,CAAC;CACrB;AAsDD,UAAU,WAAW;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB;AAoED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAQzF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAyBjE;AAED,MAAM,WAAW,mBAAmB;IACnC,gCAAgC;IAChC,QAAQ,EAAE,OAAO,CAAC;IAClB,wDAAwD;IACxD,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAC/C,OAAO,EAAE,cAAc,GACrB,mBAAmB,CA6BrB"}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tooling detection for a workspace.
|
|
3
|
+
*
|
|
4
|
+
* The proposal ("use Biome.js instead of ESLint + Prettier") is only made
|
|
5
|
+
* for a JavaScript/TypeScript workspace that still uses ESLint or Prettier
|
|
6
|
+
* and does not use Biome yet. The detection reads the workspace itself -
|
|
7
|
+
* it never guesses from the harness.
|
|
8
|
+
*/
|
|
9
|
+
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
10
|
+
import { join } from "node:path";
|
|
11
|
+
const ESLINT_CONFIGS = [
|
|
12
|
+
".eslintrc",
|
|
13
|
+
".eslintrc.js",
|
|
14
|
+
".eslintrc.cjs",
|
|
15
|
+
".eslintrc.mjs",
|
|
16
|
+
".eslintrc.json",
|
|
17
|
+
".eslintrc.yaml",
|
|
18
|
+
".eslintrc.yml",
|
|
19
|
+
"eslint.config.js",
|
|
20
|
+
"eslint.config.mjs",
|
|
21
|
+
"eslint.config.cjs",
|
|
22
|
+
"eslint.config.ts",
|
|
23
|
+
];
|
|
24
|
+
const PRETTIER_CONFIGS = [
|
|
25
|
+
".prettierrc",
|
|
26
|
+
".prettierrc.json",
|
|
27
|
+
".prettierrc.yaml",
|
|
28
|
+
".prettierrc.yml",
|
|
29
|
+
".prettierrc.js",
|
|
30
|
+
".prettierrc.cjs",
|
|
31
|
+
".prettierrc.mjs",
|
|
32
|
+
"prettier.config.js",
|
|
33
|
+
"prettier.config.cjs",
|
|
34
|
+
"prettier.config.mjs",
|
|
35
|
+
"prettier.config.ts",
|
|
36
|
+
];
|
|
37
|
+
const BIOME_CONFIGS = ["biome.json", "biome.jsonc", "biome.json5"];
|
|
38
|
+
const NEXT_CONFIGS = [
|
|
39
|
+
"next.config.js",
|
|
40
|
+
"next.config.mjs",
|
|
41
|
+
"next.config.cjs",
|
|
42
|
+
"next.config.ts",
|
|
43
|
+
];
|
|
44
|
+
const SOURCE_EXTENSIONS = [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs"];
|
|
45
|
+
const IGNORED_DIRECTORIES = new Set([
|
|
46
|
+
"node_modules",
|
|
47
|
+
"dist",
|
|
48
|
+
"build",
|
|
49
|
+
"out",
|
|
50
|
+
"coverage",
|
|
51
|
+
"vendor",
|
|
52
|
+
".git",
|
|
53
|
+
".next",
|
|
54
|
+
".turbo",
|
|
55
|
+
".cache",
|
|
56
|
+
]);
|
|
57
|
+
function readPackageJson(root) {
|
|
58
|
+
const path = join(root, "package.json");
|
|
59
|
+
if (!existsSync(path))
|
|
60
|
+
return null;
|
|
61
|
+
try {
|
|
62
|
+
const parsed = JSON.parse(readFileSync(path, "utf8"));
|
|
63
|
+
if (!parsed || typeof parsed !== "object")
|
|
64
|
+
return null;
|
|
65
|
+
return parsed;
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function allDependencies(pkg) {
|
|
72
|
+
if (!pkg)
|
|
73
|
+
return {};
|
|
74
|
+
return {
|
|
75
|
+
...(pkg.dependencies ?? {}),
|
|
76
|
+
...(pkg.devDependencies ?? {}),
|
|
77
|
+
...(pkg.peerDependencies ?? {}),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function anyExists(root, names) {
|
|
81
|
+
return names.some((name) => existsSync(join(root, name)));
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Is there a JavaScript/TypeScript source file in the workspace?
|
|
85
|
+
*
|
|
86
|
+
* The scan is shallow on purpose: it only answers "does this workspace hold
|
|
87
|
+
* JS/TS code at all", so it stops at the first source file and never walks
|
|
88
|
+
* a build or dependency directory.
|
|
89
|
+
*/
|
|
90
|
+
function hasSourceFile(root, maxDepth = 2) {
|
|
91
|
+
const queue = [{ dir: root, depth: 0 }];
|
|
92
|
+
while (queue.length > 0) {
|
|
93
|
+
const current = queue.shift();
|
|
94
|
+
if (!current)
|
|
95
|
+
break;
|
|
96
|
+
let entries;
|
|
97
|
+
try {
|
|
98
|
+
entries = readdirSync(current.dir);
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
for (const entry of entries) {
|
|
104
|
+
if (entry.startsWith("."))
|
|
105
|
+
continue;
|
|
106
|
+
const full = join(current.dir, entry);
|
|
107
|
+
let isDirectory = false;
|
|
108
|
+
try {
|
|
109
|
+
isDirectory = statSync(full).isDirectory();
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
if (isDirectory) {
|
|
115
|
+
if (current.depth < maxDepth && !IGNORED_DIRECTORIES.has(entry)) {
|
|
116
|
+
queue.push({ dir: full, depth: current.depth + 1 });
|
|
117
|
+
}
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
if (SOURCE_EXTENSIONS.some((extension) => entry.endsWith(extension))) {
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Which package manager does the workspace use?
|
|
129
|
+
*
|
|
130
|
+
* The `packageManager` field wins; a lockfile decides otherwise.
|
|
131
|
+
*/
|
|
132
|
+
export function detectPackageManager(root, pkg) {
|
|
133
|
+
const declared = pkg?.packageManager?.split("@")[0]?.trim();
|
|
134
|
+
if (declared)
|
|
135
|
+
return declared;
|
|
136
|
+
if (existsSync(join(root, "pnpm-lock.yaml")))
|
|
137
|
+
return "pnpm";
|
|
138
|
+
if (existsSync(join(root, "yarn.lock")))
|
|
139
|
+
return "yarn";
|
|
140
|
+
if (existsSync(join(root, "bun.lock")) || existsSync(join(root, "bun.lockb")))
|
|
141
|
+
return "bun";
|
|
142
|
+
if (existsSync(join(root, "package-lock.json")))
|
|
143
|
+
return "npm";
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Read the tooling facts of a workspace.
|
|
148
|
+
*/
|
|
149
|
+
export function detectToolingContext(root) {
|
|
150
|
+
const pkg = readPackageJson(root);
|
|
151
|
+
const deps = allDependencies(pkg);
|
|
152
|
+
const hasPackageJson = pkg !== null;
|
|
153
|
+
const hasTsConfig = existsSync(join(root, "tsconfig.json"));
|
|
154
|
+
const isNextJs = Boolean(deps.next) || anyExists(root, NEXT_CONFIGS);
|
|
155
|
+
const isReact = Boolean(deps.react || deps["react-dom"]) || isNextJs;
|
|
156
|
+
const isTypeScript = hasTsConfig || Boolean(deps.typescript) || hasSourceFile(root);
|
|
157
|
+
return {
|
|
158
|
+
root,
|
|
159
|
+
hasPackageJson,
|
|
160
|
+
isJavaScriptTypeScript: hasPackageJson && isTypeScript,
|
|
161
|
+
isNextJs,
|
|
162
|
+
isReact,
|
|
163
|
+
usesBiome: anyExists(root, BIOME_CONFIGS) || Boolean(deps["@biomejs/biome"]),
|
|
164
|
+
usesEslint: anyExists(root, ESLINT_CONFIGS) || Boolean(deps.eslint),
|
|
165
|
+
usesPrettier: anyExists(root, PRETTIER_CONFIGS) || Boolean(deps.prettier),
|
|
166
|
+
packageManager: detectPackageManager(root, pkg),
|
|
167
|
+
frameworks: [
|
|
168
|
+
...(isNextJs ? ["next"] : []),
|
|
169
|
+
...(isReact && !isNextJs ? ["react"] : []),
|
|
170
|
+
],
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* May the Biome proposal be sent for this workspace?
|
|
175
|
+
*
|
|
176
|
+
* A workspace that already uses Biome is never asked about Biome, and a
|
|
177
|
+
* workspace without ESLint and Prettier has nothing to replace.
|
|
178
|
+
*/
|
|
179
|
+
export function evaluateBiomeProposalEligibility(context) {
|
|
180
|
+
if (!context.hasPackageJson) {
|
|
181
|
+
return {
|
|
182
|
+
eligible: false,
|
|
183
|
+
reason: "the workspace has no package.json",
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
if (!context.isJavaScriptTypeScript) {
|
|
187
|
+
return {
|
|
188
|
+
eligible: false,
|
|
189
|
+
reason: "the workspace is not a JavaScript/TypeScript project",
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
if (context.usesBiome) {
|
|
193
|
+
return {
|
|
194
|
+
eligible: false,
|
|
195
|
+
reason: "Biome is already configured in this workspace",
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
if (!context.usesEslint && !context.usesPrettier) {
|
|
199
|
+
return {
|
|
200
|
+
eligible: false,
|
|
201
|
+
reason: "the workspace uses neither ESLint nor Prettier",
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
return {
|
|
205
|
+
eligible: true,
|
|
206
|
+
reason: "the workspace uses ESLint and/or Prettier and no Biome",
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
//# sourceMappingURL=detect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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
|
+
* in a JavaScript/TypeScript workspace. The offer is a decision of its own:
|
|
6
|
+
* it never pauses the work and never travels through the task-approval
|
|
7
|
+
* path.
|
|
8
|
+
*/
|
|
9
|
+
export { detectPackageManager, detectToolingContext, evaluateBiomeProposalEligibility, type ProposalEligibility, type ToolingContext, } from "./detect.js";
|
|
10
|
+
export { buildToolingButtons, buildToolingImplementationPrompt, buildToolingProposalMessage, buildToolingRequestId, buildToolingUserKey, parseToolingTarget, TOOLING_ACTION, type ToolingButton, type ToolingChoice, type ToolingPreference, type ToolingTarget, } from "./proposal.js";
|
|
11
|
+
export { harnessRuntimeDir, shouldAskAgain, ToolingPreferenceStore, toolingPreferenceKey, type ToolingPreferenceRecord, } from "./store.js";
|
|
12
|
+
export { ToolingRequestRegistry, type ToolingRequest, type ToolingResolution, } from "./registry.js";
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|