@steercards/agent-tools 0.1.0 → 0.1.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/dist/install.d.ts +1 -5
- package/dist/install.js +2 -3
- package/dist/package.d.ts +5 -0
- package/dist/package.js +5 -0
- package/dist/runtime.js +2 -1
- package/dist/server.js +2 -1
- package/docs/releases.md +12 -4
- package/package.json +1 -1
package/dist/install.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { packageRoot, packageInfo } from './package.js';
|
|
2
2
|
export declare const skillRoot: string;
|
|
3
|
-
export declare const packageInfo: {
|
|
4
|
-
name: string;
|
|
5
|
-
version: string;
|
|
6
|
-
};
|
|
7
3
|
export declare const clients: readonly ["claude-code", "codex", "codex-app", "codex-cli", "cursor", "claude-desktop"];
|
|
8
4
|
export type Client = typeof clients[number];
|
|
9
5
|
export declare function clientConfig(client: string, options?: {
|
package/dist/install.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { readFile, readdir, mkdir, lstat, rename, rm, mkdtemp, writeFile } from 'node:fs/promises';
|
|
2
2
|
import { dirname, join, resolve } from 'node:path';
|
|
3
3
|
import { homedir } from 'node:os';
|
|
4
|
-
import { fileURLToPath } from 'node:url';
|
|
5
4
|
import { zipSync } from 'fflate';
|
|
6
5
|
import { validateMcpUrl } from './config.js';
|
|
7
|
-
|
|
6
|
+
import { packageRoot, packageInfo } from './package.js';
|
|
7
|
+
export { packageRoot, packageInfo } from './package.js';
|
|
8
8
|
export const skillRoot = join(packageRoot, 'skills', 'steercards');
|
|
9
|
-
export const packageInfo = JSON.parse(await readFile(join(packageRoot, 'package.json'), 'utf8'));
|
|
10
9
|
export const clients = ['claude-code', 'codex', 'codex-app', 'codex-cli', 'cursor', 'claude-desktop'];
|
|
11
10
|
export function clientConfig(client, options = {}) {
|
|
12
11
|
if (!clients.includes(client))
|
package/dist/package.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
export const packageRoot = fileURLToPath(new URL('../', import.meta.url));
|
|
5
|
+
export const packageInfo = JSON.parse(await readFile(join(packageRoot, 'package.json'), 'utf8'));
|
package/dist/runtime.js
CHANGED
|
@@ -2,6 +2,7 @@ import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
|
2
2
|
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
3
3
|
import { CallToolResultSchema, ListToolsResultSchema, ToolListChangedNotificationSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
4
4
|
import { validateMcpUrl } from './config.js';
|
|
5
|
+
import { packageInfo } from './package.js';
|
|
5
6
|
/** Extract only a small, machine-readable code; arbitrary error prose stays private. */
|
|
6
7
|
async function httpErrorCode(response, agentKey) {
|
|
7
8
|
if (!response.headers.get('content-type')?.toLowerCase().includes('application/json') || !response.body) {
|
|
@@ -59,7 +60,7 @@ export class Runtime {
|
|
|
59
60
|
return this.client;
|
|
60
61
|
if (!this.connecting) {
|
|
61
62
|
this.connecting = (async () => {
|
|
62
|
-
const client = new Client({ name:
|
|
63
|
+
const client = new Client({ name: packageInfo.name, version: packageInfo.version });
|
|
63
64
|
client.setNotificationHandler(ToolListChangedNotificationSchema, async () => { this.catalog = undefined; });
|
|
64
65
|
const endpoint = this.config.url;
|
|
65
66
|
const transport = new StreamableHTTPClientTransport(new URL(endpoint), {
|
package/dist/server.js
CHANGED
|
@@ -2,6 +2,7 @@ import { readFile } from 'node:fs/promises';
|
|
|
2
2
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
3
3
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
4
|
import { CallToolRequestSchema, ErrorCode, ListResourcesRequestSchema, ListToolsRequestSchema, McpError, ReadResourceRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
5
|
+
import { packageInfo } from './package.js';
|
|
5
6
|
const guideTopics = ['overview', 'discovery', 'cards', 'profiles', 'claims-runs', 'context', 'files', 'collaboration'];
|
|
6
7
|
const guideUri = 'steercards://guide/';
|
|
7
8
|
const instructions = 'Steercards tools use progressive discovery. In compact mode search tool metadata, describe the selected tool to obtain its current schema, then call it with matching arguments. Read the Steercards guide for workflows. Tool schemas are fetched from the authenticated upstream server. Respect isError and structuredContent. Never automatically retry a mutation after a network failure; read current state first. The upstream rate limit is 120 requests per minute; follow Retry-After.';
|
|
@@ -54,7 +55,7 @@ function assertKeys(args, keys) {
|
|
|
54
55
|
export function createServer(runtime, { mode }) {
|
|
55
56
|
if (mode !== 'compact' && mode !== 'full')
|
|
56
57
|
throw new Error('Server mode must be compact or full.');
|
|
57
|
-
const server = new Server({ name:
|
|
58
|
+
const server = new Server({ name: packageInfo.name, version: packageInfo.version }, {
|
|
58
59
|
capabilities: { tools: {}, resources: {} }, instructions,
|
|
59
60
|
});
|
|
60
61
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
package/docs/releases.md
CHANGED
|
@@ -4,7 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
## 최초 설정
|
|
6
6
|
|
|
7
|
-
1. npm의 `steercards` 조직과 패키지 쓰기 권한을 확인합니다.
|
|
7
|
+
1. npm의 `steercards` 조직과 패키지 쓰기 권한을 확인합니다. trusted publisher는 패키지가 레지스트리에 존재해야 설정할 수 있습니다. 최초 `0.1.0`은 검사한 tarball을 유지관리자의 npm 로그인·2FA로 일반 게시합니다.
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm publish /absolute/path/steercards-agent-tools-0.1.0.tgz --access public --ignore-scripts
|
|
11
|
+
npm view @steercards/agent-tools@0.1.0 version dist.integrity
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
로컬 최초 게시에는 provenance가 없습니다. 다음 `0.1.1`은 아래 OIDC 절차로 게시하여 provenance를 확인합니다. 이미 게시한 버전은 덮어쓸 수 없습니다.
|
|
8
15
|
2. GitHub 저장소의 Settings → Environments에 `npm` 환경을 만듭니다. 릴리스 권한을 가진 유지관리자만 릴리스 태그를 만들 수 있도록 저장소 ruleset과 환경 보호 규칙을 관리합니다.
|
|
9
16
|
3. npm 패키지 Settings → Trusted Publisher에 아래 값을 등록합니다. 환경 이름까지 대소문자를 정확히 맞춥니다.
|
|
10
17
|
|
|
@@ -18,16 +25,16 @@
|
|
|
18
25
|
| Allowed actions | `npm publish` 허용 |
|
|
19
26
|
|
|
20
27
|
신규 설정은 staged publish만 기본 허용할 수 있으므로 직접 게시 권한을 명시적으로 켭니다. 워크플로는 장기 npm 토큰 없이 GitHub OIDC로 인증합니다. `NPM_TOKEN`·`NODE_AUTH_TOKEN` secret은 추가하지 않습니다.
|
|
21
|
-
4.
|
|
28
|
+
4. 새 trusted publisher는 등록 후 2일 안에 첫 게시를 성공해야 검증됩니다. 다음 버전 PR과 검사가 준비되어 실제 OIDC 게시를 바로 이어갈 때 등록합니다. OIDC 확인 후 npm 패키지의 Publishing access를 **Require two-factor authentication and disallow tokens**로 설정합니다.
|
|
22
29
|
|
|
23
30
|
## 새 버전 게시
|
|
24
31
|
|
|
25
|
-
1. 버전 변경은 별도 PR로 검토합니다. `npm version patch --no-git-tag-version`(또는 `minor`/`major`)으로 `package.json`과 `package-lock.json`의 버전을 함께 올리고 main에 병합합니다.
|
|
32
|
+
1. 버전 변경은 별도 PR로 검토합니다. `npm version patch --no-git-tag-version`(또는 `minor`/`major`)으로 `package.json`과 `package-lock.json`의 버전을 함께 올리고 main에 병합합니다.
|
|
26
33
|
2. README의 개발 검사를 실행하고 `npm pack --dry-run`의 포함 파일을 확인합니다. `.env`, 키, 테스트 데이터가 없어야 하며 `dist`, Skill, README, LICENSE가 포함되어야 합니다. 실제 tarball을 별도 디렉터리에 설치해 CLI와 `setup`도 확인합니다.
|
|
27
34
|
3. 통과한 main 커밋을 대상으로 `v<package.json 버전>` 태그의 안정 버전 GitHub Release를 게시합니다. CLI 예시:
|
|
28
35
|
|
|
29
36
|
```sh
|
|
30
|
-
gh release create v0.1.
|
|
37
|
+
gh release create v0.1.1 --repo velody-ai/steercards-agent-tools --target <검증한-main-커밋-SHA> --title v0.1.1 --generate-notes
|
|
31
38
|
```
|
|
32
39
|
|
|
33
40
|
예시 버전과 SHA는 실제 릴리스에 맞춥니다. 초안 저장만으로는 게시하지 않으며 prerelease는 건너뜁니다. `latest` 외의 배포 태그는 현재 워크플로의 지원 범위에 없습니다.
|
|
@@ -38,6 +45,7 @@
|
|
|
38
45
|
|
|
39
46
|
- OIDC 인증 오류: npm 설정의 저장소·workflow 파일명·`npm` 환경·직접 게시 권한을 확인합니다. GitHub-hosted runner와 npm 최소 버전도 확인합니다. 임시 해결용 토큰을 추가하지 않습니다.
|
|
40
47
|
- 태그·버전 또는 main 포함 검사 실패: 릴리스가 가리키는 커밋과 버전 변경 PR을 확인합니다. 이미 게시된 npm 버전은 덮어쓰지 않습니다.
|
|
48
|
+
- staged 버전은 직접 게시와 같은 버전 공간을 사용합니다. `0.1.0`을 stage한 상태에서 같은 버전을 직접 게시하면 `E409`가 발생했습니다. 최초 placeholder만 있는 패키지에서 마지막 stage를 reject하자 패키지가 레지스트리에서 조회되지 않고 OIDC 재시도는 `E404`로 실패했습니다([실행 기록](https://github.com/velody-ai/steercards-agent-tools/actions/runs/39330030138)). trusted publisher 설정의 삭제 여부는 이 결과만으로 판단하지 않습니다. 초기 설정에 stage → reject 절차를 사용하지 않습니다. 일반 최초 게시 후 패키지와 기존 trusted publisher 설정을 확인하고 필요한 설정을 진행합니다.
|
|
41
49
|
- 게시 후 후속 단계가 실패했다면 먼저 `npm view`로 게시 여부를 확인합니다. 미게시일 때만 실패한 Actions 작업을 재실행합니다. 이미 게시된 버전에 다시 `npm publish`하면 오류가 납니다.
|
|
42
50
|
|
|
43
51
|
근거: [npm trusted publishing](https://docs.npmjs.com/trusted-publishers/), [npm provenance](https://docs.npmjs.com/generating-provenance-statements/), [npm trust 전제 조건](https://docs.npmjs.com/cli/v11/commands/npm-trust/).
|