@uipath/solution-sdk 1.198.0-preview.88 → 1.199.0-preview.91
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 +78 -8
- package/dist/src/index.d.ts +2 -2
- package/dist/src/solution-file.d.ts +96 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2535,7 +2535,7 @@ class TextApiResponse {
|
|
|
2535
2535
|
var package_default = {
|
|
2536
2536
|
name: "@uipath/solution-sdk",
|
|
2537
2537
|
license: "MIT",
|
|
2538
|
-
version: "1.
|
|
2538
|
+
version: "1.199.0-preview.91",
|
|
2539
2539
|
repository: {
|
|
2540
2540
|
type: "git",
|
|
2541
2541
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -11974,6 +11974,7 @@ var SKILL_ATTRIBUTION = attributionRecord([
|
|
|
11974
11974
|
var KNOWN_SKILL_NAMES = new Set(Object.keys(SKILL_ATTRIBUTION));
|
|
11975
11975
|
var COMMAND_ATTRIBUTION = commandAttribution([
|
|
11976
11976
|
["cli", "troubleshoot", ["uip.feedback"]],
|
|
11977
|
+
["llm-gateway", "operate", ["uip.llm-gateway"]],
|
|
11977
11978
|
["llm-gateway", "operate", ["uip.llm-configuration", "uip.model-hub"]],
|
|
11978
11979
|
["context-grounding", "build", ["uip.context-grounding"]],
|
|
11979
11980
|
["api-workflow", "build", ["uip.api-workflow"]],
|
|
@@ -12419,7 +12420,7 @@ function validateUipxFile(parsed, uipxFileName) {
|
|
|
12419
12420
|
}
|
|
12420
12421
|
if (typeof project.ProjectRelativePath !== "string" || !project.ProjectRelativePath.trim()) {
|
|
12421
12422
|
const pathHint = typeof project.Path === "string" ? " Found Path, but .uipx uses ProjectRelativePath." : "";
|
|
12422
|
-
throw new Error(`Invalid .uipx file: Projects[${index}] is missing ProjectRelativePath.${pathHint} Use 'uip solution
|
|
12423
|
+
throw new Error(`Invalid .uipx file: Projects[${index}] is missing ProjectRelativePath.${pathHint} Use 'uip solution projects add' to add projects, or set ProjectRelativePath to the project file path, for example "Foo/project.uiproj".`);
|
|
12423
12424
|
}
|
|
12424
12425
|
}
|
|
12425
12426
|
return parsed;
|
|
@@ -12427,6 +12428,72 @@ function validateUipxFile(parsed, uipxFileName) {
|
|
|
12427
12428
|
function isRecord2(value) {
|
|
12428
12429
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
12429
12430
|
}
|
|
12431
|
+
async function createSolutionManifest(fs7, solutionDir, solutionName, options = {}) {
|
|
12432
|
+
const resolvedDir = fs7.path.resolve(solutionDir);
|
|
12433
|
+
if (!(options.allowExistingDir && await fs7.exists(resolvedDir))) {
|
|
12434
|
+
await fs7.mkdir(resolvedDir);
|
|
12435
|
+
}
|
|
12436
|
+
const solutionId = crypto.randomUUID();
|
|
12437
|
+
const manifest = {
|
|
12438
|
+
DocVersion: "1.0.0",
|
|
12439
|
+
StudioMinVersion: "2025.10.0",
|
|
12440
|
+
SolutionId: solutionId,
|
|
12441
|
+
Projects: []
|
|
12442
|
+
};
|
|
12443
|
+
const solutionFile = fs7.path.join(resolvedDir, `${solutionName}.uipx`);
|
|
12444
|
+
await fs7.writeFile(solutionFile, `${JSON.stringify(manifest, null, 2)}
|
|
12445
|
+
`);
|
|
12446
|
+
return {
|
|
12447
|
+
solutionDir: resolvedDir,
|
|
12448
|
+
solutionFile,
|
|
12449
|
+
solutionId
|
|
12450
|
+
};
|
|
12451
|
+
}
|
|
12452
|
+
var AUTO_SOLUTION_SUFFIX = "Solution";
|
|
12453
|
+
async function autoScaffoldSolution(fs7, baseDir, projectName) {
|
|
12454
|
+
const solutionName = `${projectName}${AUTO_SOLUTION_SUFFIX}`;
|
|
12455
|
+
const solutionDir = fs7.path.resolve(baseDir, solutionName);
|
|
12456
|
+
const expectedSolutionFile = fs7.path.join(solutionDir, `${solutionName}.uipx`);
|
|
12457
|
+
if (await fs7.exists(expectedSolutionFile)) {
|
|
12458
|
+
return {
|
|
12459
|
+
Name: solutionName,
|
|
12460
|
+
Path: solutionDir,
|
|
12461
|
+
SolutionFile: expectedSolutionFile
|
|
12462
|
+
};
|
|
12463
|
+
}
|
|
12464
|
+
const { solutionFile } = await createSolutionManifest(fs7, solutionDir, solutionName, { allowExistingDir: true });
|
|
12465
|
+
return {
|
|
12466
|
+
Name: solutionName,
|
|
12467
|
+
Path: solutionDir,
|
|
12468
|
+
SolutionFile: solutionFile
|
|
12469
|
+
};
|
|
12470
|
+
}
|
|
12471
|
+
async function prepareProjectLocation(fs7, candidateProjectDir, projectName, options = {}) {
|
|
12472
|
+
const resolved = fs7.path.resolve(candidateProjectDir);
|
|
12473
|
+
if (options.skipRegistration) {
|
|
12474
|
+
return { projectDir: resolved };
|
|
12475
|
+
}
|
|
12476
|
+
const discovery = await findNearestParentUipxFile(fs7, resolved);
|
|
12477
|
+
if (discovery.status !== "notFound") {
|
|
12478
|
+
return { projectDir: resolved };
|
|
12479
|
+
}
|
|
12480
|
+
const baseDir = fs7.path.dirname(resolved);
|
|
12481
|
+
const autoCreatedSolution = await autoScaffoldSolution(fs7, baseDir, projectName);
|
|
12482
|
+
const projectDir = fs7.path.join(autoCreatedSolution.Path, projectName);
|
|
12483
|
+
await warnIfCandidateDirShadowed(fs7, resolved, projectDir);
|
|
12484
|
+
return { projectDir, autoCreatedSolution };
|
|
12485
|
+
}
|
|
12486
|
+
async function warnIfCandidateDirShadowed(fs7, candidateDir, projectDir) {
|
|
12487
|
+
const [, exists2] = await catchError(fs7.exists(candidateDir));
|
|
12488
|
+
if (!exists2) {
|
|
12489
|
+
return;
|
|
12490
|
+
}
|
|
12491
|
+
const [, entries] = await catchError(fs7.readdir(candidateDir));
|
|
12492
|
+
if (!entries || entries.length === 0) {
|
|
12493
|
+
return;
|
|
12494
|
+
}
|
|
12495
|
+
logger.warn(`An existing directory "${candidateDir}" was left untouched. ` + `The project was created inside the auto-created solution at "${projectDir}". ` + "Run init from inside an existing solution, or pass --skip-solution-registration, if you meant to use the existing directory.");
|
|
12496
|
+
}
|
|
12430
12497
|
function resolveSolutionDir(fs7, inputPath) {
|
|
12431
12498
|
const resolved = fs7.path.resolve(inputPath);
|
|
12432
12499
|
if (resolved.endsWith(".uipx")) {
|
|
@@ -12632,7 +12699,7 @@ ${readDirError.message}`)
|
|
|
12632
12699
|
registration: {
|
|
12633
12700
|
Status: "Skipped",
|
|
12634
12701
|
Message: "Project registration skipped.",
|
|
12635
|
-
Instructions: `Found multiple .uipx files in ${currentDir}: ${solutionFiles.join(", ")}. Run 'uip solution
|
|
12702
|
+
Instructions: `Found multiple .uipx files in ${currentDir}: ${solutionFiles.join(", ")}. Run 'uip solution projects add "${projectDir}" <solution.uipx>' to choose one.`
|
|
12636
12703
|
}
|
|
12637
12704
|
};
|
|
12638
12705
|
}
|
|
@@ -12743,7 +12810,7 @@ async function readSolutionManifest(fs7, solutionFile) {
|
|
|
12743
12810
|
const projectRelativePath = readString(project.ProjectRelativePath);
|
|
12744
12811
|
if (!projectRelativePath) {
|
|
12745
12812
|
return [
|
|
12746
|
-
new Error(`Invalid solution file: Projects[${index}] is missing ProjectRelativePath. Use 'uip solution
|
|
12813
|
+
new Error(`Invalid solution file: Projects[${index}] is missing ProjectRelativePath. Use 'uip solution projects add' to repair the manifest.`),
|
|
12747
12814
|
null
|
|
12748
12815
|
];
|
|
12749
12816
|
}
|
|
@@ -12770,7 +12837,7 @@ function buildRegistrationSuccessInstructions(solutionDir) {
|
|
|
12770
12837
|
function buildRegistrationFailureInstructions(projectDir, details) {
|
|
12771
12838
|
return [
|
|
12772
12839
|
"Automatic solution registration could not complete.",
|
|
12773
|
-
`Run 'uip solution
|
|
12840
|
+
`Run 'uip solution projects add "${projectDir}" <solution.uipx>' after checking the project and solution files.`,
|
|
12774
12841
|
`Details: ${details}`
|
|
12775
12842
|
].join(`
|
|
12776
12843
|
`);
|
|
@@ -12779,14 +12846,14 @@ function buildStandaloneInstructions(projectDir) {
|
|
|
12779
12846
|
return [
|
|
12780
12847
|
"No parent solution was found by walking ancestor directories.",
|
|
12781
12848
|
"Studio Web upload, `flow debug`, and packaging require an enclosing solution.",
|
|
12782
|
-
`To link this project to a solution, run 'uip solution init "<SolutionName>"' then 'uip solution
|
|
12849
|
+
`To link this project to a solution, run 'uip solution init "<SolutionName>"' then 'uip solution projects add "${projectDir}" <SolutionName>.uipx'.`
|
|
12783
12850
|
].join(`
|
|
12784
12851
|
`);
|
|
12785
12852
|
}
|
|
12786
12853
|
function buildOptedOutInstructions(projectDir) {
|
|
12787
12854
|
return [
|
|
12788
12855
|
"Automatic solution registration was skipped because --skip-solution-registration was passed.",
|
|
12789
|
-
`To register this project later, run 'uip solution
|
|
12856
|
+
`To register this project later, run 'uip solution projects add "${projectDir}" <SolutionName>.uipx' from within the solution.`
|
|
12790
12857
|
].join(`
|
|
12791
12858
|
`);
|
|
12792
12859
|
}
|
|
@@ -15036,6 +15103,7 @@ export {
|
|
|
15036
15103
|
readUipxFile,
|
|
15037
15104
|
readSolutionManifest,
|
|
15038
15105
|
querystring,
|
|
15106
|
+
prepareProjectLocation,
|
|
15039
15107
|
overwriteSolution,
|
|
15040
15108
|
normalizeProjectType,
|
|
15041
15109
|
mapValues,
|
|
@@ -15083,10 +15151,12 @@ export {
|
|
|
15083
15151
|
findNearestParentUipxFile,
|
|
15084
15152
|
exists,
|
|
15085
15153
|
createZipFromDir,
|
|
15154
|
+
createSolutionManifest,
|
|
15086
15155
|
collectFiles,
|
|
15087
15156
|
canConsumeForm,
|
|
15088
15157
|
bundleSolution,
|
|
15089
15158
|
buildSolutionPackageFromDir,
|
|
15159
|
+
autoScaffoldSolution,
|
|
15090
15160
|
WorkflowActionToJSONTyped,
|
|
15091
15161
|
WorkflowActionToJSON,
|
|
15092
15162
|
WorkflowActionFromJSONTyped,
|
|
@@ -15268,4 +15338,4 @@ export {
|
|
|
15268
15338
|
BASE_PATH
|
|
15269
15339
|
};
|
|
15270
15340
|
|
|
15271
|
-
//# debugId=
|
|
15341
|
+
//# debugId=03426AA1197DB6A764756E2164756E21
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./user-agent.js";
|
|
2
2
|
export * from "../generated/src/index.js";
|
|
3
3
|
export { buildSolutionPackageFromDir, bundleSolution, resolveSolutionDir, } from "./bundle-service";
|
|
4
|
-
export type { ParentSolutionDiscovery, ProjectSolutionRegistration, RegisterProjectOptions, } from "./solution-file";
|
|
5
|
-
export { findNearestParentUipxFile, findSolutionFile, isProjectRegisteredInSolution, normalizeProjectType, readSolutionManifest, readUipxFile, toPortableRelativePath, tryRegisterProjectInParentSolution, updateSolutionFile, updateUipxSolutionId, } from "./solution-file";
|
|
4
|
+
export type { AutoCreatedSolution, ParentSolutionDiscovery, PrepareProjectLocationOptions, PrepareProjectLocationResult, ProjectSolutionRegistration, RegisterProjectOptions, SolutionManifestCreation, } from "./solution-file";
|
|
5
|
+
export { autoScaffoldSolution, createSolutionManifest, findNearestParentUipxFile, findSolutionFile, isProjectRegisteredInSolution, normalizeProjectType, prepareProjectLocation, readSolutionManifest, readUipxFile, toPortableRelativePath, tryRegisterProjectInParentSolution, updateSolutionFile, updateUipxSolutionId, } from "./solution-file";
|
|
6
6
|
export { getStudioWebSolutionProjects } from "./solution-info";
|
|
7
7
|
export type { BundleResult, SolutionImportResponse, StudioWebConfig, StudioWebSolutionProject, UipxFile, UipxProject, } from "./types";
|
|
8
8
|
export { importSolution, overwriteSolution, solutionExistsOnStudioWeb, uploadOrOverwriteSolution, } from "./upload-service";
|
|
@@ -61,6 +61,101 @@ export declare function readUipxFile(fs: IFileSystem, solutionDir: string): Prom
|
|
|
61
61
|
uipx: UipxFile;
|
|
62
62
|
uipxFileName: string;
|
|
63
63
|
}>;
|
|
64
|
+
export interface SolutionManifestCreation {
|
|
65
|
+
solutionDir: string;
|
|
66
|
+
solutionFile: string;
|
|
67
|
+
solutionId: string;
|
|
68
|
+
}
|
|
69
|
+
export interface CreateSolutionManifestOptions {
|
|
70
|
+
/**
|
|
71
|
+
* When true, do not throw if `solutionDir` already exists; only the
|
|
72
|
+
* `.uipx` manifest write happens. Lets callers recover from a partial-
|
|
73
|
+
* failure prior run (dir created, manifest write failed) without manual
|
|
74
|
+
* cleanup. `uip solution init` keeps the default (throw on existing dir);
|
|
75
|
+
* `autoScaffoldSolution` sets this so the auto-scaffold path is genuinely
|
|
76
|
+
* idempotent.
|
|
77
|
+
*/
|
|
78
|
+
allowExistingDir?: boolean;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Create a new solution directory containing a `.uipx` manifest with an empty
|
|
82
|
+
* Projects array. Used by commands that scaffold a parent solution on the
|
|
83
|
+
* user's behalf (e.g. `uip maestro flow init` when invoked outside a
|
|
84
|
+
* solution). `uip solution init` writes its own manifest in
|
|
85
|
+
* `solution-init-service.ts` because it preserves a caller-supplied file
|
|
86
|
+
* extension — keep the two skeletons in sync.
|
|
87
|
+
*
|
|
88
|
+
* Fails if `solutionDir` already exists unless `allowExistingDir` is set.
|
|
89
|
+
* AGENTS.md / CLAUDE.md briefing files are NOT written here — that template
|
|
90
|
+
* is owned by `@uipath/solution-tool`. Callers that want them should write
|
|
91
|
+
* them after this returns.
|
|
92
|
+
*/
|
|
93
|
+
export declare function createSolutionManifest(fs: IFileSystem, solutionDir: string, solutionName: string, options?: CreateSolutionManifestOptions): Promise<SolutionManifestCreation>;
|
|
94
|
+
/**
|
|
95
|
+
* Reported under `Data.AutoCreatedSolution` in the *-init command output
|
|
96
|
+
* whenever the CLI scaffolded the parent solution itself. Absent when the
|
|
97
|
+
* command was run inside an existing solution.
|
|
98
|
+
*/
|
|
99
|
+
export interface AutoCreatedSolution {
|
|
100
|
+
Name: string;
|
|
101
|
+
Path: string;
|
|
102
|
+
SolutionFile: string;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Scaffold a `<projectName>Solution/` sibling directory containing an empty
|
|
106
|
+
* `.uipx` manifest. Idempotent across both happy and partial-failure paths:
|
|
107
|
+
*
|
|
108
|
+
* - Existing `.uipx` → reuse it (re-run with `--force`).
|
|
109
|
+
* - Dir exists, no `.uipx` yet → write the manifest into the existing dir
|
|
110
|
+
* (recovers a previous run that crashed
|
|
111
|
+
* between mkdir and writeFile).
|
|
112
|
+
* - Neither exists → mkdir + write manifest.
|
|
113
|
+
*
|
|
114
|
+
* Lower-level helper. Most callers want {@link prepareProjectLocation}, which
|
|
115
|
+
* runs discovery first and only scaffolds when nothing is found.
|
|
116
|
+
*/
|
|
117
|
+
export declare function autoScaffoldSolution(fs: IFileSystem, baseDir: string, projectName: string): Promise<AutoCreatedSolution>;
|
|
118
|
+
export interface PrepareProjectLocationOptions {
|
|
119
|
+
/**
|
|
120
|
+
* Set when the caller passed `--skip-solution-registration`. Short-circuits
|
|
121
|
+
* the helper: no discovery, no scaffold, the candidate path is returned
|
|
122
|
+
* unchanged. Lets the user opt out of both registration AND the parent
|
|
123
|
+
* solution scaffold with a single flag.
|
|
124
|
+
*/
|
|
125
|
+
skipRegistration?: boolean;
|
|
126
|
+
}
|
|
127
|
+
export interface PrepareProjectLocationResult {
|
|
128
|
+
/**
|
|
129
|
+
* Absolute path the project should be created at. When the helper
|
|
130
|
+
* scaffolded a parent solution, this is `<auto-solution>/<projectName>`;
|
|
131
|
+
* otherwise it equals the resolved `candidateProjectDir`.
|
|
132
|
+
*/
|
|
133
|
+
projectDir: string;
|
|
134
|
+
/**
|
|
135
|
+
* Present when this call scaffolded a fresh parent solution. The
|
|
136
|
+
* `*-init` command surfaces it under `Data.AutoCreatedSolution` so callers
|
|
137
|
+
* can tell the auto-scaffold path apart from the in-existing-solution path.
|
|
138
|
+
*/
|
|
139
|
+
autoCreatedSolution?: AutoCreatedSolution;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Resolve where an `*-init` command should write the new project, scaffolding
|
|
143
|
+
* a parent `.uipx` solution on the user's behalf when needed.
|
|
144
|
+
*
|
|
145
|
+
* Behavior:
|
|
146
|
+
* - `skipRegistration` set → return `candidateProjectDir` as-is.
|
|
147
|
+
* - Inside an existing solution → return `candidateProjectDir` as-is.
|
|
148
|
+
* - Ambiguous discovery (skipped) → return `candidateProjectDir` as-is; the
|
|
149
|
+
* downstream `tryRegisterProjectInParentSolution`
|
|
150
|
+
* call surfaces the ambiguity in
|
|
151
|
+
* `SolutionRegistration.Status`.
|
|
152
|
+
* - No parent solution found → scaffold `<baseDir>/<projectName>Solution/`
|
|
153
|
+
* and return its nested project path.
|
|
154
|
+
*
|
|
155
|
+
* The four `*-init` tools (agent / case / flow / maestro bpmn) share this
|
|
156
|
+
* helper so the auto-scaffold behavior stays uniform.
|
|
157
|
+
*/
|
|
158
|
+
export declare function prepareProjectLocation(fs: IFileSystem, candidateProjectDir: string, projectName: string, options?: PrepareProjectLocationOptions): Promise<PrepareProjectLocationResult>;
|
|
64
159
|
/**
|
|
65
160
|
* Resolve input to a solution directory path.
|
|
66
161
|
* Accepts a directory path or a .uipx file path.
|
|
@@ -121,7 +216,7 @@ export declare function readSolutionManifest(fs: IFileSystem, solutionFile: stri
|
|
|
121
216
|
* `Projects` array, malformed entry). The boolean return is reserved for
|
|
122
217
|
* the answerable question "is this project listed?" — a corrupt manifest
|
|
123
218
|
* is a separate failure mode that callers must not silently translate
|
|
124
|
-
* into "not registered", since the repair (`uip solution
|
|
219
|
+
* into "not registered", since the repair (`uip solution projects add`)
|
|
125
220
|
* won't fix a manifest that fails to parse.
|
|
126
221
|
*
|
|
127
222
|
* Used by `flow debug` to catch the empty-solution-archive case BEFORE
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/solution-sdk",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.199.0-preview.91",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/UiPath/cli.git",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"dist"
|
|
32
32
|
],
|
|
33
33
|
"private": false,
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "f428cb1e61ba89ad18394b0c6106784055699f02"
|
|
35
35
|
}
|