@mandujs/mcp 0.38.11 → 0.39.0-beta.1
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/README.md +3 -3
- package/package.json +3 -5
- package/src/activity-adapter.ts +23 -23
- package/src/activity-monitor.ts +39 -10
- package/src/adapters/index.ts +20 -20
- package/src/adapters/monitor-adapter.ts +100 -100
- package/src/adapters/tool-adapter.ts +90 -90
- package/src/executor/index.ts +22 -22
- package/src/executor/tool-executor.ts +148 -148
- package/src/hooks/config-watcher.ts +173 -173
- package/src/hooks/index.ts +23 -23
- package/src/hooks/mcp-hooks.ts +227 -227
- package/src/index.ts +5 -5
- package/src/logging/index.ts +15 -15
- package/src/logging/mcp-transport.ts +134 -134
- package/src/new-resources.ts +2 -2
- package/src/profiles.ts +25 -54
- package/src/prompts.ts +4 -4
- package/src/registry/index.ts +13 -13
- package/src/registry/mcp-tool-registry.ts +298 -298
- package/src/resources/generated-skills/catalog.ts +36 -0
- package/src/resources/generated-skills/mandu-agent-workflow/SKILL.md +48 -0
- package/src/resources/generated-skills/mandu-contract/SKILL.md +20 -0
- package/src/resources/generated-skills/mandu-fs-routes/SKILL.md +19 -0
- package/src/resources/generated-skills/mandu-guard/SKILL.md +20 -0
- package/src/resources/generated-skills/mandu-hydration/SKILL.md +19 -0
- package/src/resources/generated-skills/mandu-testing/SKILL.md +20 -0
- package/src/resources/handlers.ts +3 -3
- package/src/resources/skills/guides.ts +49 -49
- package/src/resources/skills/index.ts +12 -12
- package/src/resources/skills/loader.ts +8 -35
- package/src/resources/skills/recipes.ts +28 -28
- package/src/server.ts +1 -1
- package/src/tools/agent.ts +479 -409
- package/src/tools/ate-exemplar.ts +92 -92
- package/src/tools/ate-flakes.ts +90 -90
- package/src/tools/ate-mutate.ts +103 -103
- package/src/tools/ate-mutation-report.ts +64 -64
- package/src/tools/ate-oracle-pending.ts +49 -49
- package/src/tools/ate-oracle-replay.ts +44 -44
- package/src/tools/ate-oracle-verdict.ts +70 -70
- package/src/tools/ate-prompt.ts +146 -146
- package/src/tools/ate-run.ts +1 -1
- package/src/tools/ate.ts +38 -38
- package/src/tools/brain.ts +6 -6
- package/src/tools/composite.ts +19 -61
- package/src/tools/contract.ts +11 -9
- package/src/tools/deploy-plan.ts +2 -2
- package/src/tools/deploy-preview.ts +316 -316
- package/src/tools/design.ts +825 -825
- package/src/tools/docs.ts +350 -350
- package/src/tools/generate.ts +4 -3
- package/src/tools/guard.ts +1 -1
- package/src/tools/history.ts +1 -1
- package/src/tools/hydration.ts +64 -64
- package/src/tools/index.ts +0 -118
- package/src/tools/kitchen.ts +72 -72
- package/src/tools/lint.ts +226 -226
- package/src/tools/loop-close.ts +175 -175
- package/src/tools/negotiate.ts +263 -263
- package/src/tools/resource.ts +1 -1
- package/src/tools/run-tests.ts +424 -424
- package/src/tools/runtime.ts +1 -1
- package/src/tools/seo.ts +1 -1
- package/src/tools/slot-validation.ts +19 -19
- package/src/tools/spec.ts +201 -201
- package/src/tools/transaction.ts +1 -1
- package/src/tx-lock.ts +73 -73
- package/src/utils/runtime-control.ts +52 -52
- package/src/utils/withWarnings.ts +1 -1
- package/src/resources/skills/mandu-agent-workflow/SKILL.md +0 -124
- package/src/resources/skills/mandu-agent-workflow/metadata.json +0 -7
- package/src/resources/skills/mandu-composition/SKILL.md +0 -131
- package/src/resources/skills/mandu-composition/metadata.json +0 -13
- package/src/resources/skills/mandu-composition/rules/_sections.md +0 -26
- package/src/resources/skills/mandu-composition/rules/_template.md +0 -77
- package/src/resources/skills/mandu-composition/rules/comp-arch-avoid-boolean-props.md +0 -146
- package/src/resources/skills/mandu-composition/rules/comp-arch-compound-components.md +0 -164
- package/src/resources/skills/mandu-composition/rules/comp-island-event.md +0 -161
- package/src/resources/skills/mandu-composition/rules/comp-island-slot-split.md +0 -167
- package/src/resources/skills/mandu-composition/rules/comp-pattern-children.md +0 -149
- package/src/resources/skills/mandu-composition/rules/comp-state-context-interface.md +0 -148
- package/src/resources/skills/mandu-composition/rules/comp-state-lift-state.md +0 -150
- package/src/resources/skills/mandu-deployment/SKILL.md +0 -135
- package/src/resources/skills/mandu-deployment/_sections.md +0 -41
- package/src/resources/skills/mandu-deployment/_template.md +0 -38
- package/src/resources/skills/mandu-deployment/metadata.json +0 -13
- package/src/resources/skills/mandu-deployment/rules/db-provider-supabase.md +0 -300
- package/src/resources/skills/mandu-deployment/rules/deploy-build-bun.md +0 -109
- package/src/resources/skills/mandu-deployment/rules/deploy-build-output.md +0 -115
- package/src/resources/skills/mandu-deployment/rules/deploy-cicd-github.md +0 -219
- package/src/resources/skills/mandu-deployment/rules/deploy-docker-bun.md +0 -150
- package/src/resources/skills/mandu-deployment/rules/deploy-docker-compose.md +0 -223
- package/src/resources/skills/mandu-deployment/rules/deploy-platform-fly.md +0 -152
- package/src/resources/skills/mandu-deployment/rules/deploy-platform-render.md +0 -179
- package/src/resources/skills/mandu-deployment/rules/deploy-platform-vercel.md +0 -140
- package/src/resources/skills/mandu-fs-routes/SKILL.md +0 -122
- package/src/resources/skills/mandu-fs-routes/metadata.json +0 -12
- package/src/resources/skills/mandu-fs-routes/rules/_sections.md +0 -36
- package/src/resources/skills/mandu-fs-routes/rules/_template.md +0 -69
- package/src/resources/skills/mandu-fs-routes/rules/routes-api-methods.md +0 -65
- package/src/resources/skills/mandu-fs-routes/rules/routes-dynamic-param.md +0 -93
- package/src/resources/skills/mandu-fs-routes/rules/routes-naming-page.md +0 -55
- package/src/resources/skills/mandu-guard/SKILL.md +0 -162
- package/src/resources/skills/mandu-guard/metadata.json +0 -12
- package/src/resources/skills/mandu-guard/rules/_sections.md +0 -36
- package/src/resources/skills/mandu-guard/rules/_template.md +0 -82
- package/src/resources/skills/mandu-guard/rules/guard-config-rules.md +0 -100
- package/src/resources/skills/mandu-guard/rules/guard-layer-direction.md +0 -76
- package/src/resources/skills/mandu-guard/rules/guard-preset-mandu.md +0 -81
- package/src/resources/skills/mandu-guard/rules/guard-validate-import.md +0 -80
- package/src/resources/skills/mandu-hydration/SKILL.md +0 -139
- package/src/resources/skills/mandu-hydration/metadata.json +0 -12
- package/src/resources/skills/mandu-hydration/rules/_sections.md +0 -31
- package/src/resources/skills/mandu-hydration/rules/_template.md +0 -72
- package/src/resources/skills/mandu-hydration/rules/hydration-data-event.md +0 -109
- package/src/resources/skills/mandu-hydration/rules/hydration-directive-use-client.md +0 -55
- package/src/resources/skills/mandu-hydration/rules/hydration-island-setup.md +0 -160
- package/src/resources/skills/mandu-hydration/rules/hydration-priority-visible.md +0 -91
- package/src/resources/skills/mandu-performance/SKILL.md +0 -125
- package/src/resources/skills/mandu-performance/metadata.json +0 -14
- package/src/resources/skills/mandu-performance/rules/_sections.md +0 -31
- package/src/resources/skills/mandu-performance/rules/_template.md +0 -64
- package/src/resources/skills/mandu-performance/rules/perf-async-defer-await.md +0 -103
- package/src/resources/skills/mandu-performance/rules/perf-async-parallel.md +0 -95
- package/src/resources/skills/mandu-performance/rules/perf-bun-file.md +0 -124
- package/src/resources/skills/mandu-performance/rules/perf-bun-serve.md +0 -125
- package/src/resources/skills/mandu-performance/rules/perf-bundle-imports.md +0 -80
- package/src/resources/skills/mandu-performance/rules/perf-bundle-island-lazy.md +0 -145
- package/src/resources/skills/mandu-performance/rules/perf-cache-react.md +0 -98
- package/src/resources/skills/mandu-performance/rules/perf-render-transitions.md +0 -154
- package/src/resources/skills/mandu-security/SKILL.md +0 -127
- package/src/resources/skills/mandu-security/metadata.json +0 -13
- package/src/resources/skills/mandu-security/rules/_sections.md +0 -31
- package/src/resources/skills/mandu-security/rules/_template.md +0 -74
- package/src/resources/skills/mandu-security/rules/sec-auth-guard.md +0 -127
- package/src/resources/skills/mandu-security/rules/sec-env-management.md +0 -133
- package/src/resources/skills/mandu-security/rules/sec-input-validate.md +0 -148
- package/src/resources/skills/mandu-security/rules/sec-protect-csrf.md +0 -146
- package/src/resources/skills/mandu-security/rules/sec-protect-headers.md +0 -138
- package/src/resources/skills/mandu-slot/SKILL.md +0 -125
- package/src/resources/skills/mandu-slot/metadata.json +0 -12
- package/src/resources/skills/mandu-slot/rules/_sections.md +0 -36
- package/src/resources/skills/mandu-slot/rules/_template.md +0 -63
- package/src/resources/skills/mandu-slot/rules/slot-basic-structure.md +0 -38
- package/src/resources/skills/mandu-slot/rules/slot-ctx-response.md +0 -56
- package/src/resources/skills/mandu-slot/rules/slot-guard-auth.md +0 -59
- package/src/resources/skills/mandu-slot/rules/slot-http-methods.md +0 -64
- package/src/resources/skills/mandu-styling/SKILL.md +0 -196
- package/src/resources/skills/mandu-styling/_sections.md +0 -43
- package/src/resources/skills/mandu-styling/_template.md +0 -32
- package/src/resources/skills/mandu-styling/metadata.json +0 -15
- package/src/resources/skills/mandu-styling/rules/style-component-compound.md +0 -235
- package/src/resources/skills/mandu-styling/rules/style-component-slots.md +0 -255
- package/src/resources/skills/mandu-styling/rules/style-component-tokens.md +0 -205
- package/src/resources/skills/mandu-styling/rules/style-island-animations.md +0 -272
- package/src/resources/skills/mandu-styling/rules/style-island-scoping.md +0 -167
- package/src/resources/skills/mandu-styling/rules/style-island-variants.md +0 -221
- package/src/resources/skills/mandu-styling/rules/style-perf-critical.md +0 -209
- package/src/resources/skills/mandu-styling/rules/style-perf-purge.md +0 -192
- package/src/resources/skills/mandu-styling/rules/style-setup-modules.md +0 -162
- package/src/resources/skills/mandu-styling/rules/style-setup-panda.md +0 -164
- package/src/resources/skills/mandu-styling/rules/style-setup-tailwind.md +0 -170
- package/src/resources/skills/mandu-styling/rules/style-tailwind-v4-gotchas.md +0 -179
- package/src/resources/skills/mandu-styling/rules/style-theme-darkmode.md +0 -229
- package/src/resources/skills/mandu-testing/SKILL.md +0 -132
- package/src/resources/skills/mandu-testing/metadata.json +0 -13
- package/src/resources/skills/mandu-testing/rules/_sections.md +0 -26
- package/src/resources/skills/mandu-testing/rules/_template.md +0 -65
- package/src/resources/skills/mandu-testing/rules/test-component-island.md +0 -195
- package/src/resources/skills/mandu-testing/rules/test-e2e-playwright.md +0 -196
- package/src/resources/skills/mandu-testing/rules/test-mock-fetch.md +0 -219
- package/src/resources/skills/mandu-testing/rules/test-slot-unit.md +0 -192
- package/src/resources/skills/mandu-ui/SKILL.md +0 -159
- package/src/resources/skills/mandu-ui/_sections.md +0 -23
- package/src/resources/skills/mandu-ui/_template.md +0 -32
- package/src/resources/skills/mandu-ui/metadata.json +0 -13
- package/src/resources/skills/mandu-ui/rules/ui-accessibility-aria.md +0 -232
- package/src/resources/skills/mandu-ui/rules/ui-accessibility-focus.md +0 -238
- package/src/resources/skills/mandu-ui/rules/ui-composition-patterns.md +0 -259
- package/src/resources/skills/mandu-ui/rules/ui-island-integration.md +0 -258
- package/src/resources/skills/mandu-ui/rules/ui-radix-patterns.md +0 -213
- package/src/resources/skills/mandu-ui/rules/ui-shadcn-setup.md +0 -209
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mandu-contract
|
|
3
|
+
description: Define and preserve typed Mandu API contracts.
|
|
4
|
+
license: MPL-2.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Mandu Contracts
|
|
8
|
+
|
|
9
|
+
Use after planning selects an API or contract change.
|
|
10
|
+
|
|
11
|
+
- Keep request, response, method, and status schemas machine-readable.
|
|
12
|
+
- Co-locate or link the contract using the surrounding project convention.
|
|
13
|
+
- Change handler and contract together; do not weaken validation to silence a
|
|
14
|
+
mismatch.
|
|
15
|
+
- Generated clients and OpenAPI artifacts are outputs, not direct-edit inputs.
|
|
16
|
+
- Preserve existing consumer behavior unless the plan explicitly authorizes a
|
|
17
|
+
breaking change.
|
|
18
|
+
|
|
19
|
+
Prefer `mandu.agent.apply` for a typed contract operation. Run targeted tests
|
|
20
|
+
and finish with `mandu.agent.verify --changed --json --write`.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mandu-fs-routes
|
|
3
|
+
description: Author Mandu pages and APIs through the app directory convention.
|
|
4
|
+
license: MPL-2.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Mandu FS Routes
|
|
8
|
+
|
|
9
|
+
Use after `mandu.agent.plan` selects the route or API domain.
|
|
10
|
+
|
|
11
|
+
- `app/page.tsx` maps to `/`.
|
|
12
|
+
- `app/<segment>/page.tsx` maps to a page route.
|
|
13
|
+
- `app/api/<segment>/route.ts` maps to an API route.
|
|
14
|
+
- `[id]`, `[...slug]`, and `[[...slug]]` define dynamic segments.
|
|
15
|
+
- Layouts use `layout.tsx`; never edit generated route manifests directly.
|
|
16
|
+
|
|
17
|
+
Inspect the nearest existing route before writing. Prefer
|
|
18
|
+
`mandu.agent.apply`; otherwise keep direct edits inside the planned `app/**`
|
|
19
|
+
scope. Verify with `mandu.agent.verify --changed --json --write`.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mandu-guard
|
|
3
|
+
description: Resolve Mandu architecture violations without weakening policy.
|
|
4
|
+
license: MPL-2.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Mandu Guard
|
|
8
|
+
|
|
9
|
+
Use when planning or verification reports an import, layer, location, or
|
|
10
|
+
generated-artifact violation.
|
|
11
|
+
|
|
12
|
+
- Fix the dependency direction or file ownership that caused the diagnostic.
|
|
13
|
+
- Do not disable a rule or broaden an allowlist unless policy change is the
|
|
14
|
+
explicit task.
|
|
15
|
+
- Read generated data through the runtime registry; never import or edit
|
|
16
|
+
`.mandu/generated` artifacts directly.
|
|
17
|
+
- Keep fixes inside the plan scope and preserve user changes.
|
|
18
|
+
|
|
19
|
+
Start with `mandu.agent.verify`, use `mandu.agent.repair` for structured next
|
|
20
|
+
actions, and verify again after the repair.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mandu-hydration
|
|
3
|
+
description: Keep Mandu server rendering and client islands deterministic.
|
|
4
|
+
license: MPL-2.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Mandu Hydration
|
|
8
|
+
|
|
9
|
+
Use for islands, partials, client boundaries, or hydration diagnostics.
|
|
10
|
+
|
|
11
|
+
- Server pages remain server-owned; move interactive state into an island.
|
|
12
|
+
- Use explicit client-boundary metadata and serializable props.
|
|
13
|
+
- Never import a generated client artifact directly.
|
|
14
|
+
- Keep HTML, manifest, and client asset URLs pinned to one build generation.
|
|
15
|
+
- Treat missing client assets or hydration samples as failures when the route
|
|
16
|
+
declares hydration.
|
|
17
|
+
|
|
18
|
+
Run the targeted hydration tests requested by the plan, then
|
|
19
|
+
`mandu.agent.verify --changed --json --write`.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mandu-testing
|
|
3
|
+
description: Select and run evidence-bearing Bun tests for Mandu changes.
|
|
4
|
+
license: MPL-2.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Mandu Testing
|
|
8
|
+
|
|
9
|
+
Use after planning identifies the changed behavior or verification recommends
|
|
10
|
+
a test.
|
|
11
|
+
|
|
12
|
+
- Prefer the smallest test that executes the changed contract, then expand to
|
|
13
|
+
the affected package and Golden Path.
|
|
14
|
+
- Use `bun test`; do not substitute npm or pnpm runners.
|
|
15
|
+
- Test failure paths, scope preservation, and generated-output invariants.
|
|
16
|
+
- Do not treat a dry run, fixture string, or missing measurement as successful
|
|
17
|
+
runtime evidence.
|
|
18
|
+
- ATE and browser-healing experiments are Labs and not part of stable testing.
|
|
19
|
+
|
|
20
|
+
Finish with `mandu.agent.verify --changed --json --write`.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Resource } from "@modelcontextprotocol/sdk/types.js";
|
|
2
2
|
import { loadManifest } from "@mandujs/core";
|
|
3
|
-
import { getTransactionStatus } from "@mandujs/core/change";
|
|
4
|
-
import type { GeneratedMap } from "@mandujs/core/generator";
|
|
5
|
-
import { getWatcher } from "@mandujs/core/watcher";
|
|
3
|
+
import { getTransactionStatus } from "@mandujs/core/compat/change/index";
|
|
4
|
+
import type { GeneratedMap } from "@mandujs/core/compat/generator/index";
|
|
5
|
+
import { getWatcher } from "@mandujs/core/compat/watcher/index";
|
|
6
6
|
import { getProjectPaths, readJsonFile } from "../utils/project.js";
|
|
7
7
|
import {
|
|
8
8
|
getGuide,
|
|
@@ -377,21 +377,21 @@ Island Hydration은 페이지의 일부분만 클라이언트에서 인터랙티
|
|
|
377
377
|
| \`idle\` | 브라우저 유휴 시 | 비중요 기능 |
|
|
378
378
|
| \`interaction\` | 사용자 상호작용 시 | 클릭해야 활성화 |
|
|
379
379
|
|
|
380
|
-
## Inline client region 만들기
|
|
381
|
-
|
|
382
|
-
### 1. 클라이언트 컴포넌트 작성
|
|
383
|
-
|
|
384
|
-
\`\`\`tsx
|
|
385
|
-
// app/counter/client.tsx
|
|
386
|
-
|
|
387
|
-
"use client";
|
|
388
|
-
|
|
389
|
-
import { useState } from "react";
|
|
390
|
-
|
|
391
|
-
export function Counter({ initial = 0 }: { initial?: number }) {
|
|
392
|
-
const [count, setCount] = useState(initial);
|
|
393
|
-
|
|
394
|
-
return (
|
|
380
|
+
## Inline client region 만들기
|
|
381
|
+
|
|
382
|
+
### 1. 클라이언트 컴포넌트 작성
|
|
383
|
+
|
|
384
|
+
\`\`\`tsx
|
|
385
|
+
// app/counter/client.tsx
|
|
386
|
+
|
|
387
|
+
"use client";
|
|
388
|
+
|
|
389
|
+
import { useState } from "react";
|
|
390
|
+
|
|
391
|
+
export function Counter({ initial = 0 }: { initial?: number }) {
|
|
392
|
+
const [count, setCount] = useState(initial);
|
|
393
|
+
|
|
394
|
+
return (
|
|
395
395
|
<div>
|
|
396
396
|
<p>Count: {count}</p>
|
|
397
397
|
<button onClick={() => setCount(c => c - 1)}>-</button>
|
|
@@ -399,43 +399,43 @@ export function Counter({ initial = 0 }: { initial?: number }) {
|
|
|
399
399
|
</div>
|
|
400
400
|
);
|
|
401
401
|
}
|
|
402
|
-
\`\`\`
|
|
403
|
-
|
|
404
|
-
### 2. 서버 페이지에서 partial로 사용
|
|
405
|
-
|
|
406
|
-
\`\`\`tsx
|
|
407
|
-
// app/counter/page.tsx
|
|
408
|
-
|
|
409
|
-
import { partial } from "@mandujs/core/client";
|
|
410
|
-
import { Counter } from "./client";
|
|
411
|
-
|
|
412
|
-
const CounterPartial = partial({
|
|
413
|
-
component: Counter,
|
|
414
|
-
priority: "visible",
|
|
415
|
-
});
|
|
416
|
-
|
|
417
|
-
export default function CounterPage() {
|
|
418
|
-
return (
|
|
402
|
+
\`\`\`
|
|
403
|
+
|
|
404
|
+
### 2. 서버 페이지에서 partial로 사용
|
|
405
|
+
|
|
406
|
+
\`\`\`tsx
|
|
407
|
+
// app/counter/page.tsx
|
|
408
|
+
|
|
409
|
+
import { partial } from "@mandujs/core/client";
|
|
410
|
+
import { Counter } from "./client";
|
|
411
|
+
|
|
412
|
+
const CounterPartial = partial({
|
|
413
|
+
component: Counter,
|
|
414
|
+
priority: "visible",
|
|
415
|
+
});
|
|
416
|
+
|
|
417
|
+
export default function CounterPage() {
|
|
418
|
+
return (
|
|
419
419
|
<div>
|
|
420
420
|
<h1>Counter Demo</h1>
|
|
421
421
|
<p>이 텍스트는 정적 HTML입니다.</p>
|
|
422
|
-
|
|
423
|
-
{/* 이 부분만 hydration됩니다 */}
|
|
424
|
-
<CounterPartial.Render initial={10} />
|
|
425
|
-
</div>
|
|
426
|
-
);
|
|
427
|
-
}
|
|
428
|
-
\`\`\`
|
|
429
|
-
|
|
430
|
-
## Mandu.island() API
|
|
431
|
-
|
|
432
|
-
고급 page-level Island 패턴을 위한 API입니다. \`Mandu.island()\`는 단일
|
|
433
|
-
정의 객체만 받습니다. \`island("visible", Component)\` 형태는 지원하지
|
|
434
|
-
않으며, 서버 페이지 안에 inline으로 렌더링할 영역은 \`partial()\`을
|
|
435
|
-
사용하세요.
|
|
436
|
-
|
|
437
|
-
\`\`\`typescript
|
|
438
|
-
// spec/slots/todos.client.ts
|
|
422
|
+
|
|
423
|
+
{/* 이 부분만 hydration됩니다 */}
|
|
424
|
+
<CounterPartial.Render initial={10} />
|
|
425
|
+
</div>
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
\`\`\`
|
|
429
|
+
|
|
430
|
+
## Mandu.island() API
|
|
431
|
+
|
|
432
|
+
고급 page-level Island 패턴을 위한 API입니다. \`Mandu.island()\`는 단일
|
|
433
|
+
정의 객체만 받습니다. \`island("visible", Component)\` 형태는 지원하지
|
|
434
|
+
않으며, 서버 페이지 안에 inline으로 렌더링할 영역은 \`partial()\`을
|
|
435
|
+
사용하세요.
|
|
436
|
+
|
|
437
|
+
\`\`\`typescript
|
|
438
|
+
// spec/slots/todos.client.ts
|
|
439
439
|
|
|
440
440
|
import { Mandu } from "@mandujs/core/client";
|
|
441
441
|
import { useState, useCallback } from "react";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { GUIDES, getGuide, listGuides, type GuideId } from "./guides.js";
|
|
2
|
-
export { RECIPES, getRecipe, listRecipes, type RecipeId } from "./recipes.js";
|
|
3
|
-
|
|
4
|
-
// Agent Skills pattern
|
|
5
|
-
export {
|
|
6
|
-
listSkills,
|
|
7
|
-
getSkill,
|
|
8
|
-
listSkillRules,
|
|
9
|
-
getSkillRule,
|
|
10
|
-
type SkillMeta,
|
|
11
|
-
type RuleMeta,
|
|
12
|
-
} from "./loader.js";
|
|
1
|
+
export { GUIDES, getGuide, listGuides, type GuideId } from "./guides.js";
|
|
2
|
+
export { RECIPES, getRecipe, listRecipes, type RecipeId } from "./recipes.js";
|
|
3
|
+
|
|
4
|
+
// Agent Skills pattern
|
|
5
|
+
export {
|
|
6
|
+
listSkills,
|
|
7
|
+
getSkill,
|
|
8
|
+
listSkillRules,
|
|
9
|
+
getSkillRule,
|
|
10
|
+
type SkillMeta,
|
|
11
|
+
type RuleMeta,
|
|
12
|
+
} from "./loader.js";
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
import { readdir, readFile } from "fs/promises";
|
|
7
7
|
import { join, dirname } from "path";
|
|
8
|
-
import { fileURLToPath } from "url";
|
|
8
|
+
import { fileURLToPath } from "url";
|
|
9
|
+
import { OFFICIAL_SKILLS, OFFICIAL_SKILL_IDS } from "../generated-skills/catalog.js";
|
|
9
10
|
|
|
10
11
|
const __filename = fileURLToPath(import.meta.url);
|
|
11
12
|
const __dirname = dirname(__filename);
|
|
@@ -26,21 +27,7 @@ export interface RuleMeta {
|
|
|
26
27
|
tags: string[];
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
const SKILL_IDS = [
|
|
31
|
-
"mandu-agent-workflow",
|
|
32
|
-
"mandu-slot",
|
|
33
|
-
"mandu-fs-routes",
|
|
34
|
-
"mandu-hydration",
|
|
35
|
-
"mandu-guard",
|
|
36
|
-
"mandu-performance",
|
|
37
|
-
"mandu-composition",
|
|
38
|
-
"mandu-security",
|
|
39
|
-
"mandu-testing",
|
|
40
|
-
"mandu-deployment",
|
|
41
|
-
"mandu-styling",
|
|
42
|
-
"mandu-ui",
|
|
43
|
-
];
|
|
30
|
+
const SKILL_IDS: readonly string[] = OFFICIAL_SKILL_IDS;
|
|
44
31
|
|
|
45
32
|
/**
|
|
46
33
|
* Parse YAML frontmatter from markdown content
|
|
@@ -94,22 +81,8 @@ export function listSkills(): SkillMeta[] {
|
|
|
94
81
|
});
|
|
95
82
|
}
|
|
96
83
|
|
|
97
|
-
function getSkillDescription(id: string): string {
|
|
98
|
-
|
|
99
|
-
"mandu-agent-workflow": "Canonical context -> plan -> apply -> verify -> repair workflow for Mandu agents",
|
|
100
|
-
"mandu-slot": "Business logic with Mandu.filling() API",
|
|
101
|
-
"mandu-fs-routes": "File-system based routing patterns",
|
|
102
|
-
"mandu-hydration": "Island hydration and client components",
|
|
103
|
-
"mandu-guard": "Architecture enforcement and layer dependencies",
|
|
104
|
-
"mandu-performance": "Performance optimization patterns for Mandu apps",
|
|
105
|
-
"mandu-composition": "React composition patterns for Islands and state",
|
|
106
|
-
"mandu-security": "Security best practices for authentication and protection",
|
|
107
|
-
"mandu-testing": "Testing patterns with Bun test and Playwright",
|
|
108
|
-
"mandu-deployment": "Production deployment with Render, Supabase, Docker, and CI/CD",
|
|
109
|
-
"mandu-styling": "CSS framework integration with Tailwind, Panda CSS, and theming",
|
|
110
|
-
"mandu-ui": "UI component library integration with shadcn/ui and accessibility",
|
|
111
|
-
};
|
|
112
|
-
return descriptions[id] || "";
|
|
84
|
+
function getSkillDescription(id: string): string {
|
|
85
|
+
return OFFICIAL_SKILLS.find((skill) => skill.id === id)?.description ?? "";
|
|
113
86
|
}
|
|
114
87
|
|
|
115
88
|
/**
|
|
@@ -120,7 +93,7 @@ export async function getSkill(skillId: string): Promise<{ meta: SkillMeta; cont
|
|
|
120
93
|
return null;
|
|
121
94
|
}
|
|
122
95
|
|
|
123
|
-
const skillPath = join(__dirname, skillId, "SKILL.md");
|
|
96
|
+
const skillPath = join(__dirname, "..", "generated-skills", skillId, "SKILL.md");
|
|
124
97
|
|
|
125
98
|
try {
|
|
126
99
|
const content = await readFile(skillPath, "utf-8");
|
|
@@ -149,7 +122,7 @@ export async function listSkillRules(skillId: string): Promise<RuleMeta[]> {
|
|
|
149
122
|
return [];
|
|
150
123
|
}
|
|
151
124
|
|
|
152
|
-
const rulesPath = join(__dirname, skillId, "rules");
|
|
125
|
+
const rulesPath = join(__dirname, "..", "generated-skills", skillId, "rules");
|
|
153
126
|
|
|
154
127
|
try {
|
|
155
128
|
const files = await readdir(rulesPath);
|
|
@@ -194,7 +167,7 @@ export async function getSkillRule(
|
|
|
194
167
|
return null;
|
|
195
168
|
}
|
|
196
169
|
|
|
197
|
-
const rulePath = join(__dirname, skillId, "rules", `${ruleId}.md`);
|
|
170
|
+
const rulePath = join(__dirname, "..", "generated-skills", skillId, "rules", `${ruleId}.md`);
|
|
198
171
|
|
|
199
172
|
try {
|
|
200
173
|
const content = await readFile(rulePath, "utf-8");
|
|
@@ -469,30 +469,30 @@ export default function Counter({ initial = 0, step = 1 }: CounterProps) {
|
|
|
469
469
|
}
|
|
470
470
|
\`\`\`
|
|
471
471
|
|
|
472
|
-
## Step 2: 서버 페이지에서 partial로 사용
|
|
473
|
-
|
|
474
|
-
\`\`\`tsx
|
|
475
|
-
// app/counter/page.tsx
|
|
476
|
-
|
|
477
|
-
import { partial } from "@mandujs/core/client";
|
|
478
|
-
import Counter from "./client";
|
|
479
|
-
|
|
480
|
-
const CounterPartial = partial({
|
|
481
|
-
component: Counter,
|
|
482
|
-
priority: "visible",
|
|
483
|
-
});
|
|
484
|
-
|
|
485
|
-
export default function CounterPage() {
|
|
486
|
-
return (
|
|
472
|
+
## Step 2: 서버 페이지에서 partial로 사용
|
|
473
|
+
|
|
474
|
+
\`\`\`tsx
|
|
475
|
+
// app/counter/page.tsx
|
|
476
|
+
|
|
477
|
+
import { partial } from "@mandujs/core/client";
|
|
478
|
+
import Counter from "./client";
|
|
479
|
+
|
|
480
|
+
const CounterPartial = partial({
|
|
481
|
+
component: Counter,
|
|
482
|
+
priority: "visible",
|
|
483
|
+
});
|
|
484
|
+
|
|
485
|
+
export default function CounterPage() {
|
|
486
|
+
return (
|
|
487
487
|
<div style={{ padding: "20px" }}>
|
|
488
488
|
<h1>Counter Demo</h1>
|
|
489
489
|
<p>아래 카운터는 클라이언트에서 hydration됩니다.</p>
|
|
490
|
-
|
|
491
|
-
{/* Inline client region */}
|
|
492
|
-
<CounterPartial.Render initial={10} step={5} />
|
|
493
|
-
|
|
494
|
-
<p style={{ marginTop: "20px", color: "#666" }}>
|
|
495
|
-
이 텍스트는 정적 HTML입니다.
|
|
490
|
+
|
|
491
|
+
{/* Inline client region */}
|
|
492
|
+
<CounterPartial.Render initial={10} step={5} />
|
|
493
|
+
|
|
494
|
+
<p style={{ marginTop: "20px", color: "#666" }}>
|
|
495
|
+
이 텍스트는 정적 HTML입니다.
|
|
496
496
|
</p>
|
|
497
497
|
</div>
|
|
498
498
|
);
|
|
@@ -624,13 +624,13 @@ export default function UserList() {
|
|
|
624
624
|
|
|
625
625
|
## Mandu.island() API (고급)
|
|
626
626
|
|
|
627
|
-
서버 데이터와 클라이언트 상태를 분리하는 page-level Island가 필요하면
|
|
628
|
-
\`Mandu.island({ setup, render })\`를 사용합니다. \`island("visible",
|
|
629
|
-
Component)\`는 지원하지 않습니다. 서버 페이지 안에 inline으로 렌더링할
|
|
630
|
-
영역은 \`partial()\`을 사용하세요.
|
|
631
|
-
|
|
632
|
-
\`\`\`typescript
|
|
633
|
-
// spec/slots/todos.client.ts
|
|
627
|
+
서버 데이터와 클라이언트 상태를 분리하는 page-level Island가 필요하면
|
|
628
|
+
\`Mandu.island({ setup, render })\`를 사용합니다. \`island("visible",
|
|
629
|
+
Component)\`는 지원하지 않습니다. 서버 페이지 안에 inline으로 렌더링할
|
|
630
|
+
영역은 \`partial()\`을 사용하세요.
|
|
631
|
+
|
|
632
|
+
\`\`\`typescript
|
|
633
|
+
// spec/slots/todos.client.ts
|
|
634
634
|
|
|
635
635
|
import { Mandu } from "@mandujs/core/client";
|
|
636
636
|
import { useState } from "react";
|
package/src/server.ts
CHANGED
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
23
23
|
|
|
24
24
|
import { loadManduConfig, type ManduConfig } from "@mandujs/core";
|
|
25
|
-
import { startWatcher } from "@mandujs/core/watcher";
|
|
25
|
+
import { startWatcher } from "@mandujs/core/compat/watcher/index";
|
|
26
26
|
|
|
27
27
|
// DNA-001: 플러그인 기반 도구 레지스트리
|
|
28
28
|
import { mcpToolRegistry } from "./registry/mcp-tool-registry.js";
|