@uipath/solutionpackager-tool-core 1.205.0-preview.281 → 1.206.0-preview.282

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/index.js CHANGED
@@ -983,9 +983,9 @@ I18nManager.registerTranslations("zu", zu);
983
983
  I18nManager.setLocale("en");
984
984
  // src/models/build-configuration.ts
985
985
  var BuildConfiguration;
986
- ((BuildConfiguration2) => {
987
- BuildConfiguration2["Debug"] = "Debug";
988
- BuildConfiguration2["Release"] = "Release";
986
+ ((BuildConfiguration) => {
987
+ BuildConfiguration["Debug"] = "Debug";
988
+ BuildConfiguration["Release"] = "Release";
989
989
  })(BuildConfiguration ||= {});
990
990
  // src/models/connection-info.ts
991
991
  function toRelativeUrl(url) {
@@ -1007,11 +1007,11 @@ function normalizeIgnoredRules(ignoredRules) {
1007
1007
  }
1008
1008
  // src/models/log-message.ts
1009
1009
  var LogLevel;
1010
- ((LogLevel2) => {
1011
- LogLevel2["Debug"] = "Debug";
1012
- LogLevel2["Info"] = "Information";
1013
- LogLevel2["Warn"] = "Warning";
1014
- LogLevel2["Error"] = "Error";
1010
+ ((LogLevel) => {
1011
+ LogLevel["Debug"] = "Debug";
1012
+ LogLevel["Info"] = "Information";
1013
+ LogLevel["Warn"] = "Warning";
1014
+ LogLevel["Error"] = "Error";
1015
1015
  })(LogLevel ||= {});
1016
1016
 
1017
1017
  class LogMessage {
@@ -1112,39 +1112,39 @@ var NugetConstants = {
1112
1112
  };
1113
1113
  // src/models/pack-job-target.ts
1114
1114
  var PackJobTargetKind;
1115
- ((PackJobTargetKind2) => {
1116
- PackJobTargetKind2["Serverless"] = "Serverless";
1117
- PackJobTargetKind2["LocalRobot"] = "LocalRobot";
1115
+ ((PackJobTargetKind) => {
1116
+ PackJobTargetKind["Serverless"] = "Serverless";
1117
+ PackJobTargetKind["LocalRobot"] = "LocalRobot";
1118
1118
  })(PackJobTargetKind ||= {});
1119
1119
  // src/models/project-type.ts
1120
1120
  var ProjectTypes;
1121
- ((ProjectTypes2) => {
1122
- ProjectTypes2["Agent"] = "Agent";
1123
- ProjectTypes2["Api"] = "Api";
1124
- ProjectTypes2["BusinessRules"] = "BusinessRules";
1125
- ProjectTypes2["Connector"] = "Connector";
1126
- ProjectTypes2["CaseManagement"] = "CaseManagement";
1127
- ProjectTypes2["Flow"] = "Flow";
1128
- ProjectTypes2["Function"] = "Function";
1129
- ProjectTypes2["ProcessOrchestration"] = "ProcessOrchestration";
1130
- ProjectTypes2["Process"] = "Process";
1131
- ProjectTypes2["Library"] = "Library";
1132
- ProjectTypes2["WebApp"] = "WebApp";
1133
- ProjectTypes2["Tests"] = "Tests";
1134
- ProjectTypes2["AppV2"] = "AppV2";
1121
+ ((ProjectTypes) => {
1122
+ ProjectTypes["Agent"] = "Agent";
1123
+ ProjectTypes["Api"] = "Api";
1124
+ ProjectTypes["BusinessRules"] = "BusinessRules";
1125
+ ProjectTypes["Connector"] = "Connector";
1126
+ ProjectTypes["CaseManagement"] = "CaseManagement";
1127
+ ProjectTypes["Flow"] = "Flow";
1128
+ ProjectTypes["Function"] = "Function";
1129
+ ProjectTypes["ProcessOrchestration"] = "ProcessOrchestration";
1130
+ ProjectTypes["Process"] = "Process";
1131
+ ProjectTypes["Library"] = "Library";
1132
+ ProjectTypes["WebApp"] = "WebApp";
1133
+ ProjectTypes["Tests"] = "Tests";
1134
+ ProjectTypes["AppV2"] = "AppV2";
1135
1135
  })(ProjectTypes ||= {});
1136
1136
  // src/models/target-frameworks.ts
1137
1137
  var TargetFramework;
1138
- ((TargetFramework2) => {
1139
- TargetFramework2["Portable"] = "Portable";
1140
- TargetFramework2["Windows"] = "Windows";
1138
+ ((TargetFramework) => {
1139
+ TargetFramework["Portable"] = "Portable";
1140
+ TargetFramework["Windows"] = "Windows";
1141
1141
  })(TargetFramework ||= {});
1142
1142
  // src/models/tool-error-code.ts
1143
1143
  var ToolErrorCodes;
1144
- ((ToolErrorCodes2) => {
1145
- ToolErrorCodes2["Success"] = "SUCCESS";
1146
- ToolErrorCodes2["InternalError"] = "INTERNAL_ERROR";
1147
- ToolErrorCodes2["Canceled"] = "CANCELED";
1144
+ ((ToolErrorCodes) => {
1145
+ ToolErrorCodes["Success"] = "SUCCESS";
1146
+ ToolErrorCodes["InternalError"] = "INTERNAL_ERROR";
1147
+ ToolErrorCodes["Canceled"] = "CANCELED";
1148
1148
  })(ToolErrorCodes ||= {});
1149
1149
  // src/models/tool-result.ts
1150
1150
  class ToolResult {
@@ -1196,31 +1196,36 @@ function createProjectCleanupInfo(unusedItems, cleanedWorkflows) {
1196
1196
  function createDefaultBindingsVersion() {
1197
1197
  return { major: 2, minor: 0 };
1198
1198
  }
1199
- // src/services/project-id.ts
1200
- var OPERATE_FILE = "operate.json";
1201
- var PROJECT_FILE = "project.json";
1202
- function isNonEmptyString(value) {
1203
- return typeof value === "string" && value.length > 0;
1204
- }
1205
- async function readJsonObject(fs, filePath) {
1206
- let content;
1199
+ // src/services/json-object.ts
1200
+ function parseJsonObject(text) {
1201
+ if (!text)
1202
+ return;
1207
1203
  try {
1208
- content = await fs.readFile(filePath, "utf-8");
1204
+ const value = JSON.parse(text);
1205
+ return typeof value === "object" && value !== null && !Array.isArray(value) ? value : undefined;
1209
1206
  } catch {
1210
1207
  return;
1211
1208
  }
1212
- if (content === null) {
1213
- return;
1214
- }
1209
+ }
1210
+ async function readJsonObjectFile(fs, filePath) {
1211
+ let content;
1215
1212
  try {
1216
- const parsed = JSON.parse(content);
1217
- if (parsed === null || typeof parsed !== "object") {
1218
- return;
1219
- }
1220
- return parsed;
1213
+ content = await fs.readFile(filePath);
1221
1214
  } catch {
1222
1215
  return;
1223
1216
  }
1217
+ if (!content)
1218
+ return;
1219
+ const text = typeof content === "string" ? content : new TextDecoder().decode(content);
1220
+ const value = parseJsonObject(text);
1221
+ return value ? { text, value } : undefined;
1222
+ }
1223
+
1224
+ // src/services/project-id.ts
1225
+ var OPERATE_FILE = "operate.json";
1226
+ var PROJECT_FILE = "project.json";
1227
+ function isNonEmptyString(value) {
1228
+ return typeof value === "string" && value.length > 0;
1224
1229
  }
1225
1230
  async function writeJsonObject(fs, filePath, data) {
1226
1231
  await fs.writeFile(filePath, `${JSON.stringify(data, null, 2)}
@@ -1230,7 +1235,7 @@ async function ensureProjectId(projectPath, fs) {
1230
1235
  const operatePath = Path.join(projectPath, OPERATE_FILE);
1231
1236
  const operateExists = await fs.exists(operatePath);
1232
1237
  if (operateExists) {
1233
- const operate = await readJsonObject(fs, operatePath);
1238
+ const operate = (await readJsonObjectFile(fs, operatePath))?.value;
1234
1239
  if (operate && isNonEmptyString(operate.projectId)) {
1235
1240
  return operate.projectId;
1236
1241
  }
@@ -1247,7 +1252,7 @@ async function ensureProjectId(projectPath, fs) {
1247
1252
  const projectFilePath = Path.join(projectPath, PROJECT_FILE);
1248
1253
  const projectFileExists = await fs.exists(projectFilePath);
1249
1254
  if (projectFileExists) {
1250
- const projectFile = await readJsonObject(fs, projectFilePath);
1255
+ const projectFile = (await readJsonObjectFile(fs, projectFilePath))?.value;
1251
1256
  if (projectFile && isNonEmptyString(projectFile.projectId)) {
1252
1257
  return projectFile.projectId;
1253
1258
  }
@@ -1267,7 +1272,7 @@ async function ensureProjectIdInOperateFile(operateFilePath, fallbackProjectId,
1267
1272
  if (!await fs.exists(operateFilePath)) {
1268
1273
  return;
1269
1274
  }
1270
- const parsed = await readJsonObject(fs, operateFilePath);
1275
+ const parsed = (await readJsonObjectFile(fs, operateFilePath))?.value;
1271
1276
  if (!parsed) {
1272
1277
  return;
1273
1278
  }
@@ -1292,15 +1297,42 @@ var OPERATE_SCHEMA = "https://cloud.uipath.com/draft/2024-12/operate";
1292
1297
  function withoutContentPrefix(filePath) {
1293
1298
  return filePath.replace(/^\/?content\//, "");
1294
1299
  }
1295
- function pickMain(entryPoints, mainFile) {
1296
- if (mainFile) {
1297
- const wanted = withoutContentPrefix(mainFile);
1298
- const declared = entryPoints.find(({ filePath }) => filePath !== undefined && withoutContentPrefix(filePath) === wanted)?.filePath;
1299
- if (declared) {
1300
- return declared;
1301
- }
1302
- }
1303
- return entryPoints[0]?.filePath ?? "";
1300
+ function entryPointFile(filePath) {
1301
+ const path = withoutContentPrefix(filePath);
1302
+ const file = path.split("#")[0] ?? "";
1303
+ return file.endsWith(".bpmn") ? file : path;
1304
+ }
1305
+ function hasFilePath(entry) {
1306
+ return typeof entry === "object" && entry !== null && typeof entry.filePath === "string";
1307
+ }
1308
+ function isDefaultFlag(value) {
1309
+ return value === true || value === "true";
1310
+ }
1311
+ function isDefaultEntryPoint(entry) {
1312
+ return hasFilePath(entry) && isDefaultFlag(entry.isDefault);
1313
+ }
1314
+ function resolveOperateMainEntry(entryPoints, mainFile) {
1315
+ const wanted = mainFile ? entryPointFile(mainFile) : undefined;
1316
+ const inMainFile = wanted ? entryPoints.filter((entry) => hasFilePath(entry) && entryPointFile(entry.filePath) === wanted) : [];
1317
+ return inMainFile.find(isDefaultEntryPoint) ?? inMainFile[0] ?? entryPoints.find(isDefaultEntryPoint) ?? entryPoints[0];
1318
+ }
1319
+ function resolvePackagedMainEntry(entryPoints, operateMain, mainFile) {
1320
+ const named = typeof operateMain === "string" && operateMain !== "" && !entryPoints.some(isDefaultEntryPoint) ? entryPoints.find((entry) => hasFilePath(entry) && withoutContentPrefix(entry.filePath) === withoutContentPrefix(operateMain)) : undefined;
1321
+ return named ?? resolveOperateMainEntry(entryPoints, mainFile);
1322
+ }
1323
+ function resolvePackagedMain(entryPoints, operateMain, mainFile) {
1324
+ const main = resolvePackagedMainEntry(entryPoints, operateMain, mainFile);
1325
+ return main && hasFilePath(main) ? main.filePath : "";
1326
+ }
1327
+ function resolveOperateMain(entryPoints, mainFile) {
1328
+ const main = resolveOperateMainEntry(entryPoints, mainFile);
1329
+ return main && hasFilePath(main) ? main.filePath : "";
1330
+ }
1331
+ function orderDefaultEntryPointFirst(entryPoints, mainFile) {
1332
+ if (!entryPoints.some(isDefaultEntryPoint))
1333
+ return entryPoints;
1334
+ const main = resolveOperateMainEntry(entryPoints, mainFile);
1335
+ return main === undefined ? entryPoints : [main, ...entryPoints.filter((entry) => entry !== main)];
1304
1336
  }
1305
1337
  async function resolveEntryPointMain(fs, sourceFolder, mainFile) {
1306
1338
  const entryPointsFilePath = Path.join(sourceFolder, NugetConstants.EntryPointsFileName);
@@ -1313,11 +1345,60 @@ async function resolveEntryPointMain(fs, sourceFolder, mainFile) {
1313
1345
  }
1314
1346
  try {
1315
1347
  const parsed = JSON.parse(new TextDecoder().decode(content));
1316
- return pickMain(parsed.entryPoints ?? [], mainFile);
1348
+ return resolveOperateMain(parsed.entryPoints ?? [], mainFile);
1317
1349
  } catch {
1318
1350
  return "";
1319
1351
  }
1320
1352
  }
1353
+ async function readProjectMainFile(fs, projectDir) {
1354
+ const mainFile = (await readJsonObjectFile(fs, Path.join(projectDir, "project.uiproj")))?.value.MainFile;
1355
+ return typeof mainFile === "string" && mainFile !== "" ? mainFile : undefined;
1356
+ }
1357
+ async function readOperateMain(fs, folder) {
1358
+ return (await readJsonObjectFile(fs, Path.join(folder, NugetConstants.OperateFileName)))?.value.main;
1359
+ }
1360
+ function formatLike(original, value) {
1361
+ const eol = original.includes(`\r
1362
+ `) ? `\r
1363
+ ` : `
1364
+ `;
1365
+ const minified = !original.trimEnd().includes(`
1366
+ `);
1367
+ const indent = /\n([ \t]+)"/.exec(original)?.[1] ?? 2;
1368
+ const text = (minified ? JSON.stringify(value) : JSON.stringify(value, null, indent)).replace(/\n/g, eol);
1369
+ return original.endsWith(`
1370
+ `) ? `${text}${eol}` : text;
1371
+ }
1372
+ async function applyDefaultEntryPoint(fs, params) {
1373
+ const entryPointsPath = Path.join(params.contentFolder, NugetConstants.EntryPointsFileName);
1374
+ const entryPointsFile = await readJsonObjectFile(fs, entryPointsPath);
1375
+ const entryPoints = entryPointsFile?.value.entryPoints;
1376
+ if (!entryPointsFile || !Array.isArray(entryPoints))
1377
+ return;
1378
+ const written = entryPoints.filter((entry) => typeof entry === "object" && entry !== null);
1379
+ if (written.length !== entryPoints.length)
1380
+ return;
1381
+ const entries = params.withDefaults?.(written) ?? written;
1382
+ const ordered = orderDefaultEntryPointFirst(entries, params.mainFile);
1383
+ if (ordered === entries)
1384
+ return;
1385
+ const packaged = ordered.map((entry, index) => {
1386
+ const { isDefault: _isDefault, ...rest } = entry;
1387
+ return index === 0 ? { ...rest, isDefault: true } : rest;
1388
+ });
1389
+ if (JSON.stringify(packaged) !== JSON.stringify(written)) {
1390
+ await fs.writeFile(entryPointsPath, formatLike(entryPointsFile.text, {
1391
+ ...entryPointsFile.value,
1392
+ entryPoints: packaged
1393
+ }));
1394
+ }
1395
+ const main = resolveOperateMain(entries, params.mainFile);
1396
+ const operatePath = Path.join(params.contentFolder, NugetConstants.OperateFileName);
1397
+ const operate = await readJsonObjectFile(fs, operatePath);
1398
+ if (operate && operate.value.main !== main) {
1399
+ await fs.writeFile(operatePath, formatLike(operate.text, { ...operate.value, main }));
1400
+ }
1401
+ }
1321
1402
  async function writeContentOperateFile(fs, params) {
1322
1403
  const operateFilePath = Path.join(params.contentFolder, NugetConstants.OperateFileName);
1323
1404
  await writeOrBackfillOperateProjectId(operateFilePath, params.projectId, fs, async () => {
@@ -1465,6 +1546,35 @@ class NugetPackager {
1465
1546
  };
1466
1547
  }
1467
1548
  }
1549
+ // src/services/project-identity.ts
1550
+ async function readIdentityJson(fs, path) {
1551
+ const stat = await fs.stat(path);
1552
+ if (!stat)
1553
+ return;
1554
+ if (!stat.isFile() || stat.size > 1024 * 1024)
1555
+ throw new Error("Invalid identity metadata");
1556
+ const text = await fs.readFile(path, "utf-8");
1557
+ if (text === null)
1558
+ return;
1559
+ const value = JSON.parse(text);
1560
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
1561
+ throw new Error("Invalid identity metadata");
1562
+ }
1563
+ return value;
1564
+ }
1565
+ async function readIdentityField(fs, file, fields) {
1566
+ let value = await readIdentityJson(fs, file);
1567
+ for (const field of fields) {
1568
+ if (!value || typeof value !== "object")
1569
+ return;
1570
+ value = value[field];
1571
+ }
1572
+ if (value === undefined || value === null || value === "")
1573
+ return;
1574
+ if (typeof value !== "string" || !value.trim())
1575
+ throw new Error("Invalid project identity");
1576
+ return value;
1577
+ }
1468
1578
  // src/services/project-tool.ts
1469
1579
  class ProjectTool {
1470
1580
  fileSystem;
@@ -1599,11 +1709,24 @@ export {
1599
1709
  ToolsFactoryRepository,
1600
1710
  TranslationService,
1601
1711
  ZipService,
1712
+ applyDefaultEntryPoint,
1602
1713
  createDefaultBindingsVersion,
1603
1714
  ensureContentOperateFile,
1604
1715
  ensureProjectId,
1605
1716
  ensureProjectIdInOperateFile,
1717
+ isDefaultFlag,
1606
1718
  normalizeIgnoredRules,
1719
+ orderDefaultEntryPointFirst,
1720
+ parseJsonObject,
1721
+ readIdentityField,
1722
+ readIdentityJson,
1723
+ readJsonObjectFile,
1724
+ readOperateMain,
1725
+ readProjectMainFile,
1726
+ resolveOperateMain,
1727
+ resolveOperateMainEntry,
1728
+ resolvePackagedMain,
1729
+ resolvePackagedMainEntry,
1607
1730
  toProjectCleanupInfo,
1608
1731
  toProjectCleanupInfoFromRemote,
1609
1732
  toRelativeUrl,
@@ -1613,4 +1736,4 @@ export {
1613
1736
  writeOrBackfillOperateProjectId
1614
1737
  };
1615
1738
 
1616
- //# debugId=795C911A64F7FD5664756E2164756E21
1739
+ //# debugId=54ADCCF818CF1DF264756E2164756E21
@@ -129,6 +129,11 @@ export interface IProjectBuildOptions extends IProjectOptions {
129
129
  * Output type
130
130
  */
131
131
  outputType?: string;
132
+ /**
133
+ * Category the Activities panel shows a library's activities under.
134
+ * Unset or blank keeps the project name. Only library projects use it.
135
+ */
136
+ activitiesRootCategory?: string;
132
137
  /**
133
138
  * Project type
134
139
  */
@@ -3,7 +3,8 @@
3
3
  *
4
4
  * Adding a value here is not the whole change (AGENTS.md Hard Rule #15). A type
5
5
  * a solution can contain also needs its `PROJECT_TYPE_TO_TOOL` entry in
6
- * packages/solution-tool/src/services/packager-tool-resolver.ts and a row in
6
+ * packages/solution-tool/src/services/project-type-tools.ts (and in
7
+ * executor-tool-resolver.ts beside it when the type runs) and a row in
7
8
  * packages/solution-tool/templates/AGENTS.md — that template ships into every
8
9
  * scaffolded solution, so a type missing from it is invisible to the agents
9
10
  * working there.
@@ -1,4 +1,59 @@
1
1
  import type { IFileSystem } from "@uipath/filesystem";
2
+ export interface OperateEntryPoint {
3
+ filePath?: string;
4
+ isDefault?: unknown;
5
+ }
6
+ /**
7
+ * Whether a stored default flag is set. JSON written by hand or read back from
8
+ * XML can carry the string `"true"`, so both forms count.
9
+ */
10
+ export declare function isDefaultFlag(value: unknown): boolean;
11
+ /**
12
+ * The entry operate.json's `main` names: inside the `mainFile`, its default
13
+ * entry point, else its first; without a matching `mainFile`, the first
14
+ * default entry point, else the first entry point. Same rule as Maestro's
15
+ * publish path.
16
+ */
17
+ export declare function resolveOperateMainEntry<T extends OperateEntryPoint>(entryPoints: readonly T[], mainFile?: string): T | undefined;
18
+ /**
19
+ * The entry a package's operate.json `main` names once
20
+ * {@link applyDefaultEntryPoint} has run: with an entry flagged default, the one
21
+ * {@link resolveOperateMainEntry} picks; otherwise the entry the project's
22
+ * existing `main` names, since a pack keeps a hand-set `main`, else that pick.
23
+ */
24
+ export declare function resolvePackagedMainEntry<T extends OperateEntryPoint>(entryPoints: readonly T[], operateMain: unknown, mainFile?: string): T | undefined;
25
+ /** The `filePath` of {@link resolvePackagedMainEntry}, else "". */
26
+ export declare function resolvePackagedMain(entryPoints: readonly OperateEntryPoint[], operateMain: unknown, mainFile?: string): string;
27
+ /** operate.json `main`: the `filePath` of {@link resolveOperateMainEntry}, else "". */
28
+ export declare function resolveOperateMain(entryPoints: readonly OperateEntryPoint[], mainFile?: string): string;
29
+ /**
30
+ * `entryPoints` with the entry `main` names moved to the front, the rest in
31
+ * their order. Unchanged (the same array) when no entry is flagged default,
32
+ * so unflagged projects keep the order they were written in.
33
+ */
34
+ export declare function orderDefaultEntryPointFirst<T extends OperateEntryPoint>(entryPoints: readonly T[], mainFile?: string): readonly T[];
35
+ /** `MainFile` from the project.uiproj in `projectDir`, or `undefined` when it names none. */
36
+ export declare function readProjectMainFile(fs: IFileSystem, projectDir: string): Promise<string | undefined>;
37
+ /** `main` from the operate.json in `folder`, or `undefined` when it cannot be read. */
38
+ export declare function readOperateMain(fs: IFileSystem, folder: string): Promise<unknown>;
39
+ export interface DefaultEntryPointParams {
40
+ /** The folder holding entry-points.json and operate.json. */
41
+ contentFolder: string;
42
+ /** See {@link ContentOperateFileParams.mainFile}. */
43
+ mainFile?: string;
44
+ /** Sets the entries' default flags from another source, such as a case plan, before `main` is resolved. */
45
+ withDefaults?: <T extends OperateEntryPoint>(entryPoints: T[]) => T[];
46
+ }
47
+ /**
48
+ * When an entry point is flagged default, list the entry `main` names first
49
+ * in entry-points.json, flagged default with every other flag removed, and set
50
+ * an existing operate.json's `main` to it,
51
+ * leaving every other operate.json field alone. Entry-0 readers (debug,
52
+ * discovery) then agree with `main`. Nothing flagged leaves both files as
53
+ * they are, so a hand-set `main` survives. A missing operate.json is left for
54
+ * {@link writeContentOperateFile}, which scaffolds the same `main`.
55
+ */
56
+ export declare function applyDefaultEntryPoint(fs: IFileSystem, params: DefaultEntryPointParams): Promise<void>;
2
57
  export interface ContentOperateFileParams {
3
58
  /** The build's content/ folder (also where entry-points.json lives). */
4
59
  contentFolder: string;
@@ -7,17 +62,17 @@ export interface ContentOperateFileParams {
7
62
  /** operate.json `contentType` for this tool (e.g. ProjectTypes.Api). */
8
63
  contentType: string;
9
64
  /**
10
- * The file the user chose as main (`project.uiproj`'s `MainFile`). The
11
- * entry point declaring it becomes `main`; absent or unmatched, the first
12
- * entry point does.
65
+ * The file the user chose as main (`project.uiproj`'s `MainFile`). Its
66
+ * default entry point becomes main, else its first; see
67
+ * {@link resolveOperateMain}.
13
68
  */
14
69
  mainFile?: string;
15
70
  }
16
71
  /**
17
72
  * Ensure content/operate.json carries `projectId`. An existing file is
18
73
  * backfilled in place; a missing one is scaffolded with the standard operate
19
- * model for `contentType`, deriving `main` from entry-points.json — the entry
20
- * point matching `mainFile`, else the first one. Shared by the packager tools
74
+ * model for `contentType`, deriving `main` from entry-points.json through
75
+ * {@link resolveOperateMain}. Shared by the packager tools
21
76
  * that emit this same operate shape.
22
77
  */
23
78
  export declare function writeContentOperateFile(fs: IFileSystem, params: ContentOperateFileParams): Promise<void>;
@@ -1,9 +1,11 @@
1
- export type { BuildContentOperateFileParams, ContentOperateFileParams, } from "./content-operate-file.js";
2
- export { ensureContentOperateFile, writeContentOperateFile, } from "./content-operate-file.js";
1
+ export type { BuildContentOperateFileParams, ContentOperateFileParams, DefaultEntryPointParams, OperateEntryPoint, } from "./content-operate-file.js";
2
+ export { applyDefaultEntryPoint, ensureContentOperateFile, isDefaultFlag, orderDefaultEntryPointFirst, readOperateMain, readProjectMainFile, resolveOperateMain, resolveOperateMainEntry, resolvePackagedMain, resolvePackagedMainEntry, writeContentOperateFile, } from "./content-operate-file.js";
3
+ export { type JsonObject, parseJsonObject, readJsonObjectFile, } from "./json-object.js";
3
4
  export type { INugetPackager, NugetPackagerResult } from "./nuget-packager.js";
4
5
  export { NugetPackager } from "./nuget-packager.js";
5
6
  export { ensureProjectId, ensureProjectIdInOperateFile, writeOrBackfillOperateProjectId, } from "./project-id.js";
6
- export type { ProjectOperationContext } from "./project-operation-context.js";
7
+ export * from "./project-identity.js";
8
+ export type { ProjectActivityObserver, ProjectOperationContext, } from "./project-operation-context.js";
7
9
  export type { ProjectBindingResource, ProjectContributionError, ProjectResourceContribution, ProjectSpecPatch, } from "./project-resource-contribution.js";
8
10
  export { ProjectTool } from "./project-tool.js";
9
11
  export type { IProjectToolFactory } from "./project-tool-factory.js";
@@ -0,0 +1,13 @@
1
+ import type { IFileSystem } from "@uipath/filesystem";
2
+ export type JsonObject = Record<string, unknown>;
3
+ /** `text` as a JSON object, or `undefined` when it is empty, not JSON, or not an object. */
4
+ export declare function parseJsonObject(text: string | null | undefined): JsonObject | undefined;
5
+ /**
6
+ * A JSON object file's text and value, or `undefined` when it is missing,
7
+ * unreadable, or not a JSON object. The text lets a rewrite keep the file's
8
+ * layout.
9
+ */
10
+ export declare function readJsonObjectFile(fs: IFileSystem, filePath: string): Promise<{
11
+ text: string;
12
+ value: JsonObject;
13
+ } | undefined>;
@@ -0,0 +1,14 @@
1
+ import type { IFileSystem } from "@uipath/filesystem";
2
+ /** Read-only identity supplied by the project format's owner. */
3
+ export interface ProjectIdentityDescription {
4
+ id?: string;
5
+ /** Actual source directory for optional host-owned context lookup. */
6
+ projectDirectory?: string;
7
+ projectType: string;
8
+ status: "resolved" | "missing" | "invalid" | "unsupported";
9
+ }
10
+ export type ProjectIdentityReader = (target: string, fs: IFileSystem) => Promise<ProjectIdentityDescription>;
11
+ /** Bounded reads; malformed files are not silently treated as absent. */
12
+ export declare function readIdentityJson(fs: IFileSystem, path: string): Promise<Record<string, unknown> | undefined>;
13
+ /** Read a source field chosen by its owner, without changing the source. */
14
+ export declare function readIdentityField(fs: IFileSystem, file: string, fields: readonly string[]): Promise<string | undefined>;
@@ -6,7 +6,10 @@ import type { IToolLogger } from "./tool-logger.js";
6
6
  /**
7
7
  * Context for a project operation, providing information about all projects involved
8
8
  */
9
+ export type ProjectActivityObserver = (project: UiPathProject, phase: "before" | "after", success?: boolean, solutionId?: string) => Promise<void>;
9
10
  export interface ProjectOperationContext {
11
+ /** Optional host-owned observation. Never required by a project tool. */
12
+ projectActivity?: ProjectActivityObserver;
10
13
  /**
11
14
  * Unique identifier for the operation
12
15
  */
@@ -22,6 +22,19 @@ export interface ProjectContributionError {
22
22
  export interface ProjectSpecPatch {
23
23
  /** Artefact resource kind this patch targets, e.g. "app", "process". */
24
24
  kind: string;
25
+ /**
26
+ * Target a resource of `kind` by name instead of by the project's
27
+ * `projectKey`. For resources the project's bindings mint rather than the
28
+ * project artefact itself — a case role, which has no `projectKey`.
29
+ */
30
+ name?: string;
31
+ /**
32
+ * The resource type to stamp on the target when its kind's SDK row
33
+ * declares none. The contributor owns the subtype the way it owns
34
+ * `projectSubType`: it lives in the project type's own world, so the host
35
+ * and the SDK carry it without reading it.
36
+ */
37
+ type?: string;
25
38
  /**
26
39
  * Spec keys to set on that resource. A `null` value **deletes** the key —
27
40
  * that is how a contributor removes a key it wrote on an earlier run and
@@ -1,5 +1,6 @@
1
1
  import type { IFileSystem } from "../filesystem/file-system.js";
2
2
  import type { ProjectType } from "../models/project-type.js";
3
+ import type { ProjectIdentityReader } from "./project-identity.js";
3
4
  import type { ProjectOperationContext } from "./project-operation-context.js";
4
5
  import type { ProjectResourceContribution } from "./project-resource-contribution.js";
5
6
  import type { ProjectTool } from "./project-tool.js";
@@ -8,9 +9,9 @@ import type { IToolLogger } from "./tool-logger.js";
8
9
  * Factory interface for creating ProjectTool instances
9
10
  */
10
11
  export interface IProjectToolFactory {
11
- /**
12
- * The project types this factory can handle
13
- */
12
+ /** Optional source identity capability; legacy factories remain unchanged. */
13
+ readProjectIdentityAsync?: ProjectIdentityReader;
14
+ /** The project types this factory can handle. */
14
15
  readonly supportedTypes: readonly ProjectType[];
15
16
  /**
16
17
  * Create a project tool instance with the provided logger
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/solutionpackager-tool-core",
3
- "version": "1.205.0-preview.281",
3
+ "version": "1.206.0-preview.282",
4
4
  "description": "UiPath contracts for solution packager tools",
5
5
  "type": "module",
6
6
  "exports": {
@@ -24,8 +24,8 @@
24
24
  "registry": "https://registry.npmjs.org/"
25
25
  },
26
26
  "dependencies": {
27
- "@uipath/filesystem": "1.205.0",
27
+ "@uipath/filesystem": "1.206.0",
28
28
  "fflate": "^0.8.2"
29
29
  },
30
- "gitHead": "03b01866007f70eea9464da2dceb191a6fc3fb77"
30
+ "gitHead": "9f18b69f2307838e3ce650b91de76cf6c9a23c13"
31
31
  }