@uipath/skills 1.206.0-preview.1718 → 1.206.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/skills",
3
- "version": "1.206.0-preview.1718",
3
+ "version": "1.206.0",
4
4
  "description": "UiPath agent skills for Claude Code, Codex, Cursor, GitHub Copilot, OpenCode, UiPath Autopilot, Kiro, Windsurf, Antigravity and Devin — RPA, UI automation, UI testing, coded agents/apps/workflows, and troubleshooting. Distributed as the UiPath Claude Code plugin.",
5
5
  "author": {
6
6
  "name": "UiPath"
@@ -15,6 +15,7 @@ Build, debug, and deploy UiPath Coded Web Applications and Coded Action Apps usi
15
15
  - User asks about `uip codedapp` commands, `.uipath/` directory, `app.config.json`, or `action-schema.json`
16
16
  - User wants to **scaffold** a new React/Vue frontend for UiPath Cloud or an Action Center form
17
17
  - User asks for app UI that a **prebuilt UiPath widget** covers: review/correct Document Understanding extraction results (Validation Station), chat with a conversational agent, browse/edit a Data Fabric entity in a grid, upload files to a storage bucket, display a PDF, or sign in with an external IdP (Google/SAML)
18
+ - User wants a coded app where a reviewer confirms or corrects a proposal and each decision is captured in the Decision Ledger (preview, decisions-and-reasons widget, Decision written through `completeTask` or `decisions.create`)
18
19
  - User wants to **push/pull source** between local and Studio Web
19
20
  - User wants to use the `@uipath/uipath-typescript` SDK from a coded app
20
21
  - User wants to run the **full pipeline** (build → pack → publish → deploy)
@@ -93,6 +94,7 @@ For the app's **JS/TS function backend** — authoring the `defineFunction` endp
93
94
  | **Embed the multi-file bucket upload widget** | [references/widgets/multi-file-upload.md](references/widgets/multi-file-upload.md) |
94
95
  | **Embed the PDF viewer widget** | [references/widgets/pdf-viewer.md](references/widgets/pdf-viewer.md) |
95
96
  | **Add external IdP sign-in buttons (Google/SAML)** | [references/widgets/external-auth.md](references/widgets/external-auth.md) |
97
+ | **Capture reviewer decisions with the decisions-and-reasons widget (preview)** | [references/widgets/decisions-and-reasons.md](references/widgets/decisions-and-reasons.md) |
96
98
  | **OAuth scopes for SDK services** | [references/oauth-scopes.md](references/oauth-scopes.md) |
97
99
  | **SDK: Import paths & subpath exports** | [references/sdk/imports.md](references/sdk/imports.md) |
98
100
  | **SDK: Assets, Queues, Buckets, Processes, Jobs, Attachments** | [references/sdk/orchestrator.md](references/sdk/orchestrator.md) |
@@ -0,0 +1,194 @@
1
+ # Preview: Decision Capture with the Decisions and Reasons Widget
2
+
3
+ Build a coded app in which a reviewer confirms or corrects a proposal, and every part of that review lands in one Decision. The widget renders the review and returns a `ReviewPayload`; this guide covers picking the widget, feeding it, and writing the payload into a Decision without losing anything.
4
+
5
+ Lifecycle commands (scaffold, OAuth client, build, `uip codedapp pack`, `publish`, `deploy`) follow [create-web-app.md](../create-web-app.md), [create-action-app.md](../create-action-app.md) and [pack-publish-deploy.md](../pack-publish-deploy.md). The SKILL.md Critical Rules still apply.
6
+
7
+ ## Packages
8
+
9
+ | Package | Entry | Owns |
10
+ |---|---|---|
11
+ | `@uipath/ui-widgets-decisions-and-reasons` `^1.0.1-beta.0` | `/preview`, plus `/DecisionsAndReasons.css` | Review formats, primitives, `useDecisionCapture`, `ReviewPayload` |
12
+ | `@uipath/uipath-typescript` `^1.8.4` | `/traces` | `Decisions` service and `DecisionCreateInput`. 1.8.4 is the first version with `Decisions` |
13
+
14
+ Install both from the public registry:
15
+
16
+ ```bash
17
+ npm install @uipath/ui-widgets-decisions-and-reasons@^1.0.1-beta.0 @uipath/uipath-typescript@^1.8.4 --@uipath:registry=https://registry.npmjs.org
18
+ ```
19
+
20
+ Import the stylesheet once in the app entry: `import '@uipath/ui-widgets-decisions-and-reasons/DecisionsAndReasons.css';`. Before using any export name below, confirm it in `node_modules/@uipath/ui-widgets-decisions-and-reasons/dist/preview.d.ts`.
21
+
22
+ ## Steps
23
+
24
+ 1. Scaffold the app. Add `Traces.Api` to the OAuth scopes when the app writes the Decision itself (see "Write the Decision"); every `Decisions` method needs it. See [oauth-scopes.md](../oauth-scopes.md).
25
+ 2. Install the packages and import the stylesheet (above).
26
+ 3. Pick the format by the reviewer's job ("Pick the format").
27
+ 4. Map the app's proposal data to the format's props ("Feed the widget"). Write `sample-proposal.json` with realistic data: 3 or 4 reasons from more than one source, at least one reason against the recommended outcome, and final details with a value for every outcome.
28
+ 5. Write the payload into a Decision ("Write the Decision"), in one pure function in `src/decisions/buildDecision.ts`.
29
+ 6. Build (`npm run build`) and fix type errors without loosening types.
30
+ 7. Run the app against the sample data and check, in the browser: no outcome selected on load, the recommended outcome marked, a changed weight, an outcome change that re-fills the final details, an added reason, and the built Decision (log it once in the console while checking, then remove the log). Every reason and every final-details field must appear in `data`. Do not report done before this.
31
+ 8. Pack, publish and deploy.
32
+
33
+ ## Pick the format
34
+
35
+ Every format returns the same `ReviewPayload`.
36
+
37
+ | Export | Reviewer's job |
38
+ |---|---|
39
+ | `CaseAssessment` | Weighs the reasons in a case and picks its outcome (claims, refunds, exceptions). Supports task tags, default reasons and Next time |
40
+ | `SourceComparison` | Compares extracted values against a system of record, field by field, with verdicts and citations |
41
+ | `ExtractionValidation` | Confirms or corrects values extracted from a document, with confidence and line items |
42
+ | `TriageRouting` | Confirms or changes the category, priority and team that were proposed |
43
+ | `DraftEditing` | Accepts, edits or rewrites proposed text |
44
+ | `FactWeighing` | Weighs each fact on a five-point scale from fraud to legitimate, beside the proposer's read |
45
+
46
+ No format fits: compose one from the primitives (`ReviewShell`, `OutcomePicker`, `ReasonsSection`, `ProposalInput`, `NextTimeSection`, `ChangesSummary`) around `useDecisionCapture`, wrapped in `CaptureProvider`. The hook builds the same payload. Never rebuild weight menus, reason chips or outcome cards by hand, and never replace them with free-text boxes.
47
+
48
+ ## Feed the widget
49
+
50
+ Props shared by every format (`ReviewProps`):
51
+
52
+ | Prop | Set it to |
53
+ |---|---|
54
+ | `title`, `subtitle`, `facts`, `excerpt` | The case the reviewer is looking at, from the app's data |
55
+ | `proposedBy` | The proposer's display name (an agent, an automation or a team). It also becomes `proposedBy.identity` in the Decision |
56
+ | `outcomes` | Every outcome the reviewer can choose: `{ id, label, description }`. Mark the proposed one `recommended: true`. Add `requiresReason` with `reasons` where a reason must go with that choice, and `requiresCoverage` where every field needs a verdict first |
57
+ | `reasonOptions` | The reason chip vocabulary, in the process's own words |
58
+ | `show` | Optional pieces: `confidence`, `citation`, `qcLane`, `nextTime`, `comparison`, `record` |
59
+ | `reviewerId` | The signed-in reviewer's identity (email or user name). It becomes `actor.identity` |
60
+ | `saved` | A previously saved draft, so a reopened review resumes where it stopped |
61
+ | `onChange(payload)` | Save the draft (optional) |
62
+ | `onComplete(outcome, payload)` | Write the Decision. Return the promise, so the widget shows completed only after the write resolves |
63
+
64
+ The format's own props type (`CaseAssessmentProps`, `SourceComparisonProps`, ...) names the items it reviews: `reasons`, `fields` or `labels`. Each reason carries its `source` and, when known, `confidence`. Each final-details field carries `byOutcome`, the proposed value for each outcome, so the field re-fills when the reviewer changes the outcome.
65
+
66
+ Never pre-select an outcome. The proposal is marked Recommended and the reviewer picks.
67
+
68
+ ## Write the Decision
69
+
70
+ Where the Decision is written depends on where the app runs.
71
+
72
+ | App | Who writes the Decision | The app does |
73
+ |---|---|---|
74
+ | Coded Action App (Action Center task) | Action Center, when the task completes | `onComplete` calls `completeTask(outcome, payload)`. Declare `reasons` and `fields` as `inOuts` and the other payload keys as `outputs` in `action-schema.json`, because Action Center drops undeclared keys. Never call `decisions.create` |
75
+ | Coded Web App | The app | `onComplete` builds a `DecisionCreateInput` from the payload and calls `decisions.create` |
76
+
77
+ The rest of this section is for a Coded Web App.
78
+
79
+ ### Decision
80
+
81
+ | Field | Value |
82
+ |---|---|
83
+ | `decisionId` | 16 lowercase hex characters, new per submit (see "Identifiers") |
84
+ | `data` | One entry per reason, per final-details field and per fact (tables below) |
85
+ | `actor` | `{ identity: payload.reviewerId, kind: 'Human' }` |
86
+ | `acceptedOutcome` | `onComplete`'s first argument, the outcome id the reviewer clicked |
87
+ | `rejectedOutcomes` | The ids of every other outcome passed in `outcomes` |
88
+ | `decisionTimestamp` | `new Date().toISOString()` at submit |
89
+ | `explicitEvidences` | The titles of the reasons whose ids are in `payload.decidingReasons`, then each of `payload.taskTags`, then `payload.rationaleText` when not empty |
90
+ | `processInstanceMetadata` | `{ processName: <app or process name> }`, plus `processKey` and `instanceId` when the app knows them |
91
+ | `platform` | `'CodedApp'` |
92
+
93
+ ### `data`: one entry per reason
94
+
95
+ Key: `reason.<reason.id>`. `payload.reasons` includes the reasons the reviewer added and the whys they picked (`added: true`); each gets its own entry.
96
+
97
+ | Field | Value |
98
+ |---|---|
99
+ | `proposedValue` | `reason.proposedWeight`; `null` when `reason.added` |
100
+ | `finalValue` | `reason.weight` |
101
+ | `disposition` | `added`: `Accepted`. `weight === proposedWeight`: `Accepted`. `weight === 'Not relevant'`: `Rejected`. Otherwise `Rewritten` |
102
+ | `proposedBy` | `added`: `{ identity: payload.reviewerId, kind: 'Person' }`. Otherwise `{ identity: reason.source ?? proposedBy, kind: 'Agent' }`, or `'Automation'` when an automation proposed it |
103
+
104
+ ### `data`: one entry per final-details field
105
+
106
+ Key: `field.id`.
107
+
108
+ | Field | Value |
109
+ |---|---|
110
+ | `proposedValue` | `field.byDecision[acceptedOutcome]`, falling back to the recommended outcome's entry |
111
+ | `finalValue` | `field.value` |
112
+ | `disposition` | `Accepted` when `finalValue` equals `proposedValue`, otherwise `Rewritten` |
113
+ | `proposedBy` | `{ identity: proposedBy, kind: 'Agent' }`, or `'Automation'` as the use case says |
114
+
115
+ ### `data`: one entry per fact (`FactWeighing`)
116
+
117
+ `FactWeighing` returns a `FactWeighingPayload`: the `ReviewPayload` plus `facts` and `rationale`. Key each fact `fact.<fact.id>`.
118
+
119
+ | Field | Value |
120
+ |---|---|
121
+ | `proposedValue` | `fact.agentRead` |
122
+ | `finalValue` | `fact.weight` |
123
+ | `disposition` | `Accepted` when `fact.setBy === 'model'` or `weight` equals `agentRead`, otherwise `Rewritten` |
124
+ | `proposedBy` | `{ identity: proposedBy, kind: 'Agent' }` |
125
+
126
+ Append `rationale.text` to `explicitEvidences` when not empty.
127
+
128
+ ### `data`: Next time
129
+
130
+ When `payload.nextTimeId` is not empty, add key `nextTime`: `proposedValue` `null`, `finalValue` `{ text: payload.nextTimeText, scope: payload.nextTimeScope, conditions: payload.nextTimeConditions }`, `disposition` `Accepted`, `proposedBy` `{ identity: proposedBy, kind: 'Agent' }`.
131
+
132
+ These dispositions match how the Decisions backend classifies Action Center tasks (a changed value is `Rewritten`, an unchanged one `Accepted`), so `decisions.query({ hasOverrides: true })` finds overrides from both kinds of app.
133
+
134
+ Import `DecisionCreateInput` and `DecisionFieldData` from `@uipath/uipath-typescript/traces`. Never declare the request shape by hand.
135
+
136
+ ### Identifiers
137
+
138
+ | Value | Format | How the app gets it |
139
+ |---|---|---|
140
+ | `decisionId` | 16 lowercase hex characters | 8 bytes from `crypto.getRandomValues`, each as two hex digits, per submit |
141
+ | `traceId` | 32 lowercase hex characters | 16 bytes the same way, once per review, so a resubmit of the same review reuses it |
142
+ | `folderKey` | Orchestrator folder GUID | The `<meta name="uipath:folder-key">` tag the platform injects at deploy, so a deploy into another folder writes there. A Vite env value only for local runs where the tag is missing |
143
+
144
+ `decisions.create` validates all three and throws `ValidationError` on a malformed value.
145
+
146
+ ### Submit
147
+
148
+ ```typescript
149
+ import { Decisions } from '@uipath/uipath-typescript/traces';
150
+ import type { ReviewPayload } from '@uipath/ui-widgets-decisions-and-reasons/preview';
151
+
152
+ const decisions = new Decisions(sdk);
153
+ const folderKey =
154
+ document.querySelector('meta[name="uipath:folder-key"]')?.getAttribute('content') ??
155
+ import.meta.env.VITE_UIPATH_FOLDER_KEY;
156
+
157
+ const submitDecision = async (outcome: string, payload: ReviewPayload) => {
158
+ const decision = buildDecision({ payload, outcome, outcomes, proposedBy, processName });
159
+ const [ack] = await decisions.create(traceId, [decision], folderKey);
160
+ return ack.feedbackId;
161
+ };
162
+ ```
163
+
164
+ Pass `submitDecision` as `onComplete`. Reuse the SDK instance from `useAuth()`, never a second `UiPath`. On failure show one plain sentence in the page, keep the reviewer's choices, and allow resubmit with the same `traceId`.
165
+
166
+ ### Read it back
167
+
168
+ `decisions.query({ platform: 'CodedApp', traceId })` returns the written Decision. In the Decision Ledger, filter Platform to CodedApp.
169
+
170
+ ## Critical Rules
171
+
172
+ 1. Use a format from the widget package, or compose one from its primitives and `useDecisionCapture`. Never hand-build weight menus, reason chips or outcome cards, and never make a free-text box the main input.
173
+ 2. Never pre-select an outcome. Mark the proposed outcome `recommended: true`.
174
+ 3. Every outcome the reviewer can choose is in `outcomes`. The clicked one is `acceptedOutcome`, the others are `rejectedOutcomes`. Never add a `decision` entry to `data`.
175
+ 4. Every reason in `payload.reasons`, including added ones, every field in `payload.fields` and, for `FactWeighing`, every fact in `payload.facts` gets its own `data` entry with `proposedValue`, `finalValue`, `disposition` and `proposedBy`.
176
+ 5. A part the reviewer added has `proposedBy.kind` `'Person'` and the reviewer's identity. Everything else names its real proposer.
177
+ 6. In a Coded Web App, build the request with `DecisionCreateInput` from `@uipath/uipath-typescript/traces` and send it with `decisions.create`. Never call the Decisions endpoint with `fetch`.
178
+ 7. In a Coded Action App, complete the task with the payload and let Action Center write the Decision. Never also call `decisions.create`, which writes a second Decision.
179
+ 8. `platform` is `'CodedApp'` for a Coded Web App.
180
+ 9. `decisionId` is 16 lowercase hex characters generated by the app, never a GUID.
181
+ 10. Read `folderKey` from the `uipath:folder-key` meta tag. Never hardcode a folder, tenant or user identifier, and never bake the folder into the build.
182
+ 11. Resolve `onComplete` only after the write resolves.
183
+ 12. Leave `implicitSignals` unset. Never write raw cursor paths, keystrokes or typed text into any `data` entry.
184
+ 13. Use an export name only if the installed `dist/preview.d.ts` exports it.
185
+
186
+ ## Anti-patterns
187
+
188
+ - Writing only the outcome and dropping the reasons or final details from `data`.
189
+ - Mapping every part to `Accepted` regardless of what the reviewer changed.
190
+ - One `data` entry holding the whole payload as a blob.
191
+ - Declaring a local `Decision` type that duplicates the SDK's.
192
+ - A GUID or a timestamp-based string as `decisionId`.
193
+ - Completing the widget before `decisions.create` resolves.
194
+ - Asking the developer "do you want decision capture?" instead of reading the request.
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
- "skillsVersion": "1.206.0-preview.1718",
3
+ "skillsVersion": "1.206.0",
4
4
  "targetCli": "^1.206.0"
5
5
  }