@sysprompthub/sdk 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/LICENSE ADDED
@@ -0,0 +1,15 @@
1
+ ISC License
2
+
3
+ Copyright (c) 2024
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,143 @@
1
+ # @sysprompthub/sdk
2
+
3
+ SDK for syncing system prompts from SysPromptHub to your projects.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @sysprompthub/sdk
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```typescript
14
+ import { SyncManager, SysPromptHubClient, ConfigManager, AssistantManager } from '@sysprompthub/sdk';
15
+
16
+ // Simple sync
17
+ const syncManager = new SyncManager(process.cwd());
18
+ await syncManager.sync({
19
+ packName: 'user/pack/latest',
20
+ assistants: ['copilot', 'claude'],
21
+ cwd: process.cwd()
22
+ });
23
+
24
+ // Using the client directly
25
+ const client = new SysPromptHubClient('https://api-dev.sysprompthub.com');
26
+ const prompt = await client.fetchPack('user/pack/latest');
27
+ console.log(prompt);
28
+
29
+ // Working with assistants
30
+ const assistantManager = new AssistantManager(['copilot', 'claude']);
31
+ for (const assistant of assistantManager.getAssistants()) {
32
+ await assistant.writePrompt('/path/to/project', prompt);
33
+ }
34
+
35
+ // Configuration management
36
+ const configManager = new ConfigManager(process.cwd());
37
+ const config = await configManager.load();
38
+ await configManager.update({
39
+ packName: 'user/pack/latest',
40
+ assistants: ['copilot']
41
+ });
42
+ ```
43
+
44
+ ## API
45
+
46
+ ### `SyncManager`
47
+
48
+ Manages syncing prompt packs to your project.
49
+
50
+ ```typescript
51
+ const syncManager = new SyncManager(cwd);
52
+ const prompt = await syncManager.sync(options);
53
+ ```
54
+
55
+ ### `SysPromptHubClient`
56
+
57
+ Client for fetching prompt packs from the API.
58
+
59
+ ```typescript
60
+ const client = new SysPromptHubClient(apiUrl?);
61
+ const prompt = await client.fetchPack(packName);
62
+ client.clearCache();
63
+ ```
64
+
65
+ ### `ConfigManager`
66
+
67
+ Manages `.sysprompthub.json` configuration files.
68
+
69
+ ```typescript
70
+ const configManager = new ConfigManager(cwd);
71
+ const config = await configManager.load();
72
+ await configManager.update(updates);
73
+ await configManager.save(config);
74
+ ```
75
+
76
+ ### `VscodeConfigManager`
77
+
78
+ Manages `.vscode/settings.json` for VSCode integration.
79
+
80
+ ```typescript
81
+ const vscodeManager = new VscodeConfigManager(cwd);
82
+ const config = await vscodeManager.load();
83
+ await vscodeManager.update(updates);
84
+ ```
85
+
86
+ ### `AssistantManager`
87
+
88
+ Manages AI assistants (Copilot, Claude).
89
+
90
+ ```typescript
91
+ const manager = new AssistantManager(['copilot', 'claude']);
92
+ const assistants = manager.getAssistants();
93
+ ```
94
+
95
+ ### `Assistant`
96
+
97
+ Individual assistant for writing prompts.
98
+
99
+ ```typescript
100
+ const assistant = new Assistant('copilot', '.github/copilot-instructions.md');
101
+ await assistant.writePrompt(baseDir, prompt);
102
+ await assistant.clearPrompt(baseDir);
103
+ ```
104
+
105
+ ## Supported Assistants
106
+
107
+ - **GitHub Copilot**: Writes to `.github/copilot-instructions.md`
108
+ - **Claude**: Writes to `.claude/system.md`
109
+
110
+ ## Types
111
+
112
+ ```typescript
113
+ import type {
114
+ AssistantType,
115
+ SyncOptions,
116
+ Config,
117
+ Environment,
118
+ InitVscodeOptions
119
+ } from '@sysprompthub/sdk';
120
+ ```
121
+
122
+ ## Development
123
+
124
+ ```bash
125
+ # Install dependencies
126
+ npm install
127
+
128
+ # Build
129
+ npm run build
130
+
131
+ # Run tests
132
+ npm test
133
+
134
+ # Run tests in watch mode
135
+ npm run test:watch
136
+
137
+ # Type check
138
+ npm run typecheck
139
+ ```
140
+
141
+ ## License
142
+
143
+ ISC
@@ -0,0 +1,16 @@
1
+ import { AssistantType } from './types.js';
2
+ export declare class Assistant {
3
+ readonly type: AssistantType;
4
+ readonly promptPath: string;
5
+ constructor(type: AssistantType, promptPath: string);
6
+ writePrompt(baseDir: string, prompt: string): Promise<void>;
7
+ clearPrompt(baseDir: string): Promise<void>;
8
+ getFullPath(baseDir: string): string;
9
+ }
10
+ export declare class AssistantManager {
11
+ private readonly assistants;
12
+ getAssistant(type: AssistantType): Assistant | undefined;
13
+ getAssistants(types: AssistantType[]): Assistant[];
14
+ getAllAssistants(): Readonly<Assistant[]>;
15
+ }
16
+ //# sourceMappingURL=assistants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assistants.d.ts","sourceRoot":"","sources":["../src/assistants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,qBAAa,SAAS;IACpB,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;gBAEhB,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM;IAK7C,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ3D,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBjD,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;CAGrC;AAOD,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAqC;IAEhE,YAAY,CAAC,IAAI,EAAE,aAAa,GAAG,SAAS,GAAG,SAAS;IAIxD,aAAa,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,SAAS,EAAE;IAIlD,gBAAgB,IAAI,QAAQ,CAAC,SAAS,EAAE,CAAC;CAG1C"}
@@ -0,0 +1,55 @@
1
+ import { mkdir, writeFile, rm, readdir } from 'fs/promises';
2
+ import { dirname, join } from 'path';
3
+ export class Assistant {
4
+ type;
5
+ promptPath;
6
+ constructor(type, promptPath) {
7
+ this.type = type;
8
+ this.promptPath = promptPath;
9
+ }
10
+ async writePrompt(baseDir, prompt) {
11
+ const fullPath = join(baseDir, this.promptPath);
12
+ const dir = dirname(fullPath);
13
+ await mkdir(dir, { recursive: true });
14
+ await writeFile(fullPath, prompt, 'utf-8');
15
+ }
16
+ async clearPrompt(baseDir) {
17
+ const fullPath = join(baseDir, this.promptPath);
18
+ try {
19
+ await rm(fullPath, { force: true });
20
+ }
21
+ catch {
22
+ // Ignore errors
23
+ }
24
+ try {
25
+ const dir = dirname(fullPath);
26
+ const files = await readdir(dir);
27
+ if (files.length === 0) {
28
+ await rm(dir, { recursive: true, force: true });
29
+ }
30
+ }
31
+ catch {
32
+ // Ignore errors
33
+ }
34
+ }
35
+ getFullPath(baseDir) {
36
+ return join(baseDir, this.promptPath);
37
+ }
38
+ }
39
+ const ASSISTANTS = Object.freeze([
40
+ new Assistant('copilot', '.github/copilot-instructions.md'),
41
+ new Assistant('claude', '.claude/system.md')
42
+ ]);
43
+ export class AssistantManager {
44
+ assistants = ASSISTANTS;
45
+ getAssistant(type) {
46
+ return this.assistants.find(a => a.type === type);
47
+ }
48
+ getAssistants(types) {
49
+ return types.map(type => this.getAssistant(type)).filter((a) => a !== undefined);
50
+ }
51
+ getAllAssistants() {
52
+ return this.assistants;
53
+ }
54
+ }
55
+ //# sourceMappingURL=assistants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assistants.js","sourceRoot":"","sources":["../src/assistants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAGrC,MAAM,OAAO,SAAS;IACX,IAAI,CAAgB;IACpB,UAAU,CAAS;IAE5B,YAAY,IAAmB,EAAE,UAAkB;QACjD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAAe,EAAE,MAAc;QAC/C,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAChD,MAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;QAE9B,MAAM,KAAK,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACtC,MAAM,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAAe;QAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAEhD,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACtC,CAAC;QAAC,MAAM,CAAC;YACP,gBAAgB;QAClB,CAAC;QAED,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;YAC9B,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;YAEjC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACvB,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YAClD,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,gBAAgB;QAClB,CAAC;IACH,CAAC;IAED,WAAW,CAAC,OAAe;QACzB,OAAO,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;CACF;AAED,MAAM,UAAU,GAA0B,MAAM,CAAC,MAAM,CAAC;IACtD,IAAI,SAAS,CAAC,SAAS,EAAE,iCAAiC,CAAC;IAC3D,IAAI,SAAS,CAAC,QAAQ,EAAE,mBAAmB,CAAC;CAC7C,CAAC,CAAC;AAEH,MAAM,OAAO,gBAAgB;IACV,UAAU,GAA0B,UAAU,CAAC;IAEhE,YAAY,CAAC,IAAmB;QAC9B,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IACpD,CAAC;IAED,aAAa,CAAC,KAAsB;QAClC,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAkB,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;IACnG,CAAC;IAED,gBAAgB;QACd,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;CACF"}
@@ -0,0 +1,8 @@
1
+ export declare class SysPromptHubClient {
2
+ private readonly apiUrl;
3
+ private cache;
4
+ constructor(apiUrl?: string);
5
+ fetchPack(packName: string): Promise<string>;
6
+ clearCache(): void;
7
+ }
8
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,KAAK,CAAkC;gBAEnC,MAAM,GAAE,MAA2C;IAIzD,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAmBlD,UAAU,IAAI,IAAI;CAGnB"}
package/dist/client.js ADDED
@@ -0,0 +1,24 @@
1
+ export class SysPromptHubClient {
2
+ apiUrl;
3
+ cache = new Map();
4
+ constructor(apiUrl = 'https://api-dev.sysprompthub.com') {
5
+ this.apiUrl = apiUrl;
6
+ }
7
+ async fetchPack(packName) {
8
+ if (this.cache.has(packName)) {
9
+ return this.cache.get(packName);
10
+ }
11
+ const url = `${this.apiUrl}/p/${packName}`;
12
+ const response = await fetch(url);
13
+ if (!response.ok) {
14
+ throw new Error(`Failed to load system prompt pack ${packName}: ${response.statusText} (${response.status})`);
15
+ }
16
+ const content = await response.text();
17
+ this.cache.set(packName, content);
18
+ return content;
19
+ }
20
+ clearCache() {
21
+ this.cache.clear();
22
+ }
23
+ }
24
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,kBAAkB;IACZ,MAAM,CAAS;IACxB,KAAK,GAAwB,IAAI,GAAG,EAAE,CAAC;IAE/C,YAAY,SAAiB,kCAAkC;QAC7D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,QAAgB;QAC9B,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAE,CAAC;QACnC,CAAC;QAED,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,MAAM,QAAQ,EAAE,CAAC;QAC3C,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;QAElC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CACb,qCAAqC,QAAQ,KAAK,QAAQ,CAAC,UAAU,KAAK,QAAQ,CAAC,MAAM,GAAG,CAC7F,CAAC;QACJ,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACtC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAClC,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,UAAU;QACR,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACF"}
@@ -0,0 +1,15 @@
1
+ import { Config, Environment } from './types.js';
2
+ import { VscodeConfigManager } from './vscode-config.js';
3
+ export declare const CONFIG_FILE_NAME = ".sysprompthub.json";
4
+ export declare const DEFAULT_ENVIRONMENT: Environment;
5
+ export declare class ConfigManager {
6
+ private readonly cwd;
7
+ private readonly vscodeManager;
8
+ constructor(cwd?: string);
9
+ static getApiUrl(environment?: Environment): string;
10
+ static validatePackName(packName: string): boolean;
11
+ load(): Promise<Config | null>;
12
+ update(updates: Partial<Config>): Promise<void>;
13
+ getVscodeManager(): VscodeConfigManager;
14
+ }
15
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,eAAO,MAAM,gBAAgB,uBAAuB,CAAC;AACrD,eAAO,MAAM,mBAAmB,EAAE,WAA2B,CAAC;AAO9D,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAsB;gBAExC,GAAG,GAAE,MAAsB;IAKvC,MAAM,CAAC,SAAS,CAAC,WAAW,GAAE,WAAiC,GAAG,MAAM;IAIxE,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAK5C,IAAI,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAiB9B,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBrD,gBAAgB,IAAI,mBAAmB;CAGxC"}
package/dist/config.js ADDED
@@ -0,0 +1,62 @@
1
+ import { readFile, writeFile } from 'fs/promises';
2
+ import { join } from 'path';
3
+ import { VscodeConfigManager } from './vscode-config.js';
4
+ export const CONFIG_FILE_NAME = '.sysprompthub.json';
5
+ export const DEFAULT_ENVIRONMENT = 'development';
6
+ const API_URLS = {
7
+ local: 'http://localhost:3000',
8
+ development: 'https://api-dev.sysprompthub.com'
9
+ };
10
+ export class ConfigManager {
11
+ cwd;
12
+ vscodeManager;
13
+ constructor(cwd = process.cwd()) {
14
+ this.cwd = cwd;
15
+ this.vscodeManager = new VscodeConfigManager(cwd);
16
+ }
17
+ static getApiUrl(environment = DEFAULT_ENVIRONMENT) {
18
+ return API_URLS[environment];
19
+ }
20
+ static validatePackName(packName) {
21
+ const pattern = /^[a-z][a-z0-9-]*[a-z0-9]\/[a-z][a-z0-9-]*[a-z0-9]\/(latest|\d{1,5})$/;
22
+ return pattern.test(packName);
23
+ }
24
+ async load() {
25
+ // First, try to load .vscode/settings.json
26
+ const vscodeConfig = await this.vscodeManager.load();
27
+ if (vscodeConfig) {
28
+ return vscodeConfig;
29
+ }
30
+ // Fall back to .sysprompthub.json
31
+ try {
32
+ const configPath = join(this.cwd, CONFIG_FILE_NAME);
33
+ const content = await readFile(configPath, 'utf-8');
34
+ return JSON.parse(content);
35
+ }
36
+ catch {
37
+ return null;
38
+ }
39
+ }
40
+ async update(updates) {
41
+ const configPath = join(this.cwd, CONFIG_FILE_NAME);
42
+ try {
43
+ const content = await readFile(configPath, 'utf-8');
44
+ const config = JSON.parse(content);
45
+ const updatedConfig = { ...config, ...updates };
46
+ await writeFile(configPath, JSON.stringify(updatedConfig, null, 2), 'utf-8');
47
+ }
48
+ catch {
49
+ // Config file doesn't exist, create it
50
+ const newConfig = {
51
+ packName: updates.packName,
52
+ assistants: updates.assistants || ['copilot'],
53
+ environment: updates.environment || DEFAULT_ENVIRONMENT
54
+ };
55
+ await writeFile(configPath, JSON.stringify(newConfig, null, 2), 'utf-8');
56
+ }
57
+ }
58
+ getVscodeManager() {
59
+ return this.vscodeManager;
60
+ }
61
+ }
62
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,CAAC,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AACrD,MAAM,CAAC,MAAM,mBAAmB,GAAgB,aAAa,CAAC;AAE9D,MAAM,QAAQ,GAAgC;IAC5C,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EAAE,kCAAkC;CAChD,CAAC;AAEF,MAAM,OAAO,aAAa;IACP,GAAG,CAAS;IACZ,aAAa,CAAsB;IAEpD,YAAY,MAAc,OAAO,CAAC,GAAG,EAAE;QACrC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,aAAa,GAAG,IAAI,mBAAmB,CAAC,GAAG,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,CAAC,SAAS,CAAC,cAA2B,mBAAmB;QAC7D,OAAO,QAAQ,CAAC,WAAW,CAAC,CAAC;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AAU,EAAE,OAAO,CAAC,UAAU,IAAI,CAAC,SAAS,CAAC;gBAC7C,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,mBAAmB;aACxD,CAAC;YACF,MAAM,SAAS,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;QAC3E,CAAC;IACH,CAAC;IAED,gBAAgB;QACd,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;CACF"}
@@ -0,0 +1,8 @@
1
+ export { SysPromptHubClient } from './client.js';
2
+ export { Assistant, AssistantManager } from './assistants.js';
3
+ export { ConfigManager, DEFAULT_ENVIRONMENT, CONFIG_FILE_NAME } from './config.js';
4
+ export { VscodeConfigManager, VSCODE_SETTINGS_PATH } from './vscode-config.js';
5
+ export { SyncManager } from './sync.js';
6
+ export type { AssistantType, SyncOptions, Config, Environment } from './types.js';
7
+ export type { InitVscodeOptions } from './vscode-config.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAClF,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ export { SysPromptHubClient } from './client.js';
2
+ export { Assistant, AssistantManager } from './assistants.js';
3
+ export { ConfigManager, DEFAULT_ENVIRONMENT, CONFIG_FILE_NAME } from './config.js';
4
+ export { VscodeConfigManager, VSCODE_SETTINGS_PATH } from './vscode-config.js';
5
+ export { SyncManager } from './sync.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC"}
package/dist/sync.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { SyncOptions } from './types.js';
2
+ export declare class SyncManager {
3
+ private readonly cwd;
4
+ private readonly assistantManager;
5
+ constructor(cwd?: string);
6
+ sync(options: SyncOptions): Promise<string>;
7
+ }
8
+ //# sourceMappingURL=sync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../src/sync.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGzC,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAmB;gBAExC,GAAG,GAAE,MAAsB;IAKjC,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC;CAyBlD"}
package/dist/sync.js ADDED
@@ -0,0 +1,26 @@
1
+ import { SysPromptHubClient } from './client.js';
2
+ import { AssistantManager } from './assistants.js';
3
+ import { ConfigManager, DEFAULT_ENVIRONMENT } from './config.js';
4
+ export class SyncManager {
5
+ cwd;
6
+ assistantManager;
7
+ constructor(cwd = process.cwd()) {
8
+ this.cwd = cwd;
9
+ this.assistantManager = new AssistantManager();
10
+ }
11
+ async sync(options) {
12
+ const { packName, assistants: assistantTypes, environment = DEFAULT_ENVIRONMENT, cwd = this.cwd, stdout = false } = options;
13
+ const apiUrl = ConfigManager.getApiUrl(environment);
14
+ const client = new SysPromptHubClient(apiUrl);
15
+ const prompt = await client.fetchPack(packName);
16
+ if (stdout) {
17
+ return prompt;
18
+ }
19
+ const assistants = this.assistantManager.getAssistants(assistantTypes);
20
+ for (const assistant of assistants) {
21
+ await assistant.writePrompt(cwd, prompt);
22
+ }
23
+ return prompt;
24
+ }
25
+ }
26
+ //# sourceMappingURL=sync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync.js","sourceRoot":"","sources":["../src/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEjE,MAAM,OAAO,WAAW;IACL,GAAG,CAAS;IACZ,gBAAgB,CAAmB;IAEpD,YAAY,MAAc,OAAO,CAAC,GAAG,EAAE;QACrC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,gBAAgB,GAAG,IAAI,gBAAgB,EAAE,CAAC;IACjD,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAoB;QAC7B,MAAM,EACJ,QAAQ,EACR,UAAU,EAAE,cAAc,EAC1B,WAAW,GAAG,mBAAmB,EACjC,GAAG,GAAG,IAAI,CAAC,GAAG,EACd,MAAM,GAAG,KAAK,EACf,GAAG,OAAO,CAAC;QAEZ,MAAM,MAAM,GAAG,aAAa,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QACpD,MAAM,MAAM,GAAG,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAC9C,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAEhD,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;QAEvE,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,MAAM,SAAS,CAAC,WAAW,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAC3C,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -0,0 +1,15 @@
1
+ export type AssistantType = 'copilot' | 'claude';
2
+ export type Environment = 'local' | 'development';
3
+ export interface SyncOptions {
4
+ packName: string;
5
+ assistants: AssistantType[];
6
+ environment?: Environment;
7
+ cwd?: string;
8
+ stdout?: boolean;
9
+ }
10
+ export interface Config {
11
+ packName?: string;
12
+ assistants?: AssistantType[];
13
+ environment?: Environment;
14
+ }
15
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,CAAC;AACjD,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,aAAa,CAAC;AAElD,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,aAAa,EAAE,CAAC;IAC5B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,aAAa,EAAE,CAAC;IAC7B,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B"}
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,28 @@
1
+ import { Config, Environment } from './types.js';
2
+ export declare const VSCODE_SETTINGS_PATH = ".vscode/settings.json";
3
+ interface VscodeSettings {
4
+ 'sysprompthub.packName'?: string;
5
+ 'sysprompthub.copilot'?: boolean;
6
+ 'sysprompthub.claude'?: boolean;
7
+ 'sysprompthub.apiBaseUrl'?: string;
8
+ 'sysprompthub.environment'?: Environment;
9
+ [key: string]: any;
10
+ }
11
+ export interface InitVscodeOptions {
12
+ pack?: string;
13
+ copilot: boolean;
14
+ claude: boolean;
15
+ environment?: Environment;
16
+ }
17
+ export declare class VscodeConfigManager {
18
+ private readonly cwd;
19
+ private readonly defaultEnvironment;
20
+ constructor(cwd?: string);
21
+ private loadSettings;
22
+ private saveSettings;
23
+ load(): Promise<Config | null>;
24
+ init(options: InitVscodeOptions): Promise<VscodeSettings>;
25
+ update(updates: Partial<Config>): Promise<void>;
26
+ }
27
+ export {};
28
+ //# sourceMappingURL=vscode-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vscode-config.d.ts","sourceRoot":"","sources":["../src/vscode-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAiB,WAAW,EAAE,MAAM,YAAY,CAAC;AAEhE,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAE5D,UAAU,cAAc;IACtB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,0BAA0B,CAAC,EAAE,WAAW,CAAC;IACzC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA8B;gBAErD,GAAG,GAAE,MAAsB;YAIzB,YAAY;YAUZ,YAAY;IAMpB,IAAI,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IA+B9B,IAAI,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC;IAyBzD,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAuBtD"}
@@ -0,0 +1,91 @@
1
+ import { readFile, writeFile, mkdir } from 'fs/promises';
2
+ import { join, dirname } from 'path';
3
+ export const VSCODE_SETTINGS_PATH = '.vscode/settings.json';
4
+ export class VscodeConfigManager {
5
+ cwd;
6
+ defaultEnvironment = 'development';
7
+ constructor(cwd = process.cwd()) {
8
+ this.cwd = cwd;
9
+ }
10
+ async loadSettings() {
11
+ try {
12
+ const settingsPath = join(this.cwd, VSCODE_SETTINGS_PATH);
13
+ const content = await readFile(settingsPath, 'utf-8');
14
+ return JSON.parse(content);
15
+ }
16
+ catch {
17
+ return null;
18
+ }
19
+ }
20
+ async saveSettings(settings) {
21
+ const settingsPath = join(this.cwd, VSCODE_SETTINGS_PATH);
22
+ await mkdir(dirname(settingsPath), { recursive: true });
23
+ await writeFile(settingsPath, JSON.stringify(settings, null, 2), 'utf-8');
24
+ }
25
+ async load() {
26
+ const settings = await this.loadSettings();
27
+ if (!settings) {
28
+ return null;
29
+ }
30
+ // Migrate old apiBaseUrl to environment
31
+ let environment = settings['sysprompthub.environment'];
32
+ if (!environment && settings['sysprompthub.apiBaseUrl']) {
33
+ if (settings['sysprompthub.apiBaseUrl'] === 'http://localhost:3000') {
34
+ environment = 'local';
35
+ }
36
+ else if (settings['sysprompthub.apiBaseUrl'] === 'https://api-dev.sysprompthub.com') {
37
+ environment = 'development';
38
+ }
39
+ }
40
+ const assistants = [];
41
+ if (settings['sysprompthub.copilot']) {
42
+ assistants.push('copilot');
43
+ }
44
+ if (settings['sysprompthub.claude']) {
45
+ assistants.push('claude');
46
+ }
47
+ return {
48
+ packName: settings['sysprompthub.packName'],
49
+ assistants: assistants.length > 0 ? assistants : undefined,
50
+ environment: environment || this.defaultEnvironment
51
+ };
52
+ }
53
+ async init(options) {
54
+ // Load existing settings to preserve non-sysprompthub settings
55
+ const existingSettings = await this.loadSettings() || {};
56
+ if (options.pack) {
57
+ existingSettings['sysprompthub.packName'] = options.pack;
58
+ }
59
+ // Default to copilot if no assistants specified
60
+ const copilot = options.copilot || (!options.copilot && !options.claude);
61
+ existingSettings['sysprompthub.copilot'] = copilot;
62
+ existingSettings['sysprompthub.claude'] = options.claude;
63
+ if (options.environment) {
64
+ existingSettings['sysprompthub.environment'] = options.environment;
65
+ }
66
+ // Remove deprecated apiBaseUrl if present
67
+ delete existingSettings['sysprompthub.apiBaseUrl'];
68
+ await this.saveSettings(existingSettings);
69
+ return existingSettings;
70
+ }
71
+ async update(updates) {
72
+ let existingSettings = await this.loadSettings() || {};
73
+ if (updates.packName !== undefined) {
74
+ existingSettings['sysprompthub.packName'] = updates.packName;
75
+ }
76
+ if (updates.assistants !== undefined) {
77
+ existingSettings['sysprompthub.copilot'] = updates.assistants.includes('copilot');
78
+ existingSettings['sysprompthub.claude'] = updates.assistants.includes('claude');
79
+ }
80
+ else if (!await this.loadSettings()) {
81
+ existingSettings['sysprompthub.copilot'] = true;
82
+ }
83
+ if (updates.environment !== undefined) {
84
+ existingSettings['sysprompthub.environment'] = updates.environment;
85
+ }
86
+ // Remove deprecated apiBaseUrl if present
87
+ delete existingSettings['sysprompthub.apiBaseUrl'];
88
+ await this.saveSettings(existingSettings);
89
+ }
90
+ }
91
+ //# sourceMappingURL=vscode-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vscode-config.js","sourceRoot":"","sources":["../src/vscode-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAGrC,MAAM,CAAC,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAkB5D,MAAM,OAAO,mBAAmB;IACb,GAAG,CAAS;IACZ,kBAAkB,GAAgB,aAAa,CAAC;IAEjE,YAAY,MAAc,OAAO,CAAC,GAAG,EAAE;QACrC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAEO,KAAK,CAAC,YAAY;QACxB,IAAI,CAAC;YACH,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAC;YAC1D,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;YACtD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAmB,CAAC;QAC/C,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,YAAY,CAAC,QAAwB;QACjD,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAC;QAC1D,MAAM,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACxD,MAAM,SAAS,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAA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IAAI,OAAO,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YACtC,gBAAgB,CAAC,0BAA0B,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC;QACrE,CAAC;QAED,0CAA0C;QAC1C,OAAO,gBAAgB,CAAC,yBAAyB,CAAC,CAAC;QAEnD,MAAM,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;CACF"}
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@sysprompthub/sdk",
3
+ "version": "0.1.0",
4
+ "description": "SDK for syncing system prompts from SysPromptHub",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "README.md"
17
+ ],
18
+ "scripts": {
19
+ "build": "tsc",
20
+ "test": "vitest run",
21
+ "test:watch": "vitest",
22
+ "test:ui": "vitest --ui",
23
+ "typecheck": "tsc --noEmit"
24
+ },
25
+ "keywords": [
26
+ "ai",
27
+ "prompts",
28
+ "system-prompts",
29
+ "copilot",
30
+ "claude",
31
+ "sdk"
32
+ ],
33
+ "author": "",
34
+ "license": "ISC",
35
+ "engines": {
36
+ "node": ">=18.0.0"
37
+ },
38
+ "devDependencies": {
39
+ "@types/node": "^25.0.2",
40
+ "@vitest/ui": "^4.0.15",
41
+ "tsx": "^4.21.0",
42
+ "typescript": "^5.9.3",
43
+ "vitest": "^4.0.15"
44
+ },
45
+ "packageManager": "pnpm@9.0.0+sha512.b4106707c7225b1748b61595953ccbebff97b54ad05d002aa3635f633b9c53cd666f7ce9b8bc44704f1fa048b9a49b55371ab2d9e9d667d1efe2ef1514bcd513"
46
+ }