Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ jobs:
timeout-minutes: 15
permissions:
contents: read
id-token: write
outputs:
published: ${{ needs.prepare-release.outputs.has_changes }}
package_versions: ${{ needs.prepare-release.outputs.package_versions }}
Expand Down Expand Up @@ -246,8 +247,7 @@ jobs:
if: needs.prepare-release.outputs.has_changes == 'true'
env:
PACKAGES: ${{ needs.analyze-changes.outputs.yarn-recursive }}
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn workspaces foreach -W --from "$PACKAGES" --verbose run deploy:npm --access public --tag "$GITHUB_REF_NAME"
run: yarn workspaces foreach -W --from "$PACKAGES" --verbose run deploy:npm --access public --tag "$GITHUB_REF_NAME" --provenance

publish-documentation:
name: Publish - Documentation
Expand Down
942 changes: 942 additions & 0 deletions .yarn/releases/yarn-4.10.3.cjs

Large diffs are not rendered by default.

934 changes: 0 additions & 934 deletions .yarn/releases/yarn-4.5.1.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
yarnPath: .yarn/releases/yarn-4.5.1.cjs
yarnPath: .yarn/releases/yarn-4.10.3.cjs
checksumBehavior: update
nodeLinker: node-modules
npmRegistryServer: "https://registry.npmjs.org"
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ into host applications.

## Tech Stack
- TypeScript, React 18, MobX, Web Components via `@r2wc/react-to-web-component`.
- Yarn 4.5.1 (PnP, workspaces); Webpack + Babel build.
- Yarn 4.10.3 (PnP, workspaces); Webpack + Babel build.
- Jest + React Testing Library (unit); Playwright (E2E). Momentum UI design system.

## Architecture
Expand Down
13 changes: 8 additions & 5 deletions ai-docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ For Consult/Transfer, `Task.uiControls.consultTransferDestinations` is the visib
| Widget / component | `ui-logging` (`withMetrics`) | call | Emit mount/unmount/error telemetry |

