@uipath/uipath-extensions-sdk 0.1.22 → 0.1.23
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/README.md +45 -8
- package/dist/adopt.d.ts +6 -0
- package/dist/adopt.js +459 -77
- package/dist/adopt.js.map +1 -1
- package/dist/cli.js +4 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/build-check.d.ts +2 -2
- package/dist/commands/build-check.js +43 -18
- package/dist/commands/build-check.js.map +1 -1
- package/dist/commands/new.js +9 -15
- package/dist/commands/new.js.map +1 -1
- package/dist/commands/pack.d.ts +12 -0
- package/dist/commands/pack.js +96 -30
- package/dist/commands/pack.js.map +1 -1
- package/dist/commands/submit.d.ts +15 -1
- package/dist/commands/submit.js +147 -35
- package/dist/commands/submit.js.map +1 -1
- package/dist/commands/upload.d.ts +4 -0
- package/dist/commands/upload.js +98 -26
- package/dist/commands/upload.js.map +1 -1
- package/dist/commands/validate-python.d.ts +15 -0
- package/dist/commands/validate-python.js +334 -0
- package/dist/commands/validate-python.js.map +1 -0
- package/dist/commands/validate.js +2 -1
- package/dist/commands/validate.js.map +1 -1
- package/dist/connector.js +14 -2
- package/dist/connector.js.map +1 -1
- package/dist/lib.d.ts +2 -1
- package/dist/lib.js +223 -21
- package/dist/lib.js.map +1 -1
- package/dist/pyproject.d.ts +1 -0
- package/dist/pyproject.js +16 -0
- package/dist/pyproject.js.map +1 -0
- package/dist/python-source.d.ts +25 -0
- package/dist/python-source.js +359 -0
- package/dist/python-source.js.map +1 -0
- package/dist/sourceWalk.d.ts +2 -1
- package/dist/sourceWalk.js +5 -3
- package/dist/sourceWalk.js.map +1 -1
- package/dist/verdict.d.ts +6 -0
- package/dist/verdict.js +13 -0
- package/dist/verdict.js.map +1 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -6,10 +6,15 @@ The author-facing SDK for community Maestro nodes. It holds the `new`, `init`, `
|
|
|
6
6
|
|
|
7
7
|
None of the commands logs in to UiPath.
|
|
8
8
|
- `uipath-extensions new <publisher/name> [--kind function|agent] [--dir <parent dir>] [--skip-install]` runs `uip function new <name> --language ts` in the parent directory (the current one by default). It keeps the layout `uip` writes: the functions stay in `functions/`, and `tsconfig.json` and the `uipath.json` function entries are not changed. The Maestro files go in `maestro/`. It removes `method` and `path` from every `defineFunction` call, sets the `name` in `package.json` to the package id `uipath-extensions.<publisher>.<name>` and the `version` to `0.1.0`, deletes the `.env.example` that `uip` writes (`submit` refuses it, and it holds credential placeholders), adds `tests` to `packOptions.directoriesExcluded` in `uipath.json` (`submit` accepts a `tests` folder, but the package gate does not accept it inside the package), keeps `@uipath/coded-functions-js-sdk` in `devDependencies`, adds `@types/node` to `devDependencies` (the connection helper reads `process.env`, so `validate` needs the Node types), writes the script `pack: uip function pack` and no `validate` script, replaces `functions/hello.ts` with a starter function whose input and output are JSON Schema literals, and writes the template `uipath-extensions.json` at the project root, the connection helper `maestro/connection.ts` and a starter fixture `fixtures/example.json` (`{ "operation": "run", "input": { "name": "World" } }`, a placeholder to replace with real cases). The project does not depend on this SDK, so `pack: uip function pack` is the only script. It then runs `npm install --include=dev` in the new project, so the type packages are ready for `validate` even when `NODE_ENV=production` or `omit=dev` is set. `--skip-install` leaves that step out, and `new` then prints `npm install` as the first of the next steps. If that `npm install` fails, `new` keeps the project, prints the npm error and exits with code 1. The starter template has no `repository`, because the node folder goes to the index repo as one pull request and no author repo exists. It writes `author` with the publisher as the name, in title case, and `https://github.com/<publisher>` as the url, for the author to correct. If any step before that `npm install` fails after `uip` ran, `new` deletes the project directory it created. `uip function new` runs its own install first, before the SDK is added, and it has no option to skip that install. When that install fails, `uip` removes the project and `new` reports the `uip` error.
|
|
9
|
-
With `--kind agent`, `new` runs `uip codedagent new <name> --dir <name>` instead (run `uip codedagent setup` first, in an environment with an agent framework package such as `uipath-langchain` installed: without one `uip codedagent new` exits 1 with "No agent framework is installed"), sets `name` in the `[project]` table of `pyproject.toml` to the package id and `version` to `0.1.0`, and writes the template `uipath-extensions.json`. It writes no `package.json` and no connection helper, and runs no install. `--kind` takes `function` (the default) or `agent`.
|
|
10
|
-
- `uipath-extensions init [--id <publisher>.<name>] [--yes] [--dir <project dir>] [--index <owner/repo>]` calls the library `init`. It plans the adopt (see Adopt) and prints the plan as a diff. Without `--yes` it writes nothing and exits 1. With `--yes` it writes the plan and prints the files it wrote and the defaults it generated. A project that needs no write prints `Nothing to write, the project is already adopted.` and exits 0, so a second run changes nothing. `--id` names the node when the `package.json` name is not a package id and the command does not run in a terminal. In a terminal `init` asks for it. `--index` picks the repository whose `policy/gate-library.yaml` sets the schema of a new template. It needs `uip` because it packs. It also needs `gh` signed in when the project has no `uipath-extensions.json`, because it reads that policy file from the index repo.
|
|
11
|
-
|
|
9
|
+
With `--kind agent`, `new` runs `uip codedagent new <name> --dir <name>` instead (run `uip codedagent setup` first, in an environment with an agent framework package such as `uipath-langchain` installed: without one `uip codedagent new` exits 1 with "No agent framework is installed"), sets `name` in the `[project]` table of `pyproject.toml` to the package id and `version` to `0.1.0`, replaces the scaffold's placeholder `authors` with the publisher name, and writes the template `uipath-extensions.json`. It writes no `package.json` and no connection helper, and runs no install. `--kind` takes `function` (the default) or `agent`. The next steps for an agent are `uip codedagent init`, `uipath-extensions init --yes` and `uipath-extensions validate`.
|
|
10
|
+
- `uipath-extensions init [--id <publisher>.<name>] [--kind function|agent] [--yes] [--dir <project dir>] [--index <owner/repo>]` calls the library `init`. It plans the adopt (see Adopt) and prints the plan as a diff. Without `--yes` it writes nothing and exits 1. With `--yes` it writes the plan and prints the files it wrote and the defaults it generated. A project that needs no write prints `Nothing to write, the project is already adopted.` and exits 0, so a second run changes nothing. `--id` names the node when the `package.json` name is not a package id and the command does not run in a terminal. In a terminal `init` asks for it. `--index` picks the repository whose `policy/gate-library.yaml` sets the schema of a new template. It needs `uip` because it packs. It also needs `gh` signed in when the project has no `uipath-extensions.json`, because it reads that policy file from the index repo.
|
|
11
|
+
For a Python coded function with one entry in `uipath.json.functions`, run `uip function init` first, then `extension init` and `uv lock`. `init` decides whether the project is a `function` or an `agent` and records it in `pyproject.toml` as `kind` under `[tool.uipath-extensions]`, which `submit` copies into a new registration. It decides in this order: `--kind`, then a `kind` already in `pyproject.toml`, then `entry-points.json` (every entry has `type` `function`, as `uip function init` writes, or `agent`), then `uipath.json` (a `.py` entry under `functions` means a function). It prints the kind and where it came from. `--kind` or a recorded kind that disagrees with `entry-points.json` or `uipath.json` fails. When nothing decides, `init` asks in a terminal and fails off one with `pass --kind function|agent`. The kind is a write, so it needs `--yes`. On a coded agent project (no Python function in `uipath.json`), `--kind agent` is accepted and nothing is recorded, because the index reads a `pyproject.toml` folder with no kind as an agent, and `--kind function` fails. `--kind` on a project with no `pyproject.toml` fails. `extension validate` checks a fresh native package from an isolated source snapshot. It uses `uv lock --check` offline and does not refresh the lock, install dependencies, run the user function, or approve catalog publishing. `extension submit --dry-run` validates the files and previews the registry submission without writing to GitHub. `extension upload` sends the checked archive only to your personal workspace, using the version in `pyproject.toml`; bump that version and refresh `uv.lock` before re-uploading. Shared release upload and live registry submit stay blocked until Python function publication gates are available.
|
|
12
|
+
- `uipath-extensions validate [--dir <project dir>]` calls the library `validate`. It plans the adopt (see Adopt) on the project folder with `offline: true`, with no call to `gh` or the index. When the plan holds any write, or its only error is the missing id, `validate` stops. It runs no gate, writes nothing, exits 1 and tells the author to run `init` on that folder. Any other plan error exits 1 with the error. For a JavaScript coded function, when the plan holds no write, `validate` loads `uipath-extensions.json`, packs the project folder and runs the registered JavaScript gates in local mode on the completed manifest, which it builds in memory from the template and the package. It prints one line per gate and exits 1 when a gate fails. A gate that needs an input a local run does not have prints `skipped`. A skipped gate has not checked anything. It needs `uip` because it packs, and the pack leaves its build output in the project folder.
|
|
12
13
|
- `uipath-extensions pack [--dir <project dir>]` runs the `pack` steps below.
|
|
14
|
+
|
|
15
|
+
For an adopted Python coded function, `validate` and `pack` use a private copy of the checked project files and verify the resulting archive, rather than running the JavaScript gates. `validate` discards its working files; `pack` returns the path to the checked archive. These commands need `uv` and the Python-capable `uip`. The lockfile must pass an offline consistency check. Python upload uses the checked archive and requires a uniquely mapped Personal workspace feed; Python does not support an explicit `--feed-id`. Upload starts a job only if you pass `--run`. Python `submit --dry-run` is read-only; live submit and index build-check are not enabled for Python coded functions.
|
|
16
|
+
|
|
17
|
+
The private copy normalizes CRLF and CR line endings to LF in text, matching the native packer. It does not change the original files or icon bytes. The archive must contain well-formed NuGet metadata with the project's name and version.
|
|
13
18
|
- `uipath-extensions upload [--id <publisher>.<name>] [--yes] [--dir <project dir>] [--input <json>] [--run] [--feed-id <id>]` calls the library `upload` in its default mode and runs the `upload` steps below. On a project that is not adopted it plans the adopt first, as `submit` does (see Adopt). `--yes` applies the adopt writes and then goes on to the upload in the same run. Without it a plan with writes prints as a diff and the command exits 1 and writes none of the adopt files. Running `init` first writes the same files without the upload. `--id` names the node when the `package.json` name is not a package id and the command does not run in a terminal. It needs `uip login`. It starts a job only with `--run`.
|
|
14
19
|
- `uipath-extensions submit [--id <publisher>.<name>] [--yes] [--security-contact <email>] [--dir <project dir>] [--index <owner/repo>] [--dry-run]` calls the library `submit` and runs the `submit` steps below after the adopt step. `--id` names the node when the `package.json` name is not a package id and the command does not run in a terminal. In a terminal `submit` asks for it. `--yes` applies the adopt writes and then goes on to the checks and the pull request in the same run. Without it a plan with writes prints as a diff and exits 1. `--security-contact` is needed for a first registration and replaces the stored contact on a later version. `--index` defaults to `UiPath/uipath-extensions`, and a sandbox index repo can stand in for it. `--dry-run` prints what `submit` would do and writes nothing to GitHub.
|
|
15
20
|
- `uipath-extensions build-check --project <dir> --tag <tag> --out <dir>` packs the project, runs the 14 build gates in CI mode against the tag, and copies the nupkg and `gate-report.json` into `--out`. It exits 1 when a gate is not met and 2 on a usage error. When `GITHUB_OUTPUT` is set and every gate is met, it appends `nupkg=<path>`. The reusable build workflow runs this command in CI, so a node author normally does not call it.
|
|
@@ -48,7 +53,7 @@ The display fields are bounded. The SDK and the `contract` gate enforce these ru
|
|
|
48
53
|
- `display.label` is 1 to 40 characters and `display.description` is 1 to 200 characters. Neither may contain `<` or `>`.
|
|
49
54
|
- `tags` holds at most 8 tags. Each tag is 1 to 24 characters of lowercase letters, digits and single hyphens.
|
|
50
55
|
- `display.iconBackground`, `display.iconBackgroundDark` and `display.iconColor` are optional, and each must be a color in the form `#RRGGBB`.
|
|
51
|
-
- `display.icon` is required when the template holds `"schema": 2`, and the template check answers `display.icon is required` when it is missing. `new` writes the legacy shape and leaves it out. To use your own icon, put a PNG
|
|
56
|
+
- `display.icon` is required when the template holds `"schema": 2`, and the template check answers `display.icon is required` when it is missing. `new` writes the legacy shape and leaves it out. To use your own icon, put a PNG under `assets/` and set `display.icon` to its path. From SDK 0.1.23 the file name is free, as long as the path matches `assets/<name>.png`, where `<name>` is 1 to 64 letters, digits, `_` or `-`. The match is case sensitive, so `assets/Coins.png` does not name `assets/coins.png`. Only that one file may sit under `assets/`, and `submit` and `validate` report a second one. Before that release only `assets/icon.png` was accepted. A path outside the pattern is a finding from SDK 0.1.9, and the package check fails a template that names an icon the package does not have. `adopt` sets `display.icon` in a template it writes, except a legacy template when `icon.png` is excluded in `uipath.json`, adds it to a schema 2 template that lacks it, and writes a default icon to `assets/icon.png` when the template names an icon the project does not have. It never touches an icon the project already has, and from SDK 0.1.23 it writes nothing for a template that names an icon other than `assets/icon.png`. The body of a new pull request that `submit` opens lists the default icon under the fields adopt generated, so replace it with your own. A later `submit` that updates the same pull request does not change its body. When the package holds the icon that `display.icon` names (`assets/icon.png` by default), from SDK 0.1.9 the package check requires a PNG file of at most 32768 bytes. From SDK 0.1.23 it runs that check on the file the template names. `validate` packs the project, so it runs that check too.
|
|
52
57
|
- Nothing displays these fields yet. Flow does not read `uipath-extensions.json` (flow-workbench `fb24f7e` has no reference to `uipath-extensions`).
|
|
53
58
|
|
|
54
59
|
`author` is optional and says who publishes the node, for Flow to show next to the badge. `author.name` is 1 to 80 characters with no `<` or `>`. `author.url` is optional, an `https://` URL of at most 200 characters with no credentials or backslash. No other key is allowed. The manifest carries the object as given. `security_contact` in the registration is the contact for UiPath and is not the author. The SDK and the `contract` gate enforce these rules from the release after SDK 0.1.14, and Flow does not show the field yet.
|
|
@@ -154,6 +159,23 @@ return api.post("/search", { body: { query: input.query } });
|
|
|
154
159
|
|
|
155
160
|
In a job, `connection()` sends each request through the Integration Service `http-request` passthrough with the robot token, so the vendor key stays in Integration Service. A vendor error status throws a `VendorError` with the vendor's message. Without a robot (a local run), it calls `baseUrl` directly with the key from the named environment variable. `localEnv()` reads only `MAESTRO_LOCAL_*` variables, so a job cannot use it to read the robot's environment.
|
|
156
161
|
|
|
162
|
+
## Dependencies
|
|
163
|
+
|
|
164
|
+
A node may depend only on npm packages that are on the allow list. The `dependency-policy` gate reads `dependencies`, `optionalDependencies` and `peerDependencies` in `package.json` and fails each name that is not on the list, except an `@uipath/` package from a trusted publisher (see below). Today the list holds one package, `@uipath/coded-functions-js-sdk`. A library such as `pdfkit` is blocked, even though the Functions runtime can install any public npm package. The limit comes from the submit gates, not from the runtime.
|
|
165
|
+
|
|
166
|
+
The list exists in two places.
|
|
167
|
+
|
|
168
|
+
- The index repo `UiPath/uipath-extensions` holds `policy/allowed-dependencies.yaml`. The index CI uses this file, so it decides whether a node is accepted.
|
|
169
|
+
- The gates package holds a copy as `DEFAULT_POLICY` in `packages/gates/src/policy.ts`. `validate` and `build-check` use this copy, because they cannot read the index file.
|
|
170
|
+
|
|
171
|
+
The two lists can differ. A package that passes `validate` can still fail in the index CI, and a package that the index later allows still fails `validate` until a new SDK release carries the change. For a blocked name outside `@uipath/`, the gate message names the package and these two locations.
|
|
172
|
+
|
|
173
|
+
Any other `@uipath/` package needs a publisher that the policy trusts, and no publisher is trusted by default. The `dependency-tree` and `license-cve` gates then check every package in the lockfile, not only the direct ones. `validate` skips both of them, and the index CI runs them. So a package on the allow list can still be refused for its own dependencies.
|
|
174
|
+
|
|
175
|
+
To ask for a new package, open a pull request against `UiPath/uipath-extensions` that adds the package name to `policy/allowed-dependencies.yaml`. Say in the description which node needs it and why no allowed package or plain code can do the job. The owners in the `CODEOWNERS` entry for `/policy/` review it. The SDK copy follows the index file in a later SDK release, and an author cannot change it from a node repo.
|
|
176
|
+
|
|
177
|
+
Check the list before you pick a library for a node. If the package is not on it, either write the code without it or ask for the package first.
|
|
178
|
+
|
|
157
179
|
## Pack
|
|
158
180
|
|
|
159
181
|
`pack({ projectDir })` does these steps in order.
|
|
@@ -161,10 +183,20 @@ In a job, `connection()` sends each request through the Integration Service `htt
|
|
|
161
183
|
2. Fails unless the `name` in `package.json` is a package id `uipath-extensions.<publisher>.<name>`, which the packer turns into the nuspec id, and the `version` is a string.
|
|
162
184
|
3. Runs `uip function pack` in the project directory.
|
|
163
185
|
|
|
164
|
-
It returns the nupkg path, the version and the
|
|
186
|
+
It returns the nupkg path, the version, the package id and the kind (`function` or `agent`). It does not read or write the nupkg, so it injects no manifest. The package holds the template file as it is. It writes no manifest into the project and does not change `package.json`. `validate` and `build-check` read the entry point from the nupkg and fail unless it lists exactly one.
|
|
165
187
|
|
|
166
188
|
`pack({ projectDir, version })` packs under a different semver while `uip function pack` runs. It sets `version` in `package.json` for that call and puts the node version back afterwards, also when `uip` fails. The template is not changed, and a schema 2 template holds no version to differ.
|
|
167
189
|
|
|
190
|
+
### Agents
|
|
191
|
+
|
|
192
|
+
A folder with a `pyproject.toml` and no `package.json` is an agent project (`projectKind`). The same commands then take the agent path.
|
|
193
|
+
|
|
194
|
+
- **`pack`** reads `name` and `version` from the `[project]` table of `pyproject.toml` and runs `uip codedagent pack`, which writes `.uipath/<package id>.<version>.nupkg`. With a `version`, it sets the `[project]` version for that call and puts `pyproject.toml` and `uv.lock` back afterwards, because `uip codedagent pack` runs `uv lock`.
|
|
195
|
+
- **`init`** (adopt) runs `uip codedagent init` first when `uipath.json` or `entry-points.json` is missing, and `uv lock` when `uv.lock` is missing (so it needs `uv` on the path), with yes only: without yes it stops with `ConfirmationRequired` and changes nothing. `validate` does not run it and stops until `init` has. `upload` and `submit` run it as part of their adopt step. It reads the single entry point from the source file and runs no pack. It sets `[project].name` from `--id` when the name is not a package id, writes the template and a default icon when they are missing, lists the icon the template names in `packOptions.filesIncluded` (`assets/icon.png` unless the template names another file, from SDK 0.1.23), and sets `packOptions.includeUvLock`. It writes no fixture and no connection helper.
|
|
196
|
+
- **`validate`** runs `PYTHON_AGENT_GATES` (`uv-lockfile`, `pack-options`, `pypi-dependency-tree`, `agent-shape`, `package-id`) on a manifest built from the template and `content/entry-points.json` of the nupkg.
|
|
197
|
+
- **`upload`** packs under the dev version, sends the nupkg with `uip or packages upload --feed-id <feed>`, then creates or moves the release and starts the job as for a function.
|
|
198
|
+
- **`submit`** collects the folder with the agent source list (`isAllowedSourcePath(path, "agent")` in the gates package), reads the identity from `pyproject.toml`, and asks for no fixture.
|
|
199
|
+
|
|
168
200
|
## Upload
|
|
169
201
|
|
|
170
202
|
`upload({ projectDir })` tests a node in the personal workspace of the logged in tenant. It never writes to GitHub or to the index. It does these steps in order.
|
|
@@ -186,7 +218,7 @@ The output ends with the destination.
|
|
|
186
218
|
|
|
187
219
|
The `@uipath/uipath-extensions-sdk/lib` export runs four commands from code. Each takes options and `LibDeps` (`exec`, `io`, an optional `github` client and an optional `now` clock) and returns `{ code, data, instructions? }`. `io` has `out`, `err`, `canPrompt` and `ask`. `code` is one of `Success`, `GatesFailed`, `ConfirmationRequired`, `InputRequired` and `Failed`. Only `Success` is a pass, and the `uipath-extensions` command exits 0 for `Success` and 1 for every other code.
|
|
188
220
|
|
|
189
|
-
- `init({ dir, id, index, yes })` plans the adopt writes, as `submit` does, and prints the diff once. It asks for the id in a terminal when the `package.json` name is not a package id, and off a terminal a missing id returns `Failed` with the plan and `pass <publisher>.<name>`. A template that exists and is malformed returns `Failed` with the message in `instructions`, before any diff or write. A plan with writes needs `yes` (else `ConfirmationRequired` with the plan, and nothing is written). With `yes` it applies the writes and returns `Success` with `{ written, generated }`. A file that changed after the plan returns `Failed` with the plan and the instruction to run `init` again, and nothing is written. A project whose plan holds no write returns `Success` with both lists empty. There is no confirmation prompt.
|
|
221
|
+
- `init({ dir, id, index, kind, yes })` plans the adopt writes, as `submit` does, and prints the diff once. For a Python function project it also decides and records the kind (see `init` under Commands). It asks for the id in a terminal when the `package.json` name is not a package id, and off a terminal a missing id returns `Failed` with the plan and `pass <publisher>.<name>`. A template that exists and is malformed returns `Failed` with the message in `instructions`, before any diff or write. A plan with writes needs `yes` (else `ConfirmationRequired` with the plan, and nothing is written). With `yes` it applies the writes and returns `Success` with `{ written, generated }`. A file that changed after the plan returns `Failed` with the plan and the instruction to run `init` again, and nothing is written. A project whose plan holds no write returns `Success` with both lists empty. There is no confirmation prompt.
|
|
190
222
|
- `validate({ dir })` plans the adopt writes on the project folder with `offline: true`. It returns `Failed` with the plan in `data` and the instruction to run `init` on the project folder when the plan holds any write or its only error is the missing id. It writes nothing and runs no gate in that case. Any other plan error returns `Failed` with the plan and the errors. A plan with no write and no error runs the gates in local mode on the project folder and returns `Success` or `GatesFailed` with the report. A malformed template, a package that cannot be packed or read, and a missing `uip` return `Failed` with the message in `instructions`, in all four commands.
|
|
191
223
|
- `upload({ dir, id, yes, run, input, feedId })` plans the adopt writes when the project has no template or its `package.json` name is not a package id, as `submit` does. It never reads the index, so it needs no `gh` and writes schema 2. A plan with writes needs `yes` (else `ConfirmationRequired`). With `yes` it applies the writes and then runs the `upload` steps below in the same call. Any other template or `package.json` problem returns `Failed` before any write. The release input checks below run before the adopt writes. A run whose job does not end `Successful` returns `Failed` with the upload result and the job in `data`. With `release: true` it needs exactly one of `folderPath` and `folderKey` (else `InputRequired`), rejects `feedId`, packs once and runs the gates on that package (`GatesFailed` uploads nothing), needs `yes` (else `ConfirmationRequired`), then runs `uip or packages upload <nupkg>` with the folder flag on the package that passed the gates, under the `package.json` version.
|
|
192
224
|
- `submit({ dir, id, yes, securityContact, index, dryRun })` plans the adopt writes. A plan with writes needs `yes` (else `ConfirmationRequired`). With `yes` it applies the writes and then runs the `submit` steps below in the same call. `index` also picks the repository whose `policy/gate-library.yaml` sets the schema of a new template. The pull request body lists the fields that the adopt step generated in this run (the license when `package.json` declares none, the label, both descriptions, the operation name and the tags), and ends with the line `Gate library: <version>`. A project that an earlier run adopted has no such list.
|
|
@@ -200,7 +232,7 @@ A project is adopted when it has a template, a package name that is a package id
|
|
|
200
232
|
- It needs `uipath.json`, and it stops with `not a uip project, run uip function new or uip codedagent new first` when that file is missing.
|
|
201
233
|
- A `package.json` name that is not `uipath-extensions.<publisher>.<name>` becomes a write of the name from `id`, or the error `pass <publisher>.<name>` when there is no `id`.
|
|
202
234
|
- A missing `uipath-extensions.json` becomes a write of a template that passes the gates, from the one operation in `entry-points.json`. It sets `license` to the one `package.json` declares, or to `MIT` when `package.json` declares none, `display.label` to the node name in title case cut to 40 characters, a one-sentence `display.description` and operation description that ask the author to describe the node, and an empty `tags` list. It sets `display.icon` to `assets/icon.png`, except in a legacy template when `icon.png` is excluded. Its shape follows `template_schema` in `policy/gate-library.yaml` of the index repo: schema 2 gets `"schema": 2` and no `version`, an absent key gets the legacy shape with the `package.json` version, and any other value is an error. The index repo is the one `--index` names, and `UiPath/uipath-extensions` by default.
|
|
203
|
-
- A missing `assets/icon.png` becomes a write of the default icon, a PNG of 256 by 256 pixels (the `language` glyph of `@uipath/apollo-core`, whose MIT notice ships in `THIRD-PARTY-NOTICES.txt`). The plan holds it as a base64 string with `encoding: "base64"`, and the diff prints one line with its size. An icon the project already has is never touched. Adopt writes the icon only when the template names it, so a legacy template with no `display.icon` gets no icon file.
|
|
235
|
+
- A missing `assets/icon.png` that the template names, or that a new template will name, becomes a write of the default icon, a PNG of 256 by 256 pixels (the `language` glyph of `@uipath/apollo-core`, whose MIT notice ships in `THIRD-PARTY-NOTICES.txt`). The plan holds it as a base64 string with `encoding: "base64"`, and the diff prints one line with its size. An icon the project already has is never touched. Adopt writes the icon only when the template names it, so a legacy template with no `display.icon` gets no icon file.
|
|
204
236
|
- A schema 2 template with no `display.icon` becomes a write of the same template with `display.icon` set to `assets/icon.png`. The write keeps the indent and every other key, and `upload` adopts this case in the same run as it adopts a missing template.
|
|
205
237
|
- When `uipath.json` lists `icon.png` or `assets` in `packOptions.filesExcluded` or `packOptions.directoriesExcluded`, the packer would leave the icon out. Adopt then returns an error for a schema 2 template that names the icon or needs it added, and names the entry to remove. For a legacy template it skips the icon.
|
|
206
238
|
- A missing `maestro/connection.ts` becomes a write when an input is a connection. The helper reads `process.env`, so the plan adds `@types/node` to the `devDependencies` of `package.json` whenever an input is a connection and neither dependency list holds it, also when the helper already exists, and reports that `npm install` has to run.
|
|
@@ -218,7 +250,7 @@ A project is adopted when it has a template, a package name that is a package id
|
|
|
218
250
|
1. Plans the adopt writes (see Adopt). It stops when the plan has an error, or has a write and no `--yes`. With `--yes` it applies the writes and goes on. When it then needs `--security-contact` and has none, it returns `InputRequired` and says the adopt files were written. Loads `uipath-extensions.json`. Takes the version and the node id from the sent `package.json`, and fails when its `name` is not a package id or its `version` is not a string.
|
|
219
251
|
2. Runs `validate` in local mode. It packs the project, so `uip` must be on the PATH. A `fail` stops `submit` before it writes anything, after the checks below have run. A `review` or `skipped` result is printed and does not stop it. The index CI runs every gate with more inputs than a local run has, so a pass here is not a pass there.
|
|
220
252
|
3. Reads the index repo and checks that the signed-in account can push to it. Without that right it stops before it writes anything, with `you cannot push branches to <index>. Ask in #feat-maestro-community-node for write access, then run submit again.`
|
|
221
|
-
4. Collects the files of the project folder. Only the allow list is sent: `uipath-extensions.json`, `package.json`, `package-lock.json`, `uipath.json`, `tsconfig.json`, `tsconfig.typecheck.json`, `project.uiproj`, `README.md`, `LICENSE`, `assets/icon.png
|
|
253
|
+
4. Collects the files of the project folder. Only the allow list is sent: `uipath-extensions.json`, `package.json`, `package-lock.json`, `uipath.json`, `tsconfig.json`, `tsconfig.typecheck.json`, `project.uiproj`, `README.md`, `LICENSE`, one icon at `assets/<name>.png` (the name is free from SDK 0.1.23, and `assets/icon.png` before it), `maestro/connection.ts`, `functions/**/*.ts`, `tests/**/*.ts` and `fixtures/**/*.json`. Names under the last three must use only letters, digits, `_`, `-` and `.`, and may not start with a dot. A file under a folder whose name starts with a dot, such as `fixtures/.vscode/tasks.json`, is not on the list, because the index refuses it. Local files that the index refuses or that a build writes are left out and listed in the output. They are `node_modules/`, `dist/`, `.git/`, `.uipath/`, `.github/`, `docs/`, `.gitignore`, `.npmrc`, `biome.json`, `commitlint.config.mjs`, `AGENTS.md`, `CHANGELOG.md`, `CLAUDE.md`, `entry-points.json`, `bindings_v2.json`, `registration.yaml` and `*.nupkg`. A `registration.yaml` in the folder, for example one copied from the index, is never sent: submit writes the registration from the index copy plus the new version. The same checks as in `validate` run on it, and a problem is a warning in the output. At any depth the collector also skips an entry whose name is in `packOptions.filesExcluded` or `packOptions.directoriesExcluded` of `uipath.json`, and the names `node_modules`, `.git`, `.env`, `.deno`, `dist` and `.uipath`, as `uip function pack` does. A source folder of the allow list at the project root (`tests`, `fixtures`) is still collected when `packOptions` excludes it, because `new` excludes `tests` only to keep it out of the package, and the index keeps those files. A `uip function pack` run writes the last three, and `validate`, `pack` and `upload` all start one, so they can sit in the folder when you submit. Any other file, a second file under `assets/`, a symlink, a file over 5 MiB, more than 200 files with `registration.yaml`, or more than 20 MiB in all stops submit with the list of paths and the reason for each. In `package-lock.json`, every package that is not `@uipath/uipath-extensions-sdk` or `@uipath/uipath-extensions-gates` and whose `resolved` URL is on `npm.pkg.github.com` is sent with the matching `registry.npmjs.org` tarball URL, because the index gate takes everything but those two from the public registry. The `integrity` value is not changed, and the file on disk is not touched.
|
|
222
254
|
5. Refuses when the index holds both the flat file `nodes/<publisher>/<name>.yaml` and the folder for the node, or when the version is already in the registration file. It then looks for an open pull request from the branch `register/<publisher>__<name>`. When there is one, it updates that pull request (see below). When there is none, it refuses if the branch already exists in the index repo.
|
|
223
255
|
6. Reads the default branch head of the index repo, and builds one tree commit on it through the git data API. The commit holds the files under `nodes/<publisher>/<name>/` and `registration.yaml` with the new version as a `listed` entry dated today (UTC). A first registration writes `id`, `package`, `security_contact`, `deprecated`, `approved` and `maintainers`, and `id` and `package` come from the `name` in `package.json`. `maintainers` holds one entry, the signed-in `gh` account, with its login in lowercase and its numeric GitHub id. The index lets only a listed maintainer, or someone with write access to the index repo, submit new versions of the node. When the signed-in account is not a normal user, `submit` writes no `maintainers` block and does not fail. That happens when the login has brackets or another shape that the index schema refuses, when the account type is not `User`, and when GitHub does not answer the identity or the user lookup. A node without the list is not checked by the index. A later version keeps every field of the existing file, `maintainers` included, appends the entry and never adds the submitter. To add people, edit `maintainers` in the registration file by hand in a pull request. The list holds 1 to 20 entries and the index checks the shape of each one. It deletes files that the index folder holds and your folder no longer has. When the node is still a flat file `nodes/<publisher>/<name>.yaml`, the same commit deletes that file and writes the folder, so the pull request never holds both. The commit touches nothing outside `nodes/<publisher>/<name>/`.
|
|
224
256
|
7. Creates the branch `register/<publisher>__<name>` at that commit, so a failure before this step leaves no branch. It opens the pull request with the body of the index `.github/PULL_REQUEST_TEMPLATE.md`. It fills the `Node id` and `Version` lines and ticks "Registers a new node" or "Adds a version to an existing node". It then tries to add the `registration` label, and warns when it cannot. The pull request title and the commit message are both `Register <id> <version>`, because the index lints every commit and the title with the same rule.
|
|
@@ -254,6 +286,11 @@ A connector node is an Integration Service connector, not a function. Its folder
|
|
|
254
286
|
|
|
255
287
|
## Limits
|
|
256
288
|
|
|
289
|
+
- For an agent, `validate` runs four Python gates only. Nothing checks the Python source for risky calls, imports, secrets in logs or a vendor host, and there is no contract, license or CVE gate, so a reviewer reads those. `pypi-dependency-tree` is skipped locally, because `validate` has no PyPI client. `validate` does not run `uip codedagent init`, so it does not catch an `entry-points.json` that is stale against the code. The index CI regenerates it and refuses a difference.
|
|
290
|
+
- For an agent, `uip codedagent init` writes `AGENTS.md`, `CLAUDE.md` and `agent.mermaid` into the project, and `uip codedagent pack` puts them in the nupkg. `submit` does not send them, so the package that the index builds holds its own copies from its `init` run.
|
|
291
|
+
- `new --kind agent` replaces the scaffold's placeholder `authors` (`John Doe`), which would otherwise go into the nuspec. `init` does not change `authors`, so a project made with `uip codedagent new` directly keeps the placeholder until the author edits it.
|
|
292
|
+
- `build-check` supports functions only. On an agent it runs the function build gates, which fail.
|
|
293
|
+
- The agent paths were run by hand against `uip` 1.208.0-dev.10110 on 2026-11-25: `new`, `init`, `validate`, `pack`, `upload --run` (a job on alpha returned its output) and `submit --dry-run`. The tests use a fake `uip`.
|
|
257
294
|
- `repository` is optional. A template that sets it must write `owner/repo`, not a URL, and the completed manifest then lists it as a `https://github.com/` URL. A template without it gets no `repository` in the manifest. The `release`, `attestation` and `identity-match` gates fail in `ci` mode for such a manifest when a caller gives them every input, because they look up the author repository, and `source` mode skips them. Nothing else in the gate library or the SDK reads the field.
|
|
258
295
|
- `author` is checked for shape only. The gates do not check that the name belongs to the publisher or that the url is theirs, so a reviewer reads it. The index can later refuse a name that impersonates another publisher.
|
|
259
296
|
- `pack` and `upload` do not compare a legacy template `version` with `package.json`. `validate` and `build-check` do, because they build the manifest. `template-match` compares bytes only, so it cannot tell a stale template from a new one, it only proves that the package carries the source file.
|
package/dist/adopt.d.ts
CHANGED
|
@@ -5,5 +5,11 @@ export declare class StaleAdoptPlanError extends Error {
|
|
|
5
5
|
readonly path: string;
|
|
6
6
|
constructor(path: string);
|
|
7
7
|
}
|
|
8
|
+
export { isPythonFunctionProject } from "./python-source.js";
|
|
9
|
+
export declare function pythonFunctionNeedsId(dir: string): Promise<boolean>;
|
|
10
|
+
export declare const AGENT_INIT = "uipath.json and entry-points.json are missing. Run init, which runs uip codedagent init to write them";
|
|
11
|
+
export declare const AGENT_LOCK = "uv.lock is missing. Run init, which runs uv lock to write it";
|
|
12
|
+
export declare function needsAgentInit(dir: string): Promise<boolean>;
|
|
13
|
+
export declare function runAgentInit(dir: string, exec: LibDeps["exec"]): Promise<string | undefined>;
|
|
8
14
|
export declare function planAdopt(opts: AdoptOptions, deps: LibDeps): Promise<AdoptPlan>;
|
|
9
15
|
export declare function applyAdopt(plan: AdoptPlan, opts: AdoptOptions): Promise<void>;
|