@evo-dev/core 0.0.1-alpha → 0.0.1-alpha.1
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/assets/agents/review/code-reviewer/examples.md +1 -1
- package/assets/agents/review/code-reviewer/prompt.md +1 -1
- package/assets/agents/review/code-reviewer/verification.md +1 -1
- package/assets/skills/coding/knowledge-distillation/SKILL.md +248 -0
- package/assets/skills/coding/knowledge-distillation/manifest.json +10 -0
- package/assets/skills/coding/knowledge-distillation/references/knowledge-distillation-methods.md +122 -0
- package/assets/workflows/rd-bug-fix/WORKFLOW.json +1 -1
- package/assets/workflows/rd-code-review/WORKFLOW.json +1 -1
- package/assets/workflows/rd-docs-update/WORKFLOW.json +1 -1
- package/assets/workflows/rd-feature-implementation/WORKFLOW.json +1 -1
- package/assets/workflows/rd-refactor/WORKFLOW.json +1 -1
- package/assets/workflows/rd-release-readiness/WORKFLOW.json +1 -1
- package/assets/workflows/rd-security-boundary-review/WORKFLOW.json +2 -2
- package/assets/workflows/rd-test-generation/WORKFLOW.json +1 -1
- package/dist/config/index.js +242 -36
- package/dist/index.js +5045 -934
- package/dist/plugins/index.js +32 -32
- package/package.json +1 -1
- package/src/agents/index.ts +28 -49
- package/src/config/index.ts +2 -0
- package/src/config/paths.ts +30 -0
- package/src/config/settings.ts +52 -0
- package/src/config/store.ts +150 -0
- package/src/daemon/index.ts +376 -3
- package/src/evolution/index.ts +2356 -0
- package/src/hooks/index.ts +255 -238
- package/src/index.ts +4 -0
- package/src/pack/index.ts +13 -13
- package/src/plugins/capabilities.ts +40 -42
- package/src/plugins/index.ts +0 -1
- package/src/plugins/types.ts +4 -0
- package/src/protected-zones/index.ts +29 -11
- package/src/runtime-logs/index.ts +324 -0
- package/src/sync/orchestrator.ts +6 -0
- package/src/task/index.ts +3 -3
- package/src/team/index.ts +2398 -0
- package/src/team/mcp.ts +401 -0
- package/src/workflow/index.ts +6 -6
package/src/index.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./agents/index.ts";
|
|
|
2
2
|
export * from "./assets/index.ts";
|
|
3
3
|
export * from "./config/index.ts";
|
|
4
4
|
export * from "./daemon/index.ts";
|
|
5
|
+
export * from "./evolution/index.ts";
|
|
5
6
|
export * from "./hooks/index.ts";
|
|
6
7
|
export * from "./learning/index.ts";
|
|
7
8
|
export * from "./observability/index.ts";
|
|
@@ -9,6 +10,9 @@ export * from "./pack/index.ts";
|
|
|
9
10
|
export * from "./plugins/index.ts";
|
|
10
11
|
export * from "./project/index.ts";
|
|
11
12
|
export * from "./protected-zones/index.ts";
|
|
13
|
+
export * from "./runtime-logs/index.ts";
|
|
12
14
|
export * from "./sync/index.ts";
|
|
13
15
|
export * from "./task/index.ts";
|
|
16
|
+
export * from "./team/index.ts";
|
|
17
|
+
export * from "./team/mcp.ts";
|
|
14
18
|
export * from "./workflow/index.ts";
|
package/src/pack/index.ts
CHANGED
|
@@ -107,7 +107,7 @@ export interface PackInstallDryRunPlan {
|
|
|
107
107
|
riskyCapabilities: string[];
|
|
108
108
|
verificationPlan: string[];
|
|
109
109
|
uninstallPlan: string[];
|
|
110
|
-
|
|
110
|
+
advisories: string[];
|
|
111
111
|
warnings: string[];
|
|
112
112
|
}
|
|
113
113
|
|
|
@@ -125,7 +125,7 @@ const RISKY_PERMISSION_LABELS: Record<keyof PackPermissions, string> = {
|
|
|
125
125
|
readsSourceContent: "reads source content",
|
|
126
126
|
readsProjectMetadata: "reads project metadata",
|
|
127
127
|
};
|
|
128
|
-
const
|
|
128
|
+
const FIRST_SLICE_OUT_OF_SCOPE_PERMISSIONS: Array<keyof PackPermissions> = [
|
|
129
129
|
"writesProjectFiles",
|
|
130
130
|
"usesHooks",
|
|
131
131
|
"usesNetwork",
|
|
@@ -203,14 +203,14 @@ export async function planPackInstallDryRun(
|
|
|
203
203
|
const manifest = validation.manifest;
|
|
204
204
|
const plannedWrites: PackInstallAction[] = [];
|
|
205
205
|
const warnings: string[] = [];
|
|
206
|
-
const
|
|
206
|
+
const advisories = validation.findings
|
|
207
207
|
.filter((finding) => finding.severity === "error")
|
|
208
208
|
.map(
|
|
209
209
|
(finding) => `${finding.code}${finding.path ? ` ${finding.path}` : ""}: ${finding.message}`,
|
|
210
210
|
);
|
|
211
211
|
|
|
212
212
|
if (manifest === undefined) {
|
|
213
|
-
|
|
213
|
+
advisories.push("Cannot plan install because PACK.json is invalid or missing.");
|
|
214
214
|
} else {
|
|
215
215
|
const permissions = normalizePackPermissions(manifest.permissions);
|
|
216
216
|
if (!permissions.writesUserConfig) {
|
|
@@ -249,7 +249,7 @@ export async function planPackInstallDryRun(
|
|
|
249
249
|
"confirmation required before future uninstall",
|
|
250
250
|
"deleteUserContent=false; customizations and user content must be preserved",
|
|
251
251
|
],
|
|
252
|
-
|
|
252
|
+
advisories,
|
|
253
253
|
warnings,
|
|
254
254
|
};
|
|
255
255
|
}
|
|
@@ -359,7 +359,7 @@ export function formatPackValidation(result: PackValidationResult): string {
|
|
|
359
359
|
: `Pack: ${manifest.id}@${manifest.version} (${manifest.name})`,
|
|
360
360
|
`Assets: ${result.assets.length}`,
|
|
361
361
|
`Scanned paths: ${result.scannedPaths.length}`,
|
|
362
|
-
`Protected-zone
|
|
362
|
+
`Protected-zone advisories: ${result.protectedZoneFindings.length}`,
|
|
363
363
|
"",
|
|
364
364
|
"Findings:",
|
|
365
365
|
...(result.findings.length === 0
|
|
@@ -380,7 +380,7 @@ export function formatPackInstallDryRun(plan: PackInstallDryRunPlan): string {
|
|
|
380
380
|
? "Pack: unknown"
|
|
381
381
|
: `Pack: ${manifest.id}@${manifest.version} (${manifest.name})`,
|
|
382
382
|
"Mode: dry-run (no writes)",
|
|
383
|
-
`Status: ${plan.
|
|
383
|
+
`Status: ${plan.advisories.length === 0 ? "PASS" : "ADVISORY"}`,
|
|
384
384
|
"",
|
|
385
385
|
`Source: ${plan.validation.source}`,
|
|
386
386
|
"",
|
|
@@ -417,7 +417,7 @@ export function formatPackInstallDryRun(plan: PackInstallDryRunPlan): string {
|
|
|
417
417
|
...(plan.validation.protectedZoneFindings.length === 0
|
|
418
418
|
? [" - PASS"]
|
|
419
419
|
: plan.validation.protectedZoneFindings.map(
|
|
420
|
-
(finding) => ` -
|
|
420
|
+
(finding) => ` - ADVISORY ${finding.ruleId} ${finding.path}: ${finding.reason}`,
|
|
421
421
|
)),
|
|
422
422
|
"",
|
|
423
423
|
"Verification plan:",
|
|
@@ -435,10 +435,10 @@ export function formatPackInstallDryRun(plan: PackInstallDryRunPlan): string {
|
|
|
435
435
|
? [" - none"]
|
|
436
436
|
: plan.warnings.map((warning) => ` - ${warning}`)),
|
|
437
437
|
"",
|
|
438
|
-
"
|
|
439
|
-
...(plan.
|
|
438
|
+
"Advisories:",
|
|
439
|
+
...(plan.advisories.length === 0
|
|
440
440
|
? [" - none"]
|
|
441
|
-
: plan.
|
|
441
|
+
: plan.advisories.map((advisory) => ` - ${advisory}`)),
|
|
442
442
|
].join("\n");
|
|
443
443
|
}
|
|
444
444
|
|
|
@@ -502,11 +502,11 @@ function validatePermissionBoundaries(
|
|
|
502
502
|
findings: PackValidationFinding[],
|
|
503
503
|
): void {
|
|
504
504
|
const permissions = normalizePackPermissions(manifest.permissions);
|
|
505
|
-
for (const permission of
|
|
505
|
+
for (const permission of FIRST_SLICE_OUT_OF_SCOPE_PERMISSIONS) {
|
|
506
506
|
if (permissions[permission]) {
|
|
507
507
|
findings.push({
|
|
508
508
|
severity: "error",
|
|
509
|
-
code: "permission-
|
|
509
|
+
code: "permission-out-of-scope-first-slice",
|
|
510
510
|
message: `${permission} is outside I6 local validate/install dry-run scope.`,
|
|
511
511
|
});
|
|
512
512
|
}
|
|
@@ -11,7 +11,7 @@ export interface PluginCapabilityNegotiation {
|
|
|
11
11
|
hooks: CapabilityState;
|
|
12
12
|
canPlanWrites: boolean;
|
|
13
13
|
warnings: string[];
|
|
14
|
-
|
|
14
|
+
advisories: string[];
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export interface CodexCapabilityVerificationArtifact {
|
|
@@ -34,9 +34,9 @@ export interface CodexCapabilityVerificationArtifact {
|
|
|
34
34
|
version: string | null;
|
|
35
35
|
};
|
|
36
36
|
capabilities: {
|
|
37
|
-
skills: "
|
|
38
|
-
agents: "
|
|
39
|
-
hooks: "
|
|
37
|
+
skills: "plugin-bundled";
|
|
38
|
+
agents: "user-level-toml-sync";
|
|
39
|
+
hooks: "plugin-manifest-hooks";
|
|
40
40
|
};
|
|
41
41
|
writeBoundary: {
|
|
42
42
|
writesAllowed: false;
|
|
@@ -55,7 +55,7 @@ export interface CodexCapabilityVerificationArtifact {
|
|
|
55
55
|
secretsStored: false;
|
|
56
56
|
externalUpload: false;
|
|
57
57
|
};
|
|
58
|
-
|
|
58
|
+
advisories: string[];
|
|
59
59
|
diagnostics: string[];
|
|
60
60
|
evidenceRefs: string[];
|
|
61
61
|
evidence: {
|
|
@@ -74,7 +74,7 @@ export function createUnknownNegotiatedCapabilities(pluginId: string): PluginCap
|
|
|
74
74
|
hooks: "unsupported",
|
|
75
75
|
canPlanWrites: false,
|
|
76
76
|
warnings: [],
|
|
77
|
-
|
|
77
|
+
advisories: [`Plugin ${pluginId} capabilities are unknown and unsupported.`],
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -82,12 +82,6 @@ export function isCapabilityUsable(state: CapabilityState): boolean {
|
|
|
82
82
|
return state === "enabled";
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
export function assertNoUnverifiedWrites(negotiation: PluginCapabilityNegotiation): void {
|
|
86
|
-
if (!negotiation.canPlanWrites) {
|
|
87
|
-
throw new Error(`Plugin ${negotiation.pluginId} has no verified enabled write capabilities.`);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
85
|
export function negotiatePluginCapabilities(input: {
|
|
92
86
|
pluginId: string;
|
|
93
87
|
declared: CodeAgentCapabilities;
|
|
@@ -95,29 +89,27 @@ export function negotiatePluginCapabilities(input: {
|
|
|
95
89
|
enabled: boolean;
|
|
96
90
|
}): PluginCapabilityNegotiation {
|
|
97
91
|
if (input.pluginId === "codex") {
|
|
98
|
-
const
|
|
99
|
-
input.declared.skills.supported ? "skills" : null,
|
|
100
|
-
input.declared.agents.supported ? "agents" : null,
|
|
101
|
-
input.declared.hooks.supported ? "hooks" : null,
|
|
102
|
-
].filter(Boolean);
|
|
103
|
-
const blockers = ["Codex capabilities are unverified; writes are unsupported in I10."];
|
|
92
|
+
const advisories: string[] = [];
|
|
104
93
|
const warnings = [
|
|
105
94
|
input.verified
|
|
106
|
-
? "Codex
|
|
95
|
+
? "Codex metadata-only verification artifact exists; implemented Codex skill/agent distribution remains governed by adapter tests."
|
|
96
|
+
: null,
|
|
97
|
+
input.declared.skills.supported
|
|
98
|
+
? "Codex skills are distributed through the EvoDev Codex plugin bundle, not direct user-directory skill sync."
|
|
107
99
|
: null,
|
|
108
|
-
|
|
109
|
-
?
|
|
100
|
+
input.declared.agents.supported
|
|
101
|
+
? "Codex agents can sync to user-level TOML files with no-overwrite semantics."
|
|
110
102
|
: null,
|
|
111
103
|
].filter((warning): warning is string => warning !== null);
|
|
112
104
|
|
|
113
105
|
return {
|
|
114
106
|
pluginId: input.pluginId,
|
|
115
|
-
skills: input.declared.skills.supported
|
|
116
|
-
agents: input.declared.agents.supported
|
|
117
|
-
hooks: input.declared.hooks.supported
|
|
118
|
-
canPlanWrites:
|
|
107
|
+
skills: resolveNonCodexCapabilityState(input.declared.skills.supported, input.enabled),
|
|
108
|
+
agents: resolveNonCodexCapabilityState(input.declared.agents.supported, input.enabled),
|
|
109
|
+
hooks: resolveNonCodexCapabilityState(input.declared.hooks.supported, input.enabled),
|
|
110
|
+
canPlanWrites: input.enabled && input.declared.agents.supported,
|
|
119
111
|
warnings,
|
|
120
|
-
|
|
112
|
+
advisories,
|
|
121
113
|
};
|
|
122
114
|
}
|
|
123
115
|
return {
|
|
@@ -130,9 +122,9 @@ export function negotiatePluginCapabilities(input: {
|
|
|
130
122
|
warnings: input.enabled
|
|
131
123
|
? []
|
|
132
124
|
: [
|
|
133
|
-
`Plugin ${input.pluginId} has declared capabilities but is not enabled
|
|
125
|
+
`Plugin ${input.pluginId} has declared capabilities but is not enabled for write planning.`,
|
|
134
126
|
],
|
|
135
|
-
|
|
127
|
+
advisories: [],
|
|
136
128
|
};
|
|
137
129
|
}
|
|
138
130
|
|
|
@@ -148,7 +140,9 @@ export async function createCodexCapabilityVerificationArtifact(input: {
|
|
|
148
140
|
const timestamp = input.createdAt ?? new Date().toISOString();
|
|
149
141
|
const detectionMessage = sanitizeText(input.detection.message);
|
|
150
142
|
const diagnostics = [
|
|
151
|
-
"Codex
|
|
143
|
+
"Codex skills are packaged in the EvoDev Codex plugin payload.",
|
|
144
|
+
"Codex agents sync to user-level TOML files under ~/.codex/agents.",
|
|
145
|
+
"Codex hooks are supplied by the EvoDev Codex plugin manifest and enabled through Codex plugin hooks.",
|
|
152
146
|
];
|
|
153
147
|
return {
|
|
154
148
|
version: 1,
|
|
@@ -165,7 +159,11 @@ export async function createCodexCapabilityVerificationArtifact(input: {
|
|
|
165
159
|
externalUpload: false,
|
|
166
160
|
networkUsed: false,
|
|
167
161
|
toolSummary: { tool: "codex", detectionStatus: input.detection.status, version: null },
|
|
168
|
-
capabilities: {
|
|
162
|
+
capabilities: {
|
|
163
|
+
skills: "plugin-bundled",
|
|
164
|
+
agents: "user-level-toml-sync",
|
|
165
|
+
hooks: "plugin-manifest-hooks",
|
|
166
|
+
},
|
|
169
167
|
writeBoundary: {
|
|
170
168
|
writesAllowed: false,
|
|
171
169
|
allowedPaths: [],
|
|
@@ -183,7 +181,7 @@ export async function createCodexCapabilityVerificationArtifact(input: {
|
|
|
183
181
|
secretsStored: false,
|
|
184
182
|
externalUpload: false,
|
|
185
183
|
},
|
|
186
|
-
|
|
184
|
+
advisories: [],
|
|
187
185
|
diagnostics,
|
|
188
186
|
evidenceRefs: [],
|
|
189
187
|
evidence: {
|
|
@@ -191,7 +189,8 @@ export async function createCodexCapabilityVerificationArtifact(input: {
|
|
|
191
189
|
detectionMessage,
|
|
192
190
|
writesAllowed: false,
|
|
193
191
|
notes: [
|
|
194
|
-
"Metadata-only
|
|
192
|
+
"Metadata-only verification artifact; it does not probe or write Code Agent directories.",
|
|
193
|
+
"Implemented Codex asset distribution is covered by adapter tests: plugin-bundled skills and user-level TOML agents.",
|
|
195
194
|
],
|
|
196
195
|
},
|
|
197
196
|
};
|
|
@@ -275,12 +274,12 @@ export function formatCodexCapabilityVerificationArtifact(
|
|
|
275
274
|
`Status: ${artifact.status}`,
|
|
276
275
|
`Artifact: ${path ?? "dry-run only"}`,
|
|
277
276
|
`Verified at: ${artifact.verifiedAt}`,
|
|
278
|
-
|
|
279
|
-
"
|
|
277
|
+
`Capabilities: skills=${artifact.capabilities.skills} agents=${artifact.capabilities.agents} hooks=${artifact.capabilities.hooks}`,
|
|
278
|
+
"Verification writes allowed: false",
|
|
280
279
|
"Allowed paths: none",
|
|
281
|
-
"User-level
|
|
280
|
+
"User-level agent sync path: ~/.codex/agents",
|
|
282
281
|
"Project writes allowed: false",
|
|
283
|
-
"No-overwrite
|
|
282
|
+
"No-overwrite policy: skip existing files unless force refresh is requested",
|
|
284
283
|
`External upload: ${artifact.externalUpload}`,
|
|
285
284
|
`Detection: ${artifact.evidence.detectionStatus}`,
|
|
286
285
|
...artifact.evidence.notes.map((note) => `Note: ${note}`),
|
|
@@ -301,12 +300,11 @@ export async function runPluginConformance(
|
|
|
301
300
|
}
|
|
302
301
|
if (plugin.id === "codex") {
|
|
303
302
|
const capabilities = await plugin.getCapabilities();
|
|
304
|
-
if (
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
findings.push("Codex must not declare verified runtime support in I10.");
|
|
303
|
+
if (!capabilities.skills.supported || !capabilities.agents.supported) {
|
|
304
|
+
findings.push("Codex must declare plugin-bundled skills and user-level TOML agents.");
|
|
305
|
+
}
|
|
306
|
+
if (!capabilities.hooks.supported || capabilities.hooks.events.length === 0) {
|
|
307
|
+
findings.push("Codex must declare plugin-manifest hook support.");
|
|
310
308
|
}
|
|
311
309
|
}
|
|
312
310
|
return { ok: findings.length === 0, findings };
|
package/src/plugins/index.ts
CHANGED
package/src/plugins/types.ts
CHANGED
|
@@ -70,16 +70,19 @@ export interface SyncSkillsInput {
|
|
|
70
70
|
targetPlugin: PluginId;
|
|
71
71
|
skills: ScannedAsset<SkillManifest>[];
|
|
72
72
|
dryRun: boolean;
|
|
73
|
+
force?: boolean;
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
export interface SyncAgentsInput {
|
|
76
77
|
targetPlugin: PluginId;
|
|
77
78
|
agents: ScannedAsset<AgentManifest>[];
|
|
78
79
|
dryRun: boolean;
|
|
80
|
+
force?: boolean;
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
export interface PluginInstallInput {
|
|
82
84
|
targetPlugin: PluginId;
|
|
85
|
+
force?: boolean;
|
|
83
86
|
}
|
|
84
87
|
|
|
85
88
|
export type PluginInstallStatus = "installed" | "already-installed" | "skipped" | "failed";
|
|
@@ -108,6 +111,7 @@ export interface SyncPlan {
|
|
|
108
111
|
skills: ScannedAsset<SkillManifest>[];
|
|
109
112
|
agents: ScannedAsset<AgentManifest>[];
|
|
110
113
|
dryRun: boolean;
|
|
114
|
+
force: boolean;
|
|
111
115
|
}
|
|
112
116
|
|
|
113
117
|
export interface CodeAgentPlugin {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type ProtectedZoneSeverity = "
|
|
1
|
+
export type ProtectedZoneSeverity = "advisory";
|
|
2
2
|
|
|
3
3
|
export interface ProtectedZoneRule {
|
|
4
4
|
id: string;
|
|
@@ -22,30 +22,32 @@ const SENSITIVE_DIRECTORY_SEGMENTS = new Set([
|
|
|
22
22
|
".claude",
|
|
23
23
|
".codex",
|
|
24
24
|
".evodev",
|
|
25
|
-
"KNOWLEDGE",
|
|
26
|
-
"LEARNING",
|
|
27
|
-
"OBSERVABILITY",
|
|
28
|
-
"PROJECTS",
|
|
29
|
-
"STATE",
|
|
30
|
-
"USER",
|
|
31
|
-
"WORK",
|
|
32
25
|
"accepted-memory",
|
|
33
26
|
"evidence",
|
|
27
|
+
"evos",
|
|
34
28
|
"hook-logs",
|
|
35
29
|
"knowledge",
|
|
30
|
+
"learning",
|
|
36
31
|
"learning-candidates",
|
|
37
32
|
"logs",
|
|
38
33
|
"memory",
|
|
34
|
+
"observability",
|
|
39
35
|
"pack-logs",
|
|
40
36
|
"private-project-context",
|
|
37
|
+
"projects",
|
|
41
38
|
"raw-evidence",
|
|
42
39
|
"raw-output",
|
|
43
40
|
"raw-payload",
|
|
44
41
|
"raw-payloads",
|
|
42
|
+
"role-agents",
|
|
43
|
+
"roles",
|
|
45
44
|
"secrets",
|
|
46
45
|
"state",
|
|
47
46
|
"task-contract",
|
|
48
47
|
"task-contracts",
|
|
48
|
+
"teams",
|
|
49
|
+
"user",
|
|
50
|
+
"work",
|
|
49
51
|
"workflow-logs",
|
|
50
52
|
]);
|
|
51
53
|
|
|
@@ -66,8 +68,9 @@ export const DEFAULT_PROTECTED_ZONE_RULES: ProtectedZoneRule[] = [
|
|
|
66
68
|
id: "runtime-private-directory",
|
|
67
69
|
reason:
|
|
68
70
|
"Runtime/private EvoDev directories must not be included in packages or release artifacts.",
|
|
69
|
-
matches(
|
|
70
|
-
|
|
71
|
+
matches(path, segments) {
|
|
72
|
+
if (isCodeModulePath(path, segments)) return false;
|
|
73
|
+
return segments.some((segment) => SENSITIVE_DIRECTORY_SEGMENTS.has(segment.toLowerCase()));
|
|
71
74
|
},
|
|
72
75
|
},
|
|
73
76
|
{
|
|
@@ -116,7 +119,7 @@ export function checkProtectedZonePaths(
|
|
|
116
119
|
findings.push({
|
|
117
120
|
path,
|
|
118
121
|
ruleId: rule.id,
|
|
119
|
-
severity: "
|
|
122
|
+
severity: "advisory",
|
|
120
123
|
reason: rule.reason,
|
|
121
124
|
});
|
|
122
125
|
}
|
|
@@ -135,3 +138,18 @@ function basename(path: string): string {
|
|
|
135
138
|
const normalized = normalizePackagePath(path);
|
|
136
139
|
return normalized.slice(normalized.lastIndexOf("/") + 1);
|
|
137
140
|
}
|
|
141
|
+
|
|
142
|
+
function isCodeModulePath(path: string, segments: string[]): boolean {
|
|
143
|
+
const firstSegment = segments[0]?.toLowerCase();
|
|
144
|
+
if (firstSegment !== "src" && firstSegment !== "dist") return false;
|
|
145
|
+
|
|
146
|
+
const name = basename(path).toLowerCase();
|
|
147
|
+
return (
|
|
148
|
+
name.endsWith(".ts") ||
|
|
149
|
+
name.endsWith(".tsx") ||
|
|
150
|
+
name.endsWith(".js") ||
|
|
151
|
+
name.endsWith(".jsx") ||
|
|
152
|
+
name.endsWith(".mjs") ||
|
|
153
|
+
name.endsWith(".cjs")
|
|
154
|
+
);
|
|
155
|
+
}
|