@capstone-nomos/cli 0.1.12 → 0.1.13

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.
@@ -125,6 +125,19 @@ server.registerTool('publish_note', {
125
125
  affects: affects ?? [],
126
126
  ...(supersedes === undefined ? {} : { supersedes }),
127
127
  }), 'publish_note'));
128
+ server.registerTool('read_contracts', {
129
+ title: 'Read confirmed API contracts',
130
+ description: 'Read the confirmed API contracts (OpenAPI fragments) of the project — the backend owner confirmed these, and frontend and backend must follow them exactly. ' +
131
+ "The contract for your own task's feature is already in your prompt; use this when you need another feature's API (paths, request/response fields, error status codes).",
132
+ inputSchema: {
133
+ project_id: z.string().describe('Project id'),
134
+ feature_key: z.string().optional().describe('Only this feature (e.g. F-02)'),
135
+ },
136
+ }, async ({ project_id, feature_key }) => run(async () => {
137
+ const { contracts } = await client.readContracts(project_id);
138
+ const picked = feature_key === undefined ? contracts : contracts.filter((c) => c.featureKey === feature_key);
139
+ return { contracts: picked.map((c) => ({ featureKey: c.featureKey, title: c.specTitle, summary: c.summary, openapiYaml: c.schemaYaml })) };
140
+ }, 'read_contracts'));
128
141
  server.registerTool('read_notes', {
129
142
  title: 'Read handover notes',
130
143
  description: 'Read handover notes for the project. Notes relevant to your task are already in your prompt, so use this only when you need more — older notes, or notes for a different feature.',
@@ -90,6 +90,10 @@ export class NomosClient {
90
90
  async submitDraft(questionId, draft) {
91
91
  return (await this.request('POST', `/api/questions/${questionId}/draft`, draft));
92
92
  }
93
+ // 확정한 API 계약(에이전트 — MCP read_contracts). FE가 연동할 API를 기능을 가리지 않고 찾는다.
94
+ async readContracts(projectId) {
95
+ return (await this.request('GET', `/api/projects/${projectId}/contracts`));
96
+ }
93
97
  // 계약 작성(Executor, 023): BACKEND 에이전트가 쓸 계약 작업·확정한 계약·읽을 레포, 그리고 초안 제출·실패 보고.
94
98
  async listContractJobs() {
95
99
  return (await this.request('GET', '/api/agents/me/contract-jobs'));
@@ -15,12 +15,15 @@ export function buildTaskPrompt(briefing, branch, environment) {
15
15
  // 확정한 API 계약 — BE 담당이 확정했고 FE·BE가 같은 것을 받는다. 다르게 만들면 서로 붙지 않는다.
16
16
  if (briefing.contract) {
17
17
  sections.push([
18
- `# 확정한 API 계약 (${briefing.contract.featureKey}) — 백엔드 담당이 확정했다. 경로·메서드·필드·상태 코드를 이대로 구현하거나 이대로 호출한다`,
18
+ task.teamRole === 'FRONTEND'
19
+ ? `# 확정한 API 계약 (${briefing.contract.featureKey}) — 백엔드 담당이 확정했다. 화면에서 이 경로·메서드로 호출하고, 응답 필드·에러 상태 코드를 이대로 처리한다(API 연동)`
20
+ : `# 확정한 API 계약 (${briefing.contract.featureKey}) — 백엔드 담당이 확정했다. 경로·메서드·필드·상태 코드를 이대로 구현한다`,
19
21
  briefing.contract.summary,
20
22
  '```yaml',
21
23
  briefing.contract.schemaYaml.trimEnd(),
22
24
  '```',
23
25
  '계약을 바꿔야 할 이유가 생기면 계약과 다르게 구현하지 말고, 그 사실을 GOTCHA 노트로 남긴다.',
26
+ '다른 기능의 API가 필요하면 read_contracts 도구로 확정한 계약을 찾는다.',
24
27
  ].join('\n'));
25
28
  }
26
29
  // 직전 제출이 반려됐다 — 같은 태스크 브랜치에 이전 작업이 남아 있으니 이어서 고친다.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capstone-nomos/cli",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "NOMOS 에이전트 CLI — 노트북의 Claude Code를 NOMOS 서버에 연결하고 배정된 태스크를 실행한다",
5
5
  "type": "module",
6
6
  "bin": {