@uipath/skills 1.199.0 → 1.200.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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/CODEOWNERS +14 -8
- package/README.md +18 -3
- package/assets/skill-status.json +9 -1
- package/assets/uip-catalog-snapshot.json +227 -21
- package/package.json +11 -2
- package/scripts/npm-package-lifecycle.mjs +46 -0
- package/skills/uipath-admin/SKILL.md +5 -1
- package/skills/uipath-admin/references/audit-commands.md +1 -1
- package/skills/uipath-admin/references/audit-workflow-guide.md +9 -0
- package/skills/uipath-agents/SKILL.md +2 -2
- package/skills/uipath-agents/references/lowcode/capabilities/context/index.md +7 -0
- package/skills/uipath-agents/references/lowcode/capabilities/integration-service/integration-service.md +5 -6
- package/skills/uipath-agents/references/lowcode/critical-rules/critical-rules.md +1 -1
- package/skills/uipath-agents/references/lowcode/evaluations/evaluation-sets.md +5 -0
- package/skills/uipath-agents/references/lowcode/project-lifecycle.md +3 -3
- package/skills/uipath-agents/references/lowcode/prompting/autonomous-agent-prompting-guide.md +3 -2
- package/skills/uipath-api-workflow/SKILL.md +2 -1
- package/skills/uipath-api-workflow/references/cli-reference.md +3 -3
- package/skills/uipath-coded-apps/SKILL.md +3 -2
- package/skills/uipath-coded-apps/assets/fixtures/governance-dashboard-starter-kit.tar.gz +0 -0
- package/skills/uipath-coded-apps/assets/templates/web-app-template.md +1 -1
- package/skills/uipath-coded-apps/references/create-web-app.md +60 -48
- package/skills/uipath-coded-apps/references/dashboards/CAPABILITY.md +2 -2
- package/skills/uipath-coded-apps/references/dashboards/plugins/build/impl.md +2 -2
- package/skills/uipath-coded-apps/references/dashboards/primitives/tier-resolution.md +16 -16
- package/skills/uipath-coded-apps/references/oauth-scopes.md +28 -272
- package/skills/uipath-coded-apps/references/sdk/action-center.md +26 -243
- package/skills/uipath-coded-apps/references/sdk/agents.md +20 -130
- package/skills/uipath-coded-apps/references/sdk/conversational-agent.md +52 -706
- package/skills/uipath-coded-apps/references/sdk/data-fabric.md +20 -237
- package/skills/uipath-coded-apps/references/sdk/feedback.md +4 -139
- package/skills/uipath-coded-apps/references/sdk/governance-traces.md +7 -55
- package/skills/uipath-coded-apps/references/sdk/governance.md +4 -44
- package/skills/uipath-coded-apps/references/sdk/imports.md +77 -35
- package/skills/uipath-coded-apps/references/sdk/maestro.md +29 -406
- package/skills/uipath-coded-apps/references/sdk/orchestrator.md +30 -324
- package/skills/uipath-coded-apps/references/sdk/pagination.md +9 -67
- package/skills/uipath-coded-apps/references/sdk/traces.md +8 -43
- package/skills/uipath-functions/SKILL.md +23 -23
- package/skills/uipath-governance/SKILL.md +5 -4
- package/skills/uipath-governance/references/cli-cheatsheet.md +2 -1
- package/skills/uipath-governance/references/compliance-pack/coverage/impl.md +143 -58
- package/skills/uipath-governance/references/compliance-pack/restore/impl.md +61 -0
- package/skills/uipath-human-in-the-loop/SKILL.md +4 -2
- package/skills/uipath-insights/SKILL.md +17 -18
- package/skills/uipath-ixp/SKILL.md +12 -7
- package/skills/uipath-ixp/references/cli-reference.md +71 -9
- package/skills/uipath-ixp/references/improve-prompts-guide.md +23 -9
- package/skills/uipath-ixp/references/label-documents-guide.md +33 -5
- package/skills/uipath-maestro-bpmn/SKILL.md +15 -14
- package/skills/uipath-maestro-bpmn/references/cli-conventions.md +15 -6
- package/skills/uipath-maestro-bpmn/references/structural-bpmn.md +18 -17
- package/skills/uipath-maestro-case/SKILL.md +46 -33
- package/skills/uipath-maestro-case/assets/templates/sdd-template.md +77 -37
- package/skills/uipath-maestro-case/assets/templates/sdd-viewer.html +0 -2
- package/skills/uipath-maestro-case/references/bindings-and-expressions.md +3 -1
- package/skills/uipath-maestro-case/references/bindings-v2-sync.md +2 -2
- package/skills/uipath-maestro-case/references/brownfield.md +15 -5
- package/skills/uipath-maestro-case/references/case-commands.md +19 -3
- package/skills/uipath-maestro-case/references/case-editing-operations.md +24 -21
- package/skills/uipath-maestro-case/references/case-schema.md +38 -16
- package/skills/uipath-maestro-case/references/connector-trigger-common.md +15 -8
- package/skills/uipath-maestro-case/references/evals/evals.json +35 -18
- package/skills/uipath-maestro-case/references/implementation.md +86 -71
- package/skills/uipath-maestro-case/references/phase-0-interview.md +92 -23
- package/skills/uipath-maestro-case/references/phased-execution.md +70 -55
- package/skills/uipath-maestro-case/references/placeholder-tasks.md +5 -5
- package/skills/uipath-maestro-case/references/planning.md +57 -9
- package/skills/uipath-maestro-case/references/plugins/case/impl-json.md +7 -5
- package/skills/uipath-maestro-case/references/plugins/case/planning.md +1 -1
- package/skills/uipath-maestro-case/references/plugins/conditions/case-exit-conditions/impl-json.md +5 -5
- package/skills/uipath-maestro-case/references/plugins/conditions/stage-entry-conditions/impl-json.md +41 -5
- package/skills/uipath-maestro-case/references/plugins/conditions/stage-entry-conditions/planning.md +27 -3
- package/skills/uipath-maestro-case/references/plugins/conditions/stage-exit-conditions/impl-json.md +6 -6
- package/skills/uipath-maestro-case/references/plugins/conditions/stage-exit-conditions/planning.md +3 -1
- package/skills/uipath-maestro-case/references/plugins/conditions/task-entry-conditions/impl-json.md +20 -7
- package/skills/uipath-maestro-case/references/plugins/conditions/task-entry-conditions/planning.md +37 -4
- package/skills/uipath-maestro-case/references/plugins/sla/impl-json.md +24 -13
- package/skills/uipath-maestro-case/references/plugins/sla/planning.md +9 -3
- package/skills/uipath-maestro-case/references/plugins/stages/impl-json.md +4 -0
- package/skills/uipath-maestro-case/references/plugins/stages/planning.md +4 -1
- package/skills/uipath-maestro-case/references/plugins/tasks/action/impl-json.md +3 -1
- package/skills/uipath-maestro-case/references/plugins/tasks/action/planning.md +2 -0
- package/skills/uipath-maestro-case/references/plugins/tasks/agent/impl-json.md +3 -2
- package/skills/uipath-maestro-case/references/plugins/tasks/agent/planning.md +4 -2
- package/skills/uipath-maestro-case/references/plugins/tasks/api-workflow/impl-json.md +3 -2
- package/skills/uipath-maestro-case/references/plugins/tasks/api-workflow/planning.md +4 -2
- package/skills/uipath-maestro-case/references/plugins/tasks/case-management/impl-json.md +3 -2
- package/skills/uipath-maestro-case/references/plugins/tasks/case-management/planning.md +4 -2
- package/skills/uipath-maestro-case/references/plugins/tasks/connector-activity/impl-json.md +1 -1
- package/skills/uipath-maestro-case/references/plugins/tasks/connector-activity/planning.md +2 -0
- package/skills/uipath-maestro-case/references/plugins/tasks/connector-trigger/impl-json.md +1 -1
- package/skills/uipath-maestro-case/references/plugins/tasks/connector-trigger/planning.md +2 -0
- package/skills/uipath-maestro-case/references/plugins/tasks/create-inline-common.md +1 -1
- package/skills/uipath-maestro-case/references/plugins/tasks/process/impl-json.md +3 -2
- package/skills/uipath-maestro-case/references/plugins/tasks/process/planning.md +6 -4
- package/skills/uipath-maestro-case/references/plugins/tasks/rpa/impl-json.md +3 -2
- package/skills/uipath-maestro-case/references/plugins/tasks/rpa/planning.md +4 -2
- package/skills/uipath-maestro-case/references/plugins/tasks/wait-for-timer/impl-json.md +4 -3
- package/skills/uipath-maestro-case/references/plugins/tasks/wait-for-timer/planning.md +4 -0
- package/skills/uipath-maestro-case/references/plugins/triggers/event/impl-json.md +17 -14
- package/skills/uipath-maestro-case/references/plugins/triggers/event/planning.md +1 -1
- package/skills/uipath-maestro-case/references/plugins/triggers/manual/impl-json.md +13 -10
- package/skills/uipath-maestro-case/references/plugins/triggers/timer/impl-json.md +18 -16
- package/skills/uipath-maestro-case/references/plugins/triggers/timer/planning.md +2 -2
- package/skills/uipath-maestro-case/references/plugins/variables/bindings/impl-json.md +1 -1
- package/skills/uipath-maestro-case/references/plugins/variables/global-vars/impl-json.md +11 -9
- package/skills/uipath-maestro-case/references/plugins/variables/io-binding/impl-json.md +6 -2
- package/skills/uipath-maestro-case/references/plugins/variables/io-binding/planning.md +19 -1
- package/skills/uipath-maestro-case/references/registry-discovery.md +3 -3
- package/skills/uipath-maestro-case/references/sdd-generation-rules.md +155 -51
- package/skills/uipath-maestro-case/references/sla-response-shapes.md +74 -0
- package/skills/uipath-maestro-flow/SKILL.md +4 -3
- package/skills/uipath-maestro-flow/references/author/CAPABILITY.md +3 -0
- package/skills/uipath-maestro-flow/references/author/references/editing-operations-json.md +10 -17
- package/skills/uipath-maestro-flow/references/author/references/editing-operations.md +1 -1
- package/skills/uipath-maestro-flow/references/author/references/greenfield.md +8 -6
- package/skills/uipath-maestro-flow/references/author/references/planning-impl.md +1 -1
- package/skills/uipath-maestro-flow/references/author/references/plugins/agent/impl.md +4 -9
- package/skills/uipath-maestro-flow/references/author/references/plugins/agentic-process/impl.md +3 -7
- package/skills/uipath-maestro-flow/references/author/references/plugins/api-workflow/impl.md +5 -8
- package/skills/uipath-maestro-flow/references/author/references/plugins/connector/impl.md +11 -4
- package/skills/uipath-maestro-flow/references/author/references/plugins/flow/impl.md +3 -7
- package/skills/uipath-maestro-flow/references/author/references/plugins/inline-agent/impl.md +14 -17
- package/skills/uipath-maestro-flow/references/author/references/plugins/ixp/impl.md +60 -13
- package/skills/uipath-maestro-flow/references/author/references/plugins/queue/impl.md +2 -14
- package/skills/uipath-maestro-flow/references/author/references/plugins/rpa/impl.md +4 -9
- package/skills/uipath-maestro-flow/references/author/references/plugins/script/impl.md +3 -0
- package/skills/uipath-maestro-flow/references/author/references/plugins/subflow/impl.md +5 -9
- package/skills/uipath-maestro-flow/references/author/references/plugins/transform/impl.md +13 -0
- package/skills/uipath-maestro-flow/references/shared/action-nodes.md +2 -2
- package/skills/uipath-maestro-flow/references/shared/file-format.md +16 -12
- package/skills/uipath-maestro-flow/references/shared/variables-and-expressions.md +3 -3
- package/skills/uipath-planner/SKILL.md +1 -1
- package/skills/uipath-planner/references/non-pdd-lane-guide.md +1 -1
- package/skills/uipath-platform/SKILL.md +1 -1
- package/skills/uipath-platform/references/data-fabric/bulk-import.md +10 -27
- package/skills/uipath-platform/references/data-fabric/choice-sets.md +7 -64
- package/skills/uipath-platform/references/data-fabric/data-fabric.md +76 -267
- package/skills/uipath-platform/references/data-fabric/entity-schema.md +23 -99
- package/skills/uipath-platform/references/data-fabric/file-attachments.md +5 -28
- package/skills/uipath-platform/references/data-fabric/filter-platform-contract.md +2 -2
- package/skills/uipath-platform/references/data-fabric/records-query.md +11 -32
- package/skills/uipath-platform/references/integration-service/reference-resolution.md +6 -2
- package/skills/uipath-platform/references/licensing/consumables-report.md +18 -0
- package/skills/uipath-platform/references/licensing/licensing.md +1 -1
- package/skills/uipath-platform/references/orchestrator/run-jobs.md +9 -2
- package/skills/uipath-platform/references/orchestrator/setup-environment.md +9 -0
- package/skills/uipath-platform/references/traces/feedback.md +4 -1
- package/skills/uipath-process-mining/SKILL.md +97 -0
- package/skills/uipath-process-mining/references/app-types.md +66 -0
- package/skills/uipath-process-mining/references/data-model.md +130 -0
- package/skills/uipath-process-mining/references/lifecycle-and-rbac.md +67 -0
- package/skills/uipath-process-mining/references/model-editing.md +112 -0
- package/skills/uipath-process-mining/references/pre-flight.md +119 -0
- package/skills/uipath-process-mining/references/querying.md +66 -0
- package/skills/uipath-process-mining/references/transformations.md +80 -0
- package/skills/uipath-process-mining/references/uip-pm-cli.md +145 -0
- package/skills/uipath-review/SKILL.md +23 -18
- package/skills/uipath-review/references/agents/agent-grading-rubric.md +1 -1
- package/skills/uipath-review/references/agents/agent-review-checklist.md +0 -4
- package/skills/uipath-review/references/agents/agents-coded-rules.md +1 -10
- package/skills/uipath-review/references/agents/agents-lowcode-rules.md +3 -6
- package/skills/uipath-review/references/agents/guardrails/coded-guardrails-review.md +62 -14
- package/skills/uipath-review/references/agents/guardrails/guardrails-review.md +60 -4
- package/skills/uipath-review/references/review-workflow-guide.md +3 -2
- package/skills/uipath-review/references/rule-catalog-workflow.md +4 -5
- package/skills/uipath-rpa/.maintenance/pattern-card-maintenance.md +20 -0
- package/skills/uipath-rpa/SKILL.md +57 -55
- package/skills/uipath-rpa/agents/uipath-project-discovery-agent.md +75 -19
- package/skills/uipath-rpa/assets/codedworkflow-template.md +245 -11
- package/skills/uipath-rpa/references/cli-reference.md +229 -6
- package/skills/uipath-rpa/references/coded/codedworkflow-reference.md +158 -2
- package/skills/uipath-rpa/references/coded/integration-service-guide.md +6 -5
- package/skills/uipath-rpa/references/coded/operations-guide.md +273 -5
- package/skills/uipath-rpa/references/coded-vs-xaml-guide.md +3 -3
- package/skills/uipath-rpa/references/common-pattern-card.md +303 -0
- package/skills/uipath-rpa/references/data-manipulation-guide.md +18 -3
- package/skills/uipath-rpa/references/debugging.md +0 -2
- package/skills/uipath-rpa/references/environment-setup.md +309 -1
- package/skills/uipath-rpa/references/error-handling-guide.md +1 -1
- package/skills/uipath-rpa/references/execution-maps-guide.md +110 -0
- package/skills/uipath-rpa/references/is-connector-xaml-guide.md +58 -4
- package/skills/uipath-rpa/references/legacy/activity-docs/Excel.md +1 -1
- package/skills/uipath-rpa/references/legacy/activity-docs/_DU-PROCESS.md +0 -2
- package/skills/uipath-rpa/references/legacy/activity-docs/_INDEX.md +2 -2
- package/skills/uipath-rpa/references/legacy/activity-docs/_PATTERNS.md +1 -1
- package/skills/uipath-rpa/references/legacy/activity-docs/_REFRAMEWORK.md +2 -7
- package/skills/uipath-rpa/references/legacy/cli-reference.md +599 -0
- package/skills/uipath-rpa/references/legacy/error-handling-guide.md +2 -2
- package/skills/uipath-rpa/references/legacy/legacy-mode-guide.md +16 -16
- package/skills/uipath-rpa/references/legacy/project-organization-guide.md +2 -2
- package/skills/uipath-rpa/references/legacy/selector-guide.md +163 -1
- package/skills/uipath-rpa/references/legacy/testing-guide.md +246 -3
- package/skills/uipath-rpa/references/legacy/xaml-basics-and-rules.md +267 -2
- package/skills/uipath-rpa/references/library-authoring-guide.md +4 -3
- package/skills/uipath-rpa/references/testing-guide.md +2 -28
- package/skills/uipath-rpa/references/trigger-pattern-guide.md +1 -1
- package/skills/uipath-rpa/references/xaml/canvas-layout-guide.md +140 -33
- package/skills/uipath-rpa/references/xaml/common-pitfalls.md +57 -240
- package/skills/uipath-rpa/references/xaml/csharp-activity-binding-guide.md +42 -2
- package/skills/uipath-rpa/references/xaml/long-running-workflow-guide.md +1 -1
- package/skills/uipath-rpa/references/xaml/xaml-basics-and-rules.md +194 -228
- package/skills/uipath-solution/references/activate-and-manage.md +22 -0
- package/skills/uipath-solution/references/develop-solution.md +26 -2
- package/skills/uipath-solution/references/pack-and-deploy.md +43 -9
- package/skills/uipath-test/SKILL.md +4 -4
- package/skills/uipath-test/references/playwright-first-mile-guide.md +5 -4
- package/skills/uipath-test/references/publish-and-link-guide.md +2 -2
- package/skills/uipath-troubleshoot/references/activity-packages/classic-activities/playbooks/click-silent-no-op.md +5 -5
- package/skills/uipath-troubleshoot/references/activity-packages/classic-activities/playbooks/queue-operation-failed.md +20 -4
- package/skills/uipath-troubleshoot/references/activity-packages/classic-activities/summary.md +1 -1
- package/skills/uipath-troubleshoot/references/activity-packages/csv-activities/playbooks/read-csv-file-not-found.md +12 -0
- package/skills/uipath-troubleshoot/references/activity-packages/mail-activities/playbooks/send-outlook-mail-failures.md +12 -1
- package/skills/uipath-troubleshoot/references/activity-packages/system-activities/playbooks/get-asset-activity-bug-silent-failure.md +2 -1
- package/skills/uipath-troubleshoot/references/activity-packages/terminal-activities/playbooks/terminal-session-connection-failed.md +5 -1
- package/skills/uipath-troubleshoot/references/activity-packages/ui-automation/playbooks/click-silent-no-op.md +5 -5
- package/skills/uipath-troubleshoot/references/activity-packages/ui-automation/playbooks/dependency-version-conflict.md +27 -6
- package/skills/uipath-troubleshoot/references/activity-packages/ui-automation/playbooks/napplicationcard-view-generation-failed.md +10 -0
- package/skills/uipath-troubleshoot/references/activity-packages/ui-automation/playbooks/scope-container-wrong-page.md +1 -1
- package/skills/uipath-troubleshoot/references/activity-packages/ui-automation/summary.md +1 -1
- package/skills/uipath-troubleshoot/references/activity-packages/web-activities/overview.md +4 -0
- package/skills/uipath-troubleshoot/references/activity-packages/web-activities/playbooks/http-request-auth-401-403.md +44 -0
- package/skills/uipath-troubleshoot/references/activity-packages/web-activities/playbooks/http-request-connection-failure.md +2 -1
- package/skills/uipath-troubleshoot/references/activity-packages/web-activities/playbooks/http-request-content-type-rejected.md +37 -0
- package/skills/uipath-troubleshoot/references/activity-packages/web-activities/playbooks/http-request-proxy-blocked.md +39 -0
- package/skills/uipath-troubleshoot/references/activity-packages/web-activities/playbooks/package-version-mismatch.md +42 -0
- package/skills/uipath-troubleshoot/references/activity-packages/web-activities/playbooks/securestring-misuse-analyzer.md +41 -0
- package/skills/uipath-troubleshoot/references/activity-packages/web-activities/summary.md +5 -0
- package/skills/uipath-troubleshoot/references/products/integration-service/playbooks/connector-null-reference.md +14 -1
- package/skills/uipath-troubleshoot/references/products/integration-service/playbooks/connector-runtime-exception.md +2 -0
- package/skills/uipath-troubleshoot/references/products/integration-service/playbooks/is-activities-prerelease-not-found.md +39 -0
- package/skills/uipath-troubleshoot/references/products/integration-service/playbooks/response-content-too-large.md +41 -0
- package/skills/uipath-troubleshoot/references/products/integration-service/summary.md +9 -0
- package/skills/uipath-troubleshoot/references/products/orchestrator/playbooks/console-conflict-login-to-console.md +40 -0
- package/skills/uipath-troubleshoot/references/products/orchestrator/playbooks/credential-store-unavailable.md +42 -0
- package/skills/uipath-troubleshoot/references/products/orchestrator/playbooks/executor-start-transient-rerun.md +49 -0
- package/skills/uipath-troubleshoot/references/products/orchestrator/playbooks/job-consecutive-system-exceptions.md +47 -0
- package/skills/uipath-troubleshoot/references/products/orchestrator/playbooks/job-faulted-session-timeout.md +19 -19
- package/skills/uipath-troubleshoot/references/products/orchestrator/playbooks/job-output-too-large.md +47 -0
- package/skills/uipath-troubleshoot/references/products/orchestrator/playbooks/job-stopped-generic-exit-code.md +55 -0
- package/skills/uipath-troubleshoot/references/products/orchestrator/playbooks/known-issue-robot-defect.md +40 -0
- package/skills/uipath-troubleshoot/references/products/orchestrator/playbooks/platform-incident-correlation.md +45 -0
- package/skills/uipath-troubleshoot/references/products/orchestrator/playbooks/screen-capture-handle-invalid.md +43 -0
- package/skills/uipath-troubleshoot/references/products/orchestrator/playbooks/serverless-license-quota.md +43 -0
- package/skills/uipath-troubleshoot/references/products/orchestrator/playbooks/serverless-time-limit-exceeded.md +34 -0
- package/skills/uipath-troubleshoot/references/products/orchestrator/playbooks/workstation-in-use-machine-slots.md +40 -0
- package/skills/uipath-troubleshoot/references/products/orchestrator/summary.md +13 -1
- package/version-manifest.json +2 -2
- package/skills/uipath-maestro-bpmn/validator/README.md +0 -224
- package/skills/uipath-maestro-bpmn/validator/model.mjs +0 -419
- package/skills/uipath-maestro-bpmn/validator/package.json +0 -17
- package/skills/uipath-maestro-bpmn/validator/rules.mjs +0 -1403
- package/skills/uipath-maestro-bpmn/validator/samples/invalid-conditional-and-variable.bpmn +0 -25
- package/skills/uipath-maestro-bpmn/validator/samples/valid-baseline.bpmn +0 -52
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/A.2.0.bpmn +0 -157
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/A.2.1.bpmn +0 -333
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/B.1.0.bpmn +0 -598
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/B.2.0.bpmn +0 -1709
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/C.2.0.bpmn +0 -564
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/C.3.0.bpmn +0 -671
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/C.4.0.bpmn +0 -1045
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/C.5.0.bpmn +0 -1176
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/C.6.0.bpmn +0 -670
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/C.7.0.bpmn +0 -466
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/Can_Parse_Complex_Process_With_Task_Gateway_BoundaryEvent_etc.bpmn +0 -74
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/ExclusiveGatewayDefaultFlow.bpmn +0 -32
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/ExternalAgentWorkflow.bpmn +0 -62
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/Golden_Scenario.initial.bpmn +0 -361
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/InclusiveJoinRouteAwayBranch.bpmn +0 -62
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/Parse_AsyncExecution_And_Create_CorrectModel.bpmn +0 -74
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/Parse_IXP_ExtractionValidation_And_Create_CorrectModel.bpmn +0 -35
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/Parse_IXP_Extraction_FileUpload_And_Create_CorrectModel.bpmn +0 -33
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/Parse_IXP_Extraction_JobAttachment_And_Create_CorrectModel.bpmn +0 -35
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/Parse_SubProcess_With_Multiple_Element_Types.bpmn +0 -76
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/StartEventWithOutputs.bpmn +0 -36
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/StartGatewayEnd.bpmn +0 -44
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/all elements.bpmn +0 -516
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/all_sequence_flow_types.bpmn +0 -173
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/demo.bpmn +0 -181
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/subprocess-example-001-collapsed.bpmn +0 -126
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/subprocess-example-001-expanded.bpmn +0 -122
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/expected-findings/subprocess-example-003-collapsed_deeply-nested.bpmn +0 -438
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/A.1.0.bpmn +0 -87
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/A.3.0.bpmn +0 -165
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/ApiWorkflow.bpmn +0 -39
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/BpmnNestedSubProcessTests.bpmn +0 -102
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/BpmnTimerBoundaryEvents.bpmn +0 -160
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/BpmnXmlWithCatchAllErrorEventSubProcess.bpmn +0 -45
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/BpmnXmlWithSpecificErrorEventSubProcess.bpmn +0 -46
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/CaseManagementWithConstantIdentifier.bpmn +0 -218
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/ErrorBoundary.bpmn +0 -78
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/ErrorPropagationInEventSubprocess.bpmn +0 -340
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/EventBasedGatewayFirstCatcherWins.bpmn +0 -56
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/Example-EventBasedGateway.bpmn +0 -117
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/ExclusiveGatewayConditional.bpmn +0 -45
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/ExclusiveGatewaySharedEndEvent.bpmn +0 -45
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/ExclusiveWithParallelGateway.bpmn +0 -68
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/FourScriptTasks.bpmn +0 -84
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/HitlTaskOnly.bpmn +0 -55
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/InclusiveGatewayForkJoin.bpmn +0 -69
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/Parse_BPMN_Elements_And_Create_CorrectModel.bpmn +0 -20
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/Parse_HttpRequest_ServiceTask_And_Create_Correct_Model.bpmn +0 -34
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/Parse_MessageBoundaryEvent_And_Create_CorrectModel.bpmn +0 -87
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/Parse_Script_Task_V2_And_Create_Correct_Model.bpmn +0 -31
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/Parse_Sets_Containers_Properly.bpmn +0 -129
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/ScriptWritesVariableThenGatewayBranches.bpmn +0 -59
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/boundaryevent.bpmn +0 -30
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/collapsed-subprocess.bpmn +0 -83
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/connectable-types.bpmn +0 -85
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/extensions-orchestrator-start-job.bpmn +0 -80
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/multiparticipantpool.bpmn +0 -77
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/nestedsubprocess.bpmn +0 -36
- package/skills/uipath-maestro-bpmn/validator/test/fixtures/known-good/simple.bpmn +0 -59
- package/skills/uipath-maestro-bpmn/validator/test/integration.test.mjs +0 -146
- package/skills/uipath-maestro-bpmn/validator/test/model-helpers.mjs +0 -42
- package/skills/uipath-maestro-bpmn/validator/test/ported-rule-tests.mjs +0 -983
- package/skills/uipath-maestro-bpmn/validator/test/run-tests.mjs +0 -530
- package/skills/uipath-maestro-bpmn/validator/uipath-moddle.v1.json +0 -715
- package/skills/uipath-maestro-bpmn/validator/validate-bpmn.mjs +0 -164
- package/skills/uipath-review/references/agents/agents-common-rules.md +0 -32
- package/skills/uipath-rpa/assets/before-after-hooks-template.md +0 -115
- package/skills/uipath-rpa/assets/helper-utility-template.md +0 -22
- package/skills/uipath-rpa/assets/testcase-template.md +0 -92
- package/skills/uipath-rpa/references/coded/coding-guidelines.md +0 -255
- package/skills/uipath-rpa/references/coded/inspect-package-guide.md +0 -80
- package/skills/uipath-rpa/references/coded/third-party-packages-guide.md +0 -67
- package/skills/uipath-rpa/references/connector-capabilities.md +0 -79
- package/skills/uipath-rpa/references/legacy/activity-docs/Testing.md +0 -95
- package/skills/uipath-rpa/references/legacy/activity-docs/UIAutomation.md +0 -159
- package/skills/uipath-rpa/references/legacy/common-pitfalls.md +0 -318
- package/skills/uipath-rpa/references/legacy/discovery-workflow.md +0 -147
- package/skills/uipath-rpa/references/legacy/environment-setup.md +0 -78
- package/skills/uipath-rpa/references/legacy/project-structure.md +0 -206
- package/skills/uipath-rpa/references/legacy/test-data-guide.md +0 -142
- package/skills/uipath-rpa/references/legacy/validation-and-fixing.md +0 -154
- package/skills/uipath-rpa/references/project-structure-guide.md +0 -168
- package/skills/uipath-rpa/references/project-structure.md +0 -135
- package/skills/uipath-rpa/references/publishing-guide.md +0 -80
- package/skills/uipath-rpa/references/validation-guide.md +0 -170
- package/skills/uipath-rpa/references/xaml/csharp-expression-pitfalls.md +0 -43
- package/skills/uipath-rpa/references/xaml/flowchart-guide.md +0 -113
- package/skills/uipath-rpa/references/xaml/workflow-guide.md +0 -258
|
@@ -1,734 +1,80 @@
|
|
|
1
|
-
# Conversational Agent
|
|
1
|
+
# Conversational Agent — Session Choreography & Chat Wiring
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Signatures/params/examples for services, event-helper classes, options, enums: `dist/conversational-agent/index.d.ts`. Per-method scopes: shipped `docs/oauth-scopes.md`. This file covers only what neither can express.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
import { ConversationalAgent, Exchanges, Messages } from '@uipath/uipath-typescript/conversational-agent';
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Scopes
|
|
10
|
-
|
|
11
|
-
Combined scopes needed: `OR.Execution` `OR.Folders` `OR.Jobs` `ConversationalAgents` `Traces.Api`
|
|
12
|
-
|
|
13
|
-
- Agents (getAll, getById): `OR.Execution` or `OR.Execution.Read`
|
|
14
|
-
- Conversations (create): `OR.Execution`, `OR.Folders`, `OR.Jobs`
|
|
15
|
-
- Conversations (read): `OR.Execution` or `OR.Execution.Read`, `OR.Jobs` or `OR.Jobs.Read`
|
|
16
|
-
- Conversations (update/delete): `OR.Execution`, `OR.Jobs`
|
|
17
|
-
- Conversations (uploadAttachment / getAttachmentUploadUri): `OR.Execution`, `OR.Jobs`
|
|
18
|
-
- startSession: `OR.Execution`, `OR.Jobs`, `ConversationalAgents`
|
|
19
|
-
- Exchanges (read): `OR.Execution` or `OR.Execution.Read`, `OR.Jobs` or `OR.Jobs.Read`
|
|
20
|
-
- Feedback: `OR.Execution`, `OR.Jobs`, `Traces.Api`
|
|
21
|
-
- User Settings (getSettings): `OR.Users` or `OR.Users.Read`
|
|
22
|
-
- User Settings (updateSettings): `OR.Users`
|
|
23
|
-
|
|
24
|
-
## Types to Import
|
|
25
|
-
|
|
26
|
-
```typescript
|
|
27
|
-
// Agent types
|
|
28
|
-
import type {
|
|
29
|
-
RawAgentGetResponse,
|
|
30
|
-
RawAgentGetByIdResponse,
|
|
31
|
-
AgentGetResponse,
|
|
32
|
-
AgentGetByIdResponse,
|
|
33
|
-
AgentAppearance,
|
|
34
|
-
AgentStartingPrompt,
|
|
35
|
-
} from '@uipath/uipath-typescript/conversational-agent';
|
|
36
|
-
|
|
37
|
-
// Conversation types
|
|
38
|
-
import type {
|
|
39
|
-
RawConversationGetResponse,
|
|
40
|
-
ConversationGetResponse,
|
|
41
|
-
ConversationCreateResponse,
|
|
42
|
-
ConversationUpdateResponse,
|
|
43
|
-
ConversationDeleteResponse,
|
|
44
|
-
ConversationCreateOptions,
|
|
45
|
-
ConversationGetAllOptions,
|
|
46
|
-
ConversationUpdateOptions,
|
|
47
|
-
ConversationSessionOptions,
|
|
48
|
-
ConversationAttachmentUploadResponse,
|
|
49
|
-
ConversationAttachmentCreateResponse,
|
|
50
|
-
} from '@uipath/uipath-typescript/conversational-agent';
|
|
51
|
-
|
|
52
|
-
// Exchange types
|
|
53
|
-
import type {
|
|
54
|
-
ExchangeGetResponse,
|
|
55
|
-
ExchangeGetAllOptions,
|
|
56
|
-
ExchangeGetByIdOptions,
|
|
57
|
-
CreateFeedbackOptions,
|
|
58
|
-
FeedbackCreateResponse,
|
|
59
|
-
} from '@uipath/uipath-typescript/conversational-agent';
|
|
60
|
-
|
|
61
|
-
// Message types
|
|
62
|
-
import type {
|
|
63
|
-
MessageGetResponse,
|
|
64
|
-
ContentPartGetResponse,
|
|
65
|
-
} from '@uipath/uipath-typescript/conversational-agent';
|
|
66
|
-
|
|
67
|
-
// User settings types
|
|
68
|
-
import type {
|
|
69
|
-
UserSettingsGetResponse,
|
|
70
|
-
UserSettingsUpdateOptions,
|
|
71
|
-
UserSettingsUpdateResponse,
|
|
72
|
-
} from '@uipath/uipath-typescript/conversational-agent';
|
|
73
|
-
|
|
74
|
-
// Core conversation types
|
|
75
|
-
import type {
|
|
76
|
-
Exchange,
|
|
77
|
-
Message,
|
|
78
|
-
ContentPart,
|
|
79
|
-
ToolCall,
|
|
80
|
-
Citation,
|
|
81
|
-
Interrupt,
|
|
82
|
-
} from '@uipath/uipath-typescript/conversational-agent';
|
|
83
|
-
|
|
84
|
-
// Real-time session stream types
|
|
85
|
-
import type {
|
|
86
|
-
SessionStream,
|
|
87
|
-
ExchangeStream,
|
|
88
|
-
MessageStream,
|
|
89
|
-
ContentPartStream,
|
|
90
|
-
ToolCallStream,
|
|
91
|
-
} from '@uipath/uipath-typescript/conversational-agent';
|
|
92
|
-
|
|
93
|
-
// Event helper types (for real-time sessions)
|
|
94
|
-
import {
|
|
95
|
-
SessionEventHelper,
|
|
96
|
-
ExchangeEventHelper,
|
|
97
|
-
MessageEventHelper,
|
|
98
|
-
ContentPartEventHelper,
|
|
99
|
-
ToolCallEventHelper,
|
|
100
|
-
} from '@uipath/uipath-typescript/conversational-agent';
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
## Enums
|
|
104
|
-
|
|
105
|
-
```typescript
|
|
106
|
-
import {
|
|
107
|
-
MessageRole, // System, User, Assistant
|
|
108
|
-
InterruptType, // ToolCallConfirmation
|
|
109
|
-
FeedbackRating, // Positive, Negative
|
|
110
|
-
SortOrder, // Ascending, Descending
|
|
111
|
-
} from '@uipath/uipath-typescript/conversational-agent';
|
|
112
|
-
|
|
113
|
-
import { LogLevel } from '@uipath/uipath-typescript/conversational-agent';
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
## ConversationalAgent Service
|
|
117
|
-
|
|
118
|
-
The main entry point. Instantiate with the SDK instance.
|
|
119
|
-
|
|
120
|
-
```typescript
|
|
121
|
-
const conversationalAgent = new ConversationalAgent(sdk);
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### getAll(folderId?: number)
|
|
125
|
-
|
|
126
|
-
Returns `Promise<AgentGetResponse[]>`. Each agent has: `id`, `name`, `description`, `processVersion`, `processKey`, `folderId`, `feedId`, `createdTime`. Each returned agent also has attached methods (see Agent-Attached Methods below).
|
|
127
|
-
|
|
128
|
-
### getById(id: number, folderId: number)
|
|
129
|
-
|
|
130
|
-
Returns `Promise<AgentGetByIdResponse>`. Same fields as `AgentGetResponse` plus `appearance?: AgentAppearance` with optional `welcomeTitle`, `welcomeDescription`, and `startingPrompts: AgentStartingPrompt[]` (each has `displayPrompt`, `actualPrompt`, `id`).
|
|
131
|
-
|
|
132
|
-
### onConnectionStatusChanged(handler)
|
|
133
|
-
|
|
134
|
-
Registers a handler called whenever the WebSocket connection status changes. Returns cleanup function.
|
|
135
|
-
|
|
136
|
-
### conversations (property)
|
|
137
|
-
|
|
138
|
-
Access to `ConversationService` for conversation CRUD and real-time sessions. See Conversation Service below.
|
|
139
|
-
|
|
140
|
-
### user (property)
|
|
141
|
-
|
|
142
|
-
Access to `UserSettingsService` — the signed-in user's agent profile. See User Settings Service below.
|
|
143
|
-
|
|
144
|
-
## User Settings Service
|
|
145
|
-
|
|
146
|
-
Accessed via `conversationalAgent.user`. Manages the current user's conversational-agent profile (display name, contact, locale).
|
|
147
|
-
|
|
148
|
-
### getSettings()
|
|
149
|
-
|
|
150
|
-
Returns `Promise<UserSettingsGetResponse>`. Includes `name`, `email`, `role`, `department`, `company`, `country`, `timezone`, plus identifiers and timestamps. **Note:** Exact fields are not fully published; check the TypeScript types. Scope: `OR.Users` or `OR.Users.Read`.
|
|
151
|
-
|
|
152
|
-
### updateSettings(options: UserSettingsUpdateOptions)
|
|
153
|
-
|
|
154
|
-
Returns `Promise<UserSettingsUpdateResponse>`. Partial update — send only the fields you want to change; pass `null` to clear a field. Scope: `OR.Users`.
|
|
155
|
-
|
|
156
|
-
```typescript
|
|
157
|
-
const settings = await conversationalAgent.user.getSettings();
|
|
158
|
-
await conversationalAgent.user.updateSettings({ timezone: 'America/New_York', department: null });
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
## Agent-Attached Methods (AgentMethods)
|
|
162
|
-
|
|
163
|
-
Each agent returned by `getAll()` or `getById()` has these attached properties:
|
|
164
|
-
|
|
165
|
-
- `agent.conversations` — A scoped conversation service where `agentId` and `folderId` are pre-filled. Use `agent.conversations.create(options?)` instead of `conversationalAgent.conversations.create(agentId, folderId, options?)`.
|
|
166
|
-
- `agent.connectionStatus` — Current WebSocket `ConnectionStatus`
|
|
167
|
-
- `agent.isConnected` — `boolean`
|
|
168
|
-
- `agent.connectionError` — `Error | null`
|
|
169
|
-
|
|
170
|
-
## Conversation Service
|
|
171
|
-
|
|
172
|
-
Accessed via `conversationalAgent.conversations`.
|
|
173
|
-
|
|
174
|
-
### create(agentId: number, folderId: number, options?: ConversationCreateOptions)
|
|
175
|
-
|
|
176
|
-
Returns `Promise<ConversationCreateResponse>`. Options: `{ label?, autogenerateLabel?, traceId?, jobStartOverrides?: { runAsMe? } }`. The response is a `ConversationGetResponse` with attached methods.
|
|
177
|
-
|
|
178
|
-
**Via agent shorthand:** `agent.conversations.create(options?)` — agentId and folderId are auto-filled.
|
|
179
|
-
|
|
180
|
-
### getById(id: string)
|
|
181
|
-
|
|
182
|
-
Returns `Promise<ConversationGetResponse>` with attached methods.
|
|
183
|
-
|
|
184
|
-
### getAll(options?: ConversationGetAllOptions)
|
|
185
|
-
|
|
186
|
-
Returns `NonPaginatedResponse<ConversationGetResponse>` or `PaginatedResponse<ConversationGetResponse>`. Options extend `PaginationOptions` with `{ sort?: SortOrder }`. Token-based pagination.
|
|
187
|
-
|
|
188
|
-
### updateById(id: string, options: ConversationUpdateOptions)
|
|
189
|
-
|
|
190
|
-
Returns `Promise<ConversationUpdateResponse>`. Options: `{ label?, autogenerateLabel?, jobKey?, isLocalJobExecution? }`.
|
|
191
|
-
|
|
192
|
-
### deleteById(id: string)
|
|
193
|
-
|
|
194
|
-
Returns `Promise<ConversationDeleteResponse>`.
|
|
195
|
-
|
|
196
|
-
### uploadAttachment(id: string, file: File)
|
|
197
|
-
|
|
198
|
-
Returns `Promise<ConversationAttachmentUploadResponse>` with `{ uri, name, mimeType }`. Handles the two-step upload (create attachment entry, then upload to blob storage).
|
|
199
|
-
|
|
200
|
-
### getAttachmentUploadUri(conversationId: string, fileName: string)
|
|
201
|
-
|
|
202
|
-
Returns `Promise<ConversationAttachmentCreateResponse>` with `{ uri, name, fileUploadAccess }`. Lower-level alternative to `uploadAttachment` — registers the attachment and returns a pre-signed upload URL but does NOT upload bytes. Use this when you need to stream large files yourself or upload from a non-`File` source. Service-level only (no conversation-attached shorthand).
|
|
203
|
-
|
|
204
|
-
```typescript
|
|
205
|
-
const { uri, fileUploadAccess } = await conversationalAgent.conversations
|
|
206
|
-
.getAttachmentUploadUri(conversationId, file.name);
|
|
207
|
-
|
|
208
|
-
await fetch(fileUploadAccess.url, {
|
|
209
|
-
method: fileUploadAccess.verb,
|
|
210
|
-
body: file,
|
|
211
|
-
headers: { 'Content-Type': file.type },
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
// Reference `uri` in subsequent messages
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
### startSession(conversationId: string, options?: ConversationSessionOptions)
|
|
218
|
-
|
|
219
|
-
Returns `SessionStream` for real-time WebSocket communication. Options: `{ echo?, logLevel? }`. See Real-Time Sessions below.
|
|
220
|
-
|
|
221
|
-
### getSession(conversationId: string)
|
|
222
|
-
|
|
223
|
-
Returns `SessionStream | undefined` — the active session for the conversation, or undefined if none.
|
|
224
|
-
|
|
225
|
-
### endSession(conversationId: string)
|
|
226
|
-
|
|
227
|
-
Ends the active session. No-op if no session exists.
|
|
228
|
-
|
|
229
|
-
### disconnect()
|
|
230
|
-
|
|
231
|
-
Tears down the underlying WebSocket connection and ends **all** active sessions for this service. Use on app unmount / agent switch to release the socket; `endSession(conversationId)` ends just one conversation's session.
|
|
232
|
-
|
|
233
|
-
### sessions (getter)
|
|
234
|
-
|
|
235
|
-
`Iterable<SessionStream>` — iterator over all active sessions.
|
|
236
|
-
|
|
237
|
-
### connectionStatus / isConnected / connectionError
|
|
238
|
-
|
|
239
|
-
WebSocket connection state properties.
|
|
240
|
-
|
|
241
|
-
### onConnectionStatusChanged(handler)
|
|
242
|
-
|
|
243
|
-
Registers handler for connection status changes. Returns cleanup function.
|
|
244
|
-
|
|
245
|
-
## ConversationGetResponse Fields
|
|
246
|
-
|
|
247
|
-
`id: string`, `createdTime: string`, `updatedTime: string`, `lastActivityTime: string`, `label: string`, `autogenerateLabel: boolean`, `userId: string`, `orgId: string`, `tenantId: string`, `folderId: number`, `agentId?: number`, `traceId: string`, `spanId?: string`, `jobStartOverrides?: ConversationJobStartOverrides`, `jobKey?: string`, `isLocalJobExecution?: boolean`. Plus all Conversation-Attached Methods.
|
|
248
|
-
|
|
249
|
-
## Conversation-Attached Methods (ConversationMethods)
|
|
250
|
-
|
|
251
|
-
Each conversation returned by `create()`, `getById()`, or `getAll()` has:
|
|
252
|
-
|
|
253
|
-
- `conversation.exchanges` — Scoped `ExchangeService` (conversationId pre-filled)
|
|
254
|
-
- `conversation.exchanges.getAll(options?)` — list exchanges
|
|
255
|
-
- `conversation.exchanges.getById(exchangeId, options?)` — get one exchange
|
|
256
|
-
- `conversation.exchanges.createFeedback(exchangeId, options)` — submit feedback
|
|
257
|
-
- `conversation.update(options)` — update conversation (label, etc.)
|
|
258
|
-
- `conversation.delete()` — delete conversation
|
|
259
|
-
- `conversation.startSession(options?)` — start real-time session
|
|
260
|
-
- `conversation.getSession()` — get active session
|
|
261
|
-
- `conversation.endSession()` — end active session
|
|
262
|
-
- `conversation.uploadAttachment(file)` — upload file attachment
|
|
263
|
-
|
|
264
|
-
## Exchange Service
|
|
265
|
-
|
|
266
|
-
Standalone: `new Exchanges(sdk)`. Or scoped via `conversation.exchanges`.
|
|
267
|
-
|
|
268
|
-
### getAll(conversationId: string, options?: ExchangeGetAllOptions)
|
|
269
|
-
|
|
270
|
-
Returns `NonPaginatedResponse<ExchangeGetResponse>` or `PaginatedResponse<ExchangeGetResponse>`. Options extend `PaginationOptions` with `{ exchangeSort?: SortOrder, messageSort?: SortOrder }`.
|
|
271
|
-
|
|
272
|
-
### getById(conversationId: string, exchangeId: string, options?: ExchangeGetByIdOptions)
|
|
273
|
-
|
|
274
|
-
Returns `Promise<ExchangeGetResponse>`. Options: `{ messageSort?: SortOrder }`.
|
|
275
|
-
|
|
276
|
-
### createFeedback(conversationId: string, exchangeId: string, options: CreateFeedbackOptions)
|
|
5
|
+
> **Scope fork warning:** scopes differ per METHOD GROUP inside this one service (agent reads vs conversation create/update vs sessions vs feedback vs user settings each need a different scope set). Never assume service-uniform scopes — check the shipped per-method table; task-level bundles: [../oauth-scopes.md](../oauth-scopes.md).
|
|
277
6
|
|
|
278
|
-
|
|
7
|
+
## Session Lifecycle (WebSocket)
|
|
279
8
|
|
|
280
|
-
|
|
9
|
+
The event flow is documented IN the package — read it there: the module JSDoc in `dist/conversational-agent/index.d.ts` has a mermaid graph of the full stream hierarchy (session → exchange → message → content part / tool call) plus an end-to-end walkthrough, and `onExchangeStart`'s JSDoc carries complete nested examples: streaming chunks, whole-message handling (`onMessageCompleted`), tool-call events, and interrupt confirmation (with the `startEvent.type` check — use that version, not a blind approve).
|
|
281
10
|
|
|
282
|
-
|
|
11
|
+
Skill-only discipline the JSDoc doesn't state: every `on*` registration returns a cleanup function — capture them and call on unmount / agent switch, or handlers leak across React re-renders.
|
|
283
12
|
|
|
284
|
-
##
|
|
13
|
+
## Chat Interface Wiring — Mandatory Design Decisions
|
|
285
14
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
## ContentPartGetResponse Fields
|
|
289
|
-
|
|
290
|
-
Extends `ContentPart` with helper methods:
|
|
291
|
-
- `isDataInline: boolean` — whether data is inline (string)
|
|
292
|
-
- `isDataExternal: boolean` — whether data is an external URL
|
|
293
|
-
- `getData(): Promise<string | Response>` — resolves inline data (string) or fetches external data (Response)
|
|
294
|
-
|
|
295
|
-
`ContentPart` fields: `id`, `contentPartId`, `mimeType`, `data` (inline string or external URL), `citations: Citation[]`, `isTranscript?: boolean`, `isIncomplete?: boolean`, `name?: string`, `createdTime`, `updatedTime`.
|
|
296
|
-
|
|
297
|
-
## Message Service
|
|
298
|
-
|
|
299
|
-
Standalone: `new Messages(sdk)`.
|
|
300
|
-
|
|
301
|
-
### getById(conversationId: string, exchangeId: string, messageId: string)
|
|
302
|
-
|
|
303
|
-
Returns `Promise<MessageGetResponse>`.
|
|
304
|
-
|
|
305
|
-
### getContentPartById(conversationId: string, exchangeId: string, messageId: string, contentPartId: string)
|
|
306
|
-
|
|
307
|
-
Returns `Promise<ContentPartGetResponse>`.
|
|
308
|
-
|
|
309
|
-
## Real-Time Sessions (WebSocket)
|
|
310
|
-
|
|
311
|
-
The core of conversational agent is the real-time WebSocket session. This enables streaming chat with agents.
|
|
312
|
-
|
|
313
|
-
### Session Lifecycle
|
|
314
|
-
|
|
315
|
-
```
|
|
316
|
-
startSession → onSessionStarted → startExchange → sendMessageWithContentPart →
|
|
317
|
-
onExchangeStart (agent response) → onMessageStart → onContentPartStart → onChunk →
|
|
318
|
-
... → sendSessionEnd
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
### Starting a Session
|
|
322
|
-
|
|
323
|
-
```typescript
|
|
324
|
-
const session = conversation.startSession({ echo: true });
|
|
325
|
-
// or
|
|
326
|
-
const session = conversationalAgent.conversations.startSession(conversationId, { echo: true });
|
|
327
|
-
```
|
|
328
|
-
|
|
329
|
-
`echo: true` means events you emit are also dispatched back to your handlers (useful for rendering your own messages in the UI).
|
|
330
|
-
|
|
331
|
-
### SessionStream API
|
|
332
|
-
|
|
333
|
-
The session object (`SessionStream`) provides:
|
|
334
|
-
|
|
335
|
-
**Sending:**
|
|
336
|
-
- `session.startExchange(options?)` — returns `ExchangeEventHelper` to send messages
|
|
337
|
-
- `session.sendSessionEnd()` — end the session
|
|
338
|
-
- `session.sendMetaEvent(metaEvent)` — send metadata
|
|
339
|
-
- `session.sendErrorStart(args)` / `session.sendErrorEnd(args)` — send error events
|
|
340
|
-
- `session.emit(event)` — emit raw conversation event
|
|
341
|
-
|
|
342
|
-
**Receiving (register handlers):**
|
|
343
|
-
- `session.onSessionStarted(handler)` — session is ready
|
|
344
|
-
- `session.onSessionEnding(handler)` — session is about to end
|
|
345
|
-
- `session.onSessionEnd(handler)` — session ended
|
|
346
|
-
- `session.onExchangeStart(handler)` — new exchange started (agent responding)
|
|
347
|
-
- `session.onLabelUpdated(handler)` — conversation label changed
|
|
348
|
-
|
|
349
|
-
**State:**
|
|
350
|
-
- `session.exchanges` — iterator over active exchanges
|
|
351
|
-
- `session.getExchange(exchangeId)` — get specific exchange
|
|
352
|
-
- `session.conversationId` — the conversation ID
|
|
353
|
-
|
|
354
|
-
All `on*` handlers return a cleanup function: `const cleanup = session.onExchangeStart(handler); cleanup();`
|
|
355
|
-
|
|
356
|
-
### ExchangeEventHelper (ExchangeStream)
|
|
357
|
-
|
|
358
|
-
Returned by `session.startExchange()` or received in `session.onExchangeStart(handler)`.
|
|
359
|
-
|
|
360
|
-
**Sending:**
|
|
361
|
-
- `exchange.startMessage(options?)` — returns `MessageEventHelper`
|
|
362
|
-
- `exchange.sendMessageWithContentPart({ data, role?, mimeType? })` — convenience: start message + content part + end in one call
|
|
363
|
-
- `exchange.sendExchangeEnd()` — end the exchange
|
|
364
|
-
- `exchange.sendMetaEvent(metaEvent)` — send metadata
|
|
365
|
-
|
|
366
|
-
**Receiving:**
|
|
367
|
-
- `exchange.onMessageStart(handler)` — new message in exchange
|
|
368
|
-
- `exchange.onMessageCompleted(handler)` — complete message after all content parts end
|
|
369
|
-
- `exchange.onExchangeEnd(handler)` — exchange ended
|
|
370
|
-
|
|
371
|
-
**State:**
|
|
372
|
-
- `exchange.messages` — iterator over messages
|
|
373
|
-
- `exchange.getMessage(messageId)` — get specific message
|
|
374
|
-
- `exchange.exchangeId` — the exchange ID
|
|
375
|
-
- `exchange.session` — parent session
|
|
376
|
-
|
|
377
|
-
### MessageEventHelper (MessageStream)
|
|
378
|
-
|
|
379
|
-
Returned by `exchange.startMessage()` or received in `exchange.onMessageStart(handler)`.
|
|
380
|
-
|
|
381
|
-
**Role checks:**
|
|
382
|
-
- `message.isUser` — boolean
|
|
383
|
-
- `message.isAssistant` — boolean
|
|
384
|
-
- `message.isSystem` — boolean
|
|
385
|
-
- `message.role` — `MessageRole` enum value
|
|
386
|
-
|
|
387
|
-
**Sending:**
|
|
388
|
-
- `message.startContentPart({ mimeType, ... })` — returns `ContentPartEventHelper`
|
|
389
|
-
- `message.sendContentPart({ data, mimeType? })` — convenience: start + chunk + end
|
|
390
|
-
- `message.startToolCall({ toolName, input?, ... })` — returns `ToolCallEventHelper`
|
|
391
|
-
- `message.sendMessageEnd()` — end the message
|
|
392
|
-
- `message.sendInterrupt(interruptId, startInterrupt)` — send interrupt
|
|
393
|
-
- `message.sendInterruptEnd(interruptId, endInterrupt)` — end interrupt
|
|
394
|
-
|
|
395
|
-
**Receiving:**
|
|
396
|
-
- `message.onContentPartStart(handler)` — new content part streaming
|
|
397
|
-
- `message.onContentPartCompleted(handler)` — complete content part with all data
|
|
398
|
-
- `message.onToolCallStart(handler)` — tool call started
|
|
399
|
-
- `message.onToolCallCompleted(handler)` — tool call finished with result
|
|
400
|
-
- `message.onInterruptStart(handler)` — interrupt (e.g., tool call confirmation)
|
|
401
|
-
- `message.onInterruptEnd(handler)` — interrupt resolved
|
|
402
|
-
- `message.onMessageEnd(handler)` — message ended
|
|
403
|
-
- `message.onCompleted(handler)` — complete message with all content parts and tool calls
|
|
404
|
-
|
|
405
|
-
**State:**
|
|
406
|
-
- `message.contentParts` — iterator over content parts
|
|
407
|
-
- `message.getContentPart(contentPartId)` — get specific content part
|
|
408
|
-
- `message.toolCalls` — iterator over tool calls
|
|
409
|
-
- `message.getToolCall(toolCallId)` — get specific tool call
|
|
410
|
-
|
|
411
|
-
### ContentPartEventHelper (ContentPartStream)
|
|
412
|
-
|
|
413
|
-
Received in `message.onContentPartStart(handler)`.
|
|
414
|
-
|
|
415
|
-
**Type checks:**
|
|
416
|
-
- `contentPart.isMarkdown` — `text/markdown`
|
|
417
|
-
- `contentPart.isText` — `text/plain`
|
|
418
|
-
- `contentPart.isHtml` — `text/html`
|
|
419
|
-
- `contentPart.isAudio` — `audio/*`
|
|
420
|
-
- `contentPart.isImage` — `image/*`
|
|
421
|
-
- `contentPart.isTranscript` — speech-to-text transcript
|
|
422
|
-
- `contentPart.mimeType` — raw MIME type string
|
|
423
|
-
|
|
424
|
-
**Sending:**
|
|
425
|
-
- `contentPart.sendChunk({ data, sequence? })` — send text chunk
|
|
426
|
-
- `contentPart.sendChunkWithCitation(...)` — chunk with citation
|
|
427
|
-
- `contentPart.sendContentPartEnd()` — end the content part
|
|
428
|
-
|
|
429
|
-
**Receiving:**
|
|
430
|
-
- `contentPart.onChunk(handler)` — streaming data chunk received
|
|
431
|
-
- `contentPart.onContentPartEnd(handler)` — content part ended
|
|
432
|
-
- `contentPart.onCompleted(handler)` — complete content part with all accumulated data, citations, and citation errors
|
|
433
|
-
|
|
434
|
-
### ToolCallEventHelper (ToolCallStream)
|
|
435
|
-
|
|
436
|
-
Received in `message.onToolCallStart(handler)`.
|
|
437
|
-
|
|
438
|
-
**Properties:**
|
|
439
|
-
- `toolCall.toolCallId` — string
|
|
440
|
-
- `toolCall.startEvent` — `{ toolName, input?, timestamp }`
|
|
441
|
-
|
|
442
|
-
**Sending:**
|
|
443
|
-
- `toolCall.sendToolCallEnd({ output?, isError?, cancelled? })` — end with result
|
|
444
|
-
|
|
445
|
-
**Receiving:**
|
|
446
|
-
- `toolCall.onToolCallEnd(handler)` — tool call ended with result
|
|
447
|
-
|
|
448
|
-
## Usage Example — Chat Interface Component
|
|
449
|
-
|
|
450
|
-
**IMPORTANT:** This pattern matches the working sample app in `samples/conversational-agent-app/`. The key design decisions:
|
|
15
|
+
**IMPORTANT:** This pattern matches the working sample app in the SDK repo (`uipath-typescript/samples/conversational-agent-app/` — repo only, not shipped in the npm package). The key design decisions:
|
|
451
16
|
|
|
452
17
|
1. **Add the assistant placeholder message IMMEDIATELY in `sendMessage()`** — before `startExchange()`. Do NOT wait for `onMessageStart`. This ensures the typing dots show up instantly.
|
|
453
18
|
2. **Pre-register exchangeId → assistantMessageId mapping** so `onExchangeStart` can wire up handlers for the right message.
|
|
454
19
|
3. **Use a single `isStreaming` state** — set `true` in `sendMessage()`, set `false` in `onExchangeEnd()` (not `onMessageEnd`).
|
|
455
20
|
4. **Show bouncing dots inside the assistant message bubble** when content is empty and `isStreaming` is true. Once chunks arrive, the dots are replaced by growing text.
|
|
456
|
-
5. **Use `echo: true`** on `startSession()` so all exchanges (including user-initiated) fire through `onExchangeStart
|
|
457
|
-
|
|
458
|
-
```typescript
|
|
459
|
-
import { useMemo, useEffect, useState, useCallback, useRef } from 'react';
|
|
460
|
-
import { useAuth } from '../hooks/useAuth';
|
|
461
|
-
import { ConversationalAgent, MessageRole } from '@uipath/uipath-typescript/conversational-agent';
|
|
462
|
-
import type {
|
|
463
|
-
AgentGetResponse,
|
|
464
|
-
ConversationGetResponse,
|
|
465
|
-
SessionStream,
|
|
466
|
-
} from '@uipath/uipath-typescript/conversational-agent';
|
|
467
|
-
|
|
468
|
-
interface ChatMessage {
|
|
469
|
-
id: string;
|
|
470
|
-
role: 'user' | 'assistant';
|
|
471
|
-
content: string;
|
|
472
|
-
isStreaming?: boolean;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
function ChatInterface() {
|
|
476
|
-
const { sdk } = useAuth();
|
|
477
|
-
const conversationalAgent = useMemo(() => new ConversationalAgent(sdk), [sdk]);
|
|
478
|
-
const [agents, setAgents] = useState<AgentGetResponse[]>([]);
|
|
479
|
-
const [selectedAgent, setSelectedAgent] = useState<AgentGetResponse | null>(null);
|
|
480
|
-
const convRef = useRef<ConversationGetResponse | null>(null);
|
|
481
|
-
const sessionRef = useRef<SessionStream | null>(null);
|
|
482
|
-
const [messages, setMessages] = useState<ChatMessage[]>([]);
|
|
483
|
-
const [input, setInput] = useState('');
|
|
484
|
-
const [isStreaming, setIsStreaming] = useState(false);
|
|
485
|
-
const messagesEndRef = useRef<HTMLDivElement>(null);
|
|
486
|
-
|
|
487
|
-
// Pre-registered mapping: exchangeId → assistant message ID
|
|
488
|
-
// Registered in sendMessage() BEFORE startExchange() so onExchangeStart can look it up
|
|
489
|
-
const exchangeAssistantIdRef = useRef<Map<string, string>>(new Map());
|
|
490
|
-
|
|
491
|
-
// Auto-scroll to bottom on new messages
|
|
492
|
-
useEffect(() => {
|
|
493
|
-
messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' });
|
|
494
|
-
}, [messages]);
|
|
495
|
-
|
|
496
|
-
// Load available agents
|
|
497
|
-
useEffect(() => {
|
|
498
|
-
const load = async () => {
|
|
499
|
-
const result = await conversationalAgent.getAll();
|
|
500
|
-
setAgents(result);
|
|
501
|
-
if (result.length > 0) setSelectedAgent(result[0]);
|
|
502
|
-
};
|
|
503
|
-
load();
|
|
504
|
-
}, [conversationalAgent]);
|
|
505
|
-
|
|
506
|
-
// Create conversation and start session when agent is selected
|
|
507
|
-
useEffect(() => {
|
|
508
|
-
if (!selectedAgent) return;
|
|
509
|
-
|
|
510
|
-
const setup = async () => {
|
|
511
|
-
const conv = await selectedAgent.conversations.create({ label: 'Chat session' });
|
|
512
|
-
convRef.current = conv;
|
|
513
|
-
|
|
514
|
-
const session = conv.startSession({ echo: true });
|
|
515
|
-
sessionRef.current = session;
|
|
516
|
-
|
|
517
|
-
// Handle all exchanges (both user-initiated via echo and agent responses)
|
|
518
|
-
session.onExchangeStart((exchange) => {
|
|
519
|
-
// Look up the pre-registered assistant message ID for this exchange
|
|
520
|
-
const assistantId = exchangeAssistantIdRef.current.get(exchange.exchangeId);
|
|
521
|
-
if (!assistantId) return;
|
|
522
|
-
|
|
523
|
-
setIsStreaming(true);
|
|
524
|
-
|
|
525
|
-
exchange.onMessageStart((message) => {
|
|
526
|
-
if (!message.isAssistant) return;
|
|
527
|
-
|
|
528
|
-
message.onContentPartStart((contentPart) => {
|
|
529
|
-
if (contentPart.isMarkdown || contentPart.isText) {
|
|
530
|
-
contentPart.onChunk((chunk) => {
|
|
531
|
-
if (chunk.data) {
|
|
532
|
-
setMessages(prev =>
|
|
533
|
-
prev.map(m =>
|
|
534
|
-
m.id === assistantId ? { ...m, content: m.content + chunk.data } : m
|
|
535
|
-
)
|
|
536
|
-
);
|
|
537
|
-
}
|
|
538
|
-
});
|
|
539
|
-
}
|
|
540
|
-
});
|
|
541
|
-
});
|
|
542
|
-
|
|
543
|
-
exchange.onExchangeEnd(() => {
|
|
544
|
-
exchangeAssistantIdRef.current.delete(exchange.exchangeId);
|
|
545
|
-
setMessages(prev =>
|
|
546
|
-
prev.map(m =>
|
|
547
|
-
m.id === assistantId ? { ...m, isStreaming: false } : m
|
|
548
|
-
)
|
|
549
|
-
);
|
|
550
|
-
setIsStreaming(false);
|
|
551
|
-
});
|
|
552
|
-
});
|
|
553
|
-
};
|
|
554
|
-
|
|
555
|
-
setup();
|
|
556
|
-
|
|
557
|
-
return () => {
|
|
558
|
-
convRef.current?.endSession();
|
|
559
|
-
sessionRef.current = null;
|
|
560
|
-
};
|
|
561
|
-
}, [selectedAgent]);
|
|
562
|
-
|
|
563
|
-
// Send a message
|
|
564
|
-
const sendMessage = useCallback(async () => {
|
|
565
|
-
if (!sessionRef.current || !input.trim() || isStreaming) return;
|
|
566
|
-
|
|
567
|
-
const userMessage: ChatMessage = {
|
|
568
|
-
id: `user-${Date.now()}`,
|
|
569
|
-
role: 'user',
|
|
570
|
-
content: input,
|
|
571
|
-
};
|
|
572
|
-
|
|
573
|
-
// Add assistant placeholder IMMEDIATELY — shows typing dots right away
|
|
574
|
-
const assistantId = `assistant-${Date.now()}`;
|
|
575
|
-
const assistantPlaceholder: ChatMessage = {
|
|
576
|
-
id: assistantId,
|
|
577
|
-
role: 'assistant',
|
|
578
|
-
content: '',
|
|
579
|
-
isStreaming: true,
|
|
580
|
-
};
|
|
581
|
-
|
|
582
|
-
setMessages(prev => [...prev, userMessage, assistantPlaceholder]);
|
|
583
|
-
setInput('');
|
|
584
|
-
setIsStreaming(true);
|
|
21
|
+
5. **Use `echo: true`** on `startSession()` so all exchanges (including user-initiated) fire through `onExchangeStart` — one code path renders both user and assistant messages.
|
|
585
22
|
|
|
586
|
-
|
|
587
|
-
const exchangeId = `exchange-${Date.now()}-${crypto.randomUUID().slice(0, 12)}`;
|
|
588
|
-
exchangeAssistantIdRef.current.set(exchangeId, assistantId);
|
|
589
|
-
|
|
590
|
-
// Start exchange with pre-determined ID and send user message
|
|
591
|
-
const exchange = sessionRef.current.startExchange({ exchangeId });
|
|
592
|
-
const message = exchange.startMessage({ role: MessageRole.User });
|
|
593
|
-
await message.sendContentPart({ data: input });
|
|
594
|
-
message.sendMessageEnd();
|
|
595
|
-
}, [input, isStreaming]);
|
|
596
|
-
|
|
597
|
-
return (
|
|
598
|
-
<div className="flex flex-col h-full">
|
|
599
|
-
{/* Agent selector */}
|
|
600
|
-
<div className="p-4 border-b">
|
|
601
|
-
<select
|
|
602
|
-
value={selectedAgent?.id ?? ''}
|
|
603
|
-
onChange={(e) => {
|
|
604
|
-
const agent = agents.find(a => a.id === Number(e.target.value));
|
|
605
|
-
if (agent) setSelectedAgent(agent);
|
|
606
|
-
}}
|
|
607
|
-
className="w-full p-2 border rounded"
|
|
608
|
-
>
|
|
609
|
-
{agents.map(agent => (
|
|
610
|
-
<option key={agent.id} value={agent.id}>{agent.name}</option>
|
|
611
|
-
))}
|
|
612
|
-
</select>
|
|
613
|
-
</div>
|
|
614
|
-
|
|
615
|
-
{/* Messages */}
|
|
616
|
-
<div className="flex-1 overflow-y-auto p-4 space-y-4">
|
|
617
|
-
{messages.map(msg => (
|
|
618
|
-
<div key={msg.id} className={`flex ${msg.role === 'user' ? 'justify-end' : 'justify-start'}`}>
|
|
619
|
-
<div className={`max-w-[70%] p-3 rounded-lg ${
|
|
620
|
-
msg.role === 'user' ? 'bg-blue-500 text-white' : 'bg-gray-100 text-gray-900'
|
|
621
|
-
}`}>
|
|
622
|
-
{/* Show typing dots INSIDE the bubble when streaming with no content yet */}
|
|
623
|
-
{msg.isStreaming && !msg.content ? (
|
|
624
|
-
<div className="flex items-center gap-1">
|
|
625
|
-
<span className="w-2 h-2 bg-gray-400 rounded-full animate-bounce [animation-delay:0ms]" />
|
|
626
|
-
<span className="w-2 h-2 bg-gray-400 rounded-full animate-bounce [animation-delay:150ms]" />
|
|
627
|
-
<span className="w-2 h-2 bg-gray-400 rounded-full animate-bounce [animation-delay:300ms]" />
|
|
628
|
-
</div>
|
|
629
|
-
) : (
|
|
630
|
-
msg.content
|
|
631
|
-
)}
|
|
632
|
-
</div>
|
|
633
|
-
</div>
|
|
634
|
-
))}
|
|
635
|
-
<div ref={messagesEndRef} />
|
|
636
|
-
</div>
|
|
637
|
-
|
|
638
|
-
{/* Input */}
|
|
639
|
-
<div className="p-4 border-t flex gap-2">
|
|
640
|
-
<input
|
|
641
|
-
type="text"
|
|
642
|
-
value={input}
|
|
643
|
-
onChange={(e) => setInput(e.target.value)}
|
|
644
|
-
onKeyDown={(e) => e.key === 'Enter' && sendMessage()}
|
|
645
|
-
placeholder="Type a message..."
|
|
646
|
-
className="flex-1 p-2 border rounded"
|
|
647
|
-
disabled={isStreaming}
|
|
648
|
-
/>
|
|
649
|
-
<button
|
|
650
|
-
onClick={sendMessage}
|
|
651
|
-
disabled={isStreaming || !input.trim()}
|
|
652
|
-
className="px-4 py-2 bg-blue-500 text-white rounded disabled:opacity-50"
|
|
653
|
-
>
|
|
654
|
-
Send
|
|
655
|
-
</button>
|
|
656
|
-
</div>
|
|
657
|
-
</div>
|
|
658
|
-
);
|
|
659
|
-
}
|
|
660
|
-
```
|
|
661
|
-
|
|
662
|
-
## Usage Example — Loading Conversation History
|
|
23
|
+
Handler wiring skeleton (session setup once per conversation; UI omitted):
|
|
663
24
|
|
|
664
25
|
```typescript
|
|
665
|
-
|
|
26
|
+
const session = conv.startSession({ echo: true });
|
|
27
|
+
sessionRef.current = session;
|
|
666
28
|
|
|
667
|
-
//
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
// Load exchanges for a conversation
|
|
674
|
-
const exchanges = await conversation.exchanges.getAll({
|
|
675
|
-
pageSize: 50,
|
|
676
|
-
exchangeSort: SortOrder.Ascending,
|
|
677
|
-
messageSort: SortOrder.Ascending,
|
|
678
|
-
});
|
|
29
|
+
// Handle all exchanges (both user-initiated via echo and agent responses)
|
|
30
|
+
session.onExchangeStart((exchange) => {
|
|
31
|
+
// Look up the pre-registered assistant message ID for this exchange
|
|
32
|
+
const assistantId = exchangeAssistantIdRef.current.get(exchange.exchangeId);
|
|
33
|
+
if (!assistantId) return;
|
|
34
|
+
setIsStreaming(true);
|
|
679
35
|
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
console.log(data);
|
|
36
|
+
exchange.onMessageStart((message) => {
|
|
37
|
+
if (!message.isAssistant) return;
|
|
38
|
+
message.onContentPartStart((contentPart) => {
|
|
39
|
+
if (contentPart.isMarkdown || contentPart.isText) {
|
|
40
|
+
contentPart.onChunk((chunk) => {
|
|
41
|
+
if (chunk.data) appendToMessage(assistantId, chunk.data);
|
|
42
|
+
});
|
|
688
43
|
}
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
}
|
|
44
|
+
});
|
|
45
|
+
});
|
|
692
46
|
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
47
|
+
exchange.onExchangeEnd(() => {
|
|
48
|
+
exchangeAssistantIdRef.current.delete(exchange.exchangeId);
|
|
49
|
+
markMessageDone(assistantId);
|
|
50
|
+
setIsStreaming(false);
|
|
51
|
+
});
|
|
697
52
|
});
|
|
698
|
-
```
|
|
699
|
-
|
|
700
|
-
## Usage Example — File Attachments
|
|
701
|
-
|
|
702
|
-
```typescript
|
|
703
|
-
// Upload a file to a conversation
|
|
704
|
-
const fileInput = document.querySelector('input[type="file"]') as HTMLInputElement;
|
|
705
|
-
const file = fileInput.files![0];
|
|
706
53
|
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
await exchange.sendMessageWithContentPart({
|
|
713
|
-
data: `Please analyze the uploaded file: ${attachment.uri}`,
|
|
714
|
-
});
|
|
54
|
+
// Cleanup on unmount / agent switch
|
|
55
|
+
return () => {
|
|
56
|
+
convRef.current?.endSession();
|
|
57
|
+
sessionRef.current = null;
|
|
58
|
+
};
|
|
715
59
|
```
|
|
716
60
|
|
|
717
|
-
|
|
61
|
+
Sending a message — pre-register the mapping BEFORE starting the exchange:
|
|
718
62
|
|
|
719
63
|
```typescript
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
});
|
|
64
|
+
// Add assistant placeholder IMMEDIATELY — shows typing dots right away
|
|
65
|
+
const assistantId = `assistant-${Date.now()}`;
|
|
66
|
+
addMessages(userMessage, { id: assistantId, role: 'assistant', content: '', isStreaming: true });
|
|
67
|
+
setIsStreaming(true);
|
|
68
|
+
|
|
69
|
+
// Pre-register the exchange → assistant mapping BEFORE starting the exchange
|
|
70
|
+
const exchangeId = `exchange-${Date.now()}-${crypto.randomUUID().slice(0, 12)}`;
|
|
71
|
+
exchangeAssistantIdRef.current.set(exchangeId, assistantId);
|
|
72
|
+
|
|
73
|
+
// Start exchange with pre-determined ID and send user message
|
|
74
|
+
const exchange = sessionRef.current.startExchange({ exchangeId });
|
|
75
|
+
const message = exchange.startMessage({ role: MessageRole.User });
|
|
76
|
+
await message.sendContentPart({ data: input });
|
|
77
|
+
message.sendMessageEnd();
|
|
732
78
|
```
|
|
733
79
|
|
|
734
80
|
## OAuth Client Setup
|