@yigyaps/client 0.1.0

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 ADDED
@@ -0,0 +1,137 @@
1
+ # @yigyaps/client
2
+
3
+ Official TypeScript/JavaScript SDK for the [YigYaps](https://yigyaps.com) open skill marketplace.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @yigyaps/client
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ### Invoke a skill (EVR pipeline)
14
+
15
+ ```typescript
16
+ import { YigYapsSecurityClient } from "@yigyaps/client";
17
+
18
+ const client = new YigYapsSecurityClient({ apiKey: process.env.YIGYAPS_API_KEY });
19
+
20
+ const result = await client.invoke(
21
+ "meeting-notes-extractor",
22
+ "Sarah will finalize the roadmap by Friday. We decided to delay the launch."
23
+ );
24
+
25
+ console.log(result.conclusion);
26
+ // → "Action Items: Sarah → roadmap (due Friday). Decision: launch delayed."
27
+
28
+ console.log(result.evaluation_details?.overall_score); // 7
29
+ console.log(result.evaluation_details?.verdict); // "recommend"
30
+ console.log(result.mode); // "local" | "hybrid"
31
+ console.log(result.privacy_notice);
32
+ // → "LOCAL MODE — Rules evaluated entirely in-process. No data transmitted."
33
+ ```
34
+
35
+ ### Search and install skills
36
+
37
+ ```typescript
38
+ import { YigYapsRegistryClient } from "@yigyaps/client";
39
+
40
+ const registry = new YigYapsRegistryClient({ apiKey: process.env.YIGYAPS_API_KEY });
41
+
42
+ // Search
43
+ const { packages } = await registry.search({ query: "github", category: "development" });
44
+ console.log(packages.map(p => p.packageId));
45
+
46
+ // Install for an agent
47
+ await registry.install({
48
+ packageId: "git-commit-reviewer",
49
+ yigbotId: "my-agent-001",
50
+ });
51
+ ```
52
+
53
+ ### Publish a skill
54
+
55
+ ```typescript
56
+ import { YigYapsPublisherClient } from "@yigyaps/client";
57
+
58
+ const publisher = new YigYapsPublisherClient({ apiKey: process.env.YIGYAPS_API_KEY });
59
+
60
+ await publisher.publishPackage({
61
+ packageId: "my-skill",
62
+ displayName: "My Skill",
63
+ description: "What this skill does in one sentence.",
64
+ authorName: "Your Name",
65
+ category: "productivity",
66
+ rules: [{ path: "rules/main.json", content: JSON.stringify([/* your rules */]) }],
67
+ });
68
+ ```
69
+
70
+ ## Connecting to Claude Desktop via MCP
71
+
72
+ The `@yigyaps/cli` package includes a `mcp-bridge` command that exposes any
73
+ marketplace skill as an MCP tool — no code required:
74
+
75
+ ```bash
76
+ npx @yigyaps/cli mcp-bridge meeting-notes-extractor --api-key yyy_xxx
77
+ ```
78
+
79
+ Add to `claude_desktop_config.json`:
80
+
81
+ ```json
82
+ {
83
+ "mcpServers": {
84
+ "meeting-notes": {
85
+ "command": "npx",
86
+ "args": ["@yigyaps/cli", "mcp-bridge", "meeting-notes-extractor"],
87
+ "env": { "YIGYAPS_API_KEY": "yyy_xxx" }
88
+ }
89
+ }
90
+ }
91
+ ```
92
+
93
+ ## Privacy Model
94
+
95
+ Skills on YigYaps use the **Encrypted Virtual Room (EVR)** pipeline:
96
+
97
+ | Mode | What happens |
98
+ |------|-------------|
99
+ | `local` | Rules evaluated 100% in-process. Zero external calls. |
100
+ | `hybrid` | Local Rule Engine + LLM language polishing. Only a score skeleton (no rule content) leaves the process. |
101
+ | `lab-preview-*` | Author-only preview with raw LLM inference. |
102
+
103
+ The `privacy_notice` field in every `SkillInvokeResult` explains exactly what
104
+ happened for that specific invocation.
105
+
106
+ ## API Reference
107
+
108
+ ### `YigYapsSecurityClient`
109
+
110
+ | Method | Description |
111
+ |--------|-------------|
112
+ | `invoke(packageId, userQuery, expertShare?)` | Invoke a skill and get a structured result |
113
+ | `encryptKnowledge(packageId, plaintextRules)` | Upload and encrypt skill rules |
114
+
115
+ ### `YigYapsRegistryClient`
116
+
117
+ | Method | Description |
118
+ |--------|-------------|
119
+ | `search(query)` | Search the skill marketplace |
120
+ | `getByPackageId(packageId)` | Fetch skill metadata |
121
+ | `install(params)` | Install a skill for an agent |
122
+ | `getInstallations()` | List installed skills |
123
+ | `uninstall(id)` | Uninstall a skill |
124
+ | `getRules(packageId)` | Fetch public rules for a skill |
125
+ | `getMe()` | Get authenticated user profile |
126
+
127
+ ### `YigYapsPublisherClient`
128
+
129
+ | Method | Description |
130
+ |--------|-------------|
131
+ | `publishPackage(params)` | Create a new skill package |
132
+ | `updatePackage(id, patch)` | Update an existing skill package |
133
+ | `mintLimitedEdition(params)` | Mint a limited-edition NFT for a skill |
134
+
135
+ ## License
136
+
137
+ Apache 2.0 — see [LICENSE](../../LICENSE)
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @yigyaps/client — Public API
3
+ *
4
+ * TypeScript/JavaScript SDK for the YigYaps open skill marketplace.
5
+ *
6
+ * @example
7
+ * // Consumers: search and install skills
8
+ * import { YigYapsRegistryClient } from "@yigyaps/client";
9
+ * const client = new YigYapsRegistryClient();
10
+ * const results = await client.search({ query: "github" });
11
+ *
12
+ * @example
13
+ * // Publishers: publish skills (Yigstudio or third-party creators)
14
+ * import { YigYapsPublisherClient } from "@yigyaps/client";
15
+ * const publisher = new YigYapsPublisherClient({ apiKey: process.env.YIGYAPS_API_KEY });
16
+ * await publisher.publishPackage({ packageId: "my-skill", displayName: "My Skill", ... });
17
+ *
18
+ * License: Apache 2.0
19
+ */
20
+ export * from "./registry-client.js";
21
+ export * from "./publisher-client.js";
22
+ export * from "./security-client.js";
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @yigyaps/client — Public API
3
+ *
4
+ * TypeScript/JavaScript SDK for the YigYaps open skill marketplace.
5
+ *
6
+ * @example
7
+ * // Consumers: search and install skills
8
+ * import { YigYapsRegistryClient } from "@yigyaps/client";
9
+ * const client = new YigYapsRegistryClient();
10
+ * const results = await client.search({ query: "github" });
11
+ *
12
+ * @example
13
+ * // Publishers: publish skills (Yigstudio or third-party creators)
14
+ * import { YigYapsPublisherClient } from "@yigyaps/client";
15
+ * const publisher = new YigYapsPublisherClient({ apiKey: process.env.YIGYAPS_API_KEY });
16
+ * await publisher.publishPackage({ packageId: "my-skill", displayName: "My Skill", ... });
17
+ *
18
+ * License: Apache 2.0
19
+ */
20
+ export * from "./registry-client.js";
21
+ export * from "./publisher-client.js";
22
+ export * from "./security-client.js";
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * YigYaps Publisher Client — for Skill Creators and Yigstudio
3
+ *
4
+ * Used by Yigstudio Lab and external creators to publish skill packages
5
+ * to the YigYaps registry. This is the HTTP API replacement for the
6
+ * previous direct SkillPackageDAL.create() call.
7
+ *
8
+ * ADR-015 Phase 2: Yigstudio's `publishSkill` implementation uses this client.
9
+ *
10
+ * License: Apache 2.0
11
+ */
12
+ import type { SkillPackage } from "@yigyaps/types";
13
+ export interface PublisherClientOptions {
14
+ baseUrl?: string;
15
+ apiKey: string;
16
+ }
17
+ export interface PublishPackageParams {
18
+ packageId: string;
19
+ version?: string;
20
+ displayName: string;
21
+ description: string;
22
+ readme?: string;
23
+ authorName: string;
24
+ category: string;
25
+ tags?: string[];
26
+ maturity?: string;
27
+ license?: string;
28
+ mcpTransport?: string;
29
+ mcpCommand?: string;
30
+ mcpUrl?: string;
31
+ repositoryUrl?: string;
32
+ /** Quality score for provenance (from Yigstudio Lab) */
33
+ qualityScore?: number;
34
+ /** Evidence trace IDs (from Yigstudio session-end hook) */
35
+ evidenceTraceIds?: string[];
36
+ /** Skill rules files */
37
+ rules?: {
38
+ path: string;
39
+ content: string;
40
+ }[];
41
+ }
42
+ export declare class YigYapsPublisherClient {
43
+ private baseUrl;
44
+ private headers;
45
+ constructor(options: PublisherClientOptions);
46
+ publishPackage(params: PublishPackageParams): Promise<SkillPackage>;
47
+ updatePackage(id: string, patch: Partial<PublishPackageParams>): Promise<SkillPackage>;
48
+ mintLimitedEdition(params: {
49
+ skillPackageId: string;
50
+ rarity: "common" | "rare" | "epic" | "legendary";
51
+ maxEditions?: number;
52
+ creatorRoyaltyPercent?: number;
53
+ graduationCertificate?: unknown;
54
+ }): Promise<{
55
+ id: string;
56
+ rarity: string;
57
+ maxEditions: number | null;
58
+ }>;
59
+ }
60
+ //# sourceMappingURL=publisher-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publisher-client.d.ts","sourceRoot":"","sources":["../src/publisher-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wDAAwD;IACxD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2DAA2D;IAC3D,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,wBAAwB;IACxB,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC7C;AAED,qBAAa,sBAAsB;IACjC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAAyB;gBAE5B,OAAO,EAAE,sBAAsB;IAQrC,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,YAAY,CAAC;IA+BnE,aAAa,CACjB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,OAAO,CAAC,oBAAoB,CAAC,GACnC,OAAO,CAAC,YAAY,CAAC;IAelB,kBAAkB,CAAC,MAAM,EAAE;QAC/B,cAAc,EAAE,MAAM,CAAC;QACvB,MAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC;QACjD,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,qBAAqB,CAAC,EAAE,MAAM,CAAC;QAC/B,qBAAqB,CAAC,EAAE,OAAO,CAAC;KACjC,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;CAkBxE"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * YigYaps Publisher Client — for Skill Creators and Yigstudio
3
+ *
4
+ * Used by Yigstudio Lab and external creators to publish skill packages
5
+ * to the YigYaps registry. This is the HTTP API replacement for the
6
+ * previous direct SkillPackageDAL.create() call.
7
+ *
8
+ * ADR-015 Phase 2: Yigstudio's `publishSkill` implementation uses this client.
9
+ *
10
+ * License: Apache 2.0
11
+ */
12
+ export class YigYapsPublisherClient {
13
+ baseUrl;
14
+ headers;
15
+ constructor(options) {
16
+ this.baseUrl = options.baseUrl ?? "https://api.yigyaps.com";
17
+ this.headers = {
18
+ "Content-Type": "application/json",
19
+ Authorization: `Bearer ${options.apiKey}`,
20
+ };
21
+ }
22
+ async publishPackage(params) {
23
+ const res = await fetch(`${this.baseUrl}/v1/packages`, {
24
+ method: "POST",
25
+ headers: this.headers,
26
+ body: JSON.stringify({
27
+ packageId: params.packageId,
28
+ version: params.version ?? "0.1.0",
29
+ displayName: params.displayName,
30
+ description: params.description,
31
+ readme: params.readme,
32
+ authorName: params.authorName,
33
+ category: params.category,
34
+ tags: params.tags ?? [],
35
+ maturity: params.maturity ?? "experimental",
36
+ license: params.license ?? "open-source",
37
+ mcpTransport: params.mcpTransport ?? "stdio",
38
+ mcpCommand: params.mcpCommand,
39
+ mcpUrl: params.mcpUrl,
40
+ repositoryUrl: params.repositoryUrl,
41
+ rules: params.rules ?? [],
42
+ }),
43
+ });
44
+ if (!res.ok) {
45
+ const err = await res.json().catch(() => ({}));
46
+ throw new Error(`YigYaps publishPackage failed: ${res.status} ${JSON.stringify(err)}`);
47
+ }
48
+ return res.json();
49
+ }
50
+ async updatePackage(id, patch) {
51
+ const res = await fetch(`${this.baseUrl}/v1/packages/${id}`, {
52
+ method: "PATCH",
53
+ headers: this.headers,
54
+ body: JSON.stringify(patch),
55
+ });
56
+ if (!res.ok) {
57
+ const err = await res.json().catch(() => ({}));
58
+ throw new Error(`YigYaps updatePackage failed: ${res.status} ${JSON.stringify(err)}`);
59
+ }
60
+ return res.json();
61
+ }
62
+ async mintLimitedEdition(params) {
63
+ const res = await fetch(`${this.baseUrl}/v1/mints`, {
64
+ method: "POST",
65
+ headers: this.headers,
66
+ body: JSON.stringify(params),
67
+ });
68
+ if (!res.ok) {
69
+ const err = await res.json().catch(() => ({}));
70
+ throw new Error(`YigYaps mintLimitedEdition failed: ${res.status} ${JSON.stringify(err)}`);
71
+ }
72
+ return res.json();
73
+ }
74
+ }
75
+ //# sourceMappingURL=publisher-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publisher-client.js","sourceRoot":"","sources":["../src/publisher-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAgCH,MAAM,OAAO,sBAAsB;IACzB,OAAO,CAAS;IAChB,OAAO,CAAyB;IAExC,YAAY,OAA+B;QACzC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,yBAAyB,CAAC;QAC5D,IAAI,CAAC,OAAO,GAAG;YACb,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,UAAU,OAAO,CAAC,MAAM,EAAE;SAC1C,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,MAA4B;QAC/C,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,cAAc,EAAE;YACrD,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,OAAO;gBAClC,WAAW,EAAE,MAAM,CAAC,WAAW;gBAC/B,WAAW,EAAE,MAAM,CAAC,WAAW;gBAC/B,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,UAAU,EAAE,MAAM,CAAC,UAAU;gBAC7B,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,EAAE;gBACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,cAAc;gBAC3C,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,aAAa;gBACxC,YAAY,EAAE,MAAM,CAAC,YAAY,IAAI,OAAO;gBAC5C,UAAU,EAAE,MAAM,CAAC,UAAU;gBAC7B,MAAM,EAAE,MAAM,C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EAAE,MAAM;YACd,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;SAC7B,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAC/C,MAAM,IAAI,KAAK,CACb,sCAAsC,GAAG,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAC1E,CAAC;QACJ,CAAC;QACD,OAAO,GAAG,CAAC,IAAI,EAIb,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * YigYaps Registry Client — for Skill Consumers
3
+ *
4
+ * Used by MCP clients (Yigcore, Claude Code, Cursor, etc.) to search
5
+ * and retrieve skill packages from the YigYaps registry.
6
+ *
7
+ * License: Apache 2.0
8
+ */
9
+ import type { SkillPackage, SkillPackageSearchQuery, SkillPackageSearchResult, SkillPackageInstallation, McpRegistryDiscovery } from "@yigyaps/types";
10
+ export interface AuthUser {
11
+ id: string;
12
+ githubUsername: string;
13
+ displayName: string;
14
+ email?: string;
15
+ avatarUrl: string;
16
+ tier: string;
17
+ role: string;
18
+ isVerifiedCreator: boolean;
19
+ totalPackages: number;
20
+ totalEarningsUsd?: string;
21
+ bio?: string;
22
+ websiteUrl?: string;
23
+ createdAt: number;
24
+ lastLoginAt: number;
25
+ }
26
+ export interface RegistryClientOptions {
27
+ baseUrl?: string;
28
+ apiKey?: string;
29
+ timeout?: number;
30
+ }
31
+ export declare class YigYapsRegistryClient {
32
+ private baseUrl;
33
+ private headers;
34
+ constructor(options?: RegistryClientOptions);
35
+ getDiscovery(): Promise<McpRegistryDiscovery>;
36
+ search(query: SkillPackageSearchQuery): Promise<SkillPackageSearchResult>;
37
+ getById(id: string): Promise<SkillPackage>;
38
+ getByPackageId(packageId: string): Promise<SkillPackage>;
39
+ install(params: {
40
+ packageId: string;
41
+ yigbotId: string;
42
+ userTier?: string;
43
+ configuration?: Record<string, unknown>;
44
+ }): Promise<{
45
+ id: string;
46
+ status: string;
47
+ }>;
48
+ getInstallations(): Promise<{
49
+ installations: SkillPackageInstallation[];
50
+ }>;
51
+ uninstall(id: string): Promise<void>;
52
+ getRules(packageIdOrId: string): Promise<{
53
+ rules: {
54
+ path: string;
55
+ content: string;
56
+ }[];
57
+ }>;
58
+ getMe(): Promise<AuthUser>;
59
+ }
60
+ //# sourceMappingURL=registry-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry-client.d.ts","sourceRoot":"","sources":["../src/registry-client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,uBAAuB,EACvB,wBAAwB,EACxB,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,OAAO,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,qBAAqB;IAChC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAAyB;gBAE5B,OAAO,GAAE,qBAA0B;IAQzC,YAAY,IAAI,OAAO,CAAC,oBAAoB,CAAC;IAQ7C,MAAM,CACV,KAAK,EAAE,uBAAuB,GAC7B,OAAO,CAAC,wBAAwB,CAAC;IAiB9B,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAQ1C,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAUxD,OAAO,CAAC,MAAM,EAAE;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACzC,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAerC,gBAAgB,IAAI,OAAO,CAAC;QAChC,aAAa,EAAE,wBAAwB,EAAE,CAAC;KAC3C,CAAC;IASI,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQpC,QAAQ,CACZ,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC;QAAE,KAAK,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,EAAE,CAAA;KAAE,CAAC;IAgBpD,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC;CAOjC"}
@@ -0,0 +1,113 @@
1
+ /**
2
+ * YigYaps Registry Client — for Skill Consumers
3
+ *
4
+ * Used by MCP clients (Yigcore, Claude Code, Cursor, etc.) to search
5
+ * and retrieve skill packages from the YigYaps registry.
6
+ *
7
+ * License: Apache 2.0
8
+ */
9
+ export class YigYapsRegistryClient {
10
+ baseUrl;
11
+ headers;
12
+ constructor(options = {}) {
13
+ this.baseUrl = options.baseUrl ?? "https://api.yigyaps.com";
14
+ this.headers = {
15
+ "Content-Type": "application/json",
16
+ ...(options.apiKey ? { Authorization: `Bearer ${options.apiKey}` } : {}),
17
+ };
18
+ }
19
+ async getDiscovery() {
20
+ const res = await fetch(`${this.baseUrl}/.well-known/mcp.json`, {
21
+ headers: this.headers,
22
+ });
23
+ if (!res.ok)
24
+ throw new Error(`YigYaps discovery failed: ${res.status}`);
25
+ return res.json();
26
+ }
27
+ async search(query) {
28
+ const params = new URLSearchParams();
29
+ if (query.query)
30
+ params.set("query", query.query);
31
+ if (query.category)
32
+ params.set("category", query.category);
33
+ if (query.license)
34
+ params.set("license", query.license);
35
+ if (query.maturity)
36
+ params.set("maturity", query.maturity);
37
+ if (query.sortBy)
38
+ params.set("sortBy", query.sortBy);
39
+ if (query.limit != null)
40
+ params.set("limit", String(query.limit));
41
+ if (query.offset != null)
42
+ params.set("offset", String(query.offset));
43
+ const res = await fetch(`${this.baseUrl}/v1/packages?${params}`, {
44
+ headers: this.headers,
45
+ });
46
+ if (!res.ok)
47
+ throw new Error(`YigYaps search failed: ${res.status}`);
48
+ return res.json();
49
+ }
50
+ async getById(id) {
51
+ const res = await fetch(`${this.baseUrl}/v1/packages/${id}`, {
52
+ headers: this.headers,
53
+ });
54
+ if (!res.ok)
55
+ throw new Error(`YigYaps getById failed: ${res.status}`);
56
+ return res.json();
57
+ }
58
+ async getByPackageId(packageId) {
59
+ const res = await fetch(`${this.baseUrl}/v1/packages/by-pkg/${encodeURIComponent(packageId)}`, { headers: this.headers });
60
+ if (!res.ok)
61
+ throw new Error(`YigYaps getByPackageId failed: ${res.status}`);
62
+ return res.json();
63
+ }
64
+ async install(params) {
65
+ const res = await fetch(`${this.baseUrl}/v1/installations`, {
66
+ method: "POST",
67
+ headers: this.headers,
68
+ body: JSON.stringify(params),
69
+ });
70
+ if (!res.ok) {
71
+ const err = await res.json().catch(() => ({}));
72
+ throw new Error(`YigYaps install failed: ${res.status} ${JSON.stringify(err)}`);
73
+ }
74
+ return res.json();
75
+ }
76
+ async getInstallations() {
77
+ const res = await fetch(`${this.baseUrl}/v1/installations/me`, {
78
+ headers: this.headers,
79
+ });
80
+ if (!res.ok)
81
+ throw new Error(`YigYaps getInstallations failed: ${res.status}`);
82
+ return res.json();
83
+ }
84
+ async uninstall(id) {
85
+ const res = await fetch(`${this.baseUrl}/v1/installations/${id}`, {
86
+ method: "DELETE",
87
+ headers: this.headers,
88
+ });
89
+ if (!res.ok)
90
+ throw new Error(`YigYaps uninstall failed: ${res.status}`);
91
+ }
92
+ async getRules(packageIdOrId) {
93
+ const isUuid = packageIdOrId.includes("-") || packageIdOrId.startsWith("spkg_");
94
+ const endpoint = isUuid
95
+ ? `/v1/packages/${packageIdOrId}/rules`
96
+ : `/v1/packages/by-pkg/${encodeURIComponent(packageIdOrId)}/rules`;
97
+ const res = await fetch(`${this.baseUrl}${endpoint}`, {
98
+ headers: this.headers,
99
+ });
100
+ if (!res.ok)
101
+ throw new Error(`YigYaps getRules failed: ${res.status}`);
102
+ return res.json();
103
+ }
104
+ async getMe() {
105
+ const res = await fetch(`${this.baseUrl}/v1/auth/me`, {
106
+ headers: this.headers,
107
+ });
108
+ if (!res.ok)
109
+ throw new Error(`YigYaps getMe failed: ${res.status}`);
110
+ return res.json();
111
+ }
112
+ }
113
+ //# sourceMappingURL=registry-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry-client.js","sourceRoot":"","sources":["../src/registry-client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAiCH,MAAM,OAAO,qBAAqB;IACxB,OAAO,CAAS;IAChB,OAAO,CAAyB;IAExC,YAAY,UAAiC,EAAE;QAC7C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,yBAAyB,CAAC;QAC5D,IAAI,CAAC,OAAO,GAAG;YACb,cAAc,EAAE,kBAAkB;YAClC,GAAG,CAAC,O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,QAAQ,CAAC,GAAG,CAAC,IAAI,aAAa,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACnE,MAAM,QAAQ,GAAG,MAAM;YACrB,CAAC,CAAC,gBAAgB,aAAa,QAAQ;YACvC,CAAC,CAAC,uBAAuB,kBAAkB,CAAC,aAAa,CAAC,QAAQ,CAAC;QAErE,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,GAAG,QAAQ,EAAE,EAAE;YACpD,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,4BAA4B,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;QACvE,OAAO,GAAG,CAAC,IAAI,EAEb,CAAC;IACL,CAAC;IAED,KAAK,CAAC,KAAK;QACT,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,aAAa,EAAE;YACpD,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;QACpE,OAAO,GAAG,CAAC,IAAI,EAAuB,CAAC;IACzC,CAAC;CACF"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * YigYaps Security Client — Encrypted Virtual Room (EVR) API
3
+ *
4
+ * Communicates with /v1/security to encrypt skill knowledge and
5
+ * invoke skills through the local Rule Engine pipeline.
6
+ *
7
+ * License: Apache 2.0
8
+ */
9
+ import type { SkillInvokeResult } from "@yigyaps/types";
10
+ export interface SecurityClientOptions {
11
+ baseUrl?: string;
12
+ apiKey?: string;
13
+ }
14
+ export declare class YigYapsSecurityClient {
15
+ private baseUrl;
16
+ private headers;
17
+ constructor(options?: SecurityClientOptions);
18
+ /**
19
+ * Encrypt plaintext rules for a skill package.
20
+ * Rules are envelope-encrypted server-side; the plaintext is never stored.
21
+ */
22
+ encryptKnowledge(packageId: string, plaintextRules: string): Promise<{
23
+ success: boolean;
24
+ message: string;
25
+ }>;
26
+ /**
27
+ * Invoke a skill through the Encrypted Virtual Room (EVR).
28
+ *
29
+ * The skill's rules are evaluated entirely in-process on the server
30
+ * (LOCAL mode). If the platform has an Anthropic API key configured,
31
+ * only a structured skeleton (scores + conclusion tokens) is sent to
32
+ * the LLM for language polishing (HYBRID mode). Rule content is never
33
+ * transmitted externally.
34
+ *
35
+ * @param packageId The skill's packageId (e.g. "meeting-notes-extractor")
36
+ * @param userQuery The content or question to evaluate against the skill
37
+ * @param expertShare Optional Shamir share from the skill author (for
38
+ * skills that require (2,3) threshold key reconstruction)
39
+ */
40
+ invoke(packageId: string, userQuery: string, expertShare?: string): Promise<SkillInvokeResult>;
41
+ }
42
+ //# sourceMappingURL=security-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"security-client.d.ts","sourceRoot":"","sources":["../src/security-client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,qBAAqB;IAChC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAAyB;gBAE5B,OAAO,GAAE,qBAA0B;IAQ/C;;;OAGG;IACG,gBAAgB,CACpB,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAkBjD;;;;;;;;;;;;;OAaG;IACG,MAAM,CACV,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,iBAAiB,CAAC;CAoB9B"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * YigYaps Security Client — Encrypted Virtual Room (EVR) API
3
+ *
4
+ * Communicates with /v1/security to encrypt skill knowledge and
5
+ * invoke skills through the local Rule Engine pipeline.
6
+ *
7
+ * License: Apache 2.0
8
+ */
9
+ export class YigYapsSecurityClient {
10
+ baseUrl;
11
+ headers;
12
+ constructor(options = {}) {
13
+ this.baseUrl = options.baseUrl ?? "https://api.yigyaps.com";
14
+ this.headers = {
15
+ "Content-Type": "application/json",
16
+ ...(options.apiKey ? { Authorization: `Bearer ${options.apiKey}` } : {}),
17
+ };
18
+ }
19
+ /**
20
+ * Encrypt plaintext rules for a skill package.
21
+ * Rules are envelope-encrypted server-side; the plaintext is never stored.
22
+ */
23
+ async encryptKnowledge(packageId, plaintextRules) {
24
+ const res = await fetch(`${this.baseUrl}/v1/security/knowledge/${encodeURIComponent(packageId)}`, {
25
+ method: "POST",
26
+ headers: this.headers,
27
+ body: JSON.stringify({ plaintextRules }),
28
+ });
29
+ if (!res.ok) {
30
+ const err = await res.json().catch(() => ({}));
31
+ throw new Error(`YigYaps encryptKnowledge failed: ${res.status} ${JSON.stringify(err)}`);
32
+ }
33
+ return res.json();
34
+ }
35
+ /**
36
+ * Invoke a skill through the Encrypted Virtual Room (EVR).
37
+ *
38
+ * The skill's rules are evaluated entirely in-process on the server
39
+ * (LOCAL mode). If the platform has an Anthropic API key configured,
40
+ * only a structured skeleton (scores + conclusion tokens) is sent to
41
+ * the LLM for language polishing (HYBRID mode). Rule content is never
42
+ * transmitted externally.
43
+ *
44
+ * @param packageId The skill's packageId (e.g. "meeting-notes-extractor")
45
+ * @param userQuery The content or question to evaluate against the skill
46
+ * @param expertShare Optional Shamir share from the skill author (for
47
+ * skills that require (2,3) threshold key reconstruction)
48
+ */
49
+ async invoke(packageId, userQuery, expertShare) {
50
+ const res = await fetch(`${this.baseUrl}/v1/security/invoke/${encodeURIComponent(packageId)}`, {
51
+ method: "POST",
52
+ headers: this.headers,
53
+ body: JSON.stringify({
54
+ user_query: userQuery,
55
+ ...(expertShare ? { expert_share: expertShare } : {}),
56
+ }),
57
+ });
58
+ if (!res.ok) {
59
+ const err = await res.json().catch(() => ({}));
60
+ throw new Error(`YigYaps invoke failed: ${res.status} ${JSON.stringify(err)}`);
61
+ }
62
+ return res.json();
63
+ }
64
+ }
65
+ //# sourceMappingURL=security-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"security-client.js","sourceRoot":"","sources":["../src/security-client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AASH,MAAM,OAAO,qBAAqB;IACxB,OAAO,CAAS;IAChB,OAAO,CAAyB;IAExC,YAAY,UAAiC,EAAE;QAC7C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,yBAAyB,CAAC;QAC5D,IAAI,CAAC,OAAO,GAAG;YACb,cAAc,EAAE,kBAAkB;YAClC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,UAAU,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACzE,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,gBAAgB,CACpB,SAAiB,EACjB,cAAsB;QAEtB,MAAM,GAAG,GAAG,MAAM,KAAK,CACrB,GAAG,IAAI,CAAC,OAAO,0BAA0B,kBAAkB,CAAC,SAAS,CAAC,EAAE,EACxE;YACE,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;SACzC,CACF,CAAC;QACF,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAC/C,MAAM,IAAI,KAAK,CACb,oCAAoC,GAAG,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CACxE,CAAC;QACJ,CAAC;QACD,OAAO,GAAG,CAAC,IAAI,EAAoD,CAAC;IACtE,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,MAAM,CACV,SAAiB,EACjB,SAAiB,EACjB,WAAoB;QAEpB,MAAM,GAAG,GAAG,MAAM,KAAK,CACrB,GAAG,IAAI,CAAC,OAAO,uBAAuB,kBAAkB,CAAC,SAAS,CAAC,EAAE,EACrE;YACE,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,UAAU,EAAE,SAAS;gBACrB,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACtD,CAAC;SACH,CACF,CAAC;QACF,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAC/C,MAAM,IAAI,KAAK,CACb,0BAA0B,GAAG,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAC9D,CAAC;QACJ,CAAC;QACD,OAAO,GAAG,CAAC,IAAI,EAAgC,CAAC;IAClD,CAAC;CACF"}
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@yigyaps/client",
3
+ "version": "0.1.0",
4
+ "description": "YigYaps TypeScript/JavaScript SDK for consumers and publishers",
5
+ "license": "Apache-2.0",
6
+ "type": "module",
7
+ "main": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "scripts": {
19
+ "build": "tsc -b",
20
+ "clean": "tsc -b --clean"
21
+ },
22
+ "publishConfig": {
23
+ "access": "public",
24
+ "registry": "https://registry.npmjs.org/"
25
+ },
26
+ "dependencies": {
27
+ "@yigyaps/types": "^0.1.0"
28
+ },
29
+ "devDependencies": {
30
+ "typescript": "^5.7.0"
31
+ }
32
+ }