@uipath/solution-sdk 1.198.0 → 1.199.0-preview.104
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.104",
|
|
2539
2539
|
repository: {
|
|
2540
2540
|
type: "git",
|
|
2541
2541
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -12202,6 +12202,7 @@ var SKILL_ATTRIBUTION = attributionRecord([
|
|
|
12202
12202
|
var KNOWN_SKILL_NAMES = new Set(Object.keys(SKILL_ATTRIBUTION));
|
|
12203
12203
|
var COMMAND_ATTRIBUTION = commandAttribution([
|
|
12204
12204
|
["cli", "troubleshoot", ["uip.feedback"]],
|
|
12205
|
+
["llm-gateway", "operate", ["uip.llm-gateway"]],
|
|
12205
12206
|
["llm-gateway", "operate", ["uip.llm-configuration", "uip.model-hub"]],
|
|
12206
12207
|
["context-grounding", "build", ["uip.context-grounding"]],
|
|
12207
12208
|
["api-workflow", "build", ["uip.api-workflow"]],
|
|
@@ -12526,7 +12527,7 @@ function validateUipxFile(parsed, uipxFileName) {
|
|
|
12526
12527
|
}
|
|
12527
12528
|
if (typeof project.ProjectRelativePath !== "string" || !project.ProjectRelativePath.trim()) {
|
|
12528
12529
|
const pathHint = typeof project.Path === "string" ? " Found Path, but .uipx uses ProjectRelativePath." : "";
|
|
12529
|
-
throw new Error(`Invalid .uipx file: Projects[${index}] is missing ProjectRelativePath.${pathHint} Use 'uip solution
|
|
12530
|
+
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".`);
|
|
12530
12531
|
}
|
|
12531
12532
|
}
|
|
12532
12533
|
return parsed;
|
|
@@ -12534,6 +12535,72 @@ function validateUipxFile(parsed, uipxFileName) {
|
|
|
12534
12535
|
function isRecord2(value) {
|
|
12535
12536
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
12536
12537
|
}
|
|
12538
|
+
async function createSolutionManifest(fs7, solutionDir, solutionName, options = {}) {
|
|
12539
|
+
const resolvedDir = fs7.path.resolve(solutionDir);
|
|
12540
|
+
if (!(options.allowExistingDir && await fs7.exists(resolvedDir))) {
|
|
12541
|
+
await fs7.mkdir(resolvedDir);
|
|
12542
|
+
}
|
|
12543
|
+
const solutionId = crypto.randomUUID();
|
|
12544
|
+
const manifest = {
|
|
12545
|
+
DocVersion: "1.0.0",
|
|
12546
|
+
StudioMinVersion: "2025.10.0",
|
|
12547
|
+
SolutionId: solutionId,
|
|
12548
|
+
Projects: []
|
|
12549
|
+
};
|
|
12550
|
+
const solutionFile = fs7.path.join(resolvedDir, `${solutionName}.uipx`);
|
|
12551
|
+
await fs7.writeFile(solutionFile, `${JSON.stringify(manifest, null, 2)}
|
|
12552
|
+
`);
|
|
12553
|
+
return {
|
|
12554
|
+
solutionDir: resolvedDir,
|
|
12555
|
+
solutionFile,
|
|
12556
|
+
solutionId
|
|
12557
|
+
};
|
|
12558
|
+
}
|
|
12559
|
+
var AUTO_SOLUTION_SUFFIX = "Solution";
|
|
12560
|
+
async function autoScaffoldSolution(fs7, baseDir, projectName) {
|
|
12561
|
+
const solutionName = `${projectName}${AUTO_SOLUTION_SUFFIX}`;
|
|
12562
|
+
const solutionDir = fs7.path.resolve(baseDir, solutionName);
|
|
12563
|
+
const expectedSolutionFile = fs7.path.join(solutionDir, `${solutionName}.uipx`);
|
|
12564
|
+
if (await fs7.exists(expectedSolutionFile)) {
|
|
12565
|
+
return {
|
|
12566
|
+
Name: solutionName,
|
|
12567
|
+
Path: solutionDir,
|
|
12568
|
+
SolutionFile: expectedSolutionFile
|
|
12569
|
+
};
|
|
12570
|
+
}
|
|
12571
|
+
const { solutionFile } = await createSolutionManifest(fs7, solutionDir, solutionName, { allowExistingDir: true });
|
|
12572
|
+
return {
|
|
12573
|
+
Name: solutionName,
|
|
12574
|
+
Path: solutionDir,
|
|
12575
|
+
SolutionFile: solutionFile
|
|
12576
|
+
};
|
|
12577
|
+
}
|
|
12578
|
+
async function prepareProjectLocation(fs7, candidateProjectDir, projectName, options = {}) {
|
|
12579
|
+
const resolved = fs7.path.resolve(candidateProjectDir);
|
|
12580
|
+
if (options.skipRegistration) {
|
|
12581
|
+
return { projectDir: resolved };
|
|
12582
|
+
}
|
|
12583
|
+
const discovery = await findNearestParentUipxFile(fs7, resolved);
|
|
12584
|
+
if (discovery.status !== "notFound") {
|
|
12585
|
+
return { projectDir: resolved };
|
|
12586
|
+
}
|
|
12587
|
+
const baseDir = fs7.path.dirname(resolved);
|
|
12588
|
+
const autoCreatedSolution = await autoScaffoldSolution(fs7, baseDir, projectName);
|
|
12589
|
+
const projectDir = fs7.path.join(autoCreatedSolution.Path, projectName);
|
|
12590
|
+
await warnIfCandidateDirShadowed(fs7, resolved, projectDir);
|
|
12591
|
+
return { projectDir, autoCreatedSolution };
|
|
12592
|
+
}
|
|
12593
|
+
async function warnIfCandidateDirShadowed(fs7, candidateDir, projectDir) {
|
|
12594
|
+
const [, exists2] = await catchError(fs7.exists(candidateDir));
|
|
12595
|
+
if (!exists2) {
|
|
12596
|
+
return;
|
|
12597
|
+
}
|
|
12598
|
+
const [, entries] = await catchError(fs7.readdir(candidateDir));
|
|
12599
|
+
if (!entries || entries.length === 0) {
|
|
12600
|
+
return;
|
|
12601
|
+
}
|
|
12602
|
+
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.");
|
|
12603
|
+
}
|
|
12537
12604
|
function resolveSolutionDir(fs7, inputPath) {
|
|
12538
12605
|
const resolved = fs7.path.resolve(inputPath);
|
|
12539
12606
|
if (resolved.endsWith(".uipx")) {
|
|
@@ -12739,7 +12806,7 @@ ${readDirError.message}`)
|
|
|
12739
12806
|
registration: {
|
|
12740
12807
|
Status: "Skipped",
|
|
12741
12808
|
Message: "Project registration skipped.",
|
|
12742
|
-
Instructions: `Found multiple .uipx files in ${currentDir}: ${solutionFiles.join(", ")}. Run 'uip solution
|
|
12809
|
+
Instructions: `Found multiple .uipx files in ${currentDir}: ${solutionFiles.join(", ")}. Run 'uip solution projects add "${projectDir}" <solution.uipx>' to choose one.`
|
|
12743
12810
|
}
|
|
12744
12811
|
};
|
|
12745
12812
|
}
|
|
@@ -12850,7 +12917,7 @@ async function readSolutionManifest(fs7, solutionFile) {
|
|
|
12850
12917
|
const projectRelativePath = readString(project.ProjectRelativePath);
|
|
12851
12918
|
if (!projectRelativePath) {
|
|
12852
12919
|
return [
|
|
12853
|
-
new Error(`Invalid solution file: Projects[${index}] is missing ProjectRelativePath. Use 'uip solution
|
|
12920
|
+
new Error(`Invalid solution file: Projects[${index}] is missing ProjectRelativePath. Use 'uip solution projects add' to repair the manifest.`),
|
|
12854
12921
|
null
|
|
12855
12922
|
];
|
|
12856
12923
|
}
|
|
@@ -12877,7 +12944,7 @@ function buildRegistrationSuccessInstructions(solutionDir) {
|
|
|
12877
12944
|
function buildRegistrationFailureInstructions(projectDir, details) {
|
|
12878
12945
|
return [
|
|
12879
12946
|
"Automatic solution registration could not complete.",
|
|
12880
|
-
`Run 'uip solution
|
|
12947
|
+
`Run 'uip solution projects add "${projectDir}" <solution.uipx>' after checking the project and solution files.`,
|
|
12881
12948
|
`Details: ${details}`
|
|
12882
12949
|
].join(`
|
|
12883
12950
|
`);
|
|
@@ -12886,14 +12953,14 @@ function buildStandaloneInstructions(projectDir) {
|
|
|
12886
12953
|
return [
|
|
12887
12954
|
"No parent solution was found by walking ancestor directories.",
|
|
12888
12955
|
"Studio Web upload, `flow debug`, and packaging require an enclosing solution.",
|
|
12889
|
-
`To link this project to a solution, run 'uip solution init "<SolutionName>"' then 'uip solution
|
|
12956
|
+
`To link this project to a solution, run 'uip solution init "<SolutionName>"' then 'uip solution projects add "${projectDir}" <SolutionName>.uipx'.`
|
|
12890
12957
|
].join(`
|
|
12891
12958
|
`);
|
|
12892
12959
|
}
|
|
12893
12960
|
function buildOptedOutInstructions(projectDir) {
|
|
12894
12961
|
return [
|
|
12895
12962
|
"Automatic solution registration was skipped because --skip-solution-registration was passed.",
|
|
12896
|
-
`To register this project later, run 'uip solution
|
|
12963
|
+
`To register this project later, run 'uip solution projects add "${projectDir}" <SolutionName>.uipx' from within the solution.`
|
|
12897
12964
|
].join(`
|
|
12898
12965
|
`);
|
|
12899
12966
|
}
|
|
@@ -15143,6 +15210,7 @@ export {
|
|
|
15143
15210
|
readUipxFile,
|
|
15144
15211
|
readSolutionManifest,
|
|
15145
15212
|
querystring,
|
|
15213
|
+
prepareProjectLocation,
|
|
15146
15214
|
overwriteSolution,
|
|
15147
15215
|
normalizeProjectType,
|
|
15148
15216
|
mapValues,
|
|
@@ -15190,10 +15258,12 @@ export {
|
|
|
15190
15258
|
findNearestParentUipxFile,
|
|
15191
15259
|
exists,
|
|
15192
15260
|
createZipFromDir,
|
|
15261
|
+
createSolutionManifest,
|
|
15193
15262
|
collectFiles,
|
|
15194
15263
|
canConsumeForm,
|
|
15195
15264
|
bundleSolution,
|
|
15196
15265
|
buildSolutionPackageFromDir,
|
|
15266
|
+
autoScaffoldSolution,
|
|
15197
15267
|
WorkflowActionToJSONTyped,
|
|
15198
15268
|
WorkflowActionToJSON,
|
|
15199
15269
|
WorkflowActionFromJSONTyped,
|
|
@@ -15375,4 +15445,4 @@ export {
|
|
|
15375
15445
|
BASE_PATH
|
|
15376
15446
|
};
|
|
15377
15447
|
|
|
15378
|
-
//# debugId=
|
|
15448
|
+
//# debugId=08C1FEAB739492EB64756E2164756E21
|
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.104",
|
|
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": "829a8ab8a25bce5b62c284bd1ddc674d2947f647"
|
|
35
35
|
}
|