## Package Map & Inter-Package Dependencies
- **Workspace tooling:** Yarn 4.5.1 (PnP). Workspace globs: `packages/**/*`, `packages/contact-center/*`,
`widgets-samples/**/**`.
- **Workspace tooling:** Yarn 4.10.3 with the `node-modules` linker. Workspace globs:
`packages/**/*`, `packages/contact-center/*`, `widgets-samples/**/**`.
- **Inter-package dependency graph** (from each package's `package.json`):
```
cc-widgets ── wraps ──> station-login, user-state, task, ai-assistant (+ cc-digital-channels)
Expand All @@ -123,13 +123,16 @@ store ──> (no internal CC deps) ──> @webex/contact-center SDK
```
- **Visibility:** `cc-widgets` is the public aggregator (consumers import widgets/store from it);
`store`, `cc-components`, `ui-logging` are shared internals.
- **Version-sync rule:** workspace-internal deps are pinned across the monorepo; releases via
semantic-release (`release:widgets`).
- **Version-sync rule:** `Deploy CD` uses `package-tools` to synchronize and increment package versions
before packing. See [`RELEASING.md`](RELEASING.md).
- **Different-kind package:** `packages/@webex/widgets` is the legacy **meetings** widget family — it does
not participate in the CC dependency flow or share the CC store.

## Release & Versioning
- Published as `@webex/*` packages; release driven by `semantic-release` (`yarn release:widgets`).
- Published as `@webex/*` packages by `Deploy CD` on pushes to `next`. The workflow checks packed
Contact Center consumers before Yarn publishes through OIDC. Each workspace keeps
`deploy:npm: yarn npm publish`; Yarn packs and publishes the restored workspace. See
[`RELEASING.md`](RELEASING.md) for trusted-publisher setup, release validation, and recovery.
- Public surfaces (exports, custom-element tag names, events) follow semver; breaking changes need a major
bump and a consumer transition note. See `CONTRACTS.md` for the compatibility policy.

Expand Down
9 changes: 6 additions & 3 deletions ai-docs/CONSUMER_BUILDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,14 @@ does not require changes to the tooling tests.
5. The existing `yarn workspaces foreach ... run deploy:npm` command publishes the changed workspaces
with the branch dist tag. Each workspace keeps its own `deploy:npm` script, including the exclusion
for `@webex/test-fixtures`. The publish job does not repeat version selection or rebuild packages.
Yarn packs the restored workspaces during publishing. The existing version outputs, documentation,
tags, and release comments remain available.
Each published workspace runs `yarn npm publish` with the pinned Yarn `4.10.3`. Yarn packs the
restored workspace and uses native OIDC authentication with release provenance. The existing
version outputs, documentation, tags, and release comments remain available.

The release preparation and consumer jobs have read access and no publishing secrets.
Only the deploy step receives `NPM_TOKEN`, through `YARN_NPM_AUTH_TOKEN`. The reusable workflow does not inherit secrets.
Only `publish-npm` has `id-token: write` for npm trusted publishing. It does not receive a long-lived
npm publish token. The reusable consumer workflow does not inherit secrets. See
[`RELEASING.md`](RELEASING.md) for owner setup and first-release validation.
PR checks use the PR merge commit and read access. They do not use `pull_request_target`.
The `@webex/test-fixtures` package is never published.

Expand Down
9 changes: 5 additions & 4 deletions ai-docs/GETTING_STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
> Context-efficiency: link to canonical docs — don't duplicate them; load on demand, not upfront.

## Prerequisites
- Node `lts/krypton` (Node 23.x — see `.nvmrc`; `nvm use` to select it).
- Yarn 4.5.1 via Corepack — this is a Yarn PnP monorepo, `packageManager` is pinned in `package.json`. Run `corepack enable` if `yarn` is unavailable.
- Node from `.nvmrc` (`nvm use` to select it).
- Yarn 4.10.3 via Corepack, with the `node-modules` linker. `packageManager` is pinned in `package.json`.
Run `corepack enable` if `yarn` is unavailable.
- Required access: none beyond the public registry to build. The Webex Contact Center SDK (`@webex/contact-center`) is a published npm dependency, not a sibling clone.

## Clone & Install
```bash
git clone git@github.com:webex/widgets.git
cd widgets
corepack enable # if yarn is missing
yarn install # installs all workspace deps (Yarn PnP)
yarn install # installs all workspace dependencies into node_modules
yarn build:dev # build all packages — required before cross-package tsc imports resolve
```
A fresh clone (or a new git worktree) has no `node_modules`; `yarn install` followed by `yarn build:dev` must complete before any per-package test or cross-package import will resolve.
Expand All @@ -32,7 +33,7 @@ The store's Webpack build emits JavaScript and TypeScript declarations together.
| E2E | `yarn test:e2e` (Playwright) |
| Lint / format | ESLint (`.eslintrc`, airbnb + prettier) — runs via editor/CI; pre-commit husky hooks run the full test suite |

Never run `npx jest` directly — always go through `yarn workspace @webex/{pkg} test:unit` so the PnP resolver and workspace config apply.
Never run `npx jest` directly — always go through `yarn workspace @webex/{pkg} test:unit` so the workspace configuration applies.

## First-Run Verification
- After `yarn install && yarn build:dev`, run a single package's tests to confirm the toolchain is wired:
Expand Down
2 changes: 1 addition & 1 deletion ai-docs/GLOSSARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
| HOC | Higher-Order Component | React wrapping pattern; used for `observer()` and `withMetrics`. |
| MobX | (product name) | The reactive state library backing the store; mutations go through `runInAction`. |
| RTL | React Testing Library | Component/unit test library paired with Jest. |
| PnP | Plug'n'Play | Yarn 4.5.1 module resolution mode used by this monorepo (no `node_modules` by default). |
| PnP | Plug'n'Play | A Yarn module resolution mode. This monorepo uses the `node-modules` linker in `.yarnrc.yml`. |
| CAD | Call-Associated Data | Interaction metadata surfaced by the CallControlCAD widget. |
| E2E | End-to-End | Playwright browser tests under `playwright/`. |
| PII | Personally Identifiable Information | Must never be logged (see `RULES.md` Logging/Security). |
Expand Down
119 changes: 119 additions & 0 deletions ai-docs/RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# npm releases

## Release path

[`Deploy CD`](../.github/workflows/deploy.yml) runs on pushes to `next`. It finds changed packages and
their dependents, synchronizes and increments versions with `package-tools`, builds production
packages, and runs the enabled [consumer checks](CONSUMER_BUILDS.md). The publish job restores the
prepared versions and build output and checks them against the tested Contact Center archives.

The repository pins Yarn `4.10.3`, which supports OIDC publishing for scoped packages. Each released
workspace keeps `deploy:npm: yarn npm publish`. Yarn packs the current workspace and publishes it
with public access and the branch dist-tag (`next`). It also manages dependencies and builds,
including conversion of `workspace:*` dependencies during packing. The release command adds
`--provenance` to publish build provenance. Candidate archives remain the input to the consumer
checks; the publish job verifies restored workspace contents before publishing.
See the [Yarn scoped-package OIDC fix](https://github.com/yarnpkg/berry/releases/tag/%40yarnpkg/cli/4.10.3).

Only `publish-npm` has `id-token: write`, with `contents: read`. It runs on a GitHub-hosted runner.
Yarn exchanges the GitHub OIDC identity for a short-lived npm publish credential. The job does not receive
`NPM_TOKEN` or `YARN_NPM_AUTH_TOKEN`. The documentation, Git tags, and release comments keep their
existing dependency on successful publication.

## Package owner setup

The person who configures npm must have write access to each package and account-level 2FA enabled.
The package owner can do this setup for the contributor. No token needs to be shared. See the
[npm trust requirements](https://docs.npmjs.com/cli/v11/commands/npm-trust/).

On npmjs.com, open each package's **Settings > Trusted publishing** and add a GitHub Actions publisher:

| Field | Value |
|---|---|
| Organization or user | `webex` |
| Repository | `widgets` |
| Workflow filename | `deploy.yml` |
| Environment | Leave empty; the current publish job has no GitHub environment |
| Allowed action | Enable **Allow npm publish** |

Configure these ten packages:

```text
@webex/widgets
@webex/cc-store
@webex/cc-components
@webex/cc-widgets
@webex/cc-station-login
@webex/cc-user-state
@webex/cc-ui-logging
@webex/cc-digital-channels
@webex/cc-ai-assistant
@webex/cc-task
```

`@webex/test-fixtures` is not published and needs no publisher entry. The release uses
`yarn npm publish --tag next`; it does not need permission for separate dist-tag commands.

Coordinate setup with the release. **Each package must complete its first successful OIDC publish
within two days after its entry is created.** Only changed packages and their dependents publish in a
run. An entry for an unchanged package can expire before that package's first release. Create it near
that release, or delete and recreate an expired entry before use. Check the exact repository and
workflow spelling. See [npm trusted publishing](https://docs.npmjs.com/trusted-publishers/).

Keep the migration PR as a draft until its checks pass and the owner confirms the required npm
entries. Merge only when the entries for the next release are ready. Track the first successful
publish evidence in [CAI-8749](https://jira-eng-sjc12.cisco.com/jira/browse/CAI-8749).

## Local checks

Use Node from `.nvmrc` and the pinned Yarn `4.10.3`. To build and check the Contact Center archives
without publishing, run from the repository root:

```sh
yarn install --immutable
yarn workspace webex-widgets build:prod
yarn workspace webex-widgets consumer-builds:pack
yarn workspace webex-widgets consumer-builds:verify
yarn workspace @webex/cc-widgets deploy:npm --dry-run --json --access public --tag next
yarn workspace webex-widgets test:tooling --runInBand tooling/tests/yarn-oidc.js tooling/tests/consumer-build-release.js
```

Check the other selected workspaces with the same dry-run options. Inspect package names, prepared
versions, repository metadata, and resolved internal dependencies. The OIDC tooling test uses local
fixtures to check the token exchange and publishing request; it does not call GitHub or npm. A local
dry run or fixture test does not confirm the real npm trusted-publisher authorization. Use the
consumer build commands in [CONSUMER_BUILDS.md](CONSUMER_BUILDS.md) to check the packages in supported
bundlers. Rebuild with `yarn build:dev` before the full unit suite or a commit.

## First OIDC release and token removal

1. Confirm that the npm entries cover every package selected for the release. Confirm that the run
uses `webex/widgets`, `deploy.yml`, a GitHub-hosted runner, and the pinned Yarn version.
2. Run the normal release with the long-lived npm publish token unavailable to the publish job.
Keep the version preparation, archive checks, and consumer checks enabled.
3. Check that each selected name, version, public access setting, and `next` dist-tag is correct on
npm. Save the successful workflow link and package results in CAI-8749. A local dry run or
`yarn npm whoami` result is not proof of OIDC publish permission.
4. Remove obsolete Widgets publish secrets after a successful release. Revoke a shared token only
after every repository and workflow that uses it has migrated. The npm token owner must handle
revocation; a repository secret deletion does not revoke an npm token.

OIDC does not authenticate dependency installs. If a private dependency later requires authentication,
use a separate read-only token only in the install step. Do not pass it to publishing. The current
public dependency install needs no npm token.

## Recovery

- If npm rejects authentication, check the trusted-publisher fields, allowed publish action, expiry,
workflow job permissions, runner, and Yarn version. The package's `repository.url` must identify
`https://github.com/webex/widgets.git`. Ask the package maintainer to correct or recreate the npm
entry. Do not add a publish token to bypass the failure.
- If an archive check or consumer check fails, fix the source or build issue and run the normal
preparation and checks again. Do not skip the release gate.
- If publication fails after some packages succeed, first check which versions reached npm. Published
versions cannot be reused. Use the normal version sync, increment, build, and consumer check path
to prepare the next release. Do not assume that rerunning only `publish-npm` can recover a partial
release. Release tags must follow successful publication.

Owner setup and a successful token-free OIDC release are required to complete CAI-8749. Repository
changes alone do not confirm that npm trusted publishing works.
2 changes: 2 additions & 0 deletions ai-docs/SPEC_INDEX.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
| Anything touching input/identity/logging | `SECURITY.md` |
| Review & merge | `REVIEW_CHECKLIST.md` |
| Consumer builds / release checks | `CONSUMER_BUILDS.md` |
| npm publishing / OIDC setup / release recovery | `RELEASING.md` |

## Intake Routing
```
Expand Down Expand Up @@ -70,5 +71,6 @@ The intake record confirms scope/modules **against the code** and sets the chang
| SDK reference | `@webex/contact-center` types (`node_modules/@webex/contact-center/dist/types/index.d.ts`) | installed SDK `.d.ts` surface — verify every SDK call |
| Participant Drop intake | `ai-docs/features/participant-drop-intake.md` | Cross-repository SDK/widget contract, behavior, delivery gates, and verification |
| Consumer build release checks | `ai-docs/CONSUMER_BUILDS.md` | Bundler configuration, candidate archives, release gate, and local checks |
| npm releases | `ai-docs/RELEASING.md` | OIDC publishing, package owner setup, release validation, and recovery |

_No `DATA_MODEL.md`: this repo owns no persistent datastore (all domain data comes from the SDK at runtime)._
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"packages/contact-center/*",
"widgets-samples/**/**"
],
"packageManager": "yarn@4.5.1",
"packageManager": "yarn@4.10.3",
"devDependencies": {
"@babel/plugin-transform-runtime": "^7.29.0",
"@babel/preset-typescript": "7.25.9",
Expand Down
5 changes: 5 additions & 0 deletions packages/contact-center/ai-assistant/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"name": "@webex/cc-ai-assistant",
"description": "Webex Contact Center Widgets: AI Assistant",
"license": "Cisco's General Terms (https://www.cisco.com/site/us/en/about/legal/contract-experience/index.html)",
"repository": {
"type": "git",
"url": "https://github.com/webex/widgets.git",
"directory": "packages/contact-center/ai-assistant"
},
"version": "1.28.0-ccwidgets.126",
"main": "dist/index.js",
"types": "dist/types/index.d.ts",
Expand Down
5 changes: 5 additions & 0 deletions packages/contact-center/cc-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"name": "@webex/cc-components",
"description": "Webex Contact Center UI Components Library for your custom contact center solutions",
"license": "Cisco's General Terms (https://www.cisco.com/site/us/en/about/legal/contract-experience/index.html)",
"repository": {
"type": "git",
"url": "https://github.com/webex/widgets.git",
"directory": "packages/contact-center/cc-components"
},
"version": "1.28.0-ccwidgets.126",
"main": "dist/index.js",
"types": "dist/types/index.d.ts",
Expand Down
5 changes: 5 additions & 0 deletions packages/contact-center/cc-digital-channels/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"name": "@webex/cc-digital-channels",
"description": "Webex Contact Center Widgets: Digital Channels",
"license": "Cisco's General Terms (https://www.cisco.com/site/us/en/about/legal/contract-experience/index.html)",
"repository": {
"type": "git",
"url": "https://github.com/webex/widgets.git",
"directory": "packages/contact-center/cc-digital-channels"
},
"version": "1.28.0-ccwidgets.126",
"main": "dist/index.js",
"types": "dist/types/index.d.ts",
Expand Down
5 changes: 5 additions & 0 deletions packages/contact-center/cc-widgets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"name": "@webex/cc-widgets",
"description": "Webex Contact Center Widgets",
"license": "Cisco's General Terms (https://www.cisco.com/site/us/en/about/legal/contract-experience/index.html)",
"repository": {
"type": "git",
"url": "https://github.com/webex/widgets.git",
"directory": "packages/contact-center/cc-widgets"
},
"version": "1.28.0-ccwidgets.126",
"main": "dist/index.js",
"types": "dist/types/index.d.ts",
Expand Down
5 changes: 5 additions & 0 deletions packages/contact-center/station-login/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"name": "@webex/cc-station-login",
"description": "Webex Contact Center Widgets: Station Login",
"license": "Cisco's General Terms (https://www.cisco.com/site/us/en/about/legal/contract-experience/index.html)",
"repository": {
"type": "git",
"url": "https://github.com/webex/widgets.git",
"directory": "packages/contact-center/station-login"
},
"version": "1.28.0-ccwidgets.126",
"main": "dist/index.js",
"types": "dist/types/index.d.ts",
Expand Down
5 changes: 5 additions & 0 deletions packages/contact-center/store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"name": "@webex/cc-store",
"description": "Webex Contact Center Widgets: Widgets Store",
"license": "Cisco's General Terms (https://www.cisco.com/site/us/en/about/legal/contract-experience/index.html)",
"repository": {
"type": "git",
"url": "https://github.com/webex/widgets.git",
"directory": "packages/contact-center/store"
},
"version": "1.28.0-ccwidgets.126",
"main": "dist/index.js",
"types": "dist/types/index.d.ts",
Expand Down
5 changes: 5 additions & 0 deletions packages/contact-center/task/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"name": "@webex/cc-task",
"description": "Webex Contact Center Widgets: Task",
"license": "Cisco's General Terms (https://www.cisco.com/site/us/en/about/legal/contract-experience/index.html)",
"repository": {
"type": "git",
"url": "https://github.com/webex/widgets.git",
"directory": "packages/contact-center/task"
},
"version": "1.28.0-ccwidgets.126",
"main": "dist/index.js",
"types": "dist/types/index.d.ts",
Expand Down
5 changes: 5 additions & 0 deletions packages/contact-center/ui-logging/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"name": "@webex/cc-ui-logging",
"repository": {
"type": "git",
"url": "https://github.com/webex/widgets.git",
"directory": "packages/contact-center/ui-logging"
},
"version": "1.28.0-ccwidgets.126",
"description": "UI metrics tracking for Webex widgets",
"license": "Cisco's General Terms (https://www.cisco.com/site/us/en/about/legal/contract-experience/index.html)",
Expand Down
5 changes: 5 additions & 0 deletions packages/contact-center/user-state/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"name": "@webex/cc-user-state",
"description": "Webex Contact Center Widgets: User State",
"license": "Cisco's General Terms (https://www.cisco.com/site/us/en/about/legal/contract-experience/index.html)",
"repository": {
"type": "git",
"url": "https://github.com/webex/widgets.git",
"directory": "packages/contact-center/user-state"
},
"version": "1.28.0-ccwidgets.126",
"main": "dist/index.js",
"types": "dist/types/index.d.ts",
Expand Down
Loading
Loading