Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
a72fe58
refactor: extract auth packages
b3hr4d May 26, 2026
81510e7
docs: clarify authentication manager APIs
b3hr4d May 26, 2026
3d94557
feat: add Next.js App Router example with IC Reactor and TanStack Que…
b3hr4d May 26, 2026
79271d7
feat: refactor authentication and replace TodoList with TokenExplorer…
b3hr4d May 26, 2026
2dff8a7
Potential fix for pull request finding 'Unused variable, import, func…
b3hr4d May 30, 2026
9858a9d
Potential fix for pull request finding 'Unused variable, import, func…
b3hr4d May 30, 2026
3be3dcf
feat: refactor actor hooks to support generic service and method types
b3hr4d May 31, 2026
3e2bc06
feat: update pnpm workspace configuration and add example version syn…
b3hr4d May 31, 2026
18f6ca6
fix(ci): add Rust toolchain to typecheck-examples job
b3hr4d May 31, 2026
fb1edf9
fix: align postcss to ^8.5.12 matching main branch
b3hr4d May 31, 2026
ed8de17
fix(candid): load optional parser without build-time import
b3hr4d May 31, 2026
1c57c51
ci: skip example installs in package-only jobs
b3hr4d May 31, 2026
c36ea88
fix(docs): silence typedoc ts6 baseUrl deprecation
b3hr4d May 31, 2026
e2b020d
fix(candid): use ESM dynamic import for optional parser to support br…
b3hr4d May 31, 2026
bd27de2
fix(examples): import Principal from @icp-sdk/core/principal in nextj…
b3hr4d May 31, 2026
2bcf347
docs: Update type alias documentation and add new classes
b3hr4d Jun 1, 2026
42d612d
chore: update dependencies and refactor backend declarations
b3hr4d Jun 1, 2026
c917a8e
chore: update package manager to pnpm@10.30.3 in examples
b3hr4d Jun 1, 2026
0221f25
feat: initialize Vite project with ICP backend integration
b3hr4d Jun 1, 2026
31e570b
feat: add backend service declarations and hooks for actor interactions
b3hr4d Jun 4, 2026
9bf8f09
Remove withCanisterEnv option from backend reactor definition in SKIL…
b3hr4d Jun 5, 2026
5d80e7f
feat: add fresh session prompt for fixing and testing examples
b3hr4d Jun 9, 2026
697a7ba
feat: integrate @ic-reactor/vite-plugin and enhance Candid parser wit…
b3hr4d Jun 9, 2026
deb3e0e
refactor: simplify frontend configuration and streamline canister dec…
b3hr4d Jun 9, 2026
f4a6dd5
chore: update icp-reactor-demo backend declarations and documentation…
b3hr4d Jun 9, 2026
4ba79f7
refactor: enhance post schema with social metadata, modernize caniste…
b3hr4d Jun 9, 2026
f01fd65
refactor: simplify reactor initialization and improve agent host auto…
b3hr4d Jun 9, 2026
1f97030
refactor: add node_modules cleanup script, improve agent host resolut…
b3hr4d Jun 9, 2026
3facc5f
deprecated: mark port property as deprecated in client configuration …
b3hr4d Jun 9, 2026
32e4d63
refactor: remove deprecated ClientManager configuration properties an…
b3hr4d Jun 9, 2026
b564c8c
refactor: migrate canister declarations to use the ic-reactor vite pl…
b3hr4d Jun 9, 2026
d4d3caf
refactor: remove withProcessEnv property from ClientManager initializ…
b3hr4d Jun 10, 2026
9c45dc2
refactor: standardize formatting and improve backend declarations acr…
b3hr4d Jun 10, 2026
b6e88ff
update examples
b3hr4d Jun 10, 2026
a583c3c
update examples
b3hr4d Jun 10, 2026
169df85
refactor: update examples and documentation for clarity and consisten…
b3hr4d Jun 10, 2026
ca94f90
Fix Vite plugin example verification
b3hr4d Jun 10, 2026
2249e5a
Merge main into auth package extraction PR
b3hr4d Jun 10, 2026
31b9fe2
Fix identity attribute key trimming
b3hr4d Jun 10, 2026
4e2a457
Fix dependency security alerts
b3hr4d Jun 10, 2026
9f7c903
chore: rerun PR checks
b3hr4d Jun 10, 2026
634834a
Improve package agent guidance
b3hr4d Jun 10, 2026
0b95d1d
Add package architecture skill
b3hr4d Jun 10, 2026
784d6ce
Fix package release readiness gaps
b3hr4d Jun 10, 2026
924a0e2
docs: improve AI agent readability
b3hr4d Jun 10, 2026
f2661cd
Potential fix for pull request finding 'Unused variable, import, func…
b3hr4d Jun 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 4 additions & 1 deletion .cursorrules
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ const { mutate } = useActorMutation({
- **Callbacks**: `onCanisterError` (not calling it just `onError` when referring to canister logic errors).

## Documentation
- Refer to `llms.txt` in the root directory for a comprehensive API overview and high-level concepts.
- Refer to `llms.txt` in the root directory for compact package/task routing.
- Refer to `llms-full.txt` for a longer API overview and task-oriented AI guide.
- Refer to `/docs` for detailed guides and examples.
- Refer to `skill-packages/ic-reactor-packages/SKILL.md` for package ownership, exports, generated artifacts, and verification workflows.
- Refer to `skill-packages/ic-reactor-hooks/SKILL.md` for React hook, query/mutation factory, and cache invalidation patterns.

## Tech Stack
- TypeScript
Expand Down
26 changes: 26 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@ Follow these repository-specific patterns when suggesting code:
- Prefer small, explicit changes over large custom abstractions.
- Keep TypeScript types accurate and inferable.
- Do not hand-edit generated files unless the user explicitly asks.
- For package ownership, exports, generated artifacts, or verification workflow questions, use `skill-packages/ic-reactor-packages/SKILL.md`.
- For React hook/factory implementation questions, use `skill-packages/ic-reactor-hooks/SKILL.md`.

## Package Ownership

- `packages/core` owns framework-agnostic runtime behavior: `ClientManager`, `Reactor`, `DisplayReactor`, and query-cache integration.
- `packages/react` owns React hooks, query/mutation factories, `defineReactor`, and `useActorMethod`.
- `packages/auth` owns Internet Identity auth state, auth client loading, and identity attributes.
- `packages/auth-react` owns React hooks over the auth managers.
- `packages/candid` owns runtime Candid fetching/parsing adapters and dynamic reactors.
- `packages/parser` owns the Rust/WASM Candid parser.
- `packages/codegen` owns declaration, reactor, client, and hook generation.
- `packages/cli` owns the `ic-reactor` executable and config schema.
- `packages/vite-plugin` owns Vite integration, `.did` watching, and environment-cookie injection.

## React Hook Patterns (Important)

Expand Down Expand Up @@ -52,7 +66,19 @@ Follow these repository-specific patterns when suggesting code:

- `packages/react/src/`
- `packages/react/README.md`
- `packages/auth/README.md`
- `packages/auth-react/README.md`
- `examples/all-in-one-demo/src/lib/factories.ts`
- `examples/tanstack-router/src/canisters/ledger/hooks/`
- `AGENTS.md`
- `llms.txt`
- `llms-full.txt`
- `skill-packages/ic-reactor-hooks/SKILL.md`
- `skill-packages/ic-reactor-packages/SKILL.md`

## Verification

- Package builds: `pnpm build`
- Package tests: `pnpm test`
- Root type check used by CI: `pnpm exec tsc --noEmit`
- Example type checks: `pnpm typecheck:examples`
54 changes: 50 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,63 @@ jobs:
targets: wasm32-unknown-unknown

- name: Install dependencies
run: pnpm install --frozen-lockfile
run: pnpm install --frozen-lockfile --filter '!./examples/**'

- name: Format check
run: pnpm format:check

- name: Build packages (excluding parser)
- name: Build packages
run: pnpm build

- name: Type check
run: pnpm exec tsc --noEmit

typecheck-examples:
name: Type Check Examples
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22

- name: Setup pnpm
run: |
corepack enable
corepack prepare pnpm@10.30.3 --activate
pnpm --version

- name: Get pnpm store path
id: pnpm-store
run: echo "path=$(pnpm store path)" >> "$GITHUB_OUTPUT"

- name: Cache pnpm store
uses: actions/cache@v5
with:
path: ${{ steps.pnpm-store.outputs.path }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown

- name: Install dependencies
run: pnpm install --frozen-lockfile

# Examples import the @ic-reactor/* packages through the workspace symlinks,
# so they must be built before type-checking the examples.
- name: Build packages
run: pnpm build

- name: Type check examples
run: pnpm typecheck:examples

test:
name: Test
runs-on: ubuntu-latest
Expand Down Expand Up @@ -94,7 +140,7 @@ jobs:
targets: wasm32-unknown-unknown

- name: Install dependencies
run: pnpm install --frozen-lockfile
run: pnpm install --frozen-lockfile --filter '!./examples/**'

- name: Build packages (excluding parser)
run: pnpm build
Expand Down Expand Up @@ -138,7 +184,7 @@ jobs:
targets: wasm32-unknown-unknown

- name: Install dependencies
run: pnpm install --frozen-lockfile
run: pnpm install --frozen-lockfile --filter '!./examples/**'

- name: Cache Rust dependencies
uses: actions/cache@v5
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
workspace:
- packages/core
- packages/react
- packages/auth
- packages/auth-react
- packages/candid
steps:
- name: Checkout
Expand Down
95 changes: 95 additions & 0 deletions .github/workflows/sync-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Sync Example Versions

# After a successful Release (tag push that published the packages to npm), bump
# the pinned @ic-reactor/* versions in every example so a standalone
# StackBlitz/CodeSandbox install resolves the just-released version. Inside this
# workspace the examples keep linking to the local packages/* regardless.
on:
workflow_run:
workflows: ["Release"]
types: [completed]
# Allow manually re-syncing (e.g. after a hotfix) from the Actions tab.
workflow_dispatch:
inputs:
version:
description: "Version to sync examples to (defaults to root package.json version)"
required: false
type: string

permissions:
contents: write
pull-requests: write

jobs:
sync:
name: Sync & open PR
runs-on: ubuntu-latest
# Only run when the triggering Release workflow succeeded (workflow_dispatch
# has no workflow_run payload, so the conclusion check passes through).
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
# Check out main so the PR branches from the default branch rather than
# the tag that triggered the release.
ref: main
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22

- name: Setup pnpm
run: |
corepack enable
corepack prepare pnpm@10.30.3 --activate
pnpm --version

- name: Get pnpm store path
id: pnpm-store
run: echo "path=$(pnpm store path)" >> "$GITHUB_OUTPUT"

- name: Cache pnpm store
uses: actions/cache@v5
with:
path: ${{ steps.pnpm-store.outputs.path }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Resolve target version
id: version
run: |
if [ -n "${{ inputs.version }}" ]; then
VERSION="${{ inputs.version }}"
else
VERSION="$(node -p "require('./package.json').version")"
fi
echo "value=$VERSION" >> "$GITHUB_OUTPUT"
echo "Syncing examples to $VERSION"

- name: Sync example versions
run: pnpm sync:examples "${{ steps.version.outputs.value }}"

- name: Install to refresh lockfile
run: pnpm install --lockfile-only

- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
commit-message: "chore(examples): sync @ic-reactor/* to v${{ steps.version.outputs.value }}"
branch: chore/sync-examples-v${{ steps.version.outputs.value }}
delete-branch: true
title: "chore(examples): sync @ic-reactor/* to v${{ steps.version.outputs.value }}"
body: |
Automated sync of the pinned `@ic-reactor/*` versions in `examples/*`
to **v${{ steps.version.outputs.value }}** after the latest release.

This keeps standalone StackBlitz/CodeSandbox installs (which resolve
from npm outside the workspace) on the just-published version. Inside
the workspace the examples still link to the local `packages/*`.
labels: |
examples
automated
45 changes: 39 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,39 @@ A skill is a set of local instructions to follow that is stored in a `SKILL.md`
### Available skills

- `ic-reactor-hooks`: Create, refactor, and document Reactor hook integrations for this repo, including `createActorHooks`, query/mutation factories, `useActorMethod`, and generated hooks. Use when implementing or explaining hook usage inside React components versus imperative usage outside React. (file: `skill-packages/ic-reactor-hooks/SKILL.md`)
- `ic-reactor-packages`: Inspect, modify, review, or document the IC Reactor monorepo package architecture, package ownership, exports, tsconfig/project references, generated artifacts, dependency boundaries, and package verification workflows. Use when deciding which package owns a behavior or when work spans package metadata/build/test/release readiness. (file: `skill-packages/ic-reactor-packages/SKILL.md`)

## Package map

Use this map before editing so you can start in the package that owns the behavior:

| Package | Owns | Look here first |
| ------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| `@ic-reactor/core` | Framework-agnostic runtime: `ClientManager`, `Reactor`, `DisplayReactor`, query-cache integration | `packages/core/src/`, `packages/core/tests/` |
| `@ic-reactor/react` | React hook factories, reusable query/mutation objects, `defineReactor`, `useActorMethod` | `packages/react/src/`, `packages/react/tests/`, `skill-packages/ic-reactor-hooks/SKILL.md` |
| `@ic-reactor/auth` | Internet Identity auth state, auth client loading, identity attributes | `packages/auth/src/`, `packages/auth/tests/` |
| `@ic-reactor/auth-react` | React hooks over `@ic-reactor/auth` managers | `packages/auth-react/src/`, `packages/auth-react/tests/` |
| `@ic-reactor/candid` | Runtime Candid fetching/parsing adapters and dynamic reactors | `packages/candid/src/`, `packages/candid/METADATA_REACTOR_GUIDE.md` |
| `@ic-reactor/parser` | Rust/WASM Candid parser package | `packages/parser/src/`, `packages/parser/tests/` |
| `@ic-reactor/codegen` | Shared declaration/reactor/client generation pipeline | `packages/codegen/src/`, `packages/codegen/src/*.test.ts` |
| `@ic-reactor/cli` | `ic-reactor` command-line interface and config schema | `packages/cli/src/`, `packages/cli/schema.json` |
| `@ic-reactor/vite-plugin` | Vite integration, `.did` watching, environment-cookie injection | `packages/vite-plugin/src/`, `examples/vite-plugin-demo/`, `examples/vite-environment-variables/` |

## Verification commands

- Package builds: `pnpm build`
- Package tests: `pnpm test`
- Root type check used by CI: `pnpm exec tsc --noEmit`
- Example type checks: `pnpm typecheck:examples`
- Docs build: `pnpm docs:build`
- Dependency audit: `corepack pnpm audit --audit-level moderate`

Generated outputs under `dist`, `.dfx`, `.icp`, `.mops`, `target`, `.next`, `.astro`, and `*.tsbuildinfo` are normally build artifacts. Do not hand-edit generated hook files; change the generator, wrapper, or source `.did` instead.

## AI context files

- `llms.txt`: compact package/task routing manifest
- `llms-full.txt`: longer AI-friendly API and task guide

### How to use skills

Expand All @@ -27,9 +60,9 @@ A skill is a set of local instructions to follow that is stored in a `SKILL.md`

These skills are designed to work across multiple AI agent platforms. Each skill includes agent-specific metadata in `agents/`:

| Agent Platform | Metadata File | Project Discovery File |
| ------------------ | --------------------- | ----------------------------------- |
| OpenAI Codex | `agents/openai.yaml` | `AGENTS.md` (this file) |
| Claude / Anthropic | `agents/claude.yaml` | `CLAUDE.md` |
| GitHub Copilot | `agents/copilot.yaml` | `.github/copilot-instructions.md` |
| Cursor | — | `.cursorrules` |
| Agent Platform | Metadata File | Project Discovery File |
| ------------------ | --------------------- | --------------------------------- |
| OpenAI Codex | `agents/openai.yaml` | `AGENTS.md` (this file) |
| Claude / Anthropic | `agents/claude.yaml` | `CLAUDE.md` |
| GitHub Copilot | `agents/copilot.yaml` | `.github/copilot-instructions.md` |
| Cursor | — | `.cursorrules` |
27 changes: 26 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,38 @@ This file provides context for Claude-based AI agents working in the IC Reactor

- `@ic-reactor/core` — Low-level API for managing actors, agents, and query caching
- `@ic-reactor/react` — High-level React hooks and context providers
- `@ic-reactor/auth` — Internet Identity auth state and identity attributes
- `@ic-reactor/auth-react` — React hooks for `@ic-reactor/auth`
- `@ic-reactor/candid` — Dynamic Candid parsing and runtime reactors
- `@ic-reactor/parser` — Rust/WASM Candid parser used by candid and codegen flows
- `@ic-reactor/codegen` — Shared declaration/reactor/client generation pipeline
- `@ic-reactor/cli` — Code generation for declarations + typed hooks/reactors
- `@ic-reactor/vite-plugin` — Watch-mode code generation for Vite projects

## Package Ownership Map

Start in the package that owns the behavior:

| Package | Primary files |
| ------------------------- | ------------------------------------------------------------------------------------------------- |
| `@ic-reactor/core` | `packages/core/src/`, `packages/core/tests/` |
| `@ic-reactor/react` | `packages/react/src/`, `packages/react/tests/`, `skill-packages/ic-reactor-hooks/SKILL.md` |
| `@ic-reactor/auth` | `packages/auth/src/`, `packages/auth/tests/` |
| `@ic-reactor/auth-react` | `packages/auth-react/src/`, `packages/auth-react/tests/` |
| `@ic-reactor/candid` | `packages/candid/src/`, `packages/candid/METADATA_REACTOR_GUIDE.md` |
| `@ic-reactor/parser` | `packages/parser/src/`, `packages/parser/tests/` |
| `@ic-reactor/codegen` | `packages/codegen/src/`, `packages/codegen/src/*.test.ts` |
| `@ic-reactor/cli` | `packages/cli/src/`, `packages/cli/schema.json` |
| `@ic-reactor/vite-plugin` | `packages/vite-plugin/src/`, `examples/vite-plugin-demo/`, `examples/vite-environment-variables/` |

## Skills

Skills are structured instruction sets stored in `skill-packages/`. When a task matches a skill's description, load the skill's `SKILL.md` and follow its workflow.

### Available Skills

- **`ic-reactor-hooks`**: Create, refactor, and document Reactor hook integrations, including `createActorHooks`, query/mutation factories, `useActorMethod`, and generated hooks. Use when implementing or explaining hook usage inside React components versus imperative usage outside React. (file: `skill-packages/ic-reactor-hooks/SKILL.md`)
- **`ic-reactor-packages`**: Inspect, modify, review, or document package ownership, exports, tsconfig/project references, generated artifacts, dependency boundaries, and verification workflows across the IC Reactor monorepo. Use when deciding which package owns behavior or when work spans package metadata/build/test/release readiness. (file: `skill-packages/ic-reactor-packages/SKILL.md`)

### How to Use Skills

Expand Down Expand Up @@ -72,13 +93,17 @@ Skills are structured instruction sets stored in `skill-packages/`. When a task
pnpm install # Install dependencies
pnpm build # Build all packages
pnpm test # Run all tests
pnpm exec tsc --noEmit # Root type check used by CI
pnpm typecheck:examples # Type-check example apps
pnpm format # Format code with Prettier
```

## Key File References

- `llms.txt` — Comprehensive AI-friendly API guide
- `llms.txt` — Compact AI routing manifest
- `llms-full.txt` — Longer AI-friendly API and task guide
- `skill-packages/ic-reactor-hooks/SKILL.md` — Hook patterns skill
- `skill-packages/ic-reactor-packages/SKILL.md` — Package ownership and verification skill
- `packages/react/src/` — React package source
- `packages/react/README.md` — React package docs
- `examples/all-in-one-demo/src/lib/factories.ts` — Factory pattern examples
Expand Down
Loading
Loading