# UI Consolidation And SDK CLI Train

## Why this note exists

This release train combines three changes that affect derived projects after `pnpm up`:

1. `@elevasis/ui` 2.18.x consolidates previously-duplicated template surface (hooks, components, constants, utilities, test-utils, org-model examples) into the published package. Files that lived in `_template/ui/src/lib/**`, `_template/ui/src/test-utils/**`, and `_template/scripts/use-*-ui.mjs` are deleted from the template and re-exported from `@elevasis/ui`. A `useDeleteRequest` hook and a rollup dts fix also land in this `@elevasis/ui` version.
2. `@elevasis/sdk` hardens project-root and CWD resolution in the `elevasis-sdk` CLI. Unsupported invocation directories now fail fast with a clear error instead of silently using `process.cwd()`.
3. `@elevasis/sdk` + `@elevasis/core` + `@elevasis/ui` close three `project:*` / `request:submit` CLI gaps: `--description` on `project:milestone:update`, `agent_learning` note-type enum alignment between `/project` skill docs and the server, and enum values surfaced in `request:submit --help`.

## Applies to

All template-derived projects that:

- import from `@elevasis/ui` (nearly all of them),
- run the `elevasis-sdk` CLI from any project directory (all of them),
- invoke `project:milestone:update`, `project:note:create --type agent_learning`, or `request:submit`.

Known affected projects: `nirvana-marketing`, `ZentaraHQ`.

## Required actions

### Step 1 -- Pull the train via `/git-sync`

`/git-sync` surfaces this note and applies template-source changes (deletions of `ui/src/lib/**`, `ui/src/test-utils/**`, `scripts/use-*-ui.mjs`).

### Step 2 -- Update package dependencies

Run from project root:

```
pnpm up @elevasis/ui @elevasis/core @elevasis/sdk --latest
```

Dep bumps are already written into `_template/ui/package.json`, `_template/operations/package.json`, and `_template/core/package.json` by the release train (`@elevasis/core` ^0.9.0, `@elevasis/ui` ^2.19.0, `@elevasis/sdk` ^1.9.0).

### Step 3 -- Replace inlined type defs with package imports

Projects that copied the Phase-1 workaround carry six inlined symbols in `ui/src/lib/platform-utils.ts` that should now come from `@elevasis/ui`:

- `CredentialSchema`, `CredentialField`, `OAuthProviderConfig`, `OAuthToken`, `OAuthState` -> `@elevasis/ui/types`
- `DOMAIN_MAP` -> `@elevasis/ui/utils`

Delete the inlined copies and replace with named imports from the appropriate subpaths. After the edit, `ui/src/lib/platform-utils.ts` should only contain Elevasis-specific symbols and the new imports.

### Step 4 -- Re-verify `elevasis-sdk` invocations

From any dir you routinely invoke the SDK CLI, run:

```
pnpm exec elevasis-sdk doctor
```

If the command fails with a "no `.elevasis` marker reachable" error, re-run from a supported directory (project root, `operations/`, or any nested path under a valid project). Previously-silent misfires now surface as hard errors; this is intentional.

### Step 5 -- Audit `project:note:create --type agent_learning` call sites

If any project scripts or agent prompts call `project:note:create --type agent_learning`, verify they match the server enum decision (the train either adds `agent_learning` to the enum or strips it from `/project` skill docs -- check the landed behavior in `pnpm exec elevasis-sdk project:note:create --help` and in the project's synced `/project` SKILL).

### Step 6 -- Rebuild and type-check

Run from project root:

```
pnpm -C ui build
pnpm -C ui exec tsc --noEmit
pnpm -C operations exec tsc --noEmit
```

All three must pass before the update is complete.

## Verification

- `pnpm up` completes cleanly.
- `ui/src/lib/platform-utils.ts` contains no inlined `CredentialSchema | CredentialField | OAuthProviderConfig | OAuthToken | OAuthState | DOMAIN_MAP` definitions -- only imports from `@elevasis/ui`.
- `pnpm -C ui exec tsc --noEmit` passes with no missing-module errors for `@elevasis/ui/hooks`, `@elevasis/ui/components`, `@elevasis/ui/constants`, `@elevasis/ui/utils`, `@elevasis/ui/test-utils`.
- `pnpm exec elevasis-sdk doctor` reports project root correctly from the directories you use.
- `pnpm exec elevasis-sdk project:milestone:update --help` lists `--description`.
- `pnpm exec elevasis-sdk request:submit --help` shows enum values for `--type`, `--category`, `--severity`.

## Not handled by /git-sync

- `/git-sync` does not run `pnpm up` -- Step 2 is manual.
- `/git-sync` does not rewrite project-owned `ui/src/lib/platform-utils.ts` -- the inlined-to-imports swap in Step 3 is manual per project.
- `/git-sync` does not validate SDK CLI behavior from project terminals -- Step 4 verification is manual.
- Any project-local override that hard-references the deleted `_template/ui/src/lib/**` paths must be cleaned up manually.